From patchwork Tue Nov 1 13:14:19 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: 13660 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2962005wru; Tue, 1 Nov 2022 06:22:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7/wy51F965rh14le4j4Ce0ERtDJeA7JnwJwrioTV6w0QWyO1u/sMJ2ki0tsXabbu6ALm0y X-Received: by 2002:a63:4651:0:b0:43c:1cb7:5c09 with SMTP id v17-20020a634651000000b0043c1cb75c09mr17677126pgk.259.1667308941159; Tue, 01 Nov 2022 06:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667308941; cv=none; d=google.com; s=arc-20160816; b=zvKPM8ioefkamnba4uIBsovG2JcNHbLdXQrDSSAHsqViThwNOqokGGlIxlk6EaiBwc nAHinJ6d8aPh9R1qGhx0QjZCsdKcB/mqpgoUrfZD1Y2TQMjf8qPYsMLoJ4Ipsz73FksV 2Wktt3yKo+b2f1XgStpL4z2MzfSPlGVR6o3EZSyqiTLrLwFC/3XlOl6aDaYuDgx6ltQa NjJt1zQVqNVixDenVMG/Ka8EfHGqKcbNTekG6G17qoZ0UidlBZMDyuzR5Qs0cxGw85bG yimbmQYgJVWg0SIe+H04lgbntIK1+7g1uBPYNX32LRRn1LTtRHwOjLfvfeQGHa6oGVVA 638A== 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=bC/GXDwgQn3ZsvFHPkFRziUk5ZciR25wACvTx7QYS3MI3HZLREVOfEdAlqN9viM6aM 31ddKvvYLBp96c+kvJU4w7dFgYQh/xx135ob9cfL8+X81G7rPn7pBWVboEmytaxN+qS1 LA3V0Ly2UFdAinSqNmc/PJ4kaQPzHs23AoIIFbKwUSfrUkZu9ffOpkayPXv3Boz56kGB xUjPqFM9G8d5Trm+ehJjUIoX5NToiPt6glF8pZqUPCBr6rZCS+BT34p7AHHily9hWBkT 9Uy/gWN2BvGWFiROC+zCz9RysoQZ5PZ2jOYrMiwwNj50X/3MqQjpt4VGRrFL7DSVyySj 6IoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="haNdp/Mo"; 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 h4-20020a170902f7c400b0017a07fc8d44si12901032plw.248.2022.11.01.06.21.57; Tue, 01 Nov 2022 06:22:21 -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="haNdp/Mo"; 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 S230350AbiKANOg (ORCPT + 99 others); Tue, 1 Nov 2022 09:14:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230376AbiKANOa (ORCPT ); Tue, 1 Nov 2022 09:14:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 403D21B9C3; Tue, 1 Nov 2022 06:14:26 -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 ams.source.kernel.org (Postfix) with ESMTPS id DFB1CB81D5F; Tue, 1 Nov 2022 13:14:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B79BFC433C1; Tue, 1 Nov 2022 13:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667308463; bh=nd0dM0YiGevMBmIw3JCc/91WirhrGmiigVH7OCr9EG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=haNdp/Mokinp3DXYASQOQZyi8n+1U33VpAEjOZ92rTuzqfZYCwiVTcVLZdyTLCejb YTqK/8nB1AJHckWRzX80TqVKFy2sAOQ6GqwuuhEpnpLTx8Xpmk8aRQvae7zf2YeHei WLQKbPfpP2LGLgfusExQ+K3suWfNgLl2mz2XhZPEjafQaihz+Ema1ffFnmDd4KGQ3x zmr6O8whgsWGoJKO3jak0g3I/+paPR9IsdORxDi1VTbE9m4OSFJJdNkys19JhQixvE K1TFa29Id1mUkVzJ1tE1C3qT6JhLhCpwSI5bVy+Fz5yiQJQTIp62eiCOV7Z61ThHbi SoSyLz3DezBNA== 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 2/3] tools/perf: Fix to use dwarf_attr_integrate for generic attr accessor Date: Tue, 1 Nov 2022 22:14:19 +0900 Message-Id: <166730845967.2095228.7831422684261433316.stgit@devnote3> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <166730844138.2095228.4225918836201778608.stgit@devnote3> References: <166730844138.2095228.4225918836201778608.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?1748300140147432374?= X-GMAIL-MSGID: =?utf-8?q?1748300140147432374?= 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;