From bbc46bf643491173b9086907cf0820b3fd2c1fe3 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Mon, 2 Feb 2009 15:58:53 +0100 Subject: Use kernel stack backtrace support when available Define new functions that use the kernel support to do a backtrace of other tasks than current. --- testsuite/ChangeLog | 4 ++++ testsuite/systemtap.examples/profiling/latencytap.stp | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index c2b1bb89..6afd1df8 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-02-11 Tim Moore + + * systemtap.examples/profiling/latencytap.stp: Use _stp_stack_snprint_tsk. + 2009-02-10 Will Cohen * systemtap.samples/profile.exp: 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) -- cgit