]> sourceware.org Git - systemtap.git/commitdiff
Use the path instead of the module for vma tracking mmap callback.
authorJunlong Li <zhuizhuhaomeng@gmail.com>
Mon, 12 Jul 2021 19:48:42 +0000 (15:48 -0400)
committerStan Cox <scox@redhat.com>
Mon, 12 Jul 2021 19:48:42 +0000 (15:48 -0400)
Use the path instead of the module for vma tracking mmap callback
since the module is usually NULL.

runtime/vma.c

index b614340f361f77cfc12e64819919bd06ff397442..048f31d8e614a923e7703cc54050fcadf4e4f29d 100644 (file)
@@ -149,7 +149,7 @@ static int _stp_vma_mmap_cb(struct stap_task_finder_target *tgt,
 {
        int i, res;
        struct _stp_module *module = NULL;
-       void *ori_mod = NULL; 
+       const char *ori_path = NULL;
        const char *name = ((dentry != NULL) ? (char *)dentry->d_name.name
                            : NULL);
         
@@ -168,8 +168,8 @@ static int _stp_vma_mmap_cb(struct stap_task_finder_target *tgt,
         // We register whether or not we know the module,
        // so we can later lookup the name given an address for this task.
        if (path != NULL &&
-           (stap_find_vma_map_info(tsk->group_leader, addr, NULL, NULL, NULL, NULL, &ori_mod) != 0 || 
-            ori_mod != module)) { 
+           (stap_find_vma_map_info(tsk->group_leader, addr, NULL, NULL, NULL, &ori_path, NULL) != 0 ||
+            strcmp(ori_path ?: "", path) != 0)) {
                for (i = 0; i < _stp_num_modules; i++) {
                        // PR20433: papering over possibility of NULL pointers
                        if (strcmp(path ?: "", _stp_modules[i]->path ?: "") == 0)
This page took 0.028945 seconds and 5 git commands to generate.