Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4439533rwi; Mon, 17 Oct 2022 06:21:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5qWDb1sjapiulaZhGVTp0dIITibZcMeujtjXafEJHppCwaN+EZAbxiTCxSOGNB1Kg6/9NP X-Received: by 2002:a17:907:a46:b0:782:1c1c:8141 with SMTP id be6-20020a1709070a4600b007821c1c8141mr8633792ejc.549.1666012897622; Mon, 17 Oct 2022 06:21:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666012897; cv=none; d=google.com; s=arc-20160816; b=X1XthMq4pJrz6iO9NxH+LBRE4c3UhhtAnQk/XS2cUy8q34YhWeN1yp6xgMuMGkrT5f lKhgsB9GkPQWP7vjz8jmCVXJQBbrLsNvMi3AMTdqoUYyV0XPNn1m//1uMBjEGFNl6mJ/ yw/edqqEeSjKayfGAPoSQn8mcvrAjBlkG3By8CwFP/f3sUqh5FNlUh2a5IP5PfgK63N4 tDUdLFPxeWLmkNjLg5ns4zWxkOX4hxDjq2jVXyHc8y2NIFWmHWbvznzju7cbea9oXrRd 6x6cYLB65rw2XadsWAG4z9WKFIPTqNIoShbLWYJXp5s2TKZTV/4Vz2rWTK7ZRDJk+OYB yRzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0eIAXHIhriyUbzXv5YraWM/rsauI44iHbILhf9hN/ZI=; b=BNR4TYUXAPyNJnJKxyljbkQmlZxnKwuZlwj9z9GdcHuVdGM3ryCVS8pF8GkCVc937t UtiER9FmqNPvE1hjh2vLFp+k30BadPYW9r/po3HKGoezGxmUiBVIAgTigXar4s1luxnH a9Fws1e+pm2/ygXTyVWorvC8aW0ma7BE6loJmcsZcxf8oPhHK1Vni5PZY/732e4unZpm Vk2D9VaCoZ00dJYZOCjPaLqRPQtWLsX6h/rO+4lYeKwz5hdJPouu7QdwkzNGPVbqKaSl vBrhkBLS6/rpufTGKmRG5Oih+o6WkdAjBDo6EgIgalrkTHUDdg97AaLT/HgPhsU9UAfp k+/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jPwFspAh; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t20-20020a1709066bd400b00783698dd8b4si8003387ejs.722.2022.10.17.06.21.10; Mon, 17 Oct 2022 06:21:37 -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 header.i=@kernel.org header.s=k20201202 header.b=jPwFspAh; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229996AbiJQMiA (ORCPT + 99 others); Mon, 17 Oct 2022 08:38:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbiJQMh6 (ORCPT ); Mon, 17 Oct 2022 08:37:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F11471B793; Mon, 17 Oct 2022 05:37:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8B2E16112D; Mon, 17 Oct 2022 12:37:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C851DC433D6; Mon, 17 Oct 2022 12:37:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666010276; bh=Sl2cezNTsWHRgmfGwBUNjn5QvcqSB4MRPCTSkICdqoM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jPwFspAhyPaRssvY4ut7N09jQgcKFfTuYHlGp8de1xYuVPyko3wGvPEJvyLtUqMf7 LIf7fdpBG8Q9DFVEKqQsRLKiZpsYo3fN2NSrg6KqEtEfzNmT7u6le3nLanZRMcPUTQ kQdkCQ2uub+iq+laV6DY358IJlNfHSEbXsDMbef9REhc8nIzvoVff+T5V5a4LxHfWj BdX7v9YWTcktXO9Gx4PZSyyacNnnIck4eQTIIbNCNsCjugmcIEOLsTWPFMfgLV04rY 5pkiWrDGMZ4b2K7iRRsLwnZQ/XRRSFmZGYYc/QwS544JuPgUen2rZ19+4DxhiE8SVo 3Bu1hd+SHblHg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 6B5C3403B6; Mon, 17 Oct 2022 09:37:53 -0300 (-03) Date: Mon, 17 Oct 2022 09:37:53 -0300 From: Arnaldo Carvalho de Melo To: Masami Hiramatsu , Namhyung Kim , Henry Castro Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] perf: fix the probe finder location (.dwo files) Message-ID: References: <20221005124710.30296-1-hcvcastro@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221005124710.30296-1-hcvcastro@gmail.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 Em Wed, Oct 05, 2022 at 08:47:02AM -0400, Henry Castro escreveu: > If the file object is compiled using -gsplit-dwarf, > the probe finder location will fail. > > Signed-off-by: Henry Castro > --- > > > Nit, I think we use _ELFUTILS_PREREQ(0, 171). > Thank you Masami, are you ok with this? Namyung, how about you? Thanks, - Arnaldo > > How about making it a separate function with 2 versions > > depending on the elfutils? Then you can have the variables > > only if they are used. > > > Something like get_source_from_debuginfod() in the same > > file. > > Sounds good, but I prefer simplicity in the patch =), > what do you think about > { > Dwarf_Die cudie, subdie; > if (dwarf_cu_info() ..) > .. > } > > to resolve unused variable? > } > > > tools/perf/util/probe-finder.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c > index 50d861a80f57..5f6781e712db 100644 > --- a/tools/perf/util/probe-finder.c > +++ b/tools/perf/util/probe-finder.c > @@ -1200,6 +1200,20 @@ static int debuginfo__find_probe_location(struct debuginfo *dbg, > continue; > } > > +#if _ELFUTILS_PREREQ(0, 171) > + { > + uint8_t unit_type; > + Dwarf_Die cudie, subdie; > + > + /* 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 -- - Arnaldo