diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-04-20 22:43:37 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-04-20 22:43:37 +0200 |
commit | 47a2a2303c9b261e88a4333bf2964b4291a22a12 (patch) | |
tree | 294c40064abc7f52ae9f5274186a8b974b38bf40 /runtime/stack.c | |
parent | 30c4b46a6da666674684cef7b57670b26534618c (diff) | |
download | systemtap-steved-47a2a2303c9b261e88a4333bf2964b4291a22a12.tar.gz systemtap-steved-47a2a2303c9b261e88a4333bf2964b4291a22a12.tar.xz systemtap-steved-47a2a2303c9b261e88a4333bf2964b4291a22a12.zip |
Pass task from tapset, through stack and unwind functions for lookup.
* runtime/stack-arm.c (__stp_stack_print): Take struct task_struct *.
* runtime/stack-ia64.c (__stp_stack_print): Likewise.
* runtime/stack-ppc64.c (__stp_stack_print): Likewise.
* runtime/stack-s390.c (__stp_stack_print): Likewise.
* runtime/stack-i386.c (__stp_stack_print): Likewise.
And add check and pass to unwind() and _stp_func_print().
* runtime/stack-x86_64.c: Likewise.
* runtime/stack.c *_stp_stack_print): Take and pass on task_struct.
(_stp_stack_snprint): Likewise.
* runtime/unwind.c (unwind): Take and use task_struct for
_stp_mod_sec_lookup().
* tapset/context-unwind.stp (print_backtrace): Pass NULL to
_stp_stack_print().
(backtrace): Pass NULL to _stp_stack_snprint().
Diffstat (limited to 'runtime/stack.c')
-rw-r--r-- | runtime/stack.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/stack.c b/runtime/stack.c index 5dd0cbdc..ee10e25f 100644 --- a/runtime/stack.c +++ b/runtime/stack.c @@ -1,6 +1,6 @@ /* -*- linux-c -*- * Stack tracing functions - * Copyright (C) 2005-2008 Red Hat Inc. + * Copyright (C) 2005-2009 Red Hat Inc. * Copyright (C) 2005 Intel Corporation. * * This file is part of systemtap, and is free software. You can @@ -107,7 +107,7 @@ static void _stp_stack_print_fallback(unsigned long stack, int verbose, int leve * @param regs A pointer to the struct pt_regs. */ -static void _stp_stack_print(struct pt_regs *regs, int verbose, struct kretprobe_instance *pi, int levels) +static void _stp_stack_print(struct pt_regs *regs, int verbose, struct kretprobe_instance *pi, int levels, struct task_struct *tsk) { if (verbose) { /* print the current address */ @@ -126,7 +126,7 @@ static void _stp_stack_print(struct pt_regs *regs, int verbose, struct kretprobe else _stp_printf("%p ", (int64_t) REG_IP(regs)); - __stp_stack_print(regs, verbose, levels); + __stp_stack_print(regs, verbose, levels, tsk); } /** Writes stack backtrace to a string @@ -135,14 +135,14 @@ static void _stp_stack_print(struct pt_regs *regs, int verbose, struct kretprobe * @param regs A pointer to the struct pt_regs. * @returns void */ -static void _stp_stack_snprint(char *str, int size, struct pt_regs *regs, int verbose, struct kretprobe_instance *pi, int levels) +static void _stp_stack_snprint(char *str, int size, struct pt_regs *regs, int verbose, struct kretprobe_instance *pi, int levels, struct task_struct *tsk) { /* To get a string, we use a simple trick. First flush the print buffer, */ /* then call _stp_stack_print, then copy the result into the output string */ /* and clear the print buffer. */ _stp_pbuf *pb = per_cpu_ptr(Stp_pbuf, smp_processor_id()); _stp_print_flush(); - _stp_stack_print(regs, verbose, pi, levels); + _stp_stack_print(regs, verbose, pi, levels, tsk); strlcpy(str, pb->buf, size < (int)pb->len ? size : (int)pb->len); pb->len = 0; } |