diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-12-21 13:02:19 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-12-21 13:24:36 +0100 |
commit | ea549ffc2915aa58861637472b12196222673fa2 (patch) | |
tree | 5bf80c4245ddfd3c12af6f7ee2c4b75075efe86b /dwflpp.cxx | |
parent | 0c487e433fd6343e49b1e9dbc6492f38cfe26143 (diff) | |
download | systemtap-steved-ea549ffc2915aa58861637472b12196222673fa2.tar.gz systemtap-steved-ea549ffc2915aa58861637472b12196222673fa2.tar.xz systemtap-steved-ea549ffc2915aa58861637472b12196222673fa2.zip |
PR11015 Support shared library reloading (in different processes)
* 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.
Diffstat (limited to 'dwflpp.cxx')
-rw-r--r-- | dwflpp.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1523,7 +1523,7 @@ dwflpp::emit_address (struct obstack *pool, Dwarf_Addr address) // This gives us the module name, and section name within the // module, for a kernel module (or other ET_REL module object). obstack_printf (pool, "({ unsigned long addr = 0; "); - obstack_printf (pool, "addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ", + obstack_printf (pool, "addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 ", NULL); ", modname, secname, reloc_address); obstack_printf (pool, "addr; })"); } @@ -1537,7 +1537,7 @@ dwflpp::emit_address (struct obstack *pool, Dwarf_Addr address) // kernel will never move after being loaded (unlike modules and // user-space dynamic share libraries). obstack_printf (pool, "({ static unsigned long addr = 0; "); - obstack_printf (pool, "if (addr==0) addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ", + obstack_printf (pool, "if (addr==0) addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 ", NULL); ", modname, secname, address); // PR10000 NB: not reloc_address obstack_printf (pool, "addr; })"); } @@ -1545,7 +1545,7 @@ dwflpp::emit_address (struct obstack *pool, Dwarf_Addr address) { enable_task_finder (sess); obstack_printf (pool, "({ unsigned long addr = 0; "); - obstack_printf (pool, "addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ", + obstack_printf (pool, "addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 ", current); ", modname, ".dynamic", reloc_address); obstack_printf (pool, "addr; })"); } |