Trace System calls using perf

This example shows how to trace sys_enter_io_submit, sys_exit_io_submit using perf.

1)Record while workload is running. ( My example runs IO on KVM VM)

perf record -ag -e syscalls:sys_enter_io_submit -e syscalls:sys_exit_io_submit

2) perf script

qemu-kvm 22423 [000] 35377.973736: syscalls:sys_enter_io_submit: ctx_id:  0x7fb1ee52c000, nr: 0x000000d1, iocbpp: 0x7fb1f7513110

7fb1ec79c697 io_submit (/usr/lib64/libaio.so.1.0.1)

2300000023 [unknown] ([unknown])

4e0000004e [unknown] ([unknown])

qemu-kvm 22423 [000] 35377.973751: syscalls:sys_exit_io_submit: 0x1

7fb1ec79c697 io_submit (/usr/lib64/libaio.so.1.0.1)

2300000023 [unknown] ([unknown])

4f0000004e [unknown] ([unknown])

subtract the exit – enter timestamps to find the duration

35377.973751 – 35377.973736 = 0.000015

Thanks to Stefanha Hajnoczi for help.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s