Message ID | 20230630-perf-libdw-symfs-v2-1-469760dd4d5b@axis.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp10218111vqr; Fri, 30 Jun 2023 02:19:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4PoJkE99Azt2qS5bKUzzgbCcmPw1HqLWIVi6cP9Dugld2hn9Uevh3Ti4nH0HCM+3IRN9j4 X-Received: by 2002:a05:6a20:4413:b0:11b:3e33:d2ce with SMTP id ce19-20020a056a20441300b0011b3e33d2cemr3007811pzb.1.1688116740488; Fri, 30 Jun 2023 02:19:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688116740; cv=none; d=google.com; s=arc-20160816; b=QRYnJp8RGkVbmf1bmoiiTexDTrI6E7OCVrE1zREIb83muEbbwK/PYEC8Vl1BQGWnOQ M/PPPcRsMjL2V617xNi+7A+Q2RwYq2StQqelaMoC9hmtVZCpV2nKDgBetqhOT0C9HQfo LavtcoIDP6+Tes3KB//V/th7RXu601hUM5Z5UCohx6lTAHdawXZkuUr9W00WlGRADKlN mbdz4O3ijuOn9Nzwg3HU8/BH0dI0fyG9hKj4Z3qx6v5POzu0JP9V/awWKi9GpvjnjPTE xTFPf20BMSNSvD0J6zpIJh2lA3Xl+s8ITM5Fc46KbhlVkNkIF/Qvyyw+aGjs+5mnY0LO /3ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=4cKZGDaggu9U53oCy9qu6BEZZ+/3aZHSr1DqRIwuEcY=; fh=kfgK1I9osox7aPApvjCPHkzOjGqLHDP8CxBFvxsFKiI=; b=NRTNO+WAy2OSzdEjtsx4AcIDJgAz+3/HDMEliTPLbVoVl+FWk8I74sCSPMvT9t2NPx XeNKcl46AzU5CRa8T09LGgPbeuMiWOylO7+lDznZd3L0x/N2+5YsAIbE0J6ItMRhIB4V u1DfieGtBIEQBk/6bA0/gDGN3w6q+yUfI3J3BdnmtE1J589VOpEewXS/qbf+Dw5qPaNa FV7iQAsm35KI3C9JemJuS2HDtXxFMPP9F8QuiIMh/4y9xCrtp0jOULC8jsernnC157xO yi6nU47bIJAlTWID/h580vHraKRVpdUK4nZmSXYb6FZzHX4CoQdtM3s0Yi0a+n2NdXGn 1wTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b="YU/5ZUTH"; 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 y6-20020a1709029b8600b001a2513b8e14si11606078plp.84.2023.06.30.02.18.47; Fri, 30 Jun 2023 02:19:00 -0700 (PDT) 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="YU/5ZUTH"; 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 S232587AbjF3JL4 (ORCPT <rfc822;ivan.orlov0322@gmail.com> + 99 others); Fri, 30 Jun 2023 05:11:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231315AbjF3JLz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 30 Jun 2023 05:11:55 -0400 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2B192680; Fri, 30 Jun 2023 02:11:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1688116312; x=1719652312; h=from:date:subject:mime-version:content-transfer-encoding: message-id:to:cc; bh=4cKZGDaggu9U53oCy9qu6BEZZ+/3aZHSr1DqRIwuEcY=; b=YU/5ZUTHnRJwQBHU/32mHz7KUoJDHILJ+8WeNnv71VAYWkxGrkshrbzw 7UJYQx3HQ4/eaFDuCcUzMPeWDuvb7KjV6Nh+d58BdQ27/O/y0owVFLS88 OBLfsP3E0l7ucziNu6oj4gwqlldTKZrP4thdO7GrdV+s1F2Mzs7d9uJE3 gO/7PfIiTSNvO2a9j0AJ1+xz6Gul5/k3GpZd6YEKzthRuHqlPiILH3hz3 AAoIHjUTNpaM+U8tB9r24zeLT6bmIQuBDsKRpO7YpfKq8F6060KTFh5iC UJewWAEkk6c/DvodH+6qL+2S1omYwFwPPG4Ifb4wBxzaR+Fyy2+9V6Q9w g==; From: Vincent Whitchurch <vincent.whitchurch@axis.com> Date: Fri, 30 Jun 2023 11:11:48 +0200 Subject: [PATCH v2] perf: unwind: Fix symfs with libdw MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20230630-perf-libdw-symfs-v2-1-469760dd4d5b@axis.com> X-B4-Tracking: v=1; b=H4sIAFOcnmQC/zWNzQ6CMBCEX8X07BJY/sST72E8lHZrN5GWtAgYw rtbTDzM4Zvkm9lEpMAUxfW0iUAzR/YuAZ5PQlnpngSsEwvMscybMoeRgoEX93qB+BlMhE7qHjt TadNqkbReRoI+SKfsIRrvm6MeAxlef0/3R2IT/ACTDST/+1gUWKe0VZkhXuq27qCAmZ0iN2WL5 UnZd1D2JleOmfKD2Pcv+zZIAsAAAAA= To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, "Namhyung Kim" <namhyung@kernel.org>, Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com> CC: <linux-perf-users@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <kernel@axis.com>, Vincent Whitchurch <vincent.whitchurch@axis.com> X-Mailer: b4 0.12.2 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1770118699068535435?= X-GMAIL-MSGID: =?utf-8?q?1770118699068535435?= |
Series |
[v2] perf: unwind: Fix symfs with libdw
|
|
Commit Message
Vincent Whitchurch
June 30, 2023, 9:11 a.m. UTC
Pass the full path including the symfs (if any) to libdw. Without this
unwinding fails with errors like this when a symfs is used:
unwind: failed with 'No such file or directory'"
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
---
I posted this last year but didn't receive any comments. This patch is
still needed in current mainline so here is a rebased version, fixing
some merge conflicts.
Changes in v2:
- Rebased to v6.4.
- Link to v1: https://lore.kernel.org/lkml/20221125112743.2285759-1-vincent.whitchurch@axis.com/
---
tools/perf/util/unwind-libdw.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
base-commit: 6995e2de6891c724bfeb2db33d7b87775f913ad1
change-id: 20230630-perf-libdw-symfs-9adb29f4df7d
Best regards,
Comments
Hello, On Fri, Jun 30, 2023 at 2:11 AM Vincent Whitchurch <vincent.whitchurch@axis.com> wrote: > > Pass the full path including the symfs (if any) to libdw. Without this > unwinding fails with errors like this when a symfs is used: > > unwind: failed with 'No such file or directory'" > > Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> > --- > I posted this last year but didn't receive any comments. This patch is > still needed in current mainline so here is a rebased version, fixing > some merge conflicts. Sorry that you didn't get any feedback. Looks like a real problem. > > Changes in v2: > - Rebased to v6.4. > - Link to v1: https://lore.kernel.org/lkml/20221125112743.2285759-1-vincent.whitchurch@axis.com/ In general, you'd better base your perf tools changes on the perf/perf-tools (for fixes) or perf/perf-tools-next (for new features) in git.kernel.org. But it seems this change applies cleanly. > --- > tools/perf/util/unwind-libdw.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c > index bdccfc511b7e2..30a63d819d74e 100644 > --- a/tools/perf/util/unwind-libdw.c > +++ b/tools/perf/util/unwind-libdw.c > @@ -66,9 +66,13 @@ static int __report_module(struct addr_location *al, u64 ip, > mod = 0; > } > > - if (!mod) > - mod = dwfl_report_elf(ui->dwfl, dso->short_name, dso->long_name, -1, > + if (!mod) { > + char filename[PATH_MAX]; > + > + __symbol__join_symfs(filename, sizeof(filename), dso->long_name); As __symbol__join_symfs() will have dso->long_name when symfs is not set, I don't think it changes the behavior, so Acked-by: Namhyung Kim <namhyung@kernel.org> Thanks, Namhyung > + mod = dwfl_report_elf(ui->dwfl, dso->short_name, filename, -1, > map__start(al->map) - map__pgoff(al->map), false); > + } > if (!mod) { > char filename[PATH_MAX]; > > > --- > base-commit: 6995e2de6891c724bfeb2db33d7b87775f913ad1 > change-id: 20230630-perf-libdw-symfs-9adb29f4df7d > > Best regards, > -- > Vincent Whitchurch <vincent.whitchurch@axis.com> >
On Sat, Jul 1, 2023 at 11:13 AM Namhyung Kim <namhyung@kernel.org> wrote: > > Hello, > > On Fri, Jun 30, 2023 at 2:11 AM Vincent Whitchurch > <vincent.whitchurch@axis.com> wrote: > > > > Pass the full path including the symfs (if any) to libdw. Without this > > unwinding fails with errors like this when a symfs is used: > > > > unwind: failed with 'No such file or directory'" > > > > Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Applied to perf-tools-next, thanks!
diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c index bdccfc511b7e2..30a63d819d74e 100644 --- a/tools/perf/util/unwind-libdw.c +++ b/tools/perf/util/unwind-libdw.c @@ -66,9 +66,13 @@ static int __report_module(struct addr_location *al, u64 ip, mod = 0; } - if (!mod) - mod = dwfl_report_elf(ui->dwfl, dso->short_name, dso->long_name, -1, + if (!mod) { + char filename[PATH_MAX]; + + __symbol__join_symfs(filename, sizeof(filename), dso->long_name); + mod = dwfl_report_elf(ui->dwfl, dso->short_name, filename, -1, map__start(al->map) - map__pgoff(al->map), false); + } if (!mod) { char filename[PATH_MAX];