Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp726255imd; Fri, 26 Oct 2018 16:20:31 -0700 (PDT) X-Google-Smtp-Source: AJdET5f/53NX+o4ctollngZ6Xzus5Il7suhh25oU+h3tmcJlj3nMQa6JDBJRU25xcj7/a4tQ8mTp X-Received: by 2002:a63:c746:: with SMTP id v6-v6mr5387991pgg.108.1540596031310; Fri, 26 Oct 2018 16:20:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540596031; cv=none; d=google.com; s=arc-20160816; b=KswF0mpsv8QB+f453T18Acm8084RGSG5TBgR3NtqC6JkdcdeVsI0KSc4E8qadAQ3+K cvKPSGo3PjlC92XONUccVA7keJlT4EIPb92zb3//JqCPFTfEow69iiqY8a/S4hZgRt/9 +QO9len+sK0w1Lk5Ejwc4aiFhaAYLDKLJU3HhSx3EJB/pMI0wNbX2EWfKq3kpAyK+J+r VrBdh7R6cVXND8dN4bHHlgJXPqqmMp6GSClAoiLrLTkiZeWX0GoyS8ltmNvkDJJU68HE l7NThNjnAWQbBIxkVorjLMc3FF9eHOGD1ALQ/0cCAMAOf7lDZ74cJqGtbF2Irhm5nVBU tvxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=g/KBtBhn1FLaem2H6KVOMVj7aD1TrXJr/x5yBej9L38=; b=QBUAUryT7im6tTldiFgU+5nJKEwWYdr7JN0a5JvipPrByrr2FVNPuN6Yg+Yf/XpHjd QPPV28GN6NCCFmzE641st5S9Racz1JvJuONyUrzzveZNeHIofeSgQJFuQw/Eeo5/Qt9e wZHe535Y7HaaoefqFty/Z+QRgkmZGBTEQKiRnPra6LWV3hwgpRxscFyCGzF0uhwXoq9W JtU7g9Qm3pcBou5DhvLof51xC39RrUUS7yHPZu4sxSER8qufVOu7YbuVt69Y7XkS8Xad obq1WFtGg/6Puzx+dkrZ1AzwfrNnMprd8+NDnj0atwRy4lt+KOuHgnhBoXW2dCZ4ziPz 98Lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4-v6si12506558plk.37.2018.10.26.16.20.14; Fri, 26 Oct 2018 16:20:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728862AbeJ0H6w (ORCPT + 99 others); Sat, 27 Oct 2018 03:58:52 -0400 Received: from mga18.intel.com ([134.134.136.126]:27525 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbeJ0H6w (ORCPT ); Sat, 27 Oct 2018 03:58:52 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Oct 2018 16:19:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,429,1534834800"; d="scan'208";a="275981031" Received: from ellie.jf.intel.com (HELO ellie) ([10.54.70.80]) by fmsmga006.fm.intel.com with ESMTP; 26 Oct 2018 16:19:52 -0700 From: Vinicius Costa Gomes To: Adrian Hunter , Arnaldo Carvalho de Melo , Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , David Ahern , Jiri Olsa , Namhyung Kim , Wang Nan Subject: Re: [PATCH 11/11] perf tools: Stop fallbacking to kallsyms for vdso symbols lookup In-Reply-To: <4c682937-3cee-6974-0970-68610e13ad37@intel.com> References: <20181017225501.32150-1-acme@kernel.org> <20181017225501.32150-12-acme@kernel.org> <4c682937-3cee-6974-0970-68610e13ad37@intel.com> Date: Fri, 26 Oct 2018 16:19:52 -0700 Message-ID: <87a7n070tj.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Adrian Hunter writes: > On 18/10/18 1:55 AM, Arnaldo Carvalho de Melo wrote: >> From: Arnaldo Carvalho de Melo >> >> David reports that: >> >> >> Perf has this hack where it uses the kernel symbol map as a backup when >> a symbol can't be found in the user's symbol table(s). > > I don't think this is a complete fix because it exposes new problems. This commit broke function name resolution for 'perf record -g' for me. What I mean is, with this commit applied: $ ./tools/perf/perf record -g -- sleep 1 $ ./tools/perf/perf report 'perf report' doesn't seem to be able to show the function names of the trace. If I revert this commit, function names are resolved fine. > This code caters for branches from kernel space to user space and vice > versa. That is, since there is only one cpumode so it is certain to be > wrong for either 'ip' or 'addr' when they are not both in the kernel > or both in userspace. > >> >> >> Cc: Adrian Hunter >> Cc: David Ahern >> Cc: Jiri Olsa >> Cc: Namhyung Kim >> Cc: Wang Nan >> Link: https://lkml.kernel.org/n/tip-cs7skq9pp0kjypiju6o7trse@git.kernel.org >> Signed-off-by: Arnaldo Carvalho de Melo >> --- >> tools/perf/util/event.c | 21 ++------------------- >> 1 file changed, 2 insertions(+), 19 deletions(-) >> >> diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c >> index 0988eb3b844b..bc646185f8d9 100644 >> --- a/tools/perf/util/event.c >> +++ b/tools/perf/util/event.c >> @@ -1561,26 +1561,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. >> -- Vinicius