summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/profiling/latencytap.stp
diff options
context:
space:
mode:
authorTim Moore <timoore@redhat.com>2009-02-02 15:58:53 +0100
committerTim Moore <timoore@redhat.com>2009-02-11 18:20:20 +0100
commitbbc46bf643491173b9086907cf0820b3fd2c1fe3 (patch)
tree9b74716911ed9deb015b1f12c4e2f31ed90a8339 /testsuite/systemtap.examples/profiling/latencytap.stp
parent89dd03e34c2f890e9fbb065c74a60036aa480827 (diff)
downloadsystemtap-steved-bbc46bf643491173b9086907cf0820b3fd2c1fe3.tar.gz
systemtap-steved-bbc46bf643491173b9086907cf0820b3fd2c1fe3.tar.xz
systemtap-steved-bbc46bf643491173b9086907cf0820b3fd2c1fe3.zip
Use kernel stack backtrace support when available
Define new functions that use the kernel support to do a backtrace of other tasks than current.
Diffstat (limited to 'testsuite/systemtap.examples/profiling/latencytap.stp')
-rw-r--r--testsuite/systemtap.examples/profiling/latencytap.stp7
1 files changed, 5 insertions, 2 deletions
diff --git a/testsuite/systemtap.examples/profiling/latencytap.stp b/testsuite/systemtap.examples/profiling/latencytap.stp
index 96944858..28956129 100644
--- a/testsuite/systemtap.examples/profiling/latencytap.stp
+++ b/testsuite/systemtap.examples/profiling/latencytap.stp
@@ -22,8 +22,8 @@ function _get_sleep_time:long(rq_param:long, p_param:long)
# Get the backtrace from an arbitrary task
function task_backtrace:string (task:long)
%{
- _stp_stack_snprint(THIS->__retvalue, MAXSTRINGLEN,
- task_pt_regs((struct task_struct *)THIS->task), 0, 0, MAXTRACE);
+ _stp_stack_snprint_tsk(THIS->__retvalue, MAXSTRINGLEN,
+ (struct task_struct *)THIS->task, 0, MAXTRACE);
%}
probe kernel.function("enqueue_task_fair") {
@@ -41,6 +41,9 @@ global pid_sleep
probe timer.ms(1000) {
foreach ([pid, backtrace] in sleep_time) {
pid_sleep[pid] += sleep_time[pid, backtrace]
+ printf("%s %d:\n", process_names[pid], pid)
+ print_stack(backtrace)
+ printf("\n")
}
foreach ([pid+] in pid_sleep) {
printf("%s %d %d\n", process_names[pid], @max(sleep_agg[pid]) / 1000000, @avg(sleep_agg[pid]) / 1000000)