From cf9be511f05d0b310b2c4ce4c050d3707be9e65a Mon Sep 17 00:00:00 2001 From: hiramatu Date: Wed, 12 Sep 2007 16:48:00 +0000 Subject: 2007-09-12 Masami Hiramatsu PR 4633 * systemtap.context/backtrace.stp: Add testcases for the return probe and the profile probe. * systemtap.context/backtrace.tcl: Ditto. * /systemtap.context/systemtap_test_module2.c: Ditto. --- testsuite/systemtap.context/backtrace.stp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'testsuite/systemtap.context/backtrace.stp') diff --git a/testsuite/systemtap.context/backtrace.stp b/testsuite/systemtap.context/backtrace.stp index 8f02c174..73781371 100644 --- a/testsuite/systemtap.context/backtrace.stp +++ b/testsuite/systemtap.context/backtrace.stp @@ -1,9 +1,9 @@ -function print_all_trace_info() { +function print_all_trace_info(point:string) { printf("backtrace from %s:\n", pp()) print_backtrace() print("--------\n") bt = backtrace() - printf("the stack is %s\n", bt) + printf("the %s stack is %s\n", point, bt) print("--------\n") print_stack(bt); print("--------\n") @@ -17,8 +17,19 @@ probe end { print_backtrace() } -probe module("systemtap_test_module2").function("yyy_func3") { - print_all_trace_info() +global flag = 0 +probe module("systemtap_test_module2").function("yyy_func3").call { + print_all_trace_info("call") + flag ++ +} +probe module("systemtap_test_module2").function("yyy_func4").return { + print_all_trace_info("return") + flag ++ +} +probe timer.profile { + if (cpu() == 0 && flag == 2 && probemod() != "systemtap_test_module2") { + print_all_trace_info("profile") + flag ++ + } } - -- cgit