Message ID | 20221125114210.2353820-1-vincent.whitchurch@axis.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3958089wrr; Fri, 25 Nov 2022 04:00:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf4vzW4NblmqdI4xy05nNp6/ii/Vq6ZkE1YDfbPAbCLB574AwQtKxr3tG4gRsmPlPrJXrDkg X-Received: by 2002:a17:906:4ec4:b0:7bb:4880:b6fd with SMTP id i4-20020a1709064ec400b007bb4880b6fdmr6270417ejv.170.1669377657917; Fri, 25 Nov 2022 04:00:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669377657; cv=none; d=google.com; s=arc-20160816; b=zpezN2iEFu/UH+CO3DU4MqBRFv6eLe4DvCyOWFWrAJOFrprzDSqNykmHJVZeznCcUN iaMS3fskkqNrCZ4THe/aCn/M11wQHRhQPPjFPHttuwE7zZTOtj/Pq4dIkpRPOswvDVeW zqcuYC2ra435h/PoJ3xqUn6bS6IlLnQcCchC7CpMydK0vRBhfKJLr9+mX+3lJ8c4ek1q +TacewmXNrfibL8E498sZNKqM9Qgz53vS0nnYqOJd9f+iq7O7BdLAP98jdmkyqyFc2/2 RNtij/1itoK/AHfiZOKivonyxpKPoRQRwW5XM8fCUsYZrNEwfXj6aKpdHtFurYQBW1cq 9fLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=JhyzSfrrReVX0sQCzaa5uP5Ld+NNauN2KVzxad0wMJA=; b=IJxCd9Nk+wtUZoUKPjW2E7DINOQr/n/QsfiZOo4Hi7mA+eGtzwBzq14dyVf8LHWvhr MYczS+KuLZTO5otMfy1mbr+18prKLu4nP70A/vBGm5Pujb37BsGZmbMWntCoHteaM7QU KLRcVhD0zGGqcDgm6odI/Q5TRL1tMsZkuPeSsm4vWMCkCLpzm48/JmWHwS79LKhHxopQ lzRoTtK1YhITIkv2h4rMMii16jR27QT8TRGgjQX/q3pNLZ1BsJBQPuWHpxtsgVOmZ7Gr a1WNBZKRe4n5h+To+1jCXxepmuSseDjjYyfRc8qQjrR76RAu4Hz4tbdf7qkNO6o7YFL1 MyXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=aaxAm7XT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b4-20020aa7d484000000b0046977e0b06dsi3052063edr.117.2022.11.25.04.00.26; Fri, 25 Nov 2022 04:00:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=aaxAm7XT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230002AbiKYLmW (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Fri, 25 Nov 2022 06:42:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiKYLmU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 25 Nov 2022 06:42:20 -0500 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34BBB1E3F6; Fri, 25 Nov 2022 03:42:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1669376539; x=1700912539; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=JhyzSfrrReVX0sQCzaa5uP5Ld+NNauN2KVzxad0wMJA=; b=aaxAm7XTJ3oP5MIs8no/Lz5/MiNXLM4WVCG+f9VE7jnk/2T0EWYOBmzD SMnOePRCp+n+DQpYNeZYu1qZO747H2RkVWALh39sn/wi1jMfJwVRkQhwy EFSlVrRpfFOZUA+SBLwRFVyr8B1l7YZdwujYDIWzyWTypXpc+c+K5C+OY WyCiUQlcuzbpH1N/G4fYsetXX4F8a62qSSQckUDPIPkycc//Yr/2GDtFL kVbuhl3EM08s1QOalPdXG2ouZmS+pJl+KpWYerAd4azPPrWqOpE0Q8Zq6 /+WmHuEFJlXZ6/Dinbpt7RL0X9fW7BcMbeesVIRkaeqrq3owkU41h2dSc Q==; From: Vincent Whitchurch <vincent.whitchurch@axis.com> To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org> CC: <kernel@axis.com>, Vincent Whitchurch <vincent.whitchurch@axis.com>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, <linux-perf-users@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH] perf annotate: Work with vmlinux outside symfs Date: Fri, 25 Nov 2022 12:42:09 +0100 Message-ID: <20221125114210.2353820-1-vincent.whitchurch@axis.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750469347331300121?= X-GMAIL-MSGID: =?utf-8?q?1750469347331300121?= |
Series |
perf annotate: Work with vmlinux outside symfs
|
|
Commit Message
Vincent Whitchurch
Nov. 25, 2022, 11:42 a.m. UTC
It is currently possible to use --symfs along with a vmlinux which lies
outside of the symfs by passing an absolute path to --vmlinux, thanks to
the check in dso__load_vmlinux() which handles this explicitly.
However, the annotate code lacks this check and thus perf annotate does
not work ("Internal error: Invalid -1 error code") for kernel functions
with this combination. Add the missing handling.
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
---
tools/perf/util/annotate.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Comments
On Fri, 2022-11-25 at 12:42 +0100, Vincent Whitchurch wrote: > It is currently possible to use --symfs along with a vmlinux which lies > outside of the symfs by passing an absolute path to --vmlinux, thanks to > the check in dso__load_vmlinux() which handles this explicitly. > > However, the annotate code lacks this check and thus perf annotate does > not work ("Internal error: Invalid -1 error code") for kernel functions > with this combination. Add the missing handling. > > Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> This patch was not merged and I did not receive any comments on it either. Should I resend it? It still applies cleanly to current mainline. Thanks.
Em Fri, Jun 16, 2023 at 10:21:52AM +0000, Vincent Whitchurch escreveu: > On Fri, 2022-11-25 at 12:42 +0100, Vincent Whitchurch wrote: > > It is currently possible to use --symfs along with a vmlinux which lies > > outside of the symfs by passing an absolute path to --vmlinux, thanks to > > the check in dso__load_vmlinux() which handles this explicitly. > > > > However, the annotate code lacks this check and thus perf annotate does > > not work ("Internal error: Invalid -1 error code") for kernel functions > > with this combination. Add the missing handling. > > > > Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> > > This patch was not merged and I did not receive any comments on it > either. Should I resend it? It still applies cleanly to current > mainline. Thanks. Thanks for the ping, I checked dso__load_vmlinux() and it has: if (vmlinux[0] == '/') snprintf(symfs_vmlinux, sizeof(symfs_vmlinux), "%s", vmlinux); else symbol__join_symfs(symfs_vmlinux, vmlinux) Exactly as you pointed out, applied. - Arnaldo
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index db475e44f42f..52bdec764545 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -1695,7 +1695,11 @@ static int dso__disassemble_filename(struct dso *dso, char *filename, size_t fil * cache, or is just a kallsyms file, well, lets hope that this * DSO is the same as when 'perf record' ran. */ - __symbol__join_symfs(filename, filename_size, dso->long_name); + if (dso->kernel && dso->long_name[0] == '/') + snprintf(filename, filename_size, + "%s", dso->long_name); + else + __symbol__join_symfs(filename, filename_size, dso->long_name); mutex_lock(&dso->lock); if (access(filename, R_OK) && errno == ENOENT && dso->nsinfo) {