summaryrefslogtreecommitdiffstats
path: root/runtime/sym.h
Commit message (Collapse)AuthorAgeFilesLines
* use eh_frame_hdr table to speed up unwindingTim Moore2010-01-201-0/+1
| | | | | | | | | | | | * 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-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Allow modules to trigger task_finder vma_tracker.Mark Wielaard2009-11-161-0/+4
| | | | | | | * runtime/sym.h: Define _stp_need_vma_tracker. * translate.cxx (emit_symbol_data_done): Output _stp_need_vma_tracker value. (c_unparser::emit_module_init): If STP_NEED_VMA_TRACKER isn't defined check _stp_need_vma_tracker to call _stp_sym_init().
* PR10524: reduce massive-uprobe script modules' .data consumptionFrank Ch. Eigler2009-09-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The general approach is to rip out task_finder_tgt's from all over the place (including the unwindsym vmcbs, and the stap_uprobe_specs), and instead have a small handful of them: one for all unwindsyms, and one per abstract probed process (PID or NAME). These are in turn shared by all new stap_unwind_specs by index. Before: probe process("./stap").function("*") -rw-r--r--. 1 fche users 11775283 2009-09-08 20:26 /var/tmp/fche/systemtap/cache/96/stap_96c0479d674db55ec98d8a8750a790e7_7989596.ko text data bss dec hex filename 445158 8351944 4306472 13103574 c7f1d6 /var/tmp/fche/systemtap/cache/96/stap_96c0479d674db55ec98d8a8750a790e7_7989596.ko After: (Note how data shrank, though text gained a bit in const-init-data.) -rw-r--r--. 1 fche users 4021569 2009-09-08 20:27 /var/tmp/fche/systemtap/cache/e4/stap_e46e88634efd850b1586e81c231c239a_8058419.ko text data bss dec hex filename 1896511 2192 4324808 6223511 5ef697 /var/tmp/fche/systemtap/cache/e4/stap_e46e88634efd850b1586e81c231c239a_8058419.ko * tapsets.cxx (uprobe_derived_probe_group): Rewrite emit_module_decls, and adjust emit_module_init. * runtime/sym.c (_stp_sym_init): Initialize unwindsyms-shared vmcb. * runtime/sym.h (_stp_module): Remove *vmcb field. * translate.cxx (emit_module_init, dump_unwindsyms): Adapt. * translate.h (assert_0_indent): Flush output before possibly assert-failing.
* PR10228: use task_finder_vma for -d /user/object files.Frank Ch. Eigler2009-08-141-0/+2
| | | | | | | | | | | | * main.cxx (main): For "-d /path" arguments, enable task finder. * runtime/sym.h (_stp_module): Add *vmcb member. * task_finder{.cxx,.h} (emit_vma_callback_probe_decl): Zap. * tapset-itrace.cxx, tapset-utrace.cxx: Use unwindsyms_modules instead. * tapsets.cxx (uprobe::emit_module_decls): Ditto. * translate.cxx (emit_module_init): Emit task finder registrations for vmcb's associated with _stp_modules. (dump_unwindsyms): Associate vmcbs with user-space unwindsyms entries.
* Detect kretprobe trampoline and use fallback unwinder.Mark Wielaard2009-06-031-4/+4
| | | | | | | | | | | | * runtime/sym.h (_stp_kretprobe_trampoline): Document. * translate.cxx (unwindsym_dump_context): Add stp_kretprobe_trampoline_addr. (dump_unwindsyms): Detect kretprobe_trampoline_holder symbol address. (emit_symbol_data): Initialize and emit _stp_kretprobe_trampoline. * runtime/transport/symbols.c (_stp_do_relocation): Detect kernel load address and adjust _stp_kretprobe_trampoline. * runtime/stack-i386.c (__stp_stack_print): Always use fallback unwinder when hitting kretprobe_trampoline_holder. * runtime/stack-x86_64.c (__stp_stack_print): Likewise.
* Fetch and store both debug_frame and eh_frame tables.Mark Wielaard2009-05-201-3/+5
| | | | | | | | | | | | | * 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.
* Keep track of relocation section sizes.Mark Wielaard2009-04-141-0/+1
| | | | | | | | * runtime/sym.h (_stp_section): Add size field. * translate.cxx (dump_unwindsyms): Get start of module address space, turn seclist into vector of secname, size pairs, track relocation section size, or add module address range if no sections, output size in _stp_section list.
* Get the canonical path of the main file for comparison at runtime.Mark Wielaard2009-03-171-0/+1
| | | | | | | | | When given directly by the user through -d or in case of the kernel name and path might differ. path should be used for matching. * runtime/sym.h (_stp_module): Add path field. * runtime/task_finder.c (__stp_tf_vm_cb): Use module path to compare vm_path. * translate.cxx (dump_unwindsyms): Output canonical path.
* 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.
* PR4886: weaken build-id failure semanticsFrank Ch. Eigler2008-10-071-6/+1
|
* PR4886: check build-id if able.Wenji Huang2008-10-061-0/+10
| | | | This provides sanity check of debuginfo file based on build-id. Many cases are considered, whether build-id exists in debuginfo file or not, whether module is loaded or not, whether build-id exists in runtime kernel/module. It will do work when LD >= 2.18 and kernel >=2.6.23, otherwise no check.
* Rename _stp_module module_base output to dwarf_module_base and document.Mark Wielaard2008-09-101-2/+5
|
* Record module base and use it for adjusting start locations in dwarf unwinder.Mark Wielaard2008-09-101-0/+2
|
* support multiple-relocatable-section modules such as hypothetical ↵Frank Ch. Eigler2008-07-171-16/+14
| | | | -ffunction-sections .ko's
* emit all symbol tables at compile time; don't do any module munging; new ↵Frank Ch. Eigler2008-07-041-43/+12
| | | | unwinder still disabled
* kretprobe trampoline fixesMartin Hunt2008-03-281-0/+1
| | | | | 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-10/+14
|
* 2008-02-27 Martin Hunt <hunt@redhat.com>hunt2008-02-271-32/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | * sym.h (_stp_module): Add text_size, lock, and unwind data pointer. * sym.c (_stp_find_module_by_addr): New function. (_stp_kallsyms_lookup): Call _stp_find_module_by_addr(). (_stp_get_unwind_info): New. * runtime.h: Move debug macros to debug.h. Include it. * debug.h: New file. * map.c: Update debug calls. * map-gen.c: Update debug calls. * pmap-gen.c: Update debug calls. * mempool.c: New file. * symbols.c: Use rwlocks. Use new dbug macros. Handle unwind info if present. * transport.c: Include mempool.c. Update dbug and kbug calls to new macros. * transport_msgs.h (_stp_command_name): Add struct containing message names for debugging. * control.c, procfs.c: Use new dbug macros. Use new mempool functions.
* 2007-07-09 Martin Hunt <hunt@redhat.com>hunt2007-07-091-1/+1
| | | | * sym.h (STP_MAX_MODULES): Raise limit to 256.
* 2007-03-21 Martin Hunt <hunt@redhat.com>hunt2007-03-211-0/+1
| | | | | | | | | | | * sym.h: Declare _stp_module_relocate. * sym.c (_stp_module_relocate): Add comments, reformat, add a way for "last" cached values to be cleared when modules are removed. (_stp_symbol_print): Simplify and remove static buffer. (_stp_symbol_snprint): Ditto. * symbols.c (_stp_del_module): Add a call to _stp_module_relocate to clear its cache.
* 2006-11-09 Martin Hunt <hunt@redhat.com>hunt2006-11-091-3/+3
| | | | * sym.h: Change int to int32_t.
* New dynamic module and symbol handling code.hunt2006-11-021-7/+46
|
* 2005-10-06 Frank Ch. Eigler <fche@elastic.org>fche2005-10-061-0/+25
PR 1332. * translate.cxx (emit_symbol_data): New function to transcribe a processed address->symbol lookup table, based upon /proc/kallsyms. 2005-10-06 Frank Ch. Eigler <fche@elastic.org> PR 1332. * sym.h: New file to declare explicit symbol table struct. * runtime.h (_stp_kallsyms_lookup_tabled): Use it if available. * sym.c (_stp_symbol_sprint): HAS_LOOKUP mooted. 2005-10-06 Frank Ch. Eigler <fche@elastic.org> PR 1132. * systemtap.samples/symbols.*: New test.