From nobody Fri Sep 19 09:23:14 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD4A2EB64DA for ; Fri, 30 Jun 2023 09:11:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232591AbjF3JL6 (ORCPT ); Fri, 30 Jun 2023 05:11:58 -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 ); 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 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: quoted-printable 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 , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , "Namhyung Kim" , Ian Rogers , Adrian Hunter CC: , , , Vincent Whitchurch X-Mailer: b4 0.12.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Namhyung Kim --- 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(-) 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 =3D 0; } =20 - if (!mod) - mod =3D 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 =3D 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]; =20 --- base-commit: 6995e2de6891c724bfeb2db33d7b87775f913ad1 change-id: 20230630-perf-libdw-symfs-9adb29f4df7d Best regards, --=20 Vincent Whitchurch