Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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