Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1544086imm; Wed, 17 Oct 2018 23:23:20 -0700 (PDT) X-Google-Smtp-Source: ACcGV61a9XFF/ABPQCtx6JVwOkRBcygayvfIR+MXeOwaU9pDtOuOHtNUhbsUFA07pTfgkp8mKoxp X-Received: by 2002:a63:ed09:: with SMTP id d9-v6mr27124064pgi.305.1539843800019; Wed, 17 Oct 2018 23:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539843799; cv=none; d=google.com; s=arc-20160816; b=pmvXmoF52r+mHk/9rkQOgl57PA4LHNbkF0bNTqnquZx7wfNyO+czcxcym4Zkqf1EhH NWVehoXABPsrmmpSG7LVVm6RKP18SARS5OFjS3rfdY+ctvQpj+pfFwrkb/klo9B+OmyU T973wwStj4tLAB8+0yObA3dey9Y3sFQKxn+1p/r4l8haiFu5CSP8l5phLawIv6SIeoOU PSYW6OYsISwW8k55EbEHqWanEE5DjZqwmuD26EDD5/2O8vtiwTjr9K8IaXpPyJIeBwHA Qd0aQfPDznp4P2cuu0dfGZhOKXXZrPtdXgv5zn1qMbNcMMs5t6Bi66TzVufaQs5Kcw64 NB5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=4knurNiKTvKmn2r99rVhVgAaqEXFwSTYuKOMCS7aJKg=; b=G8sfBLH56HgE5L/K7cff1Yk4rCfR9gc/TUi8aPAzt8o89DdytuFKHN2BXoG+NAGt6Y RWkcXOp7zV8FCHZzRdJ370Svksnp8qW5bcgen+7IM69fiYpWykFv7S7LQGqq9zY7pgGV Cimp/zmX9Q6Vdf8YvR2tKZjLtlC1PcMQmHf4W9hVo3xsrX7aaWr5Y2QjtuUTUZD9MG/b KmVulgUvWYJ9ita/jkfcBLajXo5HRLt2zVFdUFZY7yu9AkHnINNnTcjZkrt6Fg5s8A9K mOCyEgbsurOwraT/+y7D99iZC49yd6f7P4IHjHOEGV9CspheHI1W6dUFl42sYCOCF3uX fUpg== 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 l189-v6si19124106pgd.27.2018.10.17.23.23.04; Wed, 17 Oct 2018 23:23:19 -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 S1727571AbeJROVx (ORCPT + 99 others); Thu, 18 Oct 2018 10:21:53 -0400 Received: from mga11.intel.com ([192.55.52.93]:21293 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727328AbeJROVx (ORCPT ); Thu, 18 Oct 2018 10:21:53 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2018 23:22:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,395,1534834800"; d="scan'208";a="79653170" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.130]) ([10.237.72.130]) by fmsmga008.fm.intel.com with ESMTP; 17 Oct 2018 23:22:25 -0700 Subject: Re: [PATCH 11/11] perf tools: Stop fallbacking to kallsyms for vdso symbols lookup To: 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 References: <20181017225501.32150-1-acme@kernel.org> <20181017225501.32150-12-acme@kernel.org> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <4c682937-3cee-6974-0970-68610e13ad37@intel.com> Date: Thu, 18 Oct 2018 09:20:46 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181017225501.32150-12-acme@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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. >