diff options
author | Tim Moore <timoore@redhat.com> | 2009-02-02 15:58:53 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-02-11 18:20:20 +0100 |
commit | bbc46bf643491173b9086907cf0820b3fd2c1fe3 (patch) | |
tree | 9b74716911ed9deb015b1f12c4e2f31ed90a8339 /testsuite/systemtap.examples/profiling/latencytap.stp | |
parent | 89dd03e34c2f890e9fbb065c74a60036aa480827 (diff) | |
download | systemtap-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.stp | 7 |
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) |