diff options
author | Tim Moore <timoore@redhat.com> | 2009-03-04 11:56:45 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-03-04 13:18:55 +0100 |
commit | 8c5905d0b6c8206c5ed971a637077aa8ef5c1b02 (patch) | |
tree | 12e9d4f80aec601b66ec83e06e8b3675ba4a18bd /runtime/autoconf-save-stack-trace.c | |
parent | cd1db1dd034141535648a66d9896db6c5e74dd9e (diff) | |
download | systemtap-steved-8c5905d0b6c8206c5ed971a637077aa8ef5c1b02.tar.gz systemtap-steved-8c5905d0b6c8206c5ed971a637077aa8ef5c1b02.tar.xz systemtap-steved-8c5905d0b6c8206c5ed971a637077aa8ef5c1b02.zip |
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
Diffstat (limited to 'runtime/autoconf-save-stack-trace.c')
-rw-r--r-- | runtime/autoconf-save-stack-trace.c | 22 |
1 files changed, 22 insertions, 0 deletions
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 <linux/string.h> +#include <linux/sched.h> +#include <linux/stacktrace.h> +#include <asm/stacktrace.h> + +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); +} |