From patchwork Tue Nov 1 13:48:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 13671 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2977487wru; Tue, 1 Nov 2022 06:50:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6bhX2KkxtQ+mx/BsSlN8ytVoK0bFDJof3ykEHvd5UZ2OVm9DEGOAu5BFnplGavMVNgA4q3 X-Received: by 2002:aa7:de0a:0:b0:462:d2a0:93a with SMTP id h10-20020aa7de0a000000b00462d2a0093amr18492436edv.275.1667310659690; Tue, 01 Nov 2022 06:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667310659; cv=none; d=google.com; s=arc-20160816; b=E4LA8dtPc7iXhlbQxGyRhHcQKeja18Frzo71wI6ZMJl83vytTiqdJzSoyGYRCFTnDn KlpscbEzAVP0K2f3AtHN/ULSLAcWxfCfUeJNVh5vxMLqh7uatf1OrZv8fS9Rm6KxlTf6 WYqojNJmVlMHZR9Y9xuIgzwGbnC1jl4KuCpy9nPOmGdM1oJjXvzXGQnlgDgKdzm8QlIX ToBwT6faY6Ps8pqpcPXwqQAC1cyYdVXfcsianktZWcql6EdRZP01/ULjwCidevZqo/R/ f5sPt/MAqT9NX96rMEnaQJG7z/vKMbxwCmYUfcoikars+qH03oGsVSYEPWVEPs/pNJqw iXtw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wWcmbp/YCO+j4LyJ9CnX/DhA6yih5L+CytKhaSWmHF8=; b=oBt9x+h2r2dDIhLhaataodKrDbziel1WneSrLwG1VWnQIHb+HOGqdQufDdhC8oSurC zA7uPdHqAUi7Aaq013SpcRrVMRlya19nKE9HuDTILX+0/YIRc5r4lkqN3Ky9o/Dwtwvh 5o/Am9JrJJlkc31E0/JkRpVEn1C1SAHlZKOBM80uRaZiqyc+HdcF2FjU8kgepVTFUMwJ zX97ZpGGcIgrTZa7unKh0PfTBrTQzguLT7b/bL+f6vgYiZfm/pj33uwc2RI4iu2yxxmo J8qH1mxVAcp1X0MScc24d5U/Lhfl60qlnahXa3vFlva0SvoDj2yKQQs/4AI1lQ92QzfC maaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qITFJWIw; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d38-20020a056402402600b00461ac01753fsi11930163eda.369.2022.11.01.06.50.35; Tue, 01 Nov 2022 06:50:59 -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=qITFJWIw; 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 S230030AbiKANtH (ORCPT + 99 others); Tue, 1 Nov 2022 09:49:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230018AbiKANsu (ORCPT ); Tue, 1 Nov 2022 09:48:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00AAA6140; Tue, 1 Nov 2022 06:48:45 -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 A040061455; Tue, 1 Nov 2022 13:48:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CE4BC433D6; Tue, 1 Nov 2022 13:48:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667310524; bh=nd0dM0YiGevMBmIw3JCc/91WirhrGmiigVH7OCr9EG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qITFJWIw5nE67e/MvJ6BMM3CzhJhuhNuGzXbImQKrVLTjW1DVo16XYtnVhwFIWLv2 QkOoTitJELopSzp9tpv3SyZVO4dskXfjpxZFl3U1tBJCc6rRZsWCLkzSayEbyci3Nv 3o57qDMmUFlY29neDnE0gVwAlSp6QXycCuL8FVv8HuVHSdAVyMz+PzDGw4iY4Qfx4f NYxBh4wBKyWP9IJmE13zawMX+R3vBR83g+ROMugKdnBeHY0gyf4n13Z7kobJUR7F3N N1LMyweNgU4mD9CYrhGfDzrRnMLsqTjo/m80vWtvj6X5dihlsU8I/gRgbL9xtg4J/9 bOEIVqbpjk9kA== From: "Masami Hiramatsu (Google)" To: Arnaldo Carvalho de Melo Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Masami Hiramatsu , Steven Rostedt Subject: [PATCH v2 2/3] tools/perf: Fix to use dwarf_attr_integrate for generic attr accessor Date: Tue, 1 Nov 2022 22:48:39 +0900 Message-Id: <166731051988.2100653.13595339994343449770.stgit@devnote3> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <166731050151.2100653.8202870942871353491.stgit@devnote3> References: <166731050151.2100653.8202870942871353491.stgit@devnote3> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Spam-Status: No, score=-8.2 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748301942285039219?= X-GMAIL-MSGID: =?utf-8?q?1748301942285039219?= From: Masami Hiramatsu (Google) Use dwarf_attr_integrate() instead of dwarf_attr() for generic attribute acccessor functions, so that it can find the specified attribute from abstact origin DIE etc. Signed-off-by: Masami Hiramatsu (Google) --- tools/perf/util/dwarf-aux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c index 406b7bdc851a..216fc3d959e8 100644 --- a/tools/perf/util/dwarf-aux.c +++ b/tools/perf/util/dwarf-aux.c @@ -308,7 +308,7 @@ static int die_get_attr_udata(Dwarf_Die *tp_die, unsigned int attr_name, { Dwarf_Attribute attr; - if (dwarf_attr(tp_die, attr_name, &attr) == NULL || + if (dwarf_attr_integrate(tp_die, attr_name, &attr) == NULL || dwarf_formudata(&attr, result) != 0) return -ENOENT; @@ -321,7 +321,7 @@ static int die_get_attr_sdata(Dwarf_Die *tp_die, unsigned int attr_name, { Dwarf_Attribute attr; - if (dwarf_attr(tp_die, attr_name, &attr) == NULL || + if (dwarf_attr_integrate(tp_die, attr_name, &attr) == NULL || dwarf_formsdata(&attr, result) != 0) return -ENOENT;