From b4b59d474c101a2e6ef4b81a19e868dee071af15 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 4 Jun 2010 21:22:55 +0200 Subject: [PATCH] Remove unused vm_pgoff tracking from task_finder_vma. * runtime/task_finder_vma.c (__stp_tf_vma_entry): Remove vm_pgoff field. (stap_add_vma_map_info): Remove vm_pgoff argument. (stap_remove_vma_map_info): Likewise. (stap_find_vma_map_info_user): Likewise. * runtime/sym.c (_stp_tf_mmap_cb): Adjust vma_map callers. (_stp_module_relocate): Likewise. (_stp_mod_sec_lookup): Likewise. * runtime/unwind.c (adjustStartLoc): Likewise. --- runtime/sym.c | 11 ++++------- runtime/task_finder_vma.c | 15 ++++----------- runtime/unwind.c | 2 +- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/runtime/sym.c b/runtime/sym.c index 4ca293560..dd63fa49d 100644 --- a/runtime/sym.c +++ b/runtime/sym.c @@ -69,10 +69,8 @@ static int _stp_tf_mmap_cb(struct stap_task_finder_target *tgt, sections, but .absolute exes are also necessary atm. */ return stap_add_vma_map_info(tsk->group_leader, - addr, - addr + length, - offset, dentry, - module); + addr, addr + length, + dentry, module); } } } @@ -135,7 +133,7 @@ static unsigned long _stp_module_relocate(const char *module, } if (stap_find_vma_map_info_user(tsk->group_leader, m, &addr_offset, NULL, - NULL, NULL) != 0) { + NULL) != 0) { return 0; } } @@ -165,8 +163,7 @@ static struct _stp_module *_stp_mod_sec_lookup(unsigned long addr, { unsigned long vm_start = 0; if (stap_find_vma_map_info(task->group_leader, addr, - &vm_start, NULL, - NULL, NULL, &user) == 0) + &vm_start, NULL, NULL, &user) == 0) if (user != NULL) { struct _stp_module *m = (struct _stp_module *)user; diff --git a/runtime/task_finder_vma.c b/runtime/task_finder_vma.c index 838643a3f..903e38488 100644 --- a/runtime/task_finder_vma.c +++ b/runtime/task_finder_vma.c @@ -31,7 +31,6 @@ struct __stp_tf_vma_entry { pid_t pid; unsigned long vm_start; unsigned long vm_end; - unsigned long vm_pgoff; struct dentry *dentry; // User data (possibly stp_module) @@ -126,8 +125,8 @@ __stp_tf_get_vma_map_entry_internal(struct task_struct *tsk, // Add the vma info to the vma map hash table. // Caller is responsible for dentry lifetime. static int -stap_add_vma_map_info(struct task_struct *tsk, unsigned long vm_start, - unsigned long vm_end, unsigned long vm_pgoff, +stap_add_vma_map_info(struct task_struct *tsk, + unsigned long vm_start, unsigned long vm_end, struct dentry *dentry, void *user) { struct hlist_head *head; @@ -160,7 +159,6 @@ stap_add_vma_map_info(struct task_struct *tsk, unsigned long vm_start, entry->pid = tsk->pid; entry->vm_start = vm_start; entry->vm_end = vm_end; - entry->vm_pgoff = vm_pgoff; entry->dentry = dentry; entry->user = user; @@ -203,8 +201,7 @@ stap_remove_vma_map_info(struct task_struct *tsk, unsigned long vm_start) static int stap_find_vma_map_info(struct task_struct *tsk, unsigned long addr, unsigned long *vm_start, unsigned long *vm_end, - unsigned long *vm_pgoff, struct dentry **dentry, - void **user) + struct dentry **dentry, void **user) { struct hlist_head *head; struct hlist_node *node; @@ -228,8 +225,6 @@ stap_find_vma_map_info(struct task_struct *tsk, unsigned long addr, *vm_start = found_entry->vm_start; if (vm_end != NULL) *vm_end = found_entry->vm_end; - if (vm_pgoff != NULL) - *vm_pgoff = found_entry->vm_pgoff; if (dentry != NULL) *dentry = found_entry->dentry; if (user != NULL) @@ -247,7 +242,7 @@ stap_find_vma_map_info(struct task_struct *tsk, unsigned long addr, static int stap_find_vma_map_info_user(struct task_struct *tsk, void *user, unsigned long *vm_start, unsigned long *vm_end, - unsigned long *vm_pgoff, struct dentry **dentry) + struct dentry **dentry) { struct hlist_head *head; struct hlist_node *node; @@ -270,8 +265,6 @@ stap_find_vma_map_info_user(struct task_struct *tsk, void *user, *vm_start = found_entry->vm_start; if (vm_end != NULL) *vm_end = found_entry->vm_end; - if (vm_pgoff != NULL) - *vm_pgoff = found_entry->vm_pgoff; if (dentry != NULL) *dentry = found_entry->dentry; rc = 0; diff --git a/runtime/unwind.c b/runtime/unwind.c index 1c5067208..804340696 100644 --- a/runtime/unwind.c +++ b/runtime/unwind.c @@ -538,7 +538,7 @@ adjustStartLoc (unsigned long startLoc, struct task_struct *tsk, if (strcmp (s->name, ".dynamic") == 0) { unsigned long vm_addr; if (stap_find_vma_map_info_user(tsk->group_leader, m, - &vm_addr, NULL, NULL, NULL) == 0) + &vm_addr, NULL, NULL) == 0) return startLoc + vm_addr; } -- 2.43.5