From patchwork Fri Jan 27 17:02:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 4644 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp939873wrn; Fri, 27 Jan 2023 09:04:59 -0800 (PST) X-Google-Smtp-Source: AK7set8VjtRDuca5ssfDBUL/+75Iuq7f0RVXtlFx0Klfvd5o+52s3RYXw4Wf21vsY/ekXdTpFmQZ X-Received: by 2002:a62:5b05:0:b0:592:cd32:970a with SMTP id p5-20020a625b05000000b00592cd32970amr2290028pfb.19.1674839098878; Fri, 27 Jan 2023 09:04:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674839098; cv=none; d=google.com; s=arc-20160816; b=nt1+wVakI1VjTUWt4vzlnTQtUgLIuEN3AV/nHymaQlWSv7+3XQRZGAAVSe9v4mtnWe ZUtt8ocQJ5EzyNYC+tyxtA7iXgvkXMPfux3WNw4PHGl2x6pfzlq3fzyobLdd+QuNlXnE 34J9l0S+/mG8aZ3OPB18QyBW3SK96kaWSYfRpYOGz6cpYvh6DDJMhC9UrMcqf+zdGi9R bC2vUFxNwkcWbUdN9+zIxd+VgoRKcZ6Io9hRECQG0kXkdCO0p2fKBCDnKliBBZyqv2mz JB++QUq8TP8S5FBlCo7Cy+t2+XpKLaWEG3LXTMoGuo6xmcmQCvgmF3zH+uiF1URdBgg/ LMNQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=X9Ud9s7twXvN7WRWfe+9P2cXdnw7mqmvSQst+SOnX+I=; b=z3mTM8GuMcOFwvuNkN85lyZe9hVFMqshU9zqWFa06oC8GPzeGQRYRATLe1NMmTnS9r ehkn9wbd6TX6j0k8I3OrJBUE2ekbvRMSwbix3ubo5PyvB7nPlFKmxVS9DSEyD2FuxX+u tj3tf93zSh5Huy0jqMc1VxIR9Ck5wgEdSCpkyU6jhjntmWmsXj9QSrvZctcs7vGYxH3m IfAJEF8EuT6hrOcBjsK/YM30HEjNa5N1SzixRrqDYl+fGTxIVzDVvVS7+Y/hkowGO0b0 X+j9qzL+tgJe3fwNGehSjusBmHq9z/rvK9hUkSxKYHeJDSzSboaSpOAZAjiYwimBEztU Uanw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EJBZ3+hR; 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 f30-20020a63381e000000b0046ec058379bsi4899405pga.99.2023.01.27.09.04.29; Fri, 27 Jan 2023 09:04:58 -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=EJBZ3+hR; 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 S234727AbjA0RDD (ORCPT + 99 others); Fri, 27 Jan 2023 12:03:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234722AbjA0RCz (ORCPT ); Fri, 27 Jan 2023 12:02:55 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 227EF17CD3; Fri, 27 Jan 2023 09:02:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674838956; x=1706374956; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=wCtzZPSP7T2Ma+5uTMhlXVsVgYdIxPIxHp/22fDmBJE=; b=EJBZ3+hR0Ex0Um13kMigzczO0RvGRbROGHPJcmBNIBq8NukwFO5jW0NS zJI5P24OadivzkTjDRAoTXvlP9Wk3AT6OHqVMTHNOKZMJufMdzbgJf54G myJ0HtppTaECUXf5tpOUd1tCeitgpBHlpJyokwr39CR6uJ6v2/ResKuiU DUEnq1DOajmVf/t3Vj11S4pX3TEt0dzB2tEGHKLfNy2UlCwa3zrxV1KRi zuesBlRSIRegFNyTtx2Q7V+rZN4FxxMp2/Q7SNCTHDe9pDJFswScW2CYY iTt6W+Isba2lisgGe3zXn2Stt8XwZRMtT5LFHY4XQemadlzotbwn+pNxT A==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="310754097" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="310754097" 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:35 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="726739141" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="726739141" 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:32 -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 0/9] perf symbols: Improve dso__synthesize_plt_symbols() for x86 Date: Fri, 27 Jan 2023 19:02:13 +0200 Message-Id: <20230127170222.9895-1-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 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?1756196082484752471?= X-GMAIL-MSGID: =?utf-8?q?1756196082484752471?= Hi This is the second of 2 patchsets to improve dso__synthesize_plt_symbols(). This patchset focuses on getting rid of unknown symbols that show up in Intel PT traces. x86 has 2 more plt's, namely .plt.sec and .plt.got, so support is added for synthesizing symbols for them. Special handing is needed for IFUNC symbols, and it is also possible to have a .plt for static executables, so support is added for that. Adrian Hunter (9): perf symbols: Correct plt entry sizes for x86 perf symbols: Add support for x86 .plt.sec perf symbols: Sort plt relocations for x86 perf symbols: Record whether a symbol is an alias for an IFUNC symbol perf symbols: Add support for IFUNC symbols for x86_64 perf symbols: Allow for .plt without header perf symbols: Allow for static executables with .plt perf symbols: Start adding support for .plt.got for x86 perf symbols: Get symbols for .plt.got for x86-64 tools/perf/util/symbol-elf.c | 362 ++++++++++++++++++++++++++++++++++++++++--- tools/perf/util/symbol.c | 4 + tools/perf/util/symbol.h | 2 + tools/perf/util/symsrc.h | 1 + 4 files changed, 347 insertions(+), 22 deletions(-) Regards Adrian