From patchwork Tue Jan 31 13:16:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 4762 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2746694wrn; Tue, 31 Jan 2023 05:21:36 -0800 (PST) X-Google-Smtp-Source: AK7set91ZcPMncZhJ+G2IIA/fyYNhKELDwsz9vF0omayHsRa+q4QQPwPjaWl8aouSBlMG3I3HGaA X-Received: by 2002:a17:90b:38cf:b0:22c:7ed4:6bf8 with SMTP id nn15-20020a17090b38cf00b0022c7ed46bf8mr10497220pjb.24.1675171296628; Tue, 31 Jan 2023 05:21:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675171296; cv=none; d=google.com; s=arc-20160816; b=n+Ndgw/Dim6RiM88+vMRxn+2wecoa1Wcuyo1tTmhGvfsVXEN/KnqOZ/wgazEkPF8Je J2zWuBBe5CeaJ+/UToTY5HsjuEoNMT+tHemOSKbLB4facuphsgaetMchz/SKlh2kHb2t SUf3gc2AHM/x5G6skBRIy6p0xgLt0LTXrg5znSgZeDd1p4WRD2THNjrBGYQd6iUloIuX haKELgC60cphc6MOHue6z5+ryjmHxfYYVUVXD5yidP9B3tkCGUKROzrvWfCT+ibT6KXc vgPyOlpnVrCFado2d5FkuJwnce/TAgBmBb+F8g1KKPx1zuRpjIhISq3w6/nBRiMBzkfu 0Sxg== 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=m1nDsD2YI5pMt7e40SpWvyB5G0VAYZtVygSJ1/rKP7c=; b=ihGSlJzu1a1iKfM6BnQqfcpHB2bzpdlmbnH9gaMceT/9GVjoFD3eJvWMlkkXFTbbFt 6qaj9gwQ5yz1asYmKbD8GJ85aAiFEab8S7rgh2SpjfBzO8mZNJKFWAarJbZM3/vBJFKn RmtWuLwAinGyy8v3Nx4qs5tfscauDNsLuOl2fuumI0rvjKss4YlKGAC8VYCllpyj0UDU b/VKronpDjV9xlPZL1kkHsTjEw5tJfwPpTKSp1ZSe9MJX4J8Gu+FSagL6UngQ2Gw06LK oE+VeqBkznOf/88Za//Nyri+wKp5ZKzMdB/8YuTZiZ/j6QPNapk+gHjbQJvTFDATChA7 WyaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PDnxGEQn; 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 q11-20020a17090aa00b00b0022c4ddf8413si14149493pjp.8.2023.01.31.05.21.24; Tue, 31 Jan 2023 05:21:36 -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=PDnxGEQn; 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 S230427AbjAaNQm (ORCPT + 99 others); Tue, 31 Jan 2023 08:16:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230008AbjAaNQl (ORCPT ); Tue, 31 Jan 2023 08:16:41 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E35440F4; Tue, 31 Jan 2023 05:16:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675171000; x=1706707000; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=zaxyd+z/I9AM+7RzYwsdqmttiRt1yiJDKbXP9RraI94=; b=PDnxGEQn0JT1PcJehFaqzOhW22NBbquuXSaeIXcgGW/Dc0pCK9+PBH/M RPYr4jjfsEJSgo9f5WwsYsNPKAfh/okJt4JgbNpYbNk4oVKtuTOHtUqJ4 ZbJCDgdyGNmOV0o54GBbXwIgK1v0r1DIc6Mc0jW2Ix8VtJVeUYTO+9BmF dsx34106EBpKhFX4rjFDAZy0hVrgZbI1d2SlTrULIZ3uCw+0KTdpcbgcI Dc+T1kyOngTVI7fonuiAHmHKGnjOOQdhKvErqwdkCkBW5B/dmSZy2DAhl qc/9DLL27Q/eyxE3FbDrqBNOQNy+OiU4npWvRU3YlWngUVzrToaagoQdp A==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="325534132" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="325534132" 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:39 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="657864786" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="657864786" 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:35 -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 0/9] perf symbols: Improve dso__synthesize_plt_symbols() for x86 Date: Tue, 31 Jan 2023 15:16:16 +0200 Message-Id: <20230131131625.6964-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=-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?1756544417243705672?= X-GMAIL-MSGID: =?utf-8?q?1756544417243705672?= Hi This is version 2 of 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. Changes in V2: perf symbols: Add support for x86 .plt.sec Amend commit message and example about -z plt perf symbols: Get symbols for .plt.got for x86-64 Fix get_plt_got_name() not to segfault with EM_386 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 | 365 ++++++++++++++++++++++++++++++++++++++++--- tools/perf/util/symbol.c | 4 + tools/perf/util/symbol.h | 2 + tools/perf/util/symsrc.h | 1 + 4 files changed, 350 insertions(+), 22 deletions(-) Regards Adrian Reviewed-by: Namhyung Kim