From patchwork Mon Aug 26 21:35:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13778524 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 83978C5472C for ; Mon, 26 Aug 2024 21:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rAERlNiW9pyPTkrb1TcDBDVT3AA+peDza7BurMjsD1M=; b=tPTktOwOcz3up6qv7VW2EAWmjA s2N0bmj493e7k1FDtXrr2iRWa6pbz4pTaPcpezWYThqeJGZcIMTDNtx0aRlBY1D4O8t2t2e7AFTam QaLtzD90j1S9e9UatK21HwWlAzFthdvtLv+GouQP6gupGRqlHbQyka7IceQfdfROdCvSpPMllhhTF 2i5bK2B9wKA17HKbc3FCltPy4ulj37PN/IIO/NljC42ot5EZnQdO2NsnhPeWIUa5z0+nKgo9RmG+w BEhrWsnMzc9Up5dPlxt4Z9pzFbFZ0a7W/jnkBbWO8EgVzjV13SQD8Kl1H3JNsRWvW8W3cjcCOfz4G 3h1xvziw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihVW-00000008rFx-2aNN; Mon, 26 Aug 2024 21:44:14 +0000 Received: from mail-eastus2azlp170110002.outbound.protection.outlook.com ([2a01:111:f403:c110::2] helo=BN8PR05CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihO1-00000008prN-15AT for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 21:36:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AGC8pfOTCOtABgrtWq4AEPRbLmjHWrPZwQvYZ4t+Io2kOtYgvBH87oyPw9NkF9seq3i2oSkh38csFrys8IaJFLhYgTw5/TrFhvzqzGGDQ2V2xhFc1sc4Laqtln92B3Z6rmfRkZPp7k4uXz3wwlgWoHC/+DKK5iRrTnyO1bQ4HNfdgbK77nr9KBoBP7B0zZIe9ncbBuCaQVJKc/us5CsoAGrbnFIcw3ZktLXeZWjONP7YMl9X3e1YPX7s+FzBZsFcUfZ+RX54MHIcuorhBt2f5XK2ZiwfGnRqHfi+IneLRWrpwx5gTqyBcmqXW/crlb2aycpnr3Bhq6JSxjWsC7PoJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rAERlNiW9pyPTkrb1TcDBDVT3AA+peDza7BurMjsD1M=; b=CUSN6slknln5Wwnji8LHc62GZLRsmrttAfGabWCN1zd6gPW11Xuw/PgLTmo+biiHNXGpPHAhhkg8PURYGUWYJ+JcSSF7k5H4Vx7GXLng3NIWuufBQAPndmxAvB7fJWNkOpiFfCfeTGdwjYOM3AdBm+34ysuCB3Re7ZULKI0UYhpJqvU2QbOPq4mpZ8tvqc5iTgogCYkubfPTlOK9b1ubZyjwgRPa95aXALYANUHoZ/LDyaiBVgxvIRhwkjCk2sYBslycfKM0g6ZbNHdHAu6gVdtAh1tNovuKphVxKrXwuFtxI0hF15C0dZv1Ka4ATccg0KX1xQbnQ81+qYry081rhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rAERlNiW9pyPTkrb1TcDBDVT3AA+peDza7BurMjsD1M=; b=u3GcBaL+O7b1zJ0ZKdHx8UGlsA0U4JFw4kg7MVKxyyQLvNyZkm2dMof9I3bOLS3Vtmj3RL4/VEODkO2qYP8kSDZ4hddkrqaGUdjwZgR4HAuM4Zscl7zAoanF/GJUPzPJXICPsYO87sTRXlAyRdzVsNVJNz4WLJqvcrLiWwjWZhA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ2PR01MB8150.prod.exchangelabs.com (2603:10b6:a03:4ff::5) by CYYPR01MB8410.prod.exchangelabs.com (2603:10b6:930:c9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Mon, 26 Aug 2024 21:36:24 +0000 Received: from SJ2PR01MB8150.prod.exchangelabs.com ([fe80::72ca:29db:7676:9fea]) by SJ2PR01MB8150.prod.exchangelabs.com ([fe80::72ca:29db:7676:9fea%6]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024 21:36:24 +0000 From: Steve Clevenger To: james.clark@linaro.org, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@arm.com, ilkka@os.amperecomputing.com, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 1/5] Add dso__is_pie call to identify ELF PIE Date: Mon, 26 Aug 2024 15:35:56 -0600 Message-Id: <99684496008df1c7b5437a4c31277fa43df044cc.1724707494.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: YQ1P288CA0024.CANP288.PROD.OUTLOOK.COM (2603:10b6:c01:9e::7) To SJ2PR01MB8150.prod.exchangelabs.com (2603:10b6:a03:4ff::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR01MB8150:EE_|CYYPR01MB8410:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c60fced-262a-46a0-3a0b-08dcc617227e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: MJzX9sWmPfvRHx0PVweVkQgv7RP2wZ1/CqoU4m/Twbynv8VmMK1N79furnyKWgHv36dzc3T6nHvQJ+8obgxJ3A+79EV/LhV1vmMvXvIK56II1le7L/wdZT2vCZcgz5Qs8UR2aHIEaS1U2i/9nIEOrXPZHMcGctqX702fugBxcnNqxHtF/HtfsooD0eqdTGLY3RZHfJ6EZAEKR/i8Rw3zQcM5P7Qxq7Oh1zy5mUqseN5L6jZXNCyUFc74Ec/AKHbkOhnP0oVsvNdCRQQ8nwgGdD6uqCN93rqCCEIOYvZMQDqdNjDRX3/Ph7F3D/mCuH4FTXu7m5rKbeFek5aqK6sby76CBKeg9iTJx/h+jZsSm3atZKlvJsZK3ibC+63v/i/KKw+Sg7dOE1hjzXKqUU4QZr5mY7OmMaB8x12Gk0ZdTufNVwwkVdvteXaaANpKn4XnkZMkq6c5onRCW7EbpKvcJfp2/mzw3mMZsm++OHaX9kiqkwZY7ROcXIWjCSq98aq51wU6kishZKWha/DOneqbXRvi1WvGPeV+4KRGw3/YmdHqyNaNOpPp8ONRgY5XTMdwBpSPltJexLaRpK5aTzBhLwz4iPTGk0EabmbgF2ndkCc5y4aIhRfq80sDIiPnQ22X+g8/jxPTFcCeDAr4ZGPhkCHBkPHs2yF9Uo1IoL2IL/ecwJ6I/yioyP3KJays84gJlVBw/48M8h5ZOsd5TQnTFTD4YdI163ikak9tIGRgPXjKOQOhc0k2Sl9cM2Z0wEKZiUSTPFYvwQL59C9G5mWr7RdjEzHLZHzZl2BbNdtz27TszFmUcpoCooxLLs+Mvzb8yPfRr01hxDyHqFFgojzcTTYBLr44Sb43JRyX/q6vO8g2DSGzrtdkn/+stmJGB8f20QEUNb/UNzVregJkfktsxdEgrd28BPZ2D8ylbywMSMNGP9NIp9qi1Hwr+1DOK5YsyPuofujLrfN69E1MsSIY6bkwWmXXszGgPKU2/yBZ+2vCOnxkwjkcoqHFgDPIDT+MLnbxyA4ED4cP6q/R2qjqO51o6z/Ac6+45XDps0rMohAj3BUnlt+VfVgH5gAVBJx/4KinUrA91zLMMlU/xVuQR/64gh8P91R9qHcbz25tD72vUVp36zRrKeB55c4DYnnljtQTkQs7Fe/K1QfRSgELO8wTTVr++JCagM1JWdpzC1zdQz7C9EwjRDFHNkZaIB5wcGzVc+Da8V2WBylfeO5AaJxEDLq6XeXsgoY/SZaqrJw3Qme17K2OpSZyJSw1AKJ0Bavm1qw1QAIm2Wo2pvP4vZ+B1ga5NfpDpwyv4Y6rhzTnoI6IOqZJ0VYn0hfB50M5NcPCanBw5tVJdePLfTRtaH+xGBZKPjdiK4bmkn0p6sQxqQW+6qHscNqssA/ezi+vU1h2B3ndQBUP3LtChXiJVg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR01MB8150.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QNFZwQgeD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/JdkKp4U+m+ZIuJFqQEo9FsGmxlDPS2vEsBAdu1aPvg3L4qK4nDi/yivx/4eF2gjo0QeSVlbje0BY02OdUf5Xl5OFKSrExiUjvvPDYlR/Rt5+qmniC4uWFOYfvGrq2lDi45y2Va11JixehSEXWqVyddCyRQCuytgFoAULkqTIrEZjO4fMfgM6SOz9ITz/y8e1bPVJ5k7AlIBWWL88SJlex0iw0L7e9sNfI81IBgJylcgqJxrCYHstrvmndvxxm/mtTCcMDAnMKxm/lsAaa0QT3f8MbFhTPvPFvfdkspVRO3S1Fp5BxP44oF4F2XAkyHMncD0mMPzSjFiZ/iZ6QY9zuWJsACXf3YZjjv/4ds66TRIw5uOq/iiariGUGmZ2xenzcA8WHDTUUzIbfyS+Dxnn23bUmPi0un/m+d+2L3SAL2ugR/3j5LX5Z4SITF1xJNc+UA0o75xR7rGC7OnlWetjFEVlbEqFvJW1ZGxnxCCFy3ltbDApKC4KVqdFmeelwksrl+fEb/X4VkHA1i4WYCEE3xyomgf8FgrTVmGXNawV4vvew2gZn26v5FIDEExMukg6+Vn3B X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c60fced-262a-46a0-3a0b-08dcc617227e X-MS-Exchange-CrossTenant-AuthSource: SJ2PR01MB8150.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 21:36:24.6013 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GY+DjwMEb3xRZetddoQnBeTpYwCXYhteMheZdpDNiWKHUmBvSJgPyzw9tls5ior7h/JQDAvP0crMDz+rUPBnskirldIRdE7i84ctKjTPjbtIMU9/Ir//hT1q8tRhjneG X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8410 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_143629_339903_4BB0E8B8 X-CRM114-Status: GOOD ( 14.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Changes in V2: - Updated mailing list distribution - Decrease indentation, add null pointer checks per Leo Yan review Add dso__is_pie global to read the .dynamic section DT_FLAGS_1 entry for the DF_1_PIE flag. This identifies position executable code. Signed-off-by: Steve Clevenger --- tools/perf/util/symbol-elf.c | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index e398abfd13a0..0e49c1345a67 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -662,6 +662,66 @@ static int dso__synthesize_plt_got_symbols(struct dso *dso, Elf *elf, return err; } +/* + * Check dynamic section DT_FLAGS_1 for a Position Independent + * Executable (PIE). + */ +bool dso__is_pie(struct dso *dso) +{ + Elf *elf = NULL; + Elf_Scn *scn = NULL; + GElf_Ehdr ehdr; + GElf_Shdr shdr; + bool is_pie = false; + char dso_path[PATH_MAX]; + int fd = -1; + + if (!dso || (elf_version(EV_CURRENT) == EV_NONE)) + goto exit; // false + + dso__build_id_filename(dso, dso_path, sizeof(dso_path), false); + + fd = open(dso_path, O_RDONLY); + + if (fd < 0) { + pr_debug("%s: cannot read cached %s.\n", __func__, dso_path); + goto exit; // false + } + + elf = elf_begin(fd, ELF_C_READ, NULL); + gelf_getehdr(elf, &ehdr); + + if (ehdr.e_type == ET_DYN) { + Elf_Data *data; + GElf_Dyn *entry; + int n_entries = shdr.sh_size / sizeof(GElf_Dyn); + + scn = elf_section_by_name(elf, &ehdr, &shdr, ".dynamic", NULL); + if (!scn) + goto exit; // false + + data = (Elf_Data *) elf_getdata(scn, NULL); + if (!data || !data->d_buf) + goto exit; // false + + // check DT_FLAGS_1 + for (int i = 0; i < n_entries; i++) { + entry = ((GElf_Dyn *) data->d_buf) + i; + if (entry->d_tag == DT_FLAGS_1) { + if ((entry->d_un.d_val & DF_1_PIE) != 0) { + is_pie = true; + break; + } + } + } // end for + } + + elf_end(elf); + close(fd); +exit: + return is_pie; +} + /* * We need to check if we have a .dynsym, so that we can handle the * .plt, synthesizing its symbols, that aren't on the symtabs (be it From patchwork Mon Aug 26 21:35:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13778523 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2AB8C5472E for ; Mon, 26 Aug 2024 21:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2aO6isEzkq6NgGksaVY8RsXysbfIH+NsY0J1DpoyxZk=; b=AMuffs6CW/F/GKmnQPWuw5ibco AsNjuh1u0AMpQ6ltetnotJUNjmiSPimu6yyA3qOeXeTA0xaMg/438SV3ZkfImnN1z2Nsv99vLDyDb Umkgfc9KZ6lCEvDZ8aBgq/WAze3ssp3TrXtR8W9oYYuaLRfZmCiF4RI53li005vokeKv4rgoO+P8r fSeBLiptQgsjaW5DQI6loyNubLeuTpvCzMShfMEbmnM5otnjbadJHswEn79o693pyxVhLyNwz2ZZ/ /UlvvQAurChNzGw2IgQcWjNQ/4Wgg4vK0QEBcbMyAEbrnj/MHX5pPCD+QeR5ZIWjCGvM6nusyFCnD FXT9Qhhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihVW-00000008rFS-04ny; Mon, 26 Aug 2024 21:44:14 +0000 Received: from mail-eastus2azlp170110002.outbound.protection.outlook.com ([2a01:111:f403:c110::2] helo=BN8PR05CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihNz-00000008prN-2fFE for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 21:36:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BlMYGyRqxh7Z/FMR23ainTFSjbB0s0UqafaSxet863EhKJ4DznYjBqrFRDGboHlO/kqd3oa2VPBQRZ7vbtbsD+AkNj1PBjF8INN9SsRV1YiHGEmkKAEUIKKRrysNdwQW+dd/bGi6Ss3grt5M/II0vohq5Q18R9M8zMWM8WcaNCeI6VoqylIC6/L4sG3ij61Rfaz+IdYtNHPJp7UvO2Jn5WEnKXT0urFVhOblspj935IIWYkDsCQNpcaWUCQ+K4GHJPu3KBUeCS63bFCKYnDbOFB9RVrmIRI2AT7SO7oVpr+vKGYoko+W2TbWAECeo/V84qSsVB4uAeskXGteYfiouw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2aO6isEzkq6NgGksaVY8RsXysbfIH+NsY0J1DpoyxZk=; b=MGHFgNCR4F+lhkhYLGgPkGwgh+Vly+sr+8ntLZVU67+5CkgXZc0E5PV9tjKscJWTbD41nrrQzjOwRdTuPdy/7/rQZYwBGP2WlUeUnSvS6p/oDAkacYa+VgjLOaImfr9b4YVMh0wujKAHL3cbEI9DbRBHFX0vzpCITmjQMthXDWj7OeGn94rpNlZwukD1H7abCs0ywMOdyKsDCJU+Rd9RtGNAJk4enVTR6HroFfu4e1/+tzUh9sDpYJOWw/Kw6lqsQIJUCDoqWJqUcbME6lgGVCcoFBQqfhQBh2iskgdGfLIINLHw/q739Z8rfYcnbxMwbCIAkSCVlk8EtWhKsOilOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2aO6isEzkq6NgGksaVY8RsXysbfIH+NsY0J1DpoyxZk=; b=ojM8vg3F39QTpSvDPvIAGcgajBgiao+Re3EANP3KmjVzNZVaeTE7HQBvopQZopmCl7zZGOUys/QaxntHh789wLd8s2nFTEnZHX11byusMmviyHJtAxLkHsnFjkf+kDXZS/SvYU+8oQolC4DcJM4ogLnNEkhQg+utKA1QEdPwtQc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ2PR01MB8150.prod.exchangelabs.com (2603:10b6:a03:4ff::5) by CYYPR01MB8410.prod.exchangelabs.com (2603:10b6:930:c9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Mon, 26 Aug 2024 21:36:22 +0000 Received: from SJ2PR01MB8150.prod.exchangelabs.com ([fe80::72ca:29db:7676:9fea]) by SJ2PR01MB8150.prod.exchangelabs.com ([fe80::72ca:29db:7676:9fea%6]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024 21:36:22 +0000 From: Steve Clevenger To: james.clark@linaro.org, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@arm.com, ilkka@os.amperecomputing.com, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 2/5] Add dso__is_pie prototype Date: Mon, 26 Aug 2024 15:35:55 -0600 Message-Id: <197c2518fe6faea400e7d6ba49c28852fa48007f.1724698250.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: YQ1P288CA0024.CANP288.PROD.OUTLOOK.COM (2603:10b6:c01:9e::7) To SJ2PR01MB8150.prod.exchangelabs.com (2603:10b6:a03:4ff::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR01MB8150:EE_|CYYPR01MB8410:EE_ X-MS-Office365-Filtering-Correlation-Id: 86035f4b-3175-416e-2dd9-08dcc6172123 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: iH1cU8qirZzt65jQEtxf+8t3bgFD1RvHtyJ9pL1P1fgt6JV3G9VJIRWMQq0yQ3fvAVUfqoAAD7Qr8P8DlIaNCa/JH5QtD3wJd+Fak02oeen+Tnq1t3hPbh+5dCu+rBw3hQvD4NDd2BWL/OCbMpqHNNqFH9digRPCXd4vmM6kWluRCR2Zm85Upl46PT/LAHvbhC/U5KherOsoVvy8Eop7Sn16ctwYh725KXAuyZj6qAL1aYy+CZFrfGpN3Oxez118CX2Vn4XqCmBoU2r2qpJuRwty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ct+lVHHQ60dOfNMjerUJC3ywSx5yrql8OI24AHs0wHkgF3S2/4uIBY3FpqA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR01MB8150.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ctO1BUw72qJrdK33GrURG9pkzDaqvgI98KAWm8QekGlh56V2eX08gziMYCadpN3dTKfQYVjDin7m16ucuYVk1MWeAso6n9cxrKuf5gBlj9ekOC3wd4g5sKL1aUZfdIOb0vnn+Ss4DHBNEuERxHgFfIlveLPu7xanqdK9KJ5D9FBzMEeHk3YjZ0MZ1SwFCIHJ5H+AENMznmwD3umZtzLRd8ftLPQA0UFUpN6Uu9aVJ5i3pj8y0RqGyVYJs2mRXvrrE6xpoE6HH1I6ul3sJTbQ/an/YO49mRqIt3fH/CMevytWwn0znLT2sBk9cXgnRPcKwT7WG6dJ2vhHLlzaFEwNsiuNwUj4VVfHxtFYF9S+ChUOCoCYGGAAxDRIHrVnzjuZzcM87Ky1bQpS1yQiYQacjVyzhNUw3TBZHKQY7vqL1ftylqkX3tO6MFPhtZyCibEWWkdhJ8OE6BoQYUj/UQkwE908uPfAwotFbX3KLog+DD1zrpXiZOeGD9imm0SNVRV1Cr4AgLTwr5H1Wtay619zjEdzOYNyTneJPDRe8owVMLpp+jRjgnBmJqWSOCAebtCMU3wUqyTaXkJw8VYS68Ox1eC3HE51M/YqK0OfExxWPicTp0K/k9j2p1Hf3by8rshCu7Wm4+alXrzl460OFK/jYH1vhwD2S8ztmXBfZ6j6WGstT4RkcqM58rckSDy8E2ni9VZaEcGrXM3xsbn2C6kbbPpTJ3mi71HbXAuwFKYz7rmL55UDsWAJiwuoMR1q9fw0w7AJtRjvYc1cgi0lCQFBvOqiQBAnnT9Y3P5Kviiz5iPNTRqkuvfcFgXwBWM3uBCYAj2NHW1fqJb99XJre6b2UDvyG49BWjIZBlK/m+0Ki2z6InSyqnp7F2hXYzHHSW21TUcked4o8nQGp+M7uZkuMB2uV2U4rE2wTrdJC1zf2x6sDV2TnwJfdXztrtq+OLXm+U4pOsX11E26XfX1DtoaRnbsQr634Gj9play/hew79BB7U3zgYds1RAhd1HwNTNLNakj4sOkgRNZ6vGs8Uu/PkoNl+42lxXloFyJtJo223y0jz3mHhiR5+RtM+P4zn2jZ7+QtsWGWLR9ScqUca/xxSPBtOvwRhEe1yu9JneBI1ErmumCkN2nOpPvLQjARYxST0XjTGDma/CwR7bB+HNNk38ikCel+l62opboBV27hibp6Krfuz+ginYa1BqVU22HvrAGrcjPq/BuA5k3jIjlkx2p89el8xV8IxN8lBIBQ74AibHgsvvNP/lRDGZSYIiBekkAQcTx3F/mFZhFzIbFOYgIVEhCPOWX1pdtOEyav6/Qm5rPU2aNSdzrH0f+4quqC6P8bQVvqkjLYglhxUl6XR4BKceDl38gVHs2iNvWl1Br5ykLMLVnTCpDprLnF85vct2IBo7vy4323PEj0VyTwsus/1+Jh3MS9vqVqpFdsjtdheMtPEQI3dznI4zZFwrbIIqwsjVR40MPKpDnv4UVy3uFfsvAYEipcu3gtWudAIV2KVt4UIzvuignuIy1V4wSGWgM3ynzxM9WmdUh7M1LpYk2uGM/y2z9LrZr26heD14itE12/E+2Yg62s2ndQGacsbT+0xDZ1Qw3CHFISaUAxVQ0Kxjqmy1Ic9I5htJ6+ZfAtNzNi7vjEI4z9YLtITkj X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86035f4b-3175-416e-2dd9-08dcc6172123 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR01MB8150.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 21:36:22.3990 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: c1VvAXPMNjhR+4DN5IBc225sveXOmDpomJCPu0BN/8qgzySJQZXwBLOlk55pH/w7rEUXprevaLkWbIRvtuwTJ+l/S5pADhDGnKRPgdjafYbuaWiV0BMVcGzIdV4etGg9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8410 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_143627_698616_473B4016 X-CRM114-Status: UNSURE ( 7.71 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Changes in V2: - Updated mailing list distribution Add prototype to dso__is_pie() global. Signed-off-by: Steve Clevenger --- tools/perf/util/symbol.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 3fb5d146d9b1..33ea2596ce31 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -127,6 +127,7 @@ void dso__insert_symbol(struct dso *dso, struct symbol *sym); void dso__delete_symbol(struct dso *dso, struct symbol *sym); +bool dso__is_pie(struct dso *dso); struct symbol *dso__find_symbol(struct dso *dso, u64 addr); struct symbol *dso__find_symbol_nocache(struct dso *dso, u64 addr); From patchwork Mon Aug 26 21:35:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13778526 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 434A8C5321D for ; Mon, 26 Aug 2024 21:44:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OF+jnntJ/0cyM9SmXgZIk+3jfpGgZNHq/ixJEgd9brw=; b=hxpw01QHPicrCHQPDGLZxUaPGy YltM2t4UQriMZhraoARqWJvrx20h38xIcxaKtOYVHqGlv+enIdpMooID0XCtmndHAhHRxGxx4qwSE pGr63hkFhEk9jQEM1LtfUzhnJAn+k1e5PVG8x7hbxjdr8QyxqjLuIn/JC6ywgFOkdBelg9seoZi/s EV/FF6hWQeelXuylvHKJVIQca30wOjYcUEr/0PC8Av6Z+S5bd4rd8Fa+RHoX61t79VnbYNMUs9bSV aZMJc8XskZHfU1sX0XQjJbP8QAfyZ7bk6j28U3zsxEcXz6xLIXuP7cDll1u+ZEV3kka2HPc7EBHE4 LAAJelOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihVV-00000008rFK-1iL6; Mon, 26 Aug 2024 21:44:13 +0000 Received: from mail-eastus2azlp170110002.outbound.protection.outlook.com ([2a01:111:f403:c110::2] helo=BN8PR05CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihNy-00000008prN-04HA for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 21:36:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fLbyETG4lnMoOsjvBg6H/YP1yrsYFjvWVje8HGj/slEGcsqRx4Qhus/+zP9qnuVa1Henc4mXdcLZBCY4t5AOT6Rd4mzcO7m3zWWKI6j7IjwMYoCJa9UuZgXffwidYIfQFpjJQdYx/Bu7MXVIse8tu8OMqUkwAm0zMr4qwKT3lHj/OQqNuvqtej49fuE9a5lepB5v1twV1XyiKwJBtgcG8beIsJkS3mukH/EqLaJnoUmMu9zX+hinJzPhRG9Ho2NBBIGS39Jzes1WKQKxTZ5NrS/xB3Uqf9VWRTn6g5Za5ZDZalqyqlmScdLU6RWgzaAVRzlsZgrMhaO/j4aCK3LKsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OF+jnntJ/0cyM9SmXgZIk+3jfpGgZNHq/ixJEgd9brw=; b=sJuyh/i10G3knGOzBQ7modEz6klOnvK0bOP/lDt/0a/2sd3e3Rl6BLwgG2WOCpFcFmOPHrrHAeRUfz7mBb8jfMkHiDumnc1+N4eW3Zf3SpPxghANmEgvBhMC6UXBDG7iWJn7PtkGIe4gz4Bx/wm57fiPRZnujSXwAza6nfg1RnqdN3BQOtv95LaNkCwwyDB5tUN1JiJWttp8m0jCkp62QLqVXqE8dqo701E/tpYcE+qhprLvPL2SGfZx5ocmnc5WY28+tCphb58r/NjY7tSnEDK+7bsf3i7gT7qo4/VtD8l+D/c/CLiZQhrqilX6oLoSgzlX5hCU5nNGd25CUDfaoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OF+jnntJ/0cyM9SmXgZIk+3jfpGgZNHq/ixJEgd9brw=; b=fFlQ5MF2koCmXK/QGceW/SjPxErmKWUFcTJWxx0CPZZJjdUSpCCRgZcG5qnx0Z38gd8EfpW4r/sxHEtFHXWLfHeb9pG0nxaWlSn2ZsrGZsmzuB4o6ELfu3lrdcwhVR/QEzmPojgkPVMHNHglcjv+Unb3sx7r2Ut852312I3x/Wg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ2PR01MB8150.prod.exchangelabs.com (2603:10b6:a03:4ff::5) by CYYPR01MB8410.prod.exchangelabs.com (2603:10b6:930:c9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Mon, 26 Aug 2024 21:36:20 +0000 Received: from SJ2PR01MB8150.prod.exchangelabs.com ([fe80::72ca:29db:7676:9fea]) by SJ2PR01MB8150.prod.exchangelabs.com ([fe80::72ca:29db:7676:9fea%6]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024 21:36:20 +0000 From: Steve Clevenger To: james.clark@linaro.org, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@arm.com, ilkka@os.amperecomputing.com, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 3/5] Force MAPPING_TYPE__IDENTIY for PIE Date: Mon, 26 Aug 2024 15:35:54 -0600 Message-Id: <2ed246c95cac628cffc1628c115a4b791459f8fe.1724698250.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: YQ1P288CA0024.CANP288.PROD.OUTLOOK.COM (2603:10b6:c01:9e::7) To SJ2PR01MB8150.prod.exchangelabs.com (2603:10b6:a03:4ff::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR01MB8150:EE_|CYYPR01MB8410:EE_ X-MS-Office365-Filtering-Correlation-Id: 6067510b-6551-4349-2bed-08dcc6171fb4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: DvRdaSl1+UtOhmUw3gO8AAxAcjN2NGThyDVVH9Q2z0NSxICrfQcwrUB0UXcb+EB/Bg7VGxFDwKCdu8WJXkY0OKUrrsf+XlwvwI7mbtIMTb44yMdJbraNyncUH1yztK7PevqPvOYbRW2W3LUiVz1FERYwTL8Q89ktVD2utOmD56m+3f0v/n2Hncwo5SDz99N6mPv4axhQGJFafLpAn45rXreHDndVVPLsnA1wvbmSmn8zEF7Q1R82DUkCG2rdccs0Yw/EtOpqK8u22lyknl+wKlwUq7LC33o8oXCLODiMCdexaqxEcS34+FtzdlY4k38dxPOx6zu2G1ETrdNuu3/c3yE/4+2LHdNBHEACkuK7sa3UhhOO1Q8cwCoKR+p+WJnHx2j5y0QOdX9eL5yaOs1jeb6IOKJN68DxWao1n/JiS+vxuyPRfVP3oBpnxhkmI14jvkluvtgJgsZHlAP6M84W5J1IlKRa/cburGgBVQUdxTDY07KbQTd7MdzTQ5Zb+gRftE69BxkuEEwXxrih8Guj/4pdwA9SrKzYutQgXFA9z2qtHzMtJo/lhff529KzHF+DEGLv30y6CWEqDqv0pYV4SB8rLDMo+zvTmmezw7fMXdZ7M7gFcLGOeQ19yfop48k9ZhHXuPD2R+PrUY1rexsCO+9Z/8WQzHhAWpgsObQ14iXp5R8LhrJuA2hm+2gssjkdQGpcheoO/Onu89ussI+o+y/k+ZEXoXPDXc/V/FRxpI8GN/Ds8XNNPfD/DpNoIsomgtPsMPZAQdcU8zAjX8aDnAkULUdpybM+UcvgkLrzGjrI4mOBpn9vvU/PlAQuxtTUGWQeKYBzWwrHdpcr4d92UfCgCTqWSbt8R/DudMyVlHyg8vYBZ5ezuU9sIvLvORf7aYJZzjhOeP50N6CYZutWUN6s/d2v8ZDr0V8oJtpzBV4GtBHxVTOpWXrrTrHsSP4wzjevG41AJ3xK7lP6AB9Q7BfTo2+x/HUtoMRxttU4U1+3ddjbSj9fighcdTif5rSdKqIPm1k2kP0VK7b1TSkcCdDFQ3SWKz28C7igwfkPRIHsvlN9J1Y0bvbeMlUaq+/Z8RieQlb5YcyfsvuOs1p+Fa9tfVPDKfYX5Ngklqu5bQQl9vYbsZnzgUmBktCiXd3Z1j15JU6c/L3rm6eZGlivjkxU6WhzhQHdl4yvwKGPTPxdVg/6IK9GY+9+9tiUzeH0tKg8Z1GnqbmN2d9eSMi3O8lDGR5VKe3T5Nyz1tiLZ9C2QFqEU1zkTgT1Xa6/FaGevtk/fHWY+mfewZEnIOrGOdg6vdGmPD0lUatNdhfTJSGhRL9OPPJny3PY8wrKtUgi4/fZyZPejes/8Lvf2OgUkhWQ7EEVoaZKQnpsIIhgXTF2QMRTydKtaTxoSHVI/xso4TbBu1rMglTrf0eE6fdBOg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR01MB8150.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qIHJ0KD4HgY0o54WyWfZI4ly80Uz/eKDD4pgnrD/ptjgJEmgeh6X5TgAmb1KQLDrPoAYfN5A0ZuSKa96MzdeCyYE9+7AZZM1Rvdd7wefNgBYxEhi8kHV0hkqBtNt07u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KtWVVleu4dmvNrp/+Ud2+oMDxE++pNVXciph+IffD9FnMwkq1wQRpCui8WkzetkXDsWZ8YSrzFWS4HqeDYaXp5fCV5euSlU8aQ2FmnmT2FKHoianyY99ybTogFTjBJu9QKNTauxH0htkNnJCgLH4k+h9IXuEcpAJnlI6HuIo0DL/Q8AyhaQUEI0l7zn4QJNeJhdfJSNy/l2bbt0x7RhSra0OAxeHMfv5fYBdFLr3tDRVxtgVQmmcGsHvPNEmbeNW3UtcXmge22id6tZZPpBRFEofUsEDv6p0QBuoR3+G36ytqR3X0UlXJn2ymJNO3WhnGglX2zVW7tfd0N0W3VifvywAGMZUc13VuAzyJCbk39kDBd1Hh3tV0x+HK2V89gZLFnvWkr8ZJu/LstRLzsPHHWhgn/BkMcj8PR1wwHT1C1bjkaC31rksCq+SNyOrqiSQOkcQ6FcR X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6067510b-6551-4349-2bed-08dcc6171fb4 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR01MB8150.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 21:36:20.0080 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XhcuC/bOHtRjJ5Y095oZ8X0exaL4UBhyXX25vyBcPfzuDf5gX5X4malgvfBiX7jH+EBPqMDxH1oXHivUEkspCP9bLxZmOTEXbdAF05SC5KD0TyP/pfFu0oSMvyYCzeh4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8410 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_143626_078317_4F13974D X-CRM114-Status: GOOD ( 11.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Changes in V2: - Updated mailing list distribution Use dso__is_pie() to check whether the DSO file is a Position Independent Executable (PIE). If PIE, change the MAPPING_TYPE to MAPPING_TYPE__IDENTITY so a zero map pgoff (text offset) is passed into the script. Signed-off-by: Steve Clevenger --- tools/perf/util/map.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index e1d14936a60d..df7c06fc373e 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -171,8 +171,11 @@ struct map *map__new(struct machine *machine, u64 start, u64 len, assert(!dso__kernel(dso)); map__init(result, start, start + len, pgoff, dso); + if (map->pgoff && !no_dso) + no_dso = dso__is_pie(dso); // PIE check + if (anon || no_dso) { - map->mapping_type = MAPPING_TYPE__IDENTITY; + map__set_mapping_type(map, MAPPING_TYPE__IDENTITY); /* * Set memory without DSO as loaded. All map__find_* From patchwork Mon Aug 26 21:35:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13778519 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 53B7DC5321D for ; Mon, 26 Aug 2024 21:38:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dyJOIoAT/e8kDozGR4O15DBCTLg01XAPpAw7eBjWNjo=; b=VwQaMT+226WjiBIHhjEiRIJTvK wPIofx8fUWTIOhufEG3Vrfrx502daxtMdd4SE0Kg1HneSTl50UiNs6jzof4BI47NldWfJUb4GSIc4 qiV3Ub+dIYehyaQT970peKGFwraDowU/+0gKkZoYHSMK4xI43p+nC8MKzlYIeqB5CG64N4f1xPIr4 rmmY4ct+eiYcyvar712iZjp3yKyN2YcBawN7GqroQ/+BTxNAbFW0JXsF6bgRiBrbI2pgjgJvn01TC zQfjGYd9o6aCsdKAe3/bHiM2ApADQRqx9XZ+oE/VkALg+/iaWdk0zha9/z/FlpVEuJtFmmSxIBzh7 xKqAF7Jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihPT-00000008q9J-1fPi; Mon, 26 Aug 2024 21:37:59 +0000 Received: from mail-eastus2azlp170110002.outbound.protection.outlook.com ([2a01:111:f403:c110::2] helo=BN8PR05CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihNw-00000008prN-27n7 for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 21:36:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JQTEQ2EeyFoXtVOl2JM6DcSqpk+e/6/Ht/CcJP09gz5/Z05QkGEkK1PHlAeVxThQFNqCEu6E26cQtZvF5cA83n4V2E6ivbGjCKmEHO6PrzGRHaETVKuHa+tzJzIUS0PWrLSCyGXOGZlpjqc2d97b1+CbDL4lUo1wD7TJL1VLbDPsaNxVw/pYag0Qa2PR4lllnRBrmzZZSXd4G982zpX1FAjSBTMugVQTTobtiDgT9E9UFGHmE5x0G6ynM3rBKq1RzUgDgh8ZFZycC17ZRbUjSCLYwTAi8NebUZ9PbLai86OSJYUh771JjOplCUfEHHl0uLt/PJgLXwVHfdQ2QOFD2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dyJOIoAT/e8kDozGR4O15DBCTLg01XAPpAw7eBjWNjo=; b=HYt/yiDX+NYM/xvZs4giOMSiDkKuyn+zEuUqGZCJI1kDFPEibZvZZPYL4XnW852cZ2DcANrr/fi/kGVkjOeOx4Cz3I6kPPE0QJkFTsbCmrdEJkQmWK0iOF/lgqYKAyTZbbhU4SVh6G42WFnBWvAbqDXD1VFpPkC9t9hmXzC0m4fMG5aYjqzebI03piJEcl5weIrbJZbVWnZk2Zwlin0Tx6jz9CNdZirDolU/+QDp4F9/5kp5wicCCeZX+D7dU8CkvVTnC/917kFtlu1hO5NgQn4cAYGZvXtZ8/vtaXt2uUUVvFkjpKf6/zkV7bsBKDwbIQW52JVqoH6tKb1Cc1GpiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dyJOIoAT/e8kDozGR4O15DBCTLg01XAPpAw7eBjWNjo=; b=fvDGWXbB2y0jdRnabe/tUoS1AaejR+TzmespaF17huT1JfuSIaImviFAnlfxLZccR5p27nQzlWP5N7BR0mP/C9U/9GJ0ODMxAGZaCyfLoBrf2cfFo3hbC+bA34zh7Bj70MLg9ii8RmtFXz3Sf109EL5VPziNSNQOD4vPJ2HgtxE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ2PR01MB8150.prod.exchangelabs.com (2603:10b6:a03:4ff::5) by CYYPR01MB8410.prod.exchangelabs.com (2603:10b6:930:c9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Mon, 26 Aug 2024 21:36:17 +0000 Received: from SJ2PR01MB8150.prod.exchangelabs.com ([fe80::72ca:29db:7676:9fea]) by SJ2PR01MB8150.prod.exchangelabs.com ([fe80::72ca:29db:7676:9fea%6]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024 21:36:17 +0000 From: Steve Clevenger To: james.clark@linaro.org, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@arm.com, ilkka@os.amperecomputing.com, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 4/5] Add map pgoff to python dictionary based on MAPPING_TYPE Date: Mon, 26 Aug 2024 15:35:53 -0600 Message-Id: <2c0276834838dd444ad11fbbe670eca9c17f6ece.1724698250.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: YQ1P288CA0024.CANP288.PROD.OUTLOOK.COM (2603:10b6:c01:9e::7) To SJ2PR01MB8150.prod.exchangelabs.com (2603:10b6:a03:4ff::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR01MB8150:EE_|CYYPR01MB8410:EE_ X-MS-Office365-Filtering-Correlation-Id: cfbdd500-02f2-4bb7-e2a2-08dcc6171e2d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-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fvQOM/RKmjAbrB0ShoeAonZoSh/SkPB7mHtEL2edH/UTiwLp2EJ5ERVxj1qZJcH6AjLog685MeyH7Taa+eWbHDTtETtYq39zkldoSyv3zTPx0Ml6Y/DYfLHY/QFRtDWPDVYzZ74RNoe8npQ1mCHsZDflbDhSoR8VI5WS2II5VI4ebIkAF9Je7DMvsV3wC5WnapnGsYPrZIHvvgiObFsyAw1/mWm9LPLwOJbE7O2G1guE3shpyKO84UP5OWe73C2MoQBZEi73B8EZsCW3/lrTr8iRs0qGxSWgiss3bimrmo1LDTNxmK+qFNXkiKZZqO3lRIVyRr2jOHW2hZMiwFVgqacuBDnhveSIiUugkAKi5XxsENurjjZoc1lsRg2Ssh/Kd5T+Brt/Du/DARjerjj99w+dPIdcd/vXQadR+HMvhOw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR01MB8150.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: up1VzwWdYfQLFfHzcWJus604eLTbeYCvY4toRBLYzAmn+++jSGm/ffmdKZDDGXTV7RhiyxtCCffDww8fOx8pIN2LAAnLsoBhUi442emev8grBd+NVO92R2Siq6baSQVm7ppMwRtFC6AXF25BBDx+ArKFVq4O9NAuNwJR5l4LFwJKZ+lXJ9qqQyVAkPxUpfKyF9Xbk0wjjqjsq/iIdfCy6Zq0p2aB9aitPxlDqTRLqYLKgWiQLfC3PmM2wVAIiTG4Zv16lI651HCPyyJsLs0uTJHLHHeBBlq6oe0u3uJRWrMxUtrvKd32zBXasboKVrfEOTwKebxs1zNvlBdLJs3dvSgUp5MyCdumFkGRTgYICfvifAOyHshFWrafWcfBW9xS6eQ6HdFReNJj6jJkzPC8Wb7n4vt673+A9DVYzgesVSVJ6cgDA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i5tvwHrB7yvAXfr9jJZFfii+m5UJ2Q2hwXXHoZJ2Mf9FAHIDlBoRmA68laG6l4WgOxVQPdXYAWyufvOWPb37aGxTBEzWliiqNNYlm7pyGBHOh8BpaO22/uOrvP4kF66aR2P/9Z9wY X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: cfbdd500-02f2-4bb7-e2a2-08dcc6171e2d X-MS-Exchange-CrossTenant-AuthSource: SJ2PR01MB8150.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 21:36:17.3676 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yfpZi6S+EfDOEIz2DaQ7inkcg7RZqbXOhyHjeSWYeD49gp7Zf+RDzOD1VmonQc4UoL9HI4N+ha9CrJOER2v9eM3AGDGKTvXg/xQZZvie9EF4xAjlVxuDHXYpVnHpRsn4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8410 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_143624_573275_C382287A X-CRM114-Status: GOOD ( 10.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Changes in V2: - Updated mailing list distribution Add map_pgoff parameter to python dictionary so it can be seen by the python script, arm-cs-trace-disasm.py. map_pgoff is forced to zero in the dictionary if file type is MAPPING_TYPE__IDENTITY. Otherwise, the map_pgoff value is directly added to the dictionary. Signed-off-by: Steve Clevenger --- .../util/scripting-engines/trace-event-python.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index fb00f3ad6815..8a056c3574ec 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -798,7 +798,8 @@ static int set_regs_in_dict(PyObject *dict, static void set_sym_in_dict(PyObject *dict, struct addr_location *al, const char *dso_field, const char *dso_bid_field, const char *dso_map_start, const char *dso_map_end, - const char *sym_field, const char *symoff_field) + const char *sym_field, const char *symoff_field, + const char *map_pgoff) { char sbuild_id[SBUILD_ID_SIZE]; @@ -814,6 +815,12 @@ static void set_sym_in_dict(PyObject *dict, struct addr_location *al, PyLong_FromUnsignedLong(map__start(al->map))); pydict_set_item_string_decref(dict, dso_map_end, PyLong_FromUnsignedLong(map__end(al->map))); + if (al->map->mapping_type == MAPPING_TYPE__DSO) + pydict_set_item_string_decref(dict, map_pgoff, + PyLong_FromUnsignedLongLong(al->map->pgoff)); + else + pydict_set_item_string_decref(dict, map_pgoff, + PyLong_FromUnsignedLongLong(0)); } if (al->sym) { pydict_set_item_string_decref(dict, sym_field, @@ -898,7 +905,7 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, pydict_set_item_string_decref(dict, "comm", _PyUnicode_FromString(thread__comm_str(al->thread))); set_sym_in_dict(dict, al, "dso", "dso_bid", "dso_map_start", "dso_map_end", - "symbol", "symoff"); + "symbol", "symoff", "map_pgoff") pydict_set_item_string_decref(dict, "callchain", callchain); @@ -923,7 +930,7 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, PyBool_FromLong(1)); set_sym_in_dict(dict_sample, addr_al, "addr_dso", "addr_dso_bid", "addr_dso_map_start", "addr_dso_map_end", - "addr_symbol", "addr_symoff"); + "addr_symbol", "addr_symoff", "map_pgoff"); } if (sample->flags) From patchwork Mon Aug 26 21:35:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13778510 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F0108C5321D for ; Mon, 26 Aug 2024 21:37:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Km8og+hiPSrPx2C2G04skv78Rnp+hmQlSQWFlkL0/rI=; b=MrqEnpwz0mWL4rYmH9oXPRSGMI RDwcJ3SGDjwZiqW16aaPgkrMfKrr79IoLtPRFHDW5CRGtpQbWEOpQnmI6GRjQtcbaPw+oqAhW4n8J Q0fwFK7miy4kF3IPQZxYqdfFsp/ph3SrPhiKe8vbBNmweazoUyqyvfhpTWTqhLGDgXhCheLUaEYyS v8pPNJ63SzkyJ0mD0JLhYye8QiEh7/8qEIQQ5lTcQ1xIps2hUq7GuPU8e5IeGoc+4bwoGI6qWzmpm lNpTIIADLAqQFAwsWpCGy6Wkf+30rsta1xNSbuBgXGCJntOkeFe9XWcrg79Y7IQMv3G8qguo4n3QU ichvdw5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihOi-00000008q14-2X81; Mon, 26 Aug 2024 21:37:12 +0000 Received: from mail-eastus2azlp170110002.outbound.protection.outlook.com ([2a01:111:f403:c110::2] helo=BN8PR05CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihNu-00000008prN-1xgz for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 21:36:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tbAAnIBred+LohYXuP2aDjR+Atakde1rH0ggUQI/edveZXHwCjaQzsZDfvDhKvMD88z93ZIMDSwiqhTFe5YCEd9tCT8m9R7k79X4nLxx/p0ISXuPFKjq9gnb5vEm2sPTpE3CI483uu0KDl5/oeMeS+Dc3osiIZVt2j9+GIpJmVrNbPlUmdvug+r0ZwreLjWTC6RpkZfZI5h7EdtTASoLMhh6hl8hv9spFjJiEvQaiB4C9e7trvmGx/2GD5QVuzpBP9Uu9ceq9l8bTmJlXm6jinDFjFP4Gkmy9w/ICyKz7ORkueTRn9X6LtgLb7h31OMGfUv1gBChaVBtTO4L2XsCsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Km8og+hiPSrPx2C2G04skv78Rnp+hmQlSQWFlkL0/rI=; b=jiaslaN/BPb+rVO8sh5ZjaRPV1woyzaOxwVg0mw5jVqmOV3KYP2vLn3Qz+1CbDrsvj1ei7Nt26/31lFvOJ4TcwU4V2YWWWA1xF6t9P/S/uxtmCZuSpldVczWRuJ3vBEQR/OgQkcl6OBtvCM2laS32a0WzaxSmp76+VZPozQ2NiBN1nsDLYZ2S7C792CL+dTPMJ/pWtWZ+sZ3tbFjUZwWsA/bsYIKiO+zEhIf32j6P6bwXiINx2PjyGwfhEmuSPpRpekQZe/ZWC6ZlQbuMv3/ae8FQX8/xdPJMBA+bkJd15MT4FsvCJTDUS8Qr9syAVZwK2g24sjKG3wBGbwjUSaenw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Km8og+hiPSrPx2C2G04skv78Rnp+hmQlSQWFlkL0/rI=; b=SQOoDXKTuK8QWZcYbfJg3omebHXWPon9jE4EOS7VWz+NhzfOrB98aqPQWRjkF/JLQkPTtqzhMeKcSlfFJ5xcwN+58cW1TrVpImDKDg4a4U0nGi9bHAaWxzPYeRf3HfT2cZQ7yMbPSBoUJ5QmTrmgYRn2uQoiCh6VX1hLWGpGJfM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ2PR01MB8150.prod.exchangelabs.com (2603:10b6:a03:4ff::5) by CYYPR01MB8410.prod.exchangelabs.com (2603:10b6:930:c9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Mon, 26 Aug 2024 21:36:14 +0000 Received: from SJ2PR01MB8150.prod.exchangelabs.com ([fe80::72ca:29db:7676:9fea]) by SJ2PR01MB8150.prod.exchangelabs.com ([fe80::72ca:29db:7676:9fea%6]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024 21:36:14 +0000 From: Steve Clevenger To: james.clark@linaro.org, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@arm.com, ilkka@os.amperecomputing.com, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 5/5] Adjust objdump start/end range per map pgoff parameter Date: Mon, 26 Aug 2024 15:35:52 -0600 Message-Id: <7bbd5ca482b052d1c52efc52742f5c2713d5c26c.1724698250.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: YQ1P288CA0024.CANP288.PROD.OUTLOOK.COM (2603:10b6:c01:9e::7) To SJ2PR01MB8150.prod.exchangelabs.com (2603:10b6:a03:4ff::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR01MB8150:EE_|CYYPR01MB8410:EE_ X-MS-Office365-Filtering-Correlation-Id: 965ce373-0d56-4f32-d6e6-08dcc6171c76 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?HB2ZYvmnU+E8K1LF1Nb+MamugnYW9Bj?= =?utf-8?q?B8MTDhjkPQ+Gm5sC294RLgDx5XyQ454aONXYSDPLzES85dy2iumFeR53oCW+FwIVj?= =?utf-8?q?xOQp+pzLA7OV9OV6D01JYypwdzQTwgwrqPwHEVz+RjtNZn1Hwg1vthABW5Tuqi5os?= =?utf-8?q?b/G/AtRhBxZINknbPnthP/NTj9kQDvKT0qrONR7mbsH4hV4kivzGD86gDH5lGA8ue?= =?utf-8?q?uC7fOnpFO+fbZF31BLbtbgP8PRYJqF2Di4ADBqhphDm24SSVN9jPUfj6Gs6rCgLQY?= =?utf-8?q?Inf6IjtrSBywFoPgcltOxTwRbbDbhiWf3xnugusHYK/mzN3VHU3l72BMhtDC4lM1Z?= =?utf-8?q?oNMMEG+3GqvzN61UuHHqs5n1N/XZJar81pl8pafvTssRFB3WLw1tqfwrtoD65XT7m?= =?utf-8?q?a2hbklr6bzXLPigAW/r+xzNOEWp6e6NJfZLVIHy3cz0rhJsIBhMoXQfLEcquqgSe2?= =?utf-8?q?iVzTHOMoqGc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SstvbbSoxLOKqnHYZ2zw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR01MB8150.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?w0quG/lT3zMffbxVzkzVkV/Z8GZT?= =?utf-8?q?EKgCZW+WrvVmyjNOMRqm+HNqA5X8QI0YPXKzLAqY+OLkJPLE3DfOAzijjbTzbFcEj?= =?utf-8?q?0efVIwbQhFgEaoKFpPc+fMFV8pOV0iMpaMxI0NIRGg1Dk+o74DdQAosTLROXr49Ic?= =?utf-8?q?paMBKu5KfE0d4ourbPgOBbJEJsn7NJRVUclcQnRAfOLoG+V9YEp3dCpyulLWQ+TyA?= =?utf-8?q?B2jlELzqFOAx8VbKtazPH2dbaHMVZNZ7djp2hKDVV7b4BFei63dO8Om+TqnoyIfeI?= =?utf-8?q?DzLcr6nwcsEI66eUv1Ui93wXMJj7Vo1jE/rwNjF9mYjq7eHggu38JsYyjUIlDARgK?= =?utf-8?q?wc2WyGrobIJlL+W4nSNDSxBzhVspKRoe8Ymz52JGIEGnkW99b/SVEQtftZwxZIXcr?= =?utf-8?q?1DXKTl97EP8wh+WoGVkQ8RbMG3YXr6EjC1pzc70JUZxxJhNZGCPLqneMkvvbR12xK?= =?utf-8?q?/3blnqz18TUoVc2SJAfIZxSdDk8MQS6hUgDqY4z7vcCtFf6tImhaL0AyodpgK2Kfq?= =?utf-8?q?2wcHC4y6xhVweOtarq0CcT3qxy41iBKfeHEp2M25aROppFDMZvyxiPwTAg7eRDpAQ?= =?utf-8?q?129Lzwb9KiQkVIawHaWH7CHWR2niyiNFaccjqaFacrbYtwfegQYtF1wcgDR9slKdV?= =?utf-8?q?aci/kgk1fJnMBQP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i3GJlG37ExzamVpj6zbNdPIBjO3EHMtESuZRIj0S8BEeG/Ac0NwuxA?= =?utf-8?q?3jqfe7uBKvw?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 965ce373-0d56-4f32-d6e6-08dcc6171c76 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR01MB8150.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 21:36:14.4928 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BHjxdtH/iXuwn5VnOy0aEJLRC3G8EtmME4WloGckAt+rD0JGJmbC7pr2pdcXqdEYCZTQbyfKrXx+B5n2yEcomjGUAbadoXYsvdChk1YE5mFNaEM/lsed9BUZPX49WiP3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8410 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_143622_630254_F38847A6 X-CRM114-Status: GOOD ( 12.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Changes in V2: - Updated mailing list distribution Extract map_pgoff parameter from the dictionary, and adjust start/end range passed to objdump based on the value. The start_addr/stop_addr address checks are changed to print a warning only if verbose == True. This script repeatedly sees a zero value passed in for       start_addr = cpu_data[str(cpu) + 'addr'] These zero values are not a new problem. The start_addr/stop_addr warning clutters the instruction trace output, hence this change. Signed-off-by: Steve Clevenger --- .../perf/scripts/python/arm-cs-trace-disasm.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py index d973c2baed1c..6bf806078f9a 100755 --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py @@ -187,6 +187,7 @@ def process_event(param_dict): dso_start = get_optional(param_dict, "dso_map_start") dso_end = get_optional(param_dict, "dso_map_end") symbol = get_optional(param_dict, "symbol") + map_pgoff = get_optional(param_dict, "map_pgoff") cpu = sample["cpu"] ip = sample["ip"] @@ -250,13 +251,25 @@ def process_event(param_dict): return if (start_addr < int(dso_start) or start_addr > int(dso_end)): - print("Start address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (start_addr, int(dso_start), int(dso_end), dso)) + if (options.verbose == True): + print("Start address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (start_addr, int(dso_start), int(dso_end), dso)) return if (stop_addr < int(dso_start) or stop_addr > int(dso_end)): - print("Stop address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (stop_addr, int(dso_start), int(dso_end), dso)) + if (options.verbose == True): + print("Stop address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (stop_addr, int(dso_start), int(dso_end), dso)) return + if map_pgoff != None and map_pgoff != '[unknown]': + if (dso == "[kernel.kallsyms]"): + dso_vm_start = 0 + map_pgoff = '[unknown]' + else: + dso_vm_start = int(dso_start) + start_addr += map_pgoff + stop_addr += map_pgoff + map_pgoff = '[unknown]' + if (options.objdump_name != None): # It doesn't need to decrease virtual memory offset for disassembly # for kernel dso and executable file dso, so in this case we set