From patchwork Tue Jan 31 13:16:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 50845 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2747176wrn; Tue, 31 Jan 2023 05:22:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXvOqhbGs4ckVozIk8c4iSjH3MCYgu4x/eIejJeV+9kMPbKdozQ70gKLzoRo5tRMxCFgn9uR X-Received: by 2002:a05:6a20:5495:b0:b8:381d:6491 with SMTP id i21-20020a056a20549500b000b8381d6491mr72803985pzk.31.1675171363229; Tue, 31 Jan 2023 05:22:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675171363; cv=none; d=google.com; s=arc-20160816; b=EiyavE9n4RjC0s3g+sEaRQ6Z7064sn7IEt52BpBTgar226COChIqxycsfUu3B2eMmC SmdziH3u5BcfyxImRjyn02U+Hmx/kSrH4wLecyArQKqX2FyaFd8rP6rqOAP2FAufcZAv 5VzqLotRKblHfL5QbJK+x9djVyrJZSyNtohV7Q+qd0mLEMriEHFeb5tXu/JeTDtoxu91 LibwgcLXxJQ4X7R7jap4IXBYkX7ZTrFZAZ67k2giscaiT8exBI6tBtD0q5+fKDFOEduU HaloW2DJ4YcVgF3kVxWCgjRtLB7/HWBKMOS1fhx623sWwkpsmXBaE58yZ1dgcJ2hJlaW uq9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CmMuhLiuqXUsvNkbvXl0BbzLw2KQ0XXEzTTXmyZVJOI=; b=bRkELJdyGSqKNEHXEnt+v5FOOaTGBL3mQ5j1NoC9kpEHRxU63ikw+E0zZneWZ24+za s7KGQJ9ykqMp/Qfub/Y4wJIW6hMHAQJ9XkKASPiaV/8NP8ToMjEkWRuA9pImz0w+Bz7v h++otoCLRt8a6n7SgU0ziaHfxObpZy7+/p5X8qJVv/NtLVcZkZnCKpEVCMYMMnWe/w6T 4ZG+/rCkFs81SC9Hcq4fKNTgoygM1b7o5cjwH8qTGtF9PEBykPr4L5a1L3L50UaYPnPU M2XIWxQKJ7ehD6yB7wd7yLVJ1d2fy4ZgEudW8z1OXop3QQDvC/sc/ny/tpkfktMQvQXe ob4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=h4K8YnoI; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v15-20020a63bf0f000000b004b2317cd02fsi15996709pgf.582.2023.01.31.05.22.29; Tue, 31 Jan 2023 05:22:43 -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 header.i=@intel.com header.s=Intel header.b=h4K8YnoI; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231781AbjAaNQy (ORCPT + 99 others); Tue, 31 Jan 2023 08:16:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230136AbjAaNQt (ORCPT ); Tue, 31 Jan 2023 08:16:49 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49A753401A; Tue, 31 Jan 2023 05:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675171008; x=1706707008; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PgoaMa5uG1on8jbmDVSgzzslCJYjltgwG8UjBjeDNrE=; b=h4K8YnoI+cdSsw9JmRrEGtkP7mLHgsKsWBl9fogKRN67MI/+uv6fJTIX 7mkLtKsVCcWWf8a46vPRz7ipgO5xgCHBqHKEU0wXTz0QDK9w0yv4O1xgN HSNBjj8AhLr+PtHdUbrRNvrr8+FN9lO1HyNQQDLg0eph5U1CiAzIceVmg WeUPo0PNkGgd2vhImCEf8xYupvmLKp6aOQrbXbbwOLGPtDDSirAlU38cr r5BK2WTiyssxb2rh1MGO2pXm4zfF3nsC2AtnP8BgpLuKoiaY8+/ieYULt e2l9rCRHO9zDN/+S2zb3UbdsMJpLAj/4s9ZnUYEJYX2EcPw76PNS6prqR w==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="325534169" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="325534169" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 05:16:47 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="657864813" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="657864813" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.252.47.218]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 05:16:45 -0800 From: Adrian Hunter To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Ian Rogers , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V2 4/9] perf symbols: Record whether a symbol is an alias for an IFUNC symbol Date: Tue, 31 Jan 2023 15:16:20 +0200 Message-Id: <20230131131625.6964-5-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230131131625.6964-1-adrian.hunter@intel.com> References: <20230131131625.6964-1-adrian.hunter@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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?1756544487064182945?= X-GMAIL-MSGID: =?utf-8?q?1756544487064182945?= To assist with synthesizing plt symbols for IFUNCs, record whether a symbol is an alias of an IFUNC symbol. Signed-off-by: Adrian Hunter --- tools/perf/util/symbol.c | 4 ++++ tools/perf/util/symbol.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index a024f06f75d8..d05727fcb30d 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -201,10 +201,14 @@ void symbols__fixup_duplicate(struct rb_root_cached *symbols) continue; if (choose_best_symbol(curr, next) == SYMBOL_A) { + if (next->type == STT_GNU_IFUNC) + curr->ifunc_alias = true; rb_erase_cached(&next->rb_node, symbols); symbol__delete(next); goto again; } else { + if (curr->type == STT_GNU_IFUNC) + next->ifunc_alias = true; nd = rb_next(&curr->rb_node); rb_erase_cached(&curr->rb_node, symbols); symbol__delete(curr); diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 2fdeb22bd02f..7558735543c2 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -64,6 +64,8 @@ struct symbol { u8 inlined:1; /** Has symbol__annotate2 been performed. */ u8 annotate2:1; + /** Symbol is an alias of an STT_GNU_IFUNC */ + u8 ifunc_alias:1; /** Architecture specific. Unused except on PPC where it holds st_other. */ u8 arch_sym; /** The name of length namelen associated with the symbol. */