From mboxrd@z Thu Jan 1 00:00:00 1970 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 7A938C433F5 for ; Mon, 3 Oct 2022 18:10:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229702AbiJCSKy (ORCPT ); Mon, 3 Oct 2022 14:10:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbiJCSKu (ORCPT ); Mon, 3 Oct 2022 14:10:50 -0400 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B84E25E84; Mon, 3 Oct 2022 11:10:49 -0700 (PDT) Received: by mail-qk1-x734.google.com with SMTP id i17so7021698qkk.12; Mon, 03 Oct 2022 11:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=6GSBpywsjKwPYr9hvx5GHTfSyCn4GlAqxJaWR8Wo4kE=; b=a9WJRwXeC7awSc02b11mfesATFj5xtBd6llcvg3qJLnJrC33eS148byjd/TsHGqMbH zS53uh3nvUyH50Rq6CWhV8MzjwXJc5zktsmcGKxI7ITIZfxMfj0360rwtLoTdFTJjiY6 B6WmIUqtrs4fCCxGAb4ESyFDDvCGM6Csozf5eNXTZOFPRqTb7KTGNxZSvc2+/iEDeYEO BQKXinOk4GcyDq5bbYDEsYX1x695p3xCAgjVR+9JpFbcplJXqEH/bEnsBT1RlEVHqT4X z2KuJlCkzsOOl5XZqwrmcqhnBSXO2R5PbKa3ooNO86a8CCd8L+/t4z+cFP+qlA33UAGG 8Fqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=6GSBpywsjKwPYr9hvx5GHTfSyCn4GlAqxJaWR8Wo4kE=; b=0KuY2jkn0y1mhTWUZzf3COZi+XWjuqxeahQGBYfi/EQy0ZgSdk5LV/d78KQOMjhuXu cnL13YjzaRxRHj4juCfAYQM5AUPA/pdnj4BTuIVYFV2PIpFlrL0im7Y5BbbLTuaABGW/ FJbSbR8klETfgxdBD90tGvCoSKCNdk8qWAaz/xFWFG20PfGtaS3NFuGm5IIPTq/TUyHf IaTlZQWTriapSxfnjD3j2Fa8IHX3vfjMhkgYtLgfGlfwSzRTcROPO6Q9IfbzU9KkU1b4 WLQCQtTLXKkNgkqjQTHEZYHRDG4ngtZL8l0Ek7rlrl4cHwCSgbSFl6LbnMWnRCrZD/YL rDbw== X-Gm-Message-State: ACrzQf0FfYa1Tyh3O4xkh2KZ0mSWWblwpjM5XxRXiRO+PV89H4NEbMo/ pNBzywacrJjD/u1robl7K2Q= X-Google-Smtp-Source: AMsMyM4FnfmYgVQg5JBBX7kgw8rHsxg7t3Isw4ZnZJ7BBhcMSkSJsIcdL5SBLEcNi5RZsi4y78IDOA== X-Received: by 2002:a05:620a:4304:b0:6d4:56aa:430e with SMTP id u4-20020a05620a430400b006d456aa430emr7118326qko.483.1664820648173; Mon, 03 Oct 2022 11:10:48 -0700 (PDT) Received: from localhost.localdomain ([177.222.37.214]) by smtp.googlemail.com with ESMTPSA id bs43-20020a05620a472b00b006b5df4d2c81sm12176226qkb.94.2022.10.03.11.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 11:10:47 -0700 (PDT) From: Henry Castro To: hcvcastro@gmail.com Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] perf: fix the probe finder location (.dwo files) Date: Mon, 3 Oct 2022 14:10:39 -0400 Message-Id: <20221003181040.4822-1-hcvcastro@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org If the file object is compiled using -gsplit-dwarf, the probe finder location will fail. Signed-off-by: Henry Castro --- > Anyway I think it'd be safer to do > > if (dwarf_cu_info() == 0 && unit_type == skeleton) > pf->cu_die = subdie; Thank you, I have modifed the patch :) tools/perf/util/probe-finder.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 50d861a80f57..b27039f5f04b 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -1161,7 +1161,8 @@ static int debuginfo__find_probe_location(struct debuginfo *dbg, struct perf_probe_point *pp = &pf->pev->point; Dwarf_Off off, noff; size_t cuhl; - Dwarf_Die *diep; + Dwarf_Die *diep, cudie, subdie; + uint8_t unit_type; int ret = 0; off = 0; @@ -1200,6 +1201,14 @@ static int debuginfo__find_probe_location(struct debuginfo *dbg, continue; } +#if _ELFUTILS_VERSION >= 171 + /* Check separate debug information file. */ + if (dwarf_cu_info(pf->cu_die.cu, NULL, &unit_type, + &cudie, &subdie, NULL, NULL, NULL) == 0 + && unit_type == DW_UT_skeleton) + pf->cu_die = subdie; +#endif + /* Check if target file is included. */ if (pp->file) pf->fname = cu_find_realpath(&pf->cu_die, pp->file); -- 2.20.1