/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/thread-times.stp (1241B)
#!/usr/bin/stap probe perf.sw.cpu_clock!, timer.profile { // NB: To avoid contention on SMP machines, no global scalars/arrays used, // only contention-free statistics aggregates. tid=tid(); e=execname() if (!user_mode()) kticks[e,tid] <<< 1 else uticks[e,tid] <<< 1 ticks <<< 1 tids[e,tid] <<< 1 } global uticks%, kticks%, ticks global tids% probe timer.s(5), end { allticks = @count(ticks) printf ("%16s %5s %7s %7s (of %d ticks)\n", "comm", "tid", "%user", "%kernel", allticks) foreach ([e,tid] in tids- limit 20) { // SystemTap only performs integer arithmetic. // To avoid losing precision the decimal point is shifted // to the right four places (*100000). Think of this as // the original result value x.xxyy becoming xxxyy.0. // The integer percentage xxx is obtained // by dividing by 100 and the fractional percentage // is obtained with a modulo 100 operation. uscaled = @count(uticks[e,tid])*10000/allticks kscaled = @count(kticks[e,tid])*10000/allticks printf ("%16s %5d %3d.%02d%% %3d.%02d%%\n", e, tid, uscaled/100, uscaled%100, kscaled/100, kscaled%100) } printf("\n") delete uticks delete kticks delete ticks delete tids }