summaryrefslogtreecommitdiffstats
path: root/runtime/unwind.c
Commit message (Collapse)AuthorAgeFilesLines
* use eh_frame_hdr table to speed up unwindingTim Moore2010-01-201-16/+42
| | | | | | | | | | | | * runtime/sym.h (_stp_module): add unwind_hdr_addr member. * runtime/unwind.c (read_ptr_sect): Modification of read_pointer that also handles offsets from text or "data" sections. (read_pointer): Use it. (_stp_search_unwind_hdr): Use read_ptr_sect to calculate values that are relative to the .eh_frame_hdr section. (unwind_frame): Search the frame header if this is an eh frame. * translate.cxx (get_unwind_data): Get the eh_frame_hdr too. (dump_unwindsyms): Write out eh_frame_hdr stuff.
* PR11015 Support shared library reloading (in different processes)Mark Wielaard2009-12-221-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * runtime/task_finder_vma.c (stap_remove_vma_map_info): Return negative status on failure. (stap_find_vma_map_info): Likewise. (stap_find_vma_map_info_user): New function. (stap_drop_vma_maps): New function. * runtime/sym.h (addr): Renamed to static_addr, to store addresses for sections which are always mapped at the same address. (_stp_module_relocate): Add extra struct task_struct *tsk argument. * runtime/sym.c (_stp_tf_exec_cb): New callback, calls stap_drop_vma_maps. (_stp_tf_mmap_cb): Don't store address in module.section, but call stap_add_vma_map_info() per tsk->group_leader for matched module. Don't register empty/null modules. (_stp_module_relocate): Take extra struct task_struct *tsk argument, cache last tsk used. Only use section->static_addr for none dynamic modules. Use stap_find_vma_map_info_user() to locate dynamic modules. (_stp_mod_sec_lookup): Add extra argument unsigned long *rel_addr to optionally store relative address when module/section found. (_stp_kallsyms_lookup): Use _stp_mod_sec_lookup to find relative address. (_stp_sym_init): Register _stp_tf_exec_cb in stap_task_finder_target. Add error check to see if task finder could be initialized. * dwflpp.cxx (emit_address): Pass NULL for kernel/modules and current for user tasks to _stp_module_relocate. * runtime/transport/symbols.c (_stp_do_relocation): Set new static_addr _stp_section field. * runtime/unwind.c (adjustStartLoc): Take new struct task_struct *tsk argument and pass to stap_find_vma_map_info_user and _stp_module_relocate to find adjusted addr. (_stp_search_unwind_hdr): Pass through struct task_struct *tsk. (unwind_frame): Likewise. * tapset/context-symbols.stp (probemod): Add NULL to _stp_mod_sec_lookup call to indicate we aren't interested in relative address. * tapsets.cxx (dwarf_derived_probe_group::emit_module_init): Pass NULL to _stp_module_relocate to indicate kernel/module address.
* Limit the number of call frame instructions we process in the unwinder.Mark Wielaard2009-10-201-0/+7
| | | | | * runtime/unwind.c (processCFI): Fail if the number of instructions is larger than MAX_CFI (currently 512).
* Make sure cie and fde end point to sane values in while doing unwind_frame.Mark Wielaard2009-10-201-0/+11
| | | | | * runtime/unwind.c (unwind_frame): Check end read from cie or fde doesn't go passed end of unwind table.
* Be paranoid about table size resolving cie_for_fde and fde_pointer_type.Mark Wielaard2009-10-201-7/+18
| | | | | | * runtime/unwind.c (cie_for_fde): Take table and table_len into account. (fde_pointer_type): Likewise. * runtime/unwind/unwind.h: Adjust function prototypes.
* PR10589: switch to kernel vscnprintf for _stp_{dbug,warn,error} calls in runtimeFrank Ch. Eigler2009-09-021-8/+10
| | | | | | | | | | | _stp_vscnprintf is only suitable for calls from the script, with slightly different conventions (64-bit ints/pointers, extra formatting directives). * runtime/runtime.h (_stp_{dbug,warn,error}): Add __attribute__ format(printf). * runtime/io.c (_stp_vlog): Ditto. Use vscnprintf(). * runtime/sym.c (_stp_module_check): Remove hexdumping (%.*M) of mismatching buildids. Switch to _stp_warn from printk (KERN_WARNING). * translate.cxx, runtime/unwind.c: Numerous print formatting tweaks.
* gcc 3.4.6 compatibility: s/{true,false}/{1,0} in runtime/unwind.cFrank Ch. Eigler2009-06-101-4/+4
|
* Properly read eh_frame and pass is_ehframe correctly.Mark Wielaard2009-05-201-6/+10
| | | | | | | | | * runtime/unwind.c (adjustStartLoc): Add extra dbug_unwind. (_stp_search_unwind_hdr): Always pass true for is_ehframe. (unwind_frame): Properly pass through is_ehframe to adjustStartLoc(). (unwind): Add extra dbug_unwind. * translate.cxx (dump_unwindsyms): Output and use correct eh_frame and eh_len.
* Use debug_frame table, then fallback to eh_frame when necessary.Mark Wielaard2009-05-201-24/+39
| | | | | | | * runtime/unwind.c (unwind): Call new unwind_frame() first with debug_frame data, then if that wasn't able to unwind again with eh_frame data. (unwind_frame): Adapted version of old unwind() function that takes a table, table length and whether it is an eh_frame table.
* Pass and use ptrType and is_ehframe to unwind adjustStartLoc.Mark Wielaard2009-05-201-53/+66
| | | | | | | * runtime/unwind.c (adjustStartLoc): Add ptrType and is_ehframe as arguments. Use these to adjust location when necessary. (DEBUG_UNWIND): Move block before adjustStartLoc. Pass false for is_ehframe throughout.
* Fetch and store both debug_frame and eh_frame tables.Mark Wielaard2009-05-201-14/+15
| | | | | | | | | | | | | * runtime/sym.h (_stp_module): Remove unwind_data, unwind_data_len and unwind_is_ehframe fields. Add debug_frame, eh_frame, debug_frame_len, eh_frame_len and eh_frame_addr fields. * runtime/unwind.c: Use debug_frame and debug_frame_len instead of unwind_data and unwind_data_len throughout. (cie_for_fde): Take unwind_data and is_ehframe as direct arguments. * runtime/unwind/unwind.h (cie_for_fde): New function declaration. * translate.cxx (get_unwind_data): Fetch and return both debug_frame and eh_frame tables. (dump_unwindsyms): Dump both debug_frame and eh_frame tables.
* Tidy/tighten DEBUG_UNWIND ptrType a bit.Mark Wielaard2009-05-151-14/+13
| | | | | | | * runtime/unwind.c (_stp_enc_hi_name): Include prefix for hi == 0. (_stp_enc_lo_name): Don't include prefix. (_stp_eh_enc_name): Always include hi_name. (unwind): Always include newline in dbug_unwind() calls.
* Pass task from tapset, through stack and unwind functions for lookup.Mark Wielaard2009-04-201-2/+2
| | | | | | | | | | | | | | | | | * 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().
* Handle .absolute and .dynamic (user space) addresses in adjustStartLoc.Mark Wielaard2009-04-191-6/+12
| | | | | * runtime/unwind.c (adjustStartLoc): .absolute sections don't need adjustment, .dynamic sections need the section addr to be added.
* Privatize MAX_STACK_DEPTHJosh Stone2009-04-161-1/+1
| | | | | | The kernel-tip tree also has a MAX_STACK_DEPTH defined in perf_counter.h, so we need to separate our definition. I've changed the definition in our unwinder to STP_MAX_STACK_DEPTH.
* Fix unwind _stp_mod_sec_lookup.Mark Wielaard2009-04-101-1/+1
| | | | * runtime/unwind.c (unwind): Pass current to _stp_mod_sec_lookup().
* Removed unused functions and variables.David Smith2009-02-181-124/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-02-18 David Smith <dsmith@redhat.com> * io.c (_stp_log): Removed unused function. * map.c (_stp_cmp): Replace _stp_log() with dbug(). * mempool.c (_stp_mempool_resize): Removed unused function. * print.c (next_fmt): Removed unused function. * procfs.c: Removed unused variable '_stp_num_procfs_files'. * regs.c (_stp_ret_addr): Removed unused function. * string.c (_stp_text_str): Removed unused variable 'len'. * string.h: Removed unused variable '_stdout_' and function declaration for deleted function '_stp_vsprintf'. * sym.c: Removed unused variables. * unwind.c (_stp_create_unwind_hdr): Removed unused function. 2009-02-18 David Smith <dsmith@redhat.com> * control.c: Removed unused variable '_stp_current_buffers'. * procfs.c (_stp_set_buffers): Removed unused function. (_stp_register_ctl_channel_fs): Removed unused variables and label. * symbols.c (u32_swap): Removed unused function. (generic_swap): Ditto. (_stp_sort): Ditto. (_stp_section_is_interesting): Ditto. * transport.c (_stp_transport_init): Removed unused variable 'ret'.
* Use 'static' as much as possibleJosh Stone2009-01-281-2/+2
| | | | | | | | | | 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.
* Rename _stp_module module_base output to dwarf_module_base and document.Mark Wielaard2008-09-101-2/+4
|
* Record module base and use it for adjusting start locations in dwarf unwinder.Mark Wielaard2008-09-101-3/+24
|
* Feed dwarf unwinder data through _stp_mod_sec_lookup (), but disabled for now.Mark Wielaard2008-09-101-1/+2
|
* emit all symbol tables at compile time; don't do any module munging; new ↵Frank Ch. Eigler2008-07-041-14/+3
| | | | unwinder still disabled
* PR6410: unwinder-less architecture toleranceFrank Ch. Eigler2008-04-151-0/+5
|
* dded _stp_read_address() and changed code to use it.Martin Hunt2008-03-281-13/+4
|
* kretprobe trampoline fixesMartin Hunt2008-03-281-12/+74
| | | | | Recognize when a kretprobe trampoline was hit and continue with inexact stack dump. Also some testsuite changes.
* i386 fixes.Martin Hunt2008-03-261-1/+1
|
* Cleanup.Martin Hunt2008-03-251-48/+59
|
* rebased unwind_branch on top of current masterFrank Ch. Eigler2008-03-251-0/+895