Created
December 1, 2015 07:07
-
-
Save kokukuma/9b2bf5f02595546e5472 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global total_time, entry_time | |
probe begin { | |
printf("================================================ Syslog Monitoring Started\n") | |
} | |
#probe module("nfs").function("*") | |
#{ | |
# entry_time[pid(), tid()] = gettimeofday_us() | |
#} | |
#probe module("nfs").function("*").return | |
#{ | |
# total_time[execname(), pid(), probefunc()] += gettimeofday_us() - entry_time[pid(), tid()] | |
#} | |
probe module("ext4").function("*") | |
{ | |
entry_time[pid(), tid()] = gettimeofday_us() | |
} | |
probe module("ext4").function("*").return | |
{ | |
total_time[execname(), pid(), probefunc()] += gettimeofday_us() - entry_time[pid(), tid()] | |
} | |
probe kernel.function("generic_file_read_iter") | |
{ | |
entry_time[pid(), tid()] = gettimeofday_us() | |
} | |
probe kernel.function("generic_file_read_iter").return | |
{ | |
total_time[execname(), pid(), probefunc()] += gettimeofday_us() - entry_time[pid(), tid()] | |
} | |
probe end { | |
foreach ([exec, pid, func] in total_time- limit 100){ | |
printf ("%d %s(%d) %s\n", total_time[exec, pid, func], exec, pid, func) | |
} | |
printf("\n") | |
delete total_time | |
exit() | |
printf("================================================ end\n") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment