[RHEL7,COMMIT] Revert "Revert "perf tools: Stop fallbacking to kallsyms for vdso symbols lookup""

Submitted by Konstantin Khorenko on April 23, 2020, 9:12 a.m.

Details

Message ID 202004230912.03N9Coh6007239@finist-ce7.sw.ru
State New
Series "perf: make it working again"
Headers show

Commit Message

Konstantin Khorenko April 23, 2020, 9:12 a.m.
The commit is pushed to "branch-rh7-3.10.0-1127.vz7.150.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1127.vz7.150.3
------>
commit 1f7ab462e1b187694c6dd10540a28c902cdaa308
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Thu Apr 23 12:07:48 2020 +0300

    Revert "Revert "perf tools: Stop fallbacking to kallsyms for vdso symbols lookup""
    
    This reverts commit 49810a59cbad72071eed763958a41fe0a6880b98.
    
    RedHat has fixed the original issue of non-working perf
    https://jira.sw.ru/browse/HCI-128
    (symbols were not shown correctly)
    
    So, 3 other patches fix the original issue and we now safe to drop the
    patch revert.
    
    * Mon Oct 14 2019 Jan Stancek <jstancek@redhat.com> [3.10.0-1103.el7]
    
     - [tools] perf callchain: Honour the ordering of PERF_CONTEXT_{USER,
       KERNEL, etc} (Michael Petlan) [1758046]
     - [tools] perf callchain: Stop validating callchains by the max_stack
       sysctl (Michael Petlan) [1758046]
     - [tools] perf tools: Separate accounting of contexts and real
       addresses in a stack trace (Michael Petlan) [1758046]
    
    https://jira.sw.ru/browse/PSBM-100150
    
    Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 tools/perf/util/event.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 55c93bf1b4983..a7bab025f563e 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -1417,26 +1417,9 @@  struct map *thread__find_map(struct thread *thread, u8 cpumode, u64 addr,
 
 		return NULL;
 	}
-try_again:
+
 	al->map = map_groups__find(mg, al->addr);
-	if (al->map == NULL) {
-		/*
-		 * If this is outside of all known maps, and is a negative
-		 * address, try to look it up in the kernel dso, as it might be
-		 * a vsyscall or vdso (which executes in user-mode).
-		 *
-		 * XXX This is nasty, we should have a symbol list in the
-		 * "[vdso]" dso, but for now lets use the old trick of looking
-		 * in the whole kernel symbol list.
-		 */
-		if (cpumode == PERF_RECORD_MISC_USER && machine &&
-		    mg != &machine->kmaps &&
-		    machine__kernel_ip(machine, al->addr)) {
-			mg = &machine->kmaps;
-			load_map = true;
-			goto try_again;
-		}
-	} else {
+	if (al->map != NULL) {
 		/*
 		 * Kernel maps might be changed when loading symbols so loading
 		 * must be done prior to using kernel maps.