summaryrefslogtreecommitdiffstats
path: root/runtime/stack.c
Commit message (Collapse)AuthorAgeFilesLines
* Improve stack printing formatWenji Huang2010-01-151-1/+2
| | | | * runtime/stack.c (_stp_stack_print_tsk): Use _stp_symbol_print.
* Add stack walking function for 2.6.33Wenji Huang2010-01-111-0/+14
| | | | | * runtime/stack.c (walk_context_stack): New function. (print_stack_ops): Add function pointer.
* bz6436 backtraces from uprobesTim Moore2010-01-051-7/+11
| | | | | | | | | | | | | | | | | | | | | This implements proper unwinding from uprobes in the presence of uretprobe trampolines. * runtime/stack.c (_stp_stack_print): Rework for uprobe context case and refactor a bit. * runtime/uprobes2/uprobes.h (GET_PC_URETPROBE_NONE): new constant * runtime/uprobes2/uprobes.c (uprobe_get_pc): Support translating the trampoline function from uprobe context in addition to uretprobe context. * runtime/uprobes/uprobes.h (GET_PC_URETPROBE_NONE): ditto * runtime/uprobes/uprobes.c (uprobe_get_pc): ditto * tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): Initialize ri in context to GET_PC_URETPROBE_NONE in generated enter_uprobe_probe. * testsuite/systemtap.context/fib.stp: Add an option to do a backtrace on function entry. * testsuite/systemtap.context/fib.exp: Test backtrace in function entry (uprobe) probes.
* runtime: rhel4 build fix for uretprobe-wannabe stack tracebacksFrank Ch. Eigler2009-12-201-1/+3
| | | | * runtime/stack.c (_stp_stack_print): Comment out *retprobe logic if !CONFIG_UTRACE.
* Remove uprobes.h declaration from runtime.hTim Moore2009-12-181-0/+14
| | | | | | | | | | | Turns out that it breaks on kernels that don't have utrace. * runtime/runtime.h : Don't include uprobes.h * runtime/stack.c: Include uprobes.h * runtime/stack-i386.c: Check if uprobes is included at all. * runtime/stack-x86_64.c: ditto * tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): put uprobes.h include back in.
* support for a brief backtrace formatTim Moore2009-12-171-8/+14
| | | | | | | | | | | | | | This only prints symbol+offset, or an address if the symbol isn't known. * runtime/runtime.h (SYM_VERBOSE_NO, SYM_VERBOSE_FULL, SYM_VERBOSE_BRIEF): new constants * runtime/stack.c (_stp_stack_print): support brief format * runtime/sym.c (_stp_func_print): ditto * tapset/ucontext-unwind.stp (print_ubacktrace_brief): new function * testsuite/systemtap.context/fib.c: new test program * testsuite/systemtap.context/fib.stp: new test * testsuite/systemtap.context/fib.exp: new test
* backtrace through uprobes trampoline.Tim Moore2009-12-171-1/+1
| | | | | | | | | | | | | | Only works in uretprobes for the moment. * runtime/stack-x86_64.c (__stp_stack_print): Rewrite trampoline PC addresses if necessary. * runtime/stack-i386.c (__stp_stack_print): ditto * runtime/stack-arm.c (__stp_stack_print): Add extra argument * runtime/stack-ppc.c (__stp_stack_print): ditto * runtime/stack-s390.c (__stp_stack_print): ditto * runtime/stack.c (_stap_stack_print): call __stp_stack_print with uretprobe_instance. * testsuite/systemtap.context/uprobe_backtrace.stp: new test
* set the IP in return probes to the returned-to instructionTim Moore2009-12-161-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | It's easily available in kretprobes and uretprobes and is consistent with the rest of the program state. * translate.cxx (emit_common_header) : add uretprobe_instance to context. * tapsets.cxx (common_probe_entryfn_prologue): Initialize ri in context to 0. (dwarf_derived_probe_group::emit_module_decls): Change IP to return address in kretprobes. (uprobe_derived_probe_group::emit_module_decls): enter_uretprobe_probe: set ri (uretprobe_instance) in context. Change IP to return address in uretprobes. Don't emit uprobe include and #define * runtime/runtime.h : Add includes and #define for uprobes. * runtime/stack.c (_stp_stack_print, _stp_stack_snprint): Add extra argument for uretprobe_instance. * tapset/context-unwind.stp (print_backtrace, backtrace): Pass NULL for uretprobe_instance to _stp_stack_print. * tapset/ucontext-unwind.stp (print_ubacktrace, ubacktrace): pass uretprobe_instance to _stp_stack_print * testsuite/systemtap.context/uprobe_uaddr.exp : new test for uaddr in function probes * testsuite/systemtap.context/uprobe_uaddr.stp : new file
* stack-ppc: Adjust for ppc32Anton Vorontsov2009-12-011-1/+1
| | | | | | | | Get rid of magic numbers, use appropriate defines from ptrace.h. From now on stack-ppc.c should be suitable for ppc32. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
* Rename stack-ppc64.c to stack-ppc.cAnton Vorontsov2009-12-011-1/+1
| | | | | | There should be no functional changes in this patch. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
* Add uprobes_ustack testcase and bug fixlet.Mark Wielaard2009-04-211-1/+4
| | | | | | * runtime/stack.c (_stp_stack_print): Use _stp_usymbol_print when tsk given. * testsuite/systemtap.base/uprobes_ustack.exp: New test file. * testsuite/systemtap.base/uprobes_ustack.stp: Likewise.
* Remove old _stp_ustack bits.Mark Wielaard2009-04-211-17/+0
| | | | | | This code was never used, nor did it actually work. * runtime/stack.c (_stp_ustack_print): Removed.
* Pass task from tapset, through stack and unwind functions for lookup.Mark Wielaard2009-04-201-5/+5
| | | | | | | | | | | | | | | | | * 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().
* Pass task to _stp_func_print and _stp_kallsyms_lookup.Mark Wielaard2009-04-191-1/+1
| | | | | | | | | * runtime/sym.c (_stp_func_print): Take task, pass to _stp_kallsyms_lookup. * runtime/stack.c (print_stack_address): Pass NULL. * runtime/stack-i386.c (_stp_stack_print_fallback): Pass NULL. (__stp_stack_print): Pass NULL or current. * runtime/stack-x86_64.c (_stp_stack_print_fallback): Pass NULL. (__stp_stack_print): Pass current.
* Make simple probes work even without KPROBES in the kernel.Mark Wielaard2009-04-091-0/+8
| | | | | | | | | Without KPROBES very little works atm. But stack.c file is unconditionally imported, while these two functions are only used through context-unwind.stp. This at least lets us do simple sanity checks on "plain" kernels. * runtime/stack.c (_stp_stack_print, _stp_stack_snprint): Wrap in #if defined (CONFIG_KPROBES).
* stap autoconf test for kernel stack trace supportTim Moore2009-03-041-4/+3
| | | | | | | | | | * 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
* PR9866 band-aid: deactivate new CONFIG_STACKTRACE code for older kernelsFrank Ch. Eigler2009-02-181-3/+4
|
* Fixed stack.c compile problems on systems with older kernels (like RHEL4).David Smith2009-02-131-0/+2
| | | | | | | 2009-02-13 David Smith <dsmith@redhat.com> * stack.c: Fixed compile problems on systems with older kernels (like RHEL4).
* Use kernel stack backtrace support when availableTim Moore2009-02-111-0/+87
| | | | | Define new functions that use the kernel support to do a backtrace of other tasks than current.
* Use 'static' as much as possibleJosh Stone2009-01-281-3/+3
| | | | | | | | | | This change just inserts 'static' on runtime, tapset, and generated C functions and globals, so the compiler can do a better job of optimizing. My tests with small scripts show ~10% reduction in compile time and ~20% reduction in module size. Larger scripts may show less benefit, but I expect purely positive results.
* 2.6.25 fixes and stack level limits.Martin Hunt2008-04-151-4/+4
|
* dded _stp_read_address() and changed code to use it.Martin Hunt2008-03-281-1/+1
|
* kretprobe trampoline fixesMartin Hunt2008-03-281-10/+12
| | | | | Recognize when a kretprobe trampoline was hit and continue with inexact stack dump. Also some testsuite changes.
* rebased unwind_branch on top of current masterFrank Ch. Eigler2008-03-251-1/+2
|
* 2007-08-20 Martin Hunt <hunt@redhat.com>hunt2007-08-201-25/+0
| | | | * stack.c (_stp_kta): Removed.
* 2007-05-30 Martin Hunt <hunt@redhat.com>hunt2007-05-301-0/+2
| | | | | | | | | | | | Patch from Quentin Barnes. * arith.c: Add arm support for 64-bit division. * copy.c: Enable arm support. * loc2c-runtime.h: Ditto. * regs.[ch]: Ditto. * stack.c: Include stack-arm.c. * stack-arm.c: New file. * time.c (_stp_gettimeofday_ns): hack for arm. See PR 4569.
* 2007-05-15 Martin Hunt <hunt@redhat.com>hunt2007-05-161-3/+3
| | | | | * vsprintf.c: Add comment about %p. * regs.c, stack*.c, sym.c: Fix %p calls.
* 2007-03-18 Martin Hunt <hunt@redhat.com>hunt2007-03-181-1/+1
| | | | | * stack.c, string.c, sym.c, transport/symbols.c: Fix some signed vs unsigned comparison warnings.
* 2007-02-07 Martin Hunt <hunt@redhat.com>hunt2007-02-071-0/+2
| | | | | | | * stack-ppc64.c (__stp_stack_print): Remove an old reference to the string length and instead limit backtraces to MAXBACKTRACE. * stack.c: Define MAXBACKTRACE
* 2007-01-31 Martin Hunt <hunt@redhat.com>hunt2007-01-311-55/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * string.c (_stp_string_init): Deleted. (_stp_sprintf): Deleted. (_stp_vsprintf): Deleted. (_stp_string_cat_cstr): Deleted. (_stp_string_cat_string): Deleted. (_stp_string_cat_char): Deleted. (_stp_string_ptr): Deleted. (_stp_string_cat): Deleted. (_stp_snprintf): Moved from vsprintf.c. (_stp_vscnprintf): Moved from vsprintf.c. * string.h (STP_STRING_SIZE): Deleted. (STP_NUM_STRINGS): Deleted. Remove all references to type "String". * vsprintf.c (_stp_vscnprintf): Moved to string.c. (_stp_snprintf): Moved to string.c * sym.c (_stp_symbol_sprint): Replaced with _stp_symbol_print, which writes to the print buffer. (_stp_symbol_sprint_basic): Replaced with _stp_symbol_snprint. * runtime.h: Include io.c. * stat-common.c: Use new _stp_print* functions. * stat.c: Ditto. * regs.c: Renamed to regs-ia64.c. * current.c: Renamed regs.c. * regs-ia64.c: New file (renamed from regs.c). * stack.c (_stp_stack_sprint): Renamed _stp_stack_print and now just prints to the print buffer. Calls __stp_stack_print instead of __stp_stack_sprint. (_stp_stack_snprint): New function. Calls _stp_stack_print and then copies the print buffer into a string. (_stp_stack_printj): Deleted. (_stp_ustack_sprint): Deleted. * stack-*.c: Rewritten to print instead of writing to strings. Uses new _stp_print* functions. * print.c (_stp_printf): Create new function instead of macro. (_stp_print): Ditto. (_stp_print_char): New function. * map.c: Use _stp_print() and _stp_print_char() instead of _stp_print_cstr(). * io.c (_stp_vlog): Use _stp_print() instead of _stp_string_cat_cstr(). * copy.c (_stp_string_from_user): Deleted.
* Adding s390x supportdwilder2006-10-191-0/+2
|
* Fix comment.hunt2006-10-121-6/+0
|
* 2006-10-12 Martin Hunt <hunt@redhat.com>hunt2006-10-121-196/+40
| | | | | | | | | | | | | | | * stack.c: Reorganize and split arch-specific functions to separate files. (_stp_kta): Better checking. (_stp_stack_sprint): Better handling of return probes. * stack-i386.c: New file. Uses 2.6.18 DWARF unwinder if available. * stack-x86_64.c: New file. Uses 2.6.18 DWARF unwinder if available. * stack-ppc64.c: New file. * stack-ia64.c: New file. * sym.c (_stp_kallsyms_lookup_name): New function. Like kallsyms_lookup_name() except use our internal lookup table.
* 2006-09-27 Martin Hunt <hunt@redhat.com>hunt2006-09-271-0/+8
| | | | | | | | | | * stack.c (_stp_kta): Rewrite. Use the _stap_symbols struct instead of calling into the kernel. * sym.c (_stp_kallsyms_lookup): Move here from runtime.h * runtime.h: Get rid of all the symbol stuff that did not belong here.
* Remove validate_sp() dependency, therefore don't need CONFIG_KALLSYMS_ALL ↵hien2005-11-041-34/+18
| | | | anymore
* Added ppc64 _stp_stack_printhien2005-11-021-0/+70
|
* 2005-10-31 Martin Hunt <hunt@redhat.com>hunt2005-10-311-15/+15
| | | | * ALL: Cleanup copyrights.
* IA64 Runtime support patches. With this in placeaskeshav2005-10-281-0/+66
| | | | | | | Systemtap should now be able to build on Ia64. Includes supports for - function probes, return probes, function parameter access and dumping stack backtrace. Added by Anil S Keshavamurthy <Anil.s.keshavamurthy@intel.com>
* 2005-09-01 Martin Hunt <hunt@redhat.com>hunt2005-09-011-32/+26
| | | | | * stack.c (_stp_stack_sprint): Add a verbose arg to pass along to underlying funcs.
* 2005-08-31 Martin Hunt <hunt@redhat.com>hunt2005-08-311-2/+0
| | | | | | | | * sym.c (_stp_kallsyms_lookup): Moved to runtime.h. * stack.c (_stp_kta): Moved to runtime.h. * runtime.h (init_module): Initialize _stp_kallsyms_lookup and _stp_kta. * probes.c (_stp_lookup_name): Replaced by kallsyms_lookup_name().
* 2005-05-26 Martin Hunt <hunt@redhat.com>hunt2005-05-261-182/+102
| | | | | | | | * current.c (_stp_sprint_regs): Implement for i386. * sym.c (_stp_symbol_sprint): Check name before trying to print it. (_stp_symbol_print): Change to macro that calls _stp_symbol_sprint().
* Rewritten maps and other updated files.hunt2005-05-171-9/+92
|
* i386 fixes.hunt2005-04-111-4/+4
|
* *** empty log message ***hunt2005-04-071-2/+15
|
* Update to use relayfs.hunt2005-04-071-24/+30
|
* *** empty log message ***hunt2005-03-291-0/+161