From patchwork Fri Jan 27 17:02:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 49516 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp940245wrn; Fri, 27 Jan 2023 09:05:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXt+aM7kqAWHX/hhy57KOUZcTyEzU9Eh6kZOMooXkc13vEHV3KV2SiJ6ttX8cnCfbzIspkNF X-Received: by 2002:a05:6a20:8ca3:b0:b8:b38a:3bf1 with SMTP id k35-20020a056a208ca300b000b8b38a3bf1mr34459270pzh.35.1674839131973; Fri, 27 Jan 2023 09:05:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674839131; cv=none; d=google.com; s=arc-20160816; b=OqpTycHdoTome2f1ahIGrn1ifUzS/p6ZERwCmpYLzJM/VYAEU1rlO5bFoGCAf8ZoCr 5oUnRASW26KS2w4UCwFnNY7FruV1KFa0To8IK9PD0A5Pb+Nad00+Q4RlPfu2lhWtkKY5 VhT/McHuJVBtYiTGzudwX5YGh8C9pn/gXNJV8atMffm/nea47c+LbidIY4DHwL+T7wPi QhSAao4vExit4v0CTRR9STwrrVcZJDV7sIiQqVuc3DKZ3ABIbkQMsvCvFkGkBN/+4lVU 4xP6POQqulYbAA9ZVfg/IcVhxkLXiS+rYEf6yRxDEhUn1nQitv1AV5eMIrHk2eF+EmkQ D+LQ== 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=qGO3Y2gX75t2YiWfHD0fKTkrBw7SS2c6uSBM66gTlWYskoxaNGkqSc3sToT/30vhCQ 1AuVkQBLkmh81EF9OaTJHZYc1yakWVFU27CT/y15pt39dFFSW3H6DWVlVOdj8DxLH+jO YfyYuB8wW+/D56JWb4HxalQzBsuAZp7xTf45sbmoSSYTfpfBZXrgAsLN8s30Fa9exz5S wy8l3pXKDO+C1LBec25aBIcIqqRLrpXFkfTZMcrRuyAEBfP+3ft4DFQpFSSlvtTQ/XIO OpV5T14WY2LHv8+73snr8rOl8ndCjRCwoWIspJsCjJD4Pmb4LBUnZ11ilkDBsoo8JBKe 7Xyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bWepwiDh; 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 m10-20020a656a0a000000b004da5a1315a4si5442559pgu.137.2023.01.27.09.05.18; Fri, 27 Jan 2023 09:05:31 -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=bWepwiDh; 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 S234817AbjA0RD3 (ORCPT + 99 others); Fri, 27 Jan 2023 12:03:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234713AbjA0RDS (ORCPT ); Fri, 27 Jan 2023 12:03:18 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7457328D2E; Fri, 27 Jan 2023 09:02:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674838979; x=1706374979; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PgoaMa5uG1on8jbmDVSgzzslCJYjltgwG8UjBjeDNrE=; b=bWepwiDh3CuushqqyzmcjzGFC8IUR+/g6fz6hZk+Lna/qWGc1+PQhlnA F3DOzpJgEEEcZ6lSvjszs3IIXS0MwD52Rrm+eGwTRA6bkuCb0mi1zfOVE 4Yj0r9tr/8o7hll86Qw2XUznJOvUFbjmuCjQTBEFOzEspU2bnfupB03bM 1EkW9wMaJAAKcn/zEFtAZRH5YJMEPDMZYyaMA66yoojhmAPmNb8dYLH86 DYXX6198zVDmN69OsS+UkEHZMqhauNv6Dlw4hoPOL4aJio/5nutwNVznT ebSBltRSbU3m/L/hRm5GI/0xO02pEf6TnKCFtCLeEfJS8JDUi9icsiNlB A==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="310754151" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="310754151" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 09:02:43 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="726739218" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="726739218" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.252.57.171]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 09:02:41 -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 4/9] perf symbols: Record whether a symbol is an alias for an IFUNC symbol Date: Fri, 27 Jan 2023 19:02:17 +0200 Message-Id: <20230127170222.9895-5-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230127170222.9895-1-adrian.hunter@intel.com> References: <20230127170222.9895-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=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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?1756196117751575917?= X-GMAIL-MSGID: =?utf-8?q?1756196117751575917?= 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. */