/usr/share/systemtap/examples/profiling
NameSizeModeActions
container_check.meta10640644editdlrm
container_check.stp63230755editdlrm
errno.meta4560644editdlrm
errno.stp9840755editdlrm
fileline-profile.meta7830644editdlrm
fileline-profile.stp12180755editdlrm
fntimes.meta5120644editdlrm
fntimes.stp8700755editdlrm
fntimes.txt13750644editdlrm
functioncallcount.meta6490644editdlrm
functioncallcount.stp4900755editdlrm
functioncallcount.tcl3990644editdlrm
graphcall.stp5340755editdlrm
ioctl_handler.meta12090644editdlrm
ioctl_handler.stp8110755editdlrm
latencytap.meta8770644editdlrm
latencytap.stp127550755editdlrm
latencytap.tcl1400644editdlrm
latencytap.txt21040644editdlrm
linetimes.meta6880644editdlrm
linetimes.stp16080755editdlrm
linetimes.txt139360644editdlrm
perf.meta5780644editdlrm
perf.stp19360755editdlrm
perf.tcl1660644editdlrm
periodic.meta8950644editdlrm
periodic.stp26590755editdlrm
pf2.meta4200644editdlrm
pf2.stp3700755editdlrm
pf2.txt4060644editdlrm
pf3.meta4390644editdlrm
pf3.stp9920755editdlrm
pf3.txt4890644editdlrm
pf4.meta4710644editdlrm
pf4.stp9520755editdlrm
pf4.tcl790644editdlrm
pf4.txt7540644editdlrm
sched_switch.meta7800644editdlrm
sched_switch.stp21270755editdlrm
syscallerrorsbypid.meta10670644editdlrm
syscallerrorsbypid.stp9500755editdlrm
syscalllatency.meta10720644editdlrm
syscalllatency.stp9890755editdlrm
syscallsbypid.meta10200644editdlrm
syscallsbypid.stp7850755editdlrm
syscallsrw.meta4890644editdlrm
syscallsrw.stp3750755editdlrm
thread-times.meta3840644editdlrm
thread-times.stp12410755editdlrm
thread-times.txt10090644editdlrm
timeout.meta7280644editdlrm
timeout.stp27750755editdlrm
topsys.meta4460644editdlrm
topsys.stp7450755editdlrm
ucalls.meta10650644editdlrm
ucalls.stp35440755editdlrm
Edit: /usr/share/systemtap/examples/profiling/periodic.stp (2659B)
#!/usr/bin/stap # Copyright (C) 2011-2016 Red Hat, Inc. # Written by William Cohen # # This script give an idea what periodic things are running on # the system. Usage: # # stap --all-modules periodic.stp global last_expire, period, funct, data, proc_info, delayed_work_info probe kernel.trace("timer_expire_entry") { old_expire = last_expire[$timer] new_expire = gettimeofday_us() if (old_expire) { elapsed = new_expire - old_expire period[$timer] <<< elapsed funct[$timer] = $timer->function data[$timer] = @defined($timer->data) ? $timer->data : 0 proc_info[$timer] = @defined($timer->data) ? 0 : @module_container_of($timer, "kernel", "struct process_timer", timer)->task delayed_work_info[$timer] = @defined($timer->data) ? 0 : & @module_container_of($timer, "kernel", "struct delayed_work", timer) } last_expire[$timer] = new_expire } function output() { printf("%-7s %-50s %15s %25s %9s\n", "#type", "function", "avg period(us)", "period variance(us^2)", "count") # print out the various timers firing foreach([timer] in period-) { fname = symname(funct[timer]) if (fname == "process_timeout") { ptr = (data[timer] ? data[timer] : proc_info[timer]) fname = sprintf("%s(%d)", kernel_string_n(@cast(ptr, "struct task_struct", "kernel")->comm, 16), @cast(ptr, "struct task_struct", "kernel")->pid) type="process" } else if (fname == "delayed_work_timer_fn") { ptr = (data[timer] ? data[timer] : delayed_work_info[timer]) faddr = @defined(@cast(ptr, "struct delayed_work", "kernel")->work->func) ? @cast(ptr, "struct delayed_work", "kernel")->work->func : @cast(ptr, "struct work_struct", "kernel")->func fname = sprintf("%s", symname(faddr)) type="work_q" } else { fileline = symfileline(funct[timer]) if (strtol(fileline, 16)) // fileline is just the address fname = sprintf("%s", symdata(funct[timer])) else fname = sprintf("%s@%s", symname(funct[timer]), fileline) type="kernel" } printf("%-7s %-50.50s %15d %25d %9d\n", type, fname, @avg(period[timer]), @variance(period[timer], 2), @count(period[timer])) } } probe begin { printf("#monitoring timer periods (press control-c for output)\n") } probe end { output() } # allow optional period output from script %( $# > 0 %? probe timer.s($1) { output(); delete last_expire delete period delete funct delete data delete proc_info delete delayed_work_info } %)