From patchwork Fri Nov 25 11:27:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Whitchurch X-Patchwork-Id: 25943 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3941091wrr; Fri, 25 Nov 2022 03:28:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf5cLMaxU47uOxz2XAdzdtG8MFfauqHI7z6flRui9rRO4DTiDecpw0iie1ByGUxxwEhiukMW X-Received: by 2002:a05:6402:189:b0:469:85d:2663 with SMTP id r9-20020a056402018900b00469085d2663mr31281218edv.56.1669375705995; Fri, 25 Nov 2022 03:28:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669375705; cv=none; d=google.com; s=arc-20160816; b=rqfNQ6RGJV3GeuQ5CNb3gghtSENb1B8l5fPn0IhipdC9pCp+5lRW0NeSjtMduXtTiC Ldc5I4/g1PkgsI/P8DWMHNsAd7ZvLA4WsYOag4sptupRlNrarh3Pi42SYmXWfutGffZX 8CNdnLFFQPYkevy5i5zHowRxxF8H1b05PrwBvSeAGDlMH3///SRl65IfQr6m3nIhTiN6 IXvbcAr2V68lVMc4PkjA/kMHNqTz4RweV1t1m4HIwo1tmFYrBuCt3INsTExmaC+CkLTB A/5II8JWtuiaZy7Lw5AH9bbc1PKcFugWGUZ0/uE7D+RBDTW9uMC6otQPvhY8lfnTLvCG Yovg== 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=6RwO0n+pzzOhCsDKCSVeKrBpyMVuCVb4JiVVtM5sYu4=; b=F5jLO0F2tjvRMkTdVjdMCme80Ynlr87D0L6kEULUffbcjWr7MN5vidudRbBGONFUyG qK5lPLOTNiK7WOFYIYllv3KK3YyRU7YJbnEE/rHTinEHdI1pUXaONsW27dclYTu5vPcf JML73JhE6Amw0NdCC/gRzsRhkrQvXc+cVzzyM2F8bIzkbk1WmFpWUAow+tNg8D0V7ec3 3zaxQXVJUDEqYmZ8Qs8z3YUsW2uLO/Fnzc7S6a2MHooKuF9FjgREXdVF8IX4ou3cKI4q PwL0ADfnzMWxPGCQ6pllwlYZdgVE+KuOAYKam+Aq9vfBJXeRd7Eq3+4hC14O0wh5/1T0 EdUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=pwHCbBbe; 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 s13-20020a056402520d00b00467e2dc8d13si3497048edd.94.2022.11.25.03.28.01; Fri, 25 Nov 2022 03:28:25 -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=pwHCbBbe; 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 S229534AbiKYL1v (ORCPT + 99 others); Fri, 25 Nov 2022 06:27:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbiKYL1s (ORCPT ); Fri, 25 Nov 2022 06:27:48 -0500 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0852FF08; Fri, 25 Nov 2022 03:27:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1669375667; x=1700911667; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6RwO0n+pzzOhCsDKCSVeKrBpyMVuCVb4JiVVtM5sYu4=; b=pwHCbBbeukyXnq5WdhibKNMqILv/3oNZENB5q/WzOkjsO9VLbGULNFoX O/w8YPpYzRdLodVL4+Kiv6+uWLPpPxm5snUoKfawJHHX2g11uBI9Xso5o o9+971M1svpPjjhIyAGKbUzhLr1cu/TC9LR+yxUWOMytDkHOsfhdy2qJH XuIY5riI3UOwzugDf53UhteALEyJHrqqw8X7i9ELSO0WHE39mx19F9Ama +35kRnZIB+NQOMavTBUr9z1xlNitn1YOznuVAeOaESkBmfnwPfIlE9Un0 EmrPLwpaJsCMpSbZWLhZ5f7vPr/HzXBvypTTr/m9vb/bYXV9hiVpDSn0q w==; From: Vincent Whitchurch To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo CC: , Vincent Whitchurch , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , , Subject: [PATCH] perf: unwind: Fix symfs with libdw Date: Fri, 25 Nov 2022 12:27:42 +0100 Message-ID: <20221125112743.2285759-1-vincent.whitchurch@axis.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750467300396608388?= X-GMAIL-MSGID: =?utf-8?q?1750467300396608388?= 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 --- 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 94aa40f6e348..1915c9769dbe 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, al->map->start - al->map->pgoff, false); + } if (!mod) { char filename[PATH_MAX];