]> sourceware.org Git - systemtap.git/commitdiff
_stp_vma_mmap_cb: Really mean that we are only interested in the first load.
authorMark Wielaard <mjw@redhat.com>
Mon, 28 Nov 2011 11:06:39 +0000 (12:06 +0100)
committerMark Wielaard <mjw@redhat.com>
Mon, 28 Nov 2011 11:06:39 +0000 (12:06 +0100)
There was a chance our test for whether this was the first load of the
whole module that is executable could miss a second load, which would
override the original start address. Fix that by explicitly checking
whether we already registered this module or not.

runtime/vma.c

index 91ec7e2d0b0335e71d32d1daf6d23e424dd10e64..941a9fdc52ba052cebd1defe664a84e9e8fbd096 100644 (file)
@@ -132,7 +132,8 @@ static int _stp_vma_mmap_cb(struct stap_task_finder_target *tgt,
        // We are only interested in the first load of the whole module that
        // is executable. 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 && offset == 0 && (vm_flags & VM_EXEC)) {
+       if (path != NULL && offset == 0 && (vm_flags & VM_EXEC)
+           && stap_find_vma_map_info(tsk, addr, NULL, NULL, NULL, NULL) != 0) {
                for (i = 0; i < _stp_num_modules; i++) {
                        if (strcmp(path, _stp_modules[i]->path) == 0)
                        {
This page took 0.026468 seconds and 5 git commands to generate.