summaryrefslogtreecommitdiffstats
path: root/runtime/transport/symbols.c
Commit message (Collapse)AuthorAgeFilesLines
* PR11015 Support shared library reloading (in different processes)Mark Wielaard2009-12-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* PR10602 prime: runtime: shrink stack frame of _stp_do_relocation().Frank Ch. Eigler2009-09-091-1/+1
| | | | * transport/symbols.c (_stp_do_relocation): Make msg static.
* Detect kretprobe trampoline and use fallback unwinder.Mark Wielaard2009-06-031-0/+8
| | | | | | | | | | | | * 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.
* Removed unused functions and variables.David Smith2009-02-181-94/+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-1/+1
| | | | | | | | | | 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.
* Adapt _stp_sort to 2.6.29.Wenji Huang2009-01-121-12/+12
| | | | | Acked-by: Masami Hiramatsu <mhiramat@redhat.com> Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
* PR5947: make runtime code -Wpointer-arith-cleanFrank Ch. Eigler2008-11-281-4/+7
|
* PR4886: weaken build-id failure semanticsFrank Ch. Eigler2008-10-071-10/+9
|
* PR4886: check build-id if able.Wenji Huang2008-10-061-1/+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.
* support multiple-relocatable-section modules such as hypothetical ↵Frank Ch. Eigler2008-07-171-24/+1
| | | | -ffunction-sections .ko's
* emit all symbol tables at compile time; don't do any module munging; new ↵Frank Ch. Eigler2008-07-041-550/+21
| | | | unwinder still disabled
* transport/symbol rework: kernel-only probes workingFrank Ch. Eigler2008-06-291-4/+2
|
* STP_RELOCATE message for kernel relocatability (re)adaption, starting ↵Frank Ch. Eigler2008-06-291-19/+44
| | | | implementation
* Revert checking address in runtimeWenji Huang2008-06-251-23/+0
|
* Remove validating _stext due to many aliased symbolsWenji Huang2008-06-241-7/+0
|
* PR6646: Add checking address in runtimeWenji Huang2008-06-241-1/+33
|
* PR6429: remove stapio STP_UNWIND support and associated elfutils dependencyFrank Ch. Eigler2008-06-031-1/+1
|
* Srinivasa DS <srinivasa@in.ibm.com>,PR6429 Inerim fix to avoid compilation ↵Srikar Dronamraju2008-05-251-0/+20
| | | | error of systemtap module
* PR6410: unwinder-less architecture toleranceFrank Ch. Eigler2008-04-151-0/+2
|
* PR6405: unwinder build compatibility with RHEL5Frank Ch. Eigler2008-04-151-4/+15
|
* Change stap to get kernel symbols from debuginfo andMartin Hunt2008-04-091-4/+19
| | | | compile them into the module.
* Add new define STP_USE_DWARF_UNWINDER which is set based on which archsMartin Hunt2008-03-311-5/+6
| | | | work with the unwinder.
* Support for kernels built with CONFIG_FRAME_POINTERMartin Hunt2008-03-301-1/+4
|
* kretprobe trampoline fixesMartin Hunt2008-03-281-0/+2
| | | | | Recognize when a kretprobe trampoline was hit and continue with inexact stack dump. Also some testsuite changes.
* 32-bit fixesMartin Hunt2008-03-251-5/+5
|
* rebased unwind_branch on top of current masterFrank Ch. Eigler2008-03-251-287/+319
|
* 2008-02-27 Martin Hunt <hunt@redhat.com>hunt2008-02-271-68/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2008-01-28 Martin Hunt <hunt@redhat.com>hunt2008-01-281-1/+1
| | | | * control.c, procfs.c, symbols.c: Use DEFINE_SPINLOCK
* PR4037 and fixes to better synchronize staprun and stapio.hunt2008-01-151-35/+60
|
* Add support for memory allocation tracking.hunt2008-01-151-11/+11
|
* 2007-08-14 David Smith <dsmith@redhat.com>dsmith2007-08-141-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge from setuid-branch. Changes also by Martin Hunt <hunt@redhat.com>. * control.c (_stp_ctl_write): Make sure we don't overflow. (_stp_ctl_open_cmd): Do not allow multiple opens of the control file. (_stp_ctl_write_cmd): Once STP_START is received, ignore everything except STP_EXIT. Create another state variable "initialized". Don't respond to STP_SYMBOLS or STP_MODULES unless initialized is 0. Also check that current pid is the same as the pid that did insmod. (_stp_register_ctl_channel): Bug fix - sets owner/group after checking for NULL. * procfs.c (_stp_ctl_write): Make sure we don't overflow. (_stp_ctl_open_cmd): Do not allow multiple opens of the control file. (_stp_ctl_write_cmd): Once STP_START is received, ignore everything except STP_EXIT. Create another state variable "initialized". Don't respond to STP_SYMBOLS or STP_MODULES unless initialized is 0. Also check that current pid is the same as the pid that did insmod. (_stp_register_ctl_channel): Set ownership of cmd file and percpu files for bulkmode. * relayfs.c (utt_trace_setup): Set ownership of percpu files. Improved error handling. (utt_trace_remove): Improved error checking. * utt.c (utt_remove_tree): Improved error checking. (utt_trace_cleanup): Ditto. (utt_create_buf_file_callback): Set file ownership. (utt_create_global_buf_file_callback): Set file ownership. * transport.h: Delcare _stp_uid, _stp_gid, and _stp_init_pid. * transport.c (_stp_transport_init): Set _stp_uid, _stp_gid, and _stp_init_pid.
* 2007-07-09 Martin Hunt <hunt@redhat.com>hunt2007-07-091-3/+13
| | | | | | * symbols.c (_stp_ins_module): Check for overflow of modules array. (_stp_do_module): If _stp_ins_module() fails, return an error.
* 2007-07-02 Martin Hunt <hunt@redhat.com>hunt2007-07-021-2/+74
| | | | | | * symbols.c (_stp_do_symbols): Set "data" pointer for kernel to _etext. (_stp_sort): New. sort function from the kernel. (_stp_load_module_symbols): Use _stp_sort().
* 2007-03-26 Martin Hunt <hunt@redhat.com>hunt2007-03-261-1/+1
| | | | | | | | * symbols.c (_stp_do_module): If a module has no symbols, just return NULL instead of an errorcode. * control.c, procfs.c, relayfs.c, transport.c, utt.c, utt.h: Revert back to using systemtap/modulename instead of systemtap_pid.
* 2007-03-21 Martin Hunt <hunt@redhat.com>hunt2007-03-211-1/+4
| | | | | | | | | | | * 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.
* 2007-03-20 Frank Ch. Eigler <fche@elastic.org>fche2007-03-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | PR 4224. * tapsets.cxx (add_probe_point): Make kernel implicitly relocated relative to the _stext symbol. (dwarf_derived_probe ctor, emit_module_decls): Cooperate. (lookup_symbol_address): New function. (dwarf_builder::build): Call it thrice. (in_kprobes_function): Simplify. * session.h (systemtap_session): Rename cached symbol addresses. * translate.cxx, elaborate.cxx: Corresponding tweaks. 2007-03-20 Frank Ch. Eigler <fche@elastic.org> PR 4224. * sym.c (_stp_module_relocate): Support kernel relocations. 2007-03-20 Frank Ch. Eigler <fche@elastic.org> * symbols.c (_stp_do_symbols): Add cautionary blurb for important setup of _stp_modules[0]->text.
* 2007-03-20 Martin Hunt <hunt@redhat.com>hunt2007-03-201-6/+7
| | | | | * symbols.c (_stp_alloc_module): Fix up error cleanup when malloc fails.
* 2007-03-18 Martin Hunt <hunt@redhat.com>hunt2007-03-181-6/+5
| | | | | * stack.c, string.c, sym.c, transport/symbols.c: Fix some signed vs unsigned comparison warnings.
* 2007-03-14 Martin Hunt <hunt@redhat.com>hunt2007-03-141-9/+9
| | | | | | | | | | | | | | | | * transport_msgs.h: ifdef old messages as such. Add support for new transport. * relayfs.c: Simplify and add new interface to look like utt. * utt.[ch]: New files. Similar to the proposed utt interface. These setup and teardown relayfs on debugfs. * control.c: New file. Implements a simple control channel. A small subset of procfs.c. * procfs.c: This is now only used for old kernels lacking newer relayfs. Change STP_RELAYFS to STP_BULKMODE. Use new messages from transport_msgs.h. Don't support RELAYFS_CHANNEL_VERSION >= 4. CHanges all control channel functions to new names. Use pids instead of module names in /proc names.
* 2007-01-30 Martin Hunt <hunt@redhat.com>hunt2007-01-301-8/+8
| | | | * symbols.c: Comment out many debug lines.
* 2007-01-29 Martin Hunt <hunt@redhat.com>hunt2007-01-291-5/+4
| | | | | | * procfs.c: Count allocated IO memory. * symbols.c: Use _stp_kmalloc() and _stp_kzalloc(). * transport.c: Count allocated IO memory.
* 2007-01-09 Martin Hunt <hunt@redhat.com>hunt2007-01-091-4/+4
| | | | | | * symbols.c (_stp_del_module): Fix so memory allocated for module 0 (kernel) is freed. (_stp_free_modules): No need to lock module list.
* 2006-11-15 Martin Hunt <hunt@redhat.com>hunt2006-11-151-6/+6
| | | | | | | | * procfs.c (_stp_proc_write_cmd): For STP_SYMBOLS, type field is a long to preserve alignment. Use STP_ALLOC_FLAGS. * symbols.c: Use STP_ALLOC_FLAGS.
* 2006-11-02 Martin Hunt <hunt@redhat.com>hunt2006-11-021-1/+1
| | | | * symbols.c (_stp_do_module): Fix error message.
* New dynamic module and symbol handling code.hunt2006-11-021-0/+420