From 8c5905d0b6c8206c5ed971a637077aa8ef5c1b02 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Wed, 4 Mar 2009 11:56:45 +0100 Subject: stap autoconf test for kernel stack trace support * buildrun.cxx (compile_pass): Add autoconf line for stack trace test, which defines STAPCONF_KERNEL_STACKTRACE. * runtime/autoconf-save-stack-trace.c: New file. * runtime/stack.c : Use STAPCONF_KERNEL_STACKTRACE instead of tests for kernel configuration and versions. * runtime/stack-i386.c : ditto * runtime/stack-x86_64.c : ditto --- runtime/autoconf-save-stack-trace.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 runtime/autoconf-save-stack-trace.c (limited to 'runtime/autoconf-save-stack-trace.c') diff --git a/runtime/autoconf-save-stack-trace.c b/runtime/autoconf-save-stack-trace.c new file mode 100644 index 00000000..39ded684 --- /dev/null +++ b/runtime/autoconf-save-stack-trace.c @@ -0,0 +1,22 @@ +#include +#include +#include +#include + +void foo(struct task_struct *foo) +{ + struct stack_trace trace; + unsigned long backtrace[20]; + memset(&trace, 0, sizeof(trace)); + trace.entries = &backtrace[0]; + trace.max_entries = 20; + trace.skip = 0; + save_stack_trace_tsk(tsk, &trace); +} + +static const struct stacktrace_ops print_stack_ops; + +void dumper(struct task_struct *foo) +{ + dump_trace(foo, 0, 0, 0, &print_stack_ops, 0); +} -- cgit