summaryrefslogtreecommitdiffstats
path: root/runtime/task_finder_vma.c
Commit message (Collapse)AuthorAgeFilesLines
* PR11015 Support shared library reloading (in different processes)Mark Wielaard2009-12-221-4/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Get rid of __stp_tf_get_vma_entry_addr function.Mark Wielaard2009-03-191-31/+9
| | | | | | | | * runtime/task_finder_vma.c (__stp_tf_get_vma_entry_addr): Deleted. (struct __stp_tf_vma_entry): Replace module by user void* field. (stap_add_vma_map_info): Take a void *user arg. (stap_find_vma_map_info): Take a void **user arg. * runtime/sym.c (_stp_mod_sec_lookup): Use stap_find_vma_map_info.
* Replace mutex in task_finder_vma with rwlock to be interrupt context safe.Mark Wielaard2009-03-181-31/+51
| | | | | * runtime/task_finder_vma.c: Replace all mutex calls with appropriate read or write (un)lock calls.
* Don't mutex_unlock in __stp_tf_get_vma_map_entry_internal.Mark Wielaard2009-03-181-1/+0
| | | | | | | | | All callers of __stp_tf_get_vma_map_entry_internal lock and unlock the mutex correctly themselves in all cases. This unlock would trigger a double unlock. * runtime/task_finder_vma.c (__stp_tf_get_vma_map_entry_internal): Don't mutex_unlock(&__stp_tf_vma_mutex).
* Move vma module tracking from pr6866 branch to master.Mark Wielaard2009-03-151-1/+29
| | | | | | | | | | | | * tapsets.cxx (utrace_derived_probe_group::emit_module_decls): Always emit vm callback probe for __stp_tf_vm_cb. * runtime/task_finder.c (__stp_tf_vm_cb): Always expose, move _stp_dbug statements under ifdef DEBUG_TASK_FINDER_VMA. Find and record corresponding module when vm_path not NULL. * runtime/task_finder_vma.c (struct __stp_tf_vma_entry): Add _stp_module. (stap_add_vma_map_info): Add _stp_module argument and assign. (__stp_tf_get_vma_entry_addr): New static function to get the __stp_tf_vma_entry given an address.
* Fix compilation warning of uninitialized value in gcc 3.x.Wenji Huang2008-10-171-1/+1
|
* fix #if->#ifdef DEBUG_TASK_FINDER_VMAFrank Ch. Eigler2008-09-011-1/+1
|
* pr4225: fix shared library address range checks; make more task_finder_vma ↵Frank Ch. Eigler2008-08-221-5/+7
| | | | tracing conditional on DEBUG_TASK_FINDER_VMA
* Saves thread vma information.David Smith2008-08-081-0/+132
| | | | | | | | | | | | 2008-08-08 David Smith <dsmith@redhat.com> * task_finder.c (__stp_tf_vm_cb): Added calls to save/delete vma information. * task_finder_vma.c (__stp_tf_vma_map_hash): New function. (__stp_tf_get_vma_map_entry_internal): Ditto. (stap_add_vma_map_info): Ditto. (stap_remove_vma_map_info): Ditto. (stap_find_vma_map_info): Ditto.
* No longer allocates structure used to save vma information.David Smith2008-07-211-4/+65
| | | | | | | | | | | | | | | 2008-07-21 David Smith <dsmith@redhat.com> * task_finder_vma.c (__stp_tf_vma_initialize): New function to initialize the free list. (__stp_tf_vma_put_free_entry): Puts a vma entry back on the free list. (__stp_tf_add_vma): Instead of allocating a vma entry, grab one from the free list by calling __stp_tf_vma_put_free_entry(). (__stp_tf_remove_vma_entry): Instead of freeing a vma entry, call __stp_tf_vma_put_free_entry() to put it on the free list instead. * task_finder.c (stap_start_task_finder): Calls __stp_tf_vma_initialize().
* Made RHEL5 changes.David Smith2008-06-231-1/+1
| | | | | | | | | 2008-06-23 David Smith <dsmith@redhat.com> * task_finder_vma.c (__stp_tf_vma_hash): Improved determination of whether this is a 64-bit platform. * syscall.h: Handles kernels with older style register definitions.
* Major update to memory map change notification code.David Smith2008-06-231-0/+112
2008-06-23 David Smith <dsmith@redhat.com> * tapsets.cxx (utrace_derived_probe_group::emit_probe_decl): Handles UDPF_NONE value. (utrace_derived_probe_group::emit_vm_callback_probe_decl): New function. (utrace_derived_probe_group::emit_module_decls): Calls emit_vm_callback_probe_decl() to set up vm_callbacks. 2008-06-23 David Smith <dsmith@redhat.com> * task_finder.c (__stp_tf_vm_cb): New function. (stap_register_task_finder_target): Sets up syscall entry and syscall exit handlers. (__stp_find_file_based_vma): New function. (__stp_utrace_task_finder_target_syscall_entry): New function. Saves vma information off at syscall entry. (__stp_target_call_vm_callback): New function. (__stp_utrace_task_finder_target_syscall_exit): New function. Handles changes to memory maps based on information saved at syscall entry. * syscall.h: New file containing syscall function. * task_finder_vma.c: New file containing saved vma information handling functions.