summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-03-20 13:30:58 +0100
committerMark Wielaard <mjw@redhat.com>2009-03-20 13:30:58 +0100
commitf735e6054d182b589750db65a906c1851faa9d75 (patch)
tree8b97be8c9218ae90cf6f8e11a97bed49e4847958 /runtime
parent3bbd893b113a2b67162b98e7b207d9bd1eeda035 (diff)
downloadsystemtap-steved-f735e6054d182b589750db65a906c1851faa9d75.tar.gz
systemtap-steved-f735e6054d182b589750db65a906c1851faa9d75.tar.xz
systemtap-steved-f735e6054d182b589750db65a906c1851faa9d75.zip
Move _stp_tf_vm_cb to sym.c.
* tapsets.cxx (utrace_derived_probe_group::emit_module_decls): Remove output task finder vma callback _stp_tf_vm_cb. * runtime/sym.c (_stp_tf_vm_cb): And add it here.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/sym.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/runtime/sym.c b/runtime/sym.c
index ed108f08..d0c5d9fd 100644
--- a/runtime/sym.c
+++ b/runtime/sym.c
@@ -20,6 +20,40 @@
* @{
*/
+/* Callback that needs to be registered (in tapsets.cxx for
+ emit_module_init) for every user task path or pid for which we
+ might need symbols or unwind info. */
+static int _stp_tf_vm_cb(struct stap_task_finder_target *tgt,
+ struct task_struct *tsk,
+ int map_p, char *vm_path,
+ unsigned long vm_start, unsigned long vm_end,
+ unsigned long vm_pgoff)
+{
+ int i;
+#ifdef DEBUG_TASK_FINDER_VMA
+ _stp_dbug(__FUNCTION__, __LINE__, "vm_cb: tsk %d:%d path %s, start 0x%08lx, end 0x%08lx, offset 0x%lx\n", tsk->pid, map_p, vm_path, vm_start, vm_end, vm_pgoff);
+#endif
+ if (map_p)
+ {
+ struct _stp_module *module = NULL;
+ if (vm_path != NULL)
+ for (i = 0; i < _stp_num_modules; i++)
+ if (strcmp(vm_path, _stp_modules[i]->path) == 0)
+ {
+#ifdef DEBUG_TASK_FINDER_VMA
+ _stp_dbug(__FUNCTION__, __LINE__, "vm_cb: matched path %s to module\n", vm_path);
+#endif
+ module = _stp_modules[i];
+ break;
+ }
+ stap_add_vma_map_info(tsk, vm_start, vm_end, vm_pgoff, module);
+ }
+ else
+ stap_remove_vma_map_info(tsk, vm_start, vm_end, vm_pgoff);
+
+ return 0;
+}
+
/* XXX: this needs to be address-space-specific. */
static unsigned long _stp_module_relocate(const char *module, const char *section, unsigned long offset)
{