Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp21991020rwd; Fri, 30 Jun 2023 02:21:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlH7ct9/f6o30aw34RHmt+bI8X+uA+9n9rDlPeBSFibexs6jznniZ3CbRIVvfJFBBHFa30M+ X-Received: by 2002:a05:6359:63aa:b0:133:291:f9ac with SMTP id sg42-20020a05635963aa00b001330291f9acmr1870526rwb.25.1688116890731; Fri, 30 Jun 2023 02:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688116890; cv=none; d=google.com; s=arc-20160816; b=1AuKlC8CA/dAhh4C089g8oFiNUNu+Wsm5znuhSkMqel0DPh4NxbinCVKbJxOAr6xbN jKMtPAvPT73MU+0LKLYCG/00wCQy0kkfQQaVW6IlcrIP2/a0uRfuGB+hADE5FDZcBJgE TZDwK8AXbEpQiil1VMFscsW6LM7z3o3gSbNQOdAaKlpkQxIJRgAQ8+CUsCxpVP40zgGL gSG8fQZ7eP58k5ostIfVpbyxT0dxt7vKDyvMonG7xyXQ0e0fEjWemK0UupZk5BzJtKIG tuS/LYQrJ6pwdRWK78ukWslcETDQPKrCaryYwV8msEf/g3qUd6b7kE/fwlF7jLWVmOE6 8IuQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cm25-20020a056a00339900b0067bf9a05b45si6936834pfb.110.2023.06.30.02.21.18; Fri, 30 Jun 2023 02:21:30 -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 S232562AbjF3JL4 (ORCPT + 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 ); 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: 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 , 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 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: 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 --- 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 = 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]; --- base-commit: 6995e2de6891c724bfeb2db33d7b87775f913ad1 change-id: 20230630-perf-libdw-symfs-9adb29f4df7d Best regards, -- Vincent Whitchurch