From patchwork Tue Aug 20 22:11:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13770612 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 307BAC3DA4A for ; Tue, 20 Aug 2024 22:16:39 +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=LWT9byCzx1h/F2NimXQpIKNzwc0SlRD8qgdi/yxbFJo=; b=dMYlBdo8gBvM07SFrF86dnt8oG 1suaRPa9YGPv/eX/PYjBTb1C4/UatyHT9vZeLMUA7YRBJK+2JvWFXmTIsMzqK0LdO9wN+J7Pe0n3o z8av2ctxOnPqNlSISLCjAPyM5MCif8p/pdJl2a0YHITdxn3ovrHOAB8OdTxJPburJOyQlGXrv74W/ MKYuTdzjLGFlx6/fl+tqXkMJ1VirppGuo92R8y5goYkY8U9kgf0TFzwfSrfjTtyjU+KrH0DSC1v0z hGRj5i7b3m0yasQIR5qavFGqVL/iNDVHhIHMDZMGfdXYS2uOKfr7n57JINSe6FV7/kdDaJLfZctXH 5E6nuOsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX9S-00000006n2m-2xCq; Tue, 20 Aug 2024 22:16:30 +0000 Received: from mail-westusazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c000::1] helo=BYAPR05CU005.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX67-00000006mCF-2orG for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 22:13:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uYET6vm6D4XTyJbO3QxC9F8b28LtmXnbuW0+4DQphz9aA9NBfO4Hi8iMQL87+qrb+2EhB9ILqZmRHyER/Xn6zYZMWZDSR58Ax+hL8qMGcoHagPAZswy2+0m86EaNRm1XURF24zGtPbf+wybAqZMappGWISLYdXvs619RkwPAtLeZe/8sSJLHMbl3t0yBmF21c4LtL18I2w4DTiB36RQGaX5t3T1o7bS8isF0q+JyUkLsGeVAR2qPTiJRRZRTG0L1ClNHZk6GIaAYnYzbah6Y88IiEAiSBzSn2Uaj0FBwIGrS5SJ9phO2cG9C4TGov+910GsKkaDOJ7cMnHFqac5kFg== 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=LWT9byCzx1h/F2NimXQpIKNzwc0SlRD8qgdi/yxbFJo=; b=antKFXNbJfSv2xn7KidxmB/n5TTRGc/oGF10ukOi48T0E1WsOPRD43VViHGg51kxuXi/1kvA3h7mUVHbhzmqmb8JYoUjP1gNm4Iq3IqO2ddGz4aEYL82WYLlTw0Nsx/JUapkrnun3UEDcfwm8s/X1bf7/igTJEtIAa/RQBU5kE7Yy72n/FTaJCnRmn583nJYIvwHVORAy1AUMBqYwMxTawgEa2YR221Xt4z0nCDO1I2z8OuhEHefdUFI2AEZ7TjmtOXLrjFLq6UCRcq19BlZ04aTEHd5djFxhyyw3MxaXVVirdZRs7xfx09x2kKa4LAbHRk3cSCcC4N4cDO/TmL3dA== 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=LWT9byCzx1h/F2NimXQpIKNzwc0SlRD8qgdi/yxbFJo=; b=aNWwGz/mmId69mq+fClgh1WX/CCHCYNAeb1dCy20xSFgoQyQ0yMZiClTfN5rN9TdwuAhV5UAp7ECknP5y5LIgMXY7bxeMbnMqOSttpMjlOTT6fDcynqPA41jXQYvjdiY7ey7KhS8gvRDFvTuNNrMbUQR5vWoPEuoswX3En7sV5E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) by CYYPR01MB8601.prod.exchangelabs.com (2603:10b6:930:c5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug 2024 22:12:56 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%6]) with mapi id 15.20.7897.014; Tue, 20 Aug 2024 22:12:56 +0000 From: Steve Clevenger To: james.clark@arm.com, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@linaro.org, ilkka@os.ampercomputing.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "steve.c.clevenger.ampere" Subject: [PATCH 1/5] Add dso__is_pie call to identify ELF PIE Date: Tue, 20 Aug 2024 16:11:35 -0600 Message-Id: <323e931fe9f8f080eb0dfc2e29d112dd7edf1fb2.1724104248.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: YQXP288CA0033.CANP288.PROD.OUTLOOK.COM (2603:10b6:c00:41::30) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|CYYPR01MB8601:EE_ X-MS-Office365-Filtering-Correlation-Id: fc0c151b-ba9d-4e45-63a6-08dcc1653ead X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: Wsir/4LbK40O9nFlVkRK6ONIHNQ/EQqVsWqm9Qx3lU5IPQvTwHvjyraGrtydMFNn1t8rzso9b0ntrESsTl8jpMi/W2TObJCspV4jRhW2vLviNyK1Xsk8FoQbXT0s4RHMiTQJAVhDq7ZxQo5Xqlp5JeNeKAbLJL29vvIqVDl1TFolHU/NtffZWNVHhp2h0NIMYGvM9MC0iZvbU5fiW8zyJJHnf+RxWWKBCf8FIxPj5qIl9QTeXEQHLJo/V07degdBDB/dy77s2UZaC9OvIv86msf36/ZKfoE15DxrFrzAVki2ygKl8hk4IgHyDz9qU9sq1c+KUVCrLJeEb+0g0d5I4AEWtYBXxGeH8+LmFgIYU3D9hL9z8W+E4qon7wBOG3VrPLOr6HeVQP4rADgLzTkHihseRkyFk/iIYCmVEXAZ1Y0Z+vTfU0c0kPNGw+ltAM91tkrrXIyXX/u/GBrRUMzPXZ/lKaph4sxeRguZZ7uhalRNOAvn5JHprG0dV+piVZu4RAwYQHkdq2tX+BZFV6krKnsWYaWjmqp5z5RjWzMw+tFiCV2j2XGE+M0Sihh5rbQnBGs/3R5nZPRpubBnENJatuRQuq9RefAvTCZGYJIBvFCQcqFliHz2bO203inyThtDEuMxmwwdJXKoniYUkhRN8hbVuVgjveYh7TOPVp68vrQcCwNxfZXuHtEY5um3NiFojvq0bVPe0M0FOKsqa9ynC5UP656MQKJgeBJ3fogpX/gIVJa7BCQ2uk21yD2x533RUxwKNcd7J88Ks6OFGSnWsblJF6gCRWQDBs3Am2wYEDAAMGDEESxiJP/FHaDqkyqhMFb43Nmognda7teNZMSMLfTVn4Uk6TJfF3Rv8aUes/LhWk4J8etfEXW8e5pgupjlQ4zSkW0Vl7rh0mcJbYHU0FhdFYUGLOUW2tWtcu4KeQOEPuTdjdlZAWzKKbjglsu8lB1k1C3eTCWbuf4m8N3RaAn4v5+/iGqM+OCX/Mhqr4HZ0WC3ka0v+hNqeJkOvDJf5YkDVTfqQb8GNAUEOrpxeWcXmkIVYqauG/9Hv2PHQ6b1fCAZFJomaGQyaHDBF6XhWkziGp5/WsHOmWVBJcK/ZBALvnBdaw7PU2oc1QMKpLe/gIQTSW9IRsIPMfngj/3C2HsoWrokhxUt7GSV+CIvedrDbd10qF0KBkkJo6mswTIxTbGD74Gf95up6pmi6X4C1csbXzDXxI52IUhEzkQD6DabIsUj3lj6PO6ehXt5TO9WM1LRMLP7fnafL6utfBGR+PQEAiTEOqDrxjUHmckGZ2FdzJ4On+DbclgZY76AxT/r+8IK6aqnMnU9PsqwX6Gx93FHpfEFgnynTQWWyKstJy0HXxT4Ex7Rp8rXaRVdcPCf57ho35DrQIVpe34IHBhTcWeY/6z5a7xFaMbye0pRkg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR01MB8146.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vp9Ky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QCD13kWWDGv4NrU26lb2juH4J+oVLeZ4Wdr4SJb2OmTxrI3pmtnpKJxFggg6DrtGXPDUiz8f/83GcrKyZXCnRuSlq43qJoF4gMNKB1uITI6QnGFD9HGi+QiR22+1dtzXoOcWqW+U8XqouskZxVuzZ/++yQ1DXk9oNh/ZAyQRswMmWhv2Rv7RS6yhcq6DZ4xvRUKpAOq++PZIjcNnNEkp3ZbzhVYwVPDdF/Jhjw6Y4Jf04KBXP/isMfKDAJibdn4gp/L9WAXbbK9RN9D/sM2lHAUdGzvhgDI6gnlJHmEBjOrRzkFJt7RsTDhnjIU54UsSkAclVbs+Z8SVs8LON9an/bto3IhXpmQZdk8I0BO9eYdT8CknWq8JMaHlgBsut2fVcrynnOmxDpoNv/HcnGzpa+A8q2bDxbU5ivpbc/eM361i0yFbnOxNrzcOAlaFIbBuoUoEt1Qv2wRdMcJUsd7xLPHp2wsOTEbfzRz8IDW0nvFKNggjHKcqqTsKJqbs/o05TiFSRFYzzI6oiaqp2cIx7N8S7f7wVeDC2ucLkFE+y/52tCZVMkeL2N+cJYl6diJIY0md7KEeWcRgA X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc0c151b-ba9d-4e45-63a6-08dcc1653ead X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 22:12:56.8273 (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: 0O0fNvdJdjQlD/XRgVWiDhzcSJrxUbO0lTYxd7CmebRuooqtckvxMuLgfgkIPT36YEpYovlRhYZ8VEf7c4+uHJgOhCWVkcZ1LB0/7yb5g2E6kdWH8WFQ555nGsKa9xo6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8601 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240820_151303_749539_44CDE811 X-CRM114-Status: GOOD ( 13.34 ) 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 From: "steve.c.clevenger.ampere" 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.c.clevenger.ampere Reviewed-by: Leo Yan --- tools/perf/util/symbol-elf.c | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index e398abfd13a0..1d4bd222b314 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -662,6 +662,61 @@ 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)) + return is_pie; // 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); + return is_pie; // false + } + + elf = elf_begin(fd, ELF_C_READ, NULL); + gelf_getehdr(elf, &ehdr); + + if (ehdr.e_type == ET_DYN) { + scn = elf_section_by_name(elf, &ehdr, &shdr, ".dynamic", NULL); + if (scn) { // check DT_FLAGS_1 + Elf_Data *data; + GElf_Dyn *entry; + int n_entries = shdr.sh_size / sizeof(GElf_Dyn); + + data = (Elf_Data *) elf_getdata(scn, NULL); + 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); + + 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 Tue Aug 20 22:11:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13770611 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 296F7C5320E for ; Tue, 20 Aug 2024 22:15:58 +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=iiFJ8MvfYUVnov92UnU3n/J++eNtloa8iiECuINsF/0=; b=UHV+hWvdFH7k+9R0XVO/0u0OO0 4WPr7hNqRQEJdvbFf1fjk3Y5nUpG5dB/A9NsnBm8Lh5vba9xvZpv0ImyMkKiXL6ERrPowKAcuAbXf cgkHPmAll+rA4dvwu4rM/XpUNDYwmJ7aP+K39KWXE0ola0JlzAn1KtSxTqjk4sS7vysGlp/0+HfdA YwSszJgZG4iSLiO4VskD3KOiEgmOuA3vcBETFtg1Hs4CGZ0v+05nFCUpnX8gP0tZkGh2L+baK8TxD 8Wlmu3T4LnoibU22EOwGJRxInThE7BXzXr8I5qSzSgnPgmUEoziD3EwS+C7RLpJQsKg7eBEFtJMna lrzfqPoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX8k-00000006mqC-2RTf; Tue, 20 Aug 2024 22:15:46 +0000 Received: from mail-westusazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c000::1] helo=BYAPR05CU005.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX66-00000006mCF-1GMY for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 22:13:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iGwPpCx6vwQyu7HLW5JH9jlf3UlVRqJqkeHOYcS6K7OigH3zToXpIP3X/LZbXe40c5c/stQWQz0gBfsKEeLupBTWnhjrsDAr2Kn4geeTSFHIAsG/Ow1enhbe4PB3xp50fasC1kGzq1a7PHy+ha1JJUf959wGOUzdHtfs4lSN0X9fEU9Etg+2xDg+z4UvO/G/LB8AgMdro/DuFUVIzedqrzceNI8CXSxaQSzEv8oRHhtCHq+X4KbX7YwntzCcu+apMbTeZsapNYq4v+bzwKUvvf+SGwV2+TnVLuJ+9k9fDwbekHOtLV/1xbG0piJN+qj2Nz829AL0bKjIYh9knTNyYQ== 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=iiFJ8MvfYUVnov92UnU3n/J++eNtloa8iiECuINsF/0=; b=DYV9xFT4JRSpHDWeIbFY/qKWnG60l1h+HttwJLccO+Ark+lKeagDCFT8rB2UhAedE1jeQ3PaY94fjlfP7UVwho1mpr2buOxI6Ydx07JUDaPDe75QtmQzf03KMe/myEzJq3r3TIHLn2jr9wS4+J6+Fw+jOoUArOniVPxGFyTM+l3Gbm1CRZot9uSdz2ypuE/igk7KhTdluBEnbiv3tFCrOEXf+MK0geL3DmL325+bnw3VuAp3qGVHClGbbeaHCarciqCn4Nge2HkSsuOCU4VZdnTQwccsqqUTC05liL4mR33jNcvrYOekCYEMN8fIapdGo7sMg+BBKS/Ewi7l1aE7/A== 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=iiFJ8MvfYUVnov92UnU3n/J++eNtloa8iiECuINsF/0=; b=hmlaW/bYxO69OlLYuXimmZSU6FzqnRHcEgBiL3mwXGruifj/jSf2k9GtHnF7kBIZFE20w6aecmvWekNxN9o1HjGSepoMZ7AhkAnTRbAjGN6AarAdb6MnZk2bsgEAZwupUFcB4g+NNksHGPHUOXpONwsgIUId3LMel4Ttg7lJY6Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) by CYYPR01MB8601.prod.exchangelabs.com (2603:10b6:930:c5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug 2024 22:12:54 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%6]) with mapi id 15.20.7897.014; Tue, 20 Aug 2024 22:12:54 +0000 From: Steve Clevenger To: james.clark@arm.com, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@linaro.org, ilkka@os.ampercomputing.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "steve.c.clevenger.ampere" Subject: [PATCH 2/5] Add dso__is_pie prototype Date: Tue, 20 Aug 2024 16:11:34 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: YQXP288CA0033.CANP288.PROD.OUTLOOK.COM (2603:10b6:c00:41::30) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|CYYPR01MB8601:EE_ X-MS-Office365-Filtering-Correlation-Id: 19020fd9-2d4d-4240-c709-08dcc1653d3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: Zbb3d6mTDBjvM/67VgJzuTeCadoDP5Jhp7b17s+FfWH/SiF1oC6oULnEXcxDC2aoAPXtgigjhYCakIU88Y6u92hHskuLbQ3HwqQtPD4i3FBMmUDteCptr5zIMvXSWhWC5iMksF5inzf0NQugUnezb5YDnzDcfsrAFw7jC5R0H/n5iXlbTMbi1S8nGFp3L0t7FJNjPFp1BfkcceFWGzF3IWiFFwon/GFIT9qSg4jWWod8a7yESmNGBxa6qOtzBdGbHmzu8IfAiE5Fdmm4C/bKhSfk9mULjv+efaRKh4KTwfB0RhUHUIodWvGLgEfp7O5vro1+i8y1AMWunf9bX/EDLRaxED3CV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kg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR01MB8146.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: k1Jfl0ygP+TQlaIR6qfRVk/TqGea377LGeL+spEx9mXpqHF9GE99f8Ke1hNRMFRHZgAlRuBLDWtTeSN2KC7F2fCwopv75YEz//L4Ru+UdJrIuCxzsFfwLu4pRTWe9TOlaYrb5AwgtUbkn9XQ9x0BfX3zrmoKRRAOUX9VKwDORLaAKUk6gLVRuU5Fv5BZ2SlXh9wqrIdDl08BtOWmQzzJOIA6y+2qohzolceNi4G1oybZCyPaDDZ5GSH46OPEo2UP32hulCgZC/EvGB7MvT/ETmi5Gz2oh7w6F13h9Zd68ltlMu5aNde2Bnn7SlsXRlZTD55h+/KWGBFt4wXq8tx6Zag4DMWe6v4Ht5SEnuBMdBv9BigYgYR9CG6lHQm5e7MZ5Z37qwoTzX/woRG5FTCoNMvqJ7P2kLbPpLzhUnZJN0YIv4aQi7MazKEiOhZvoWeat3OviSAAcN7XRcbE08PAKBT1wuL8zsRu99Riu9yeod8DUI86l1BLDGiOyoIIK0nV82doTiZBdqOhKpuzKxWQRJtmD5a9gLbove7Asqx0hNsrFWiYoNPt6PKja0EVAu1FsOo8lYocn4v43aMdemGKyjSuur6D62ShqiR61/0D4D2dd5jT7Psh1suKjaFDmpqd31r6KPrxI1OinJrGv/NFQSjB0q2z+sX4jnrujEuYum8lvOGtl1TRQi4k3Lq7u3ZauRN6YbcOvatTYGhCb0eJCshvW2bpr5xwBSUgvOzkA4RXnoKmIDLYIlKUPhJB4z8TL9hOHUfPAf887aaanq9scZPYQ6xcvvoT9dDHzvvkBoplvnNHeRYdtlkZHZ1TRywoz2Ns7cFkvV622aiorTKXo7QXU6gvnqGl/T6tQpdQ1jDGT2fM733UqTmHvDkm560u55FxxzE3cUfVmH+C8Wq+neOQCsZXJuFXL+Nd9r0t2FbG6a8J175FQ/g6LrCpLfN9BYz2qiDaQMU2QzAKgdjAGVaxEnDQHYwdZG1+gW0T8t8YAV8Q0pc0qN+m8JhQY/GmbSWnyhiqEFmF36g3DIhIJCyhTs/YbrMUn2xE6IRKR+nCwI0yELxfSRP92k1lEtl+gjCOtoCzEHphrmN9RtEkK+oH+Ys/8vsEevnWQf678GP8UaOy2S4OqKdi7EsTsjBH5sZSXnGbDoGEOd3nmGZYF1IQInY8oGzBkcF2gnZpAs2EJdP4C/6RTZDK3zHcmaCyOOMNDppb41MHpAJVVHx9pHTH8YUJC8E8Wq7f7ciBzY3Ar98PXJWM/un9zdwW6TwVs2HhlrTR6i2P2vlz+iywaj+qVVYxt4azYJJmFm/cE33xb5zfpRPKBhhKw70ev0AFLWu0eNzcaCvUjCVNvEJZzRrrwFeAowcig9B+dN3ExgxHpaL24YgZeHEmYVbkuf2aExCbJa47jaWCGgsqhbzAZkhtMseHmIZaLn1fOX+kZGY5PmDF98oEgGSW1eE8Y+zXRgNbsAMVT9xIj/Hw3NMnDLlsQZ9kqew1vQTEzjSs004gRhT7b1gHkbDj4CsxzHu8cOdH1LcaxVd/TaXBEkLqTIyaF3sDrWaie3diB/nTCju1eHrhtFc3HnD2f0a8AtEz1ym1nPzXzW6Vq4jdwE5sBESdnNOU1+p7ar/0hOwuihYa8yuNo1Q/UX9ejHDskEU5 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19020fd9-2d4d-4240-c709-08dcc1653d3a X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 22:12:54.4836 (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: EZYzzWj8GojAIortXRqWJDZpXd0zztyZfmh5WO3AYWdDBeBr/jOtXhKpLSColXoTPNylIp9HsZORBo3L1yrZzZk8y+1pm4dB5K9p0Bj1nMIsCFE+XUiYCOyszeViQPxl X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8601 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240820_151302_375628_1B1CCAA9 X-CRM114-Status: UNSURE ( 7.29 ) 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 From: "steve.c.clevenger.ampere" Add prototype to dso__is_pie() global. Signed-off-by: steve.c.clevenger.ampere --- 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 Tue Aug 20 22:11:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13770610 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 7F629C5320E for ; Tue, 20 Aug 2024 22:15:13 +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=hnKaon/i5khsMvYjzdfUM5lmYxTQtdiWRewc7JQ6JmM=; b=ngyIiWw9MWGYYH9UK0KpkxjCpv CvZ9OrQBA/5peRi0b6WAwEy1nX1cggottyx04T3o2OD6BKKPORNoWSlrwMzWfBTLkoNonzng3laq5 FmXRkvrcFVc4YIWq8xMwC44mzGcmzrLiAXvxP14oCxds5NyS6j261zm2EnzJGpcy42ibAZbIJ3DD7 0zRAYJUVZk5g1nuJoJdUWqAThfhQrVLDwtJ1uITt0+lmosaexJlCJcnXz++aNZfzj3GzZOH7eChzT 16Z1DkHkVjyOyFzsvfr4H7tw5yCSgOemlsbNUoeOx6ahfEAKLie4xGMnAZDXB9sjNG5pUps0IpNrN G8ABfNqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX84-00000006mg5-3UR0; Tue, 20 Aug 2024 22:15:04 +0000 Received: from mail-westusazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c000::1] helo=BYAPR05CU005.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX64-00000006mCF-3Qdw for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 22:13:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=a8aZDxJW0ev6YWRqfSohfa4BR3FNcs+JD8qGKWx4M9QKn3S3m1Wy0lRjxj2cq43hoF3Y6XGaQUWhSSJR3WQ9d7jtdpGiMu0kbNhlmzSx8Ok8MfT1hc+4igQNSPOCH7N4SSREgD+TNZyVa3oXNnBwdBMCUeTeUufPjbbGHZ0Q6ZadE1XkUL4BVarM5kzWLdr/03EBWcMeSiZ+5LYOWAiUUCyDxWlxLr4MlranYXUc8p6jzOlPK4y8e864QaICasC0dL2buaklGiXasPn5i2y4CpeAx6RUXSgWfLl/xta0LK8KNvwctM/mBF/CMUGmKtpzKX6oRBSJNEpLf1euM02CNw== 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=hnKaon/i5khsMvYjzdfUM5lmYxTQtdiWRewc7JQ6JmM=; b=ec2I2blbk+IqM6SUDdd9N57WNjf6vcJQrPIxskVGfCgeWDqhIKuK2xsXojSZFvzX5i4l7w9ieDduySTmZD67VWLEnwTtOApRUielWy1gkyzkighimUQ1U5WIbpIAkz8P261WUwWgs2mNNQ8sat47ZBtsFm2JkZkEKuXdSo0Vc2MfARRc4bwt5ibnSeT/3RT4P8SRW+QlDEjZ1HfL+x3U1H3YHRP9FeTCqf3eZGnwc8DaBgAAh5A9sO3ZONZQzW2phNiCCH4DMZ+Fr0H2NNRfdhLPnkDldY4NlksoCk669uZZ8xfBTcrfASzTHubYFB2i3Ay4+4mCbI51exstEzhjRg== 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=hnKaon/i5khsMvYjzdfUM5lmYxTQtdiWRewc7JQ6JmM=; b=Q41xTiBrKf1LMoiAUJ9bveDrAiAfLm5BkC5HmIa3wGZwgXQHXfyorRP0LTaPAcYheHXQu1Lc1oxEJ/Bnl9LFfnZMiKK8KqD2vVacUobKfB/31pO/hWZkjnS+xhDV9uuoNhSiGlTHOHBIRLGDekZgarfRRq7nLLJyuWz7MruokUg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) by CYYPR01MB8601.prod.exchangelabs.com (2603:10b6:930:c5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug 2024 22:12:52 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%6]) with mapi id 15.20.7897.014; Tue, 20 Aug 2024 22:12:51 +0000 From: Steve Clevenger To: james.clark@arm.com, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@linaro.org, ilkka@os.ampercomputing.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "steve.c.clevenger.ampere" Subject: [PATCH 3/5] Force MAPPING_TYPE__IDENTIY for PIE Date: Tue, 20 Aug 2024 16:11:33 -0600 Message-Id: <95df5a08acc2c87e8ff9e374f9ae1c56cdc59470.1724104248.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: YQXP288CA0033.CANP288.PROD.OUTLOOK.COM (2603:10b6:c00:41::30) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|CYYPR01MB8601:EE_ X-MS-Office365-Filtering-Correlation-Id: c74c6fa3-09b9-4f21-e66e-08dcc1653bb0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: cquTa7cVo/m9tg9nPmamJxEBSrgm4xcCoYIf7BlWyiUOnL228b2s+6MINac/aCtgENtPhQh71kShQlTLlVUYC6SPsCkJbSff+UM/B0ig9XzSPf3bo2RsohWX9OTjztaD5+PJ7KwkTDRtPnu9LUea0kzP/eaNNA0/VACOaL6lIiI6ckzV1oPih1m0ADZnMg3FKiR+p6EmXmQoIHNBLtrwdZfaLHeosagYSqIw5G1Dwl1TmHpEo8jsuv+GOPuja8+MKpUUpnGM6VCy+EVP0eYTTBVHD318oyy5GCwibFbSI6CUG/+/PIDGQzi7z0cwSdsYvJmPBp7zNI1ohPwnF5oroKkuX8E1X//P3QgSgPxTFI9pleMk1hCcZ7PV2jsMRzjIUK/dvoDuejbhT/Gg4lJ2e45RC05gfGJQA71CV5e33/dXr9BrJXfHkkD5JLnUiwvcgjbdBnV6sQ1lsWuVp1uhYat57nbET3DVjFjibmST6hZ1Zf4AN2mgBKPoqsSPyUS0tj6rTtkqVhZDDeMJvqIhl6sDgQe3Bu5JvLYUK5xdM4XKIH+yHSdAvljUlOfJTva3MiUbYvzBhbA+ZUolINdX4PN95SiG309xpBgDBhzm83cEhejePKMoYfQRjHMsW9qO1mPcul++PwTtyWWvpCGzM1WTVba/W/8Etch4HGbgXzzF/IDxdvxGMs29ELbo7z2mSlQjhKTTgMdAiApchuxVMCvPL1MHRUmftgarsQSWuiXlchef2ndWNMT66b58SXhptzwt4MwdBHg3CSUtc9OuoBNd8qe6F0ijPY6lTPplZirFJ6aatyDWwiCpTisR0zJf6LosVE+GENonyNNzIXxFaKqGW593r135Rbg/6zShPc/C0H6AQ7ZoMHIaeFIQvLkCAhhF9EHcg8m6hHHXj3eDj1h9KN1dgQlqhbZtsyLlBcQpbbUiJEX3QDVhLk95ajR4OyB6o8O8sSvd5hXVmgkp9TA1k4Dmj0k11GJVUJB3RyePFey6Mnav7ULYOLSepMeJpon2RoxvaG2a3TXhWHTWM5I/H0t0/DHTzI2fEcSWl1MPIkkQwdv1ZQyDrVtIcjMPGTSGTrr5I9PYjrp160/62nLwMP5WX3Hs/mRsPoLwFGBQ58qacYGlJTWISgsm7xvj+PouLvEVhjQazwyUQGewwMtHjFXt6wGSOAlWqP5x3KuwudLNBTN+0q8LUjQNJEtzq9xpCBDQSBC+GDwdH04UFGuqQ76StLFR4quYrPFYQbnhLywXnZg+hq+ScuK+E9nnSWTWootnh3Ve1GAZR91TOfjkg/8fEr7x3PCukIqzuz05RsoDN2WF0ievpjoMi8fkSfxXPMryJa4cerbr8CC7EMaZats2aATc9HFV24NgUddTqs4i0wq24bToaRonpuR/bMq9zdgBuZmc1igTHNrhKg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR01MB8146.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TPoN0oDE22x64H/9mDQb9MGEQXNRFwJZVqR+J+QDFWi0Tl34C1CZ4pCoh09PZAXe3tlUwDD/3HHOF7EuzFMZhe/Ka6VADeA4JpYYSVV2K80/xEJW5ohYfeznCOVqWdYYlw6cfiwJrAlktdg7xdihHfea8O7mjJ0QdIDXtv37M7ORaI5LGKcB5m4L64aw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pzP/jaY+9QCWc5wFfwPHHzeckHiX3lkDzj+8tOKZN28k7J9KtrNTqtagDrl/Vx/e2rmTgj/QomPFX4vWWX+IgujsVg7t+IAIAJM6oPi7iNyGNAGEn+EcSaiSdXOgA/p4UY5lw6m5ro/X6unYnid7OJxB2RNyXTzItV4EZ2MqHqoHav7QgYyGO8mlrUvaAyZH7Q5ukESwStTdUi/sx39DC7f+7rHqCvDqS87uXLPYd8ngjEmIHVNa2zObhxe0WE8z7uyJ97IVU2oaT/fBBMqXyKEZ6FfOhfsskYX+ZFZbLxAS4k89bLFsw0nxHg3swMRPa9VcVfQ6fATHMYj1TtnoEJiqirDkM+S8e6F+FmP7F45xdlt4FEcW2VetZKVo7D9jfUeD38c9u7Hj7Ij4ETJ1Tsx X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: c74c6fa3-09b9-4f21-e66e-08dcc1653bb0 X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 22:12:51.8913 (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: Ymjk2DJIFpTxvrIYlAhVTn9iTLxaNYW4dNBob2Gcn5gC4/NZ2Ws/lfDXJcnNCuNkJRmtqC2ACWyQcttbtsVa3OmWea2gUbKDfcTK0y/71fQ3zQS/GuJFBI1QL5nypg8W X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8601 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240820_151300_973875_CB469B5C X-CRM114-Status: GOOD ( 10.67 ) 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 From: "steve.c.clevenger.ampere" 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.c.clevenger.ampere --- 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 Tue Aug 20 22:11:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13770609 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 6C9ADC3DA4A for ; Tue, 20 Aug 2024 22:14:36 +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=Pf3ErGzbj/xReXHB5DO1lBmCdUC2OrZTBiWWMTBwIS8=; b=IpDY2W4mMPlIHpm8SqZ7q58fmx osgTjmBu9JQOlgvsyeudUvMc3lYgV9WYGt90Bh+rL8tD8D1SqVDD/U+Q04w+DZJ/C7+vfc4eE8n3h ND0sG15dReyZZpo7KcETiKWbgIZ0YQOJbMlS/OL1LtXswv/7w82NEZI9dhDB8n+LEjwvuv79Mp7Qr uvFip8PNb/0lM7Cg19Y2IY+j2pIw/4UVUDE/udTY6NNFnDo2mw514Knxg3VyukfE6zr/q5YgEhPsW oltAdqqXd2dizNwgrkrhfKWUl+zWaKjeDNf3TC/n2gUIw7przIsVVwrj1QGvARmeMVp/MsfIcTJOW sj3I95GA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX7P-00000006mYv-3mCG; Tue, 20 Aug 2024 22:14:23 +0000 Received: from mail-westusazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c000::1] helo=BYAPR05CU005.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX63-00000006mCF-1Yr2 for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 22:13:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b26b5FRy7zCcVZ1IEo07sXQ+Tau5gg9J6Nr81g5cnanB+TsWlegTRtyB9V1a9RsnKY+XJoD6MxQq101ofbsCAUFzmCNt9wwqzqNP3/3B+2KyE3XDICLx86fu/fLGBG+ZcPrzqnzekBKhwDUzh1abXQkBmtNj8Poo72dtlpDnKsdRJqAaXmTV2gub2tU6ALs1cM++l1+1cYolM7zu3zAtMyxH0rSmUhC4CoEnJh5lX6JdsjppBBeC+7DwdRk3cLZtSGGatMSS0Q1QuZkOjiudsb9sbk+RiGZhY4vJeNu5sGc3OAmWXdIxOshUDBp+NAbZXXEtwOXncg0S75MzCaC7TQ== 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=Pf3ErGzbj/xReXHB5DO1lBmCdUC2OrZTBiWWMTBwIS8=; b=D+Fb9cvmHORj7L9brgZPyoO+1SNmIgccACQNJy/F/7vBc2ILOji+yKmvVJ6q8CVova9tWr0+OD/eVk+wpf01JfbV2zT0Vx1crr3962V7r+SCrRUDDF67IHCKau/maNWvsVus0zYMtnkC6ZV/21EEZEElx9WccNNLdI8rk4kC/1lM5E90lVYyLa5IfSZNTy958z+ZtwkDLDIAH/f+/fdqly/+uLSgY2n5kmSa7WiWb+F1YaO7tjyxsq8szATsh4Faf0rhNk4XWGWZ8NXSM6CfpY8Yxndr2i9AK3huTY7ArhWWuY/g5JMGNQJstsbgofe4UIpZlye8ox5t1W2koAgyzA== 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=Pf3ErGzbj/xReXHB5DO1lBmCdUC2OrZTBiWWMTBwIS8=; b=b/RaYsxE9MNxPrqc2Cml/IeAIM7WgC9O9xe+cYVIA7FxsguKJuSEH+dy7LqoSOHN6fQLP5pIRUArEUPY/zjlTWpd0Z2uT2PiQ4j0+eic0T8SI1sizCEL82ZRbUCdAAhExAXtgb+/B39wWy17Kn2UJSjKdXCKSdelHWBAuVpIgKw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) by CYYPR01MB8601.prod.exchangelabs.com (2603:10b6:930:c5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug 2024 22:12:45 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%6]) with mapi id 15.20.7897.014; Tue, 20 Aug 2024 22:12:45 +0000 From: Steve Clevenger To: james.clark@arm.com, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@linaro.org, ilkka@os.ampercomputing.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "steve.c.clevenger.ampere" Subject: [PATCH 4/5] Add map pgoff to python dictionary based on MAPPING_TYPE Date: Tue, 20 Aug 2024 16:11:32 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: YQXP288CA0033.CANP288.PROD.OUTLOOK.COM (2603:10b6:c00:41::30) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|CYYPR01MB8601:EE_ X-MS-Office365-Filtering-Correlation-Id: dfcb3e25-66d3-4ce0-bfae-08dcc1653803 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: J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UY1Y8AW/Im/zVkMsZJt0wz4CX/ZxVSiBmYUn0fXex/igfeZUCt2QAyyzKfZOwwrbhqzJBlxHN1dDXhbNSoEOgQK9DN0tFm05WHjQOiV7zfMKPvXK9qqY8cxOgTP29aG5nlMGcelzE0+i4nE/2WvU/E8vmiM4k4zIDlAaTPlAq0DX8SgiTBJsBl3lOA1DCvXVLA+ZzrfMTY6kq0nA+Vi6eukwByoa+W6XsyKhj/wN9/b3WtkHHGJo46Kaz0YBmpKJFSTOH/km+sNWVsIYSOk8b1lSkSbQjoArawoTL/a4pUNKLp50Afhv9/yh5DjgEnp1jySqDyjWwyh5EfHgzhlfvUw127tkXVm24boOGA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR01MB8146.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qYhOdPBviZXJc3Lr0/vdbV58dFbRW+cnuF6rw9dQP9ew6LPAqUm/Vaz1CY0he6V4oF+rUynBU7Z2wYSVdta8l1q4fq9976TxLYnIEenqufRiWYm5FsQM6jvx9G0X+k5lK2GbFRXlBv4ayDESx6ZPV4uKQr8pMDYiG8pM6JxKP1P387keEpLirPz7+HVOwHEIVvqO9cAH12OpdbIR6JLL0z4OO1C/U+/hbuoB34i3S7lmCC9FFOMs615QMcCqigmaHp4iG/L3adrkZ6cEniNe+03UbnNGgxMsv7ckGklF57IhgDp44DQqGMObGPUC/sOWJrRZPGcIWL6eH0+4V7gTBtTMRAsJMDQAK+FHACzFx8vQciflTRBPCZZj8HNI+i4vBtXiysTHS4FhuXQJf8TP36NltLXU0LAipyELsV3fWFGrwAdg8pYIlFjh43/+qI3YRCGFWaA8ZJ7Y2w0c3eaH6P6eVeBj6Fx4UMolsdR1iN8Irx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7RfR5tJjJiONsgsUYMWcZw8qYHIgxUxLp8uIB5tueP3sakKuUHMBtbzBYFqlhsD16dvCpr0CuiT7dWETzlElMQr X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: dfcb3e25-66d3-4ce0-bfae-08dcc1653803 X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 22:12:45.6792 (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: j0Mz7L2AXNTeZxOV+DG/Y844JVsEZ898HHZ29USoQztxtP/pGp0EnBxV/3YhtVQszaTqQlgCK13FMa8ghwjbqranb8YMmP6X103huID3ylvrTqhttNvgWUb1yJmDy1p2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8601 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240820_151259_455620_2383CC74 X-CRM114-Status: GOOD ( 10.71 ) 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 From: "steve.c.clevenger.ampere" 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.c.clevenger.ampere --- .../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 Tue Aug 20 22:11:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13770608 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 3FF64C3DA4A for ; Tue, 20 Aug 2024 22:13:54 +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=ZFvWZRecnX0N1ux2PHO8A48Q6TMXZBkQUslN0TESaiY=; b=liLaKgIyZErFts5jaOBFpVM3B4 XDHVjH4F0XGJj0958fxbiCXL62JTnSduZW5GKgiUjTltz7TSUHvizPekxdZdVeOGrZ0nXLicpjJDu SNHXp/5RAMxr5VuLfK6zO558VR1zImwZgUKDaH38FpiebesejFHuv/y0ErLsXFtNE8Br25mbI6oG7 FkZyZgzVsX7TnQ6JM3j081IZ7BHEkXyBw1QaW92giggfe5oC2RtctnVnbpDWOYm0lUIf+sIjf6h9h SQxPDWtUKE6WpCy+wy4HdpcRqxr3ga15XLwuya9JQhlpmkWeaUEQf1P3FRCUj8iuClHcegFtMWUTj C5R/BmaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX6l-00000006mPa-17s6; Tue, 20 Aug 2024 22:13:43 +0000 Received: from mail-westusazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c000::1] helo=BYAPR05CU005.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX61-00000006mCF-4AO3 for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 22:12:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=I5yM/SmJe6IK+h7HDCFXIxi+VgUX6YRyqeDvBENgf+P4OXoIpGy0+NL5WUo8ROS6nhYQwF9nMfuI03QVNJym0BzwQDkKONqwRNO9bS7L4C/ntwX03B6HcmHs3o3gF2TRf0lU37PumdHWpKZbGt1x7XXFK5KOJMWg/Uy5PmTcreBRXB1BknOBaSn05RPHz899/AahN/oZRgLmVSkGphZGDB2zjzQqc5iGP5D1leUjsBFx8drgn0I/j0TZ96gcwjUP/ZZElMHdPLhfGKE+Q8u8daetyrZC/CzuP6xAE504r5WR6IbTrYe0kD1fb1d3wHa7u6JRc6lW2yzDn1a2iR//TQ== 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=ZFvWZRecnX0N1ux2PHO8A48Q6TMXZBkQUslN0TESaiY=; b=Kg+SSW6zH1eQAkDEq6mmcYQVFuh82qkHVsXn32Bswi5jMGdfqs5DQV435sQNcwatTpSNEzxWXRmzVP+HFbU4X5UP9o/RDqaWaDpQwqG3Nkl8dtkAXFtcdAPxw/4ZzTVb0K0MyAedlJpKjNYwHsAuOmH66ZsszosMe5pexftpJNKPLj9FaAdg60EmO4Y8QHl3Jq5a80OfiPpLIs5n/S24e9Jw0XewG0fpyxhnin6tqEABscIFSVFfDeBNRrL6p5EToO7U1ChFGWlgx7TxryxhQlArssxKx6JMVNzfuzhn+4AUxb6CGaJKKNB6lHJVWknozXjrUTHYoedb4m2+UqMv2w== 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=ZFvWZRecnX0N1ux2PHO8A48Q6TMXZBkQUslN0TESaiY=; b=ZygTGB3ucG1c9YB3j7BavIv4lPra2HxicUBFk8uCis736Mpeej5QUs0Y97Mm6o+VB+iKcVSj96Z4n30gl6scNjPuM53YjrQeSVz0jyIeLxCe6O9PbudMYbePtz/sNEBERkmg3pXK1y9J/s3PHAWxhJvS7M1aRjHmT7CJCn4fkz0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) by CYYPR01MB8601.prod.exchangelabs.com (2603:10b6:930:c5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug 2024 22:12:41 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%6]) with mapi id 15.20.7897.014; Tue, 20 Aug 2024 22:12:41 +0000 From: Steve Clevenger To: james.clark@arm.com, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@linaro.org, ilkka@os.ampercomputing.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "steve.c.clevenger.ampere" Subject: [PATCH 5/5] Adjust objdump start/end range per map pgoff parameter Date: Tue, 20 Aug 2024 16:11:31 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: YQXP288CA0033.CANP288.PROD.OUTLOOK.COM (2603:10b6:c00:41::30) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|CYYPR01MB8601:EE_ X-MS-Office365-Filtering-Correlation-Id: ace6a6ac-e831-4fcd-b858-08dcc1653560 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?PFj5Bugl8edTYjCSAtVTt5dbIDsY0aZ?= =?utf-8?q?DlSyQakakCaR7WE0acQJLNK/FmSr4HJh5V7t8ylCFcBOIlHMVsnoYtT+B66C2kH/P?= =?utf-8?q?+rXBVOo1F5JvTzq7LZpovCMY2YvhIZ3U6Kj8Pn3KI0qhpTeiNZ5zyvd2WPmGaN3vR?= =?utf-8?q?YdMXyX2E9U5fTaQuEiA3bv1xqVpUTnCTcZD0mC9nc1nZyWyC8NgHXPiObcpRhsfkh?= =?utf-8?q?QdY8ylWyqkD9TXKm9yZr+nrhTYtY+ZBzhvqjl9Ek6N5ZzDIPBkqAK7y3kuIsKWp3h?= =?utf-8?q?HYygxd91vX6w3797LxS8dy90syVBnGrF4JNUbjx7paR3b+R8xm1pz/robx3Hr7yUA?= =?utf-8?q?mBGwuiUEnWymyPmU77zVw+zNLD5fN0SS4Ou9gnkvn4PXwDZFYuBnRBpYKM1LhOi4B?= =?utf-8?q?yRlBHu5hltNFEW0BU1ufCdyOWmtfLS31wQS9uDIoyfTzD40WnzKnJ6rBD5a4fHoeP?= =?utf-8?q?jrNwpBKBHbsigFo0LhKCAKq4kqy18ubZlRNITNLJ4sjaNhMtj0Zlq1a3Gis3DgJSE?= =?utf-8?q?o8/p0sdpUGuZptoKBRQ+tT1aJWTubmKQFClZ83EHZv5IU0ga7LHtTsNK076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.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Nt3DEs2huG2ut8vZLpxHJiPBYSlM?= =?utf-8?q?s4dsQYH+WmzZ/YPItrQR73h0XUmzHboJ3nJzyjFPpHrYEUSLjPkwu1H+kUHi2DT5W?= =?utf-8?q?LU12myZHBlr1HGjhvuZqmiDfhPJ0ptNmvei5jEfsl7OqHSK873E89OzAWADc6iCns?= =?utf-8?q?ikB+GlrUDaRp8fRuL+ZCEUZ3M7uPeYmGxq7/iRXLvYSFct/tEHKpaQGOLbW7KZH5d?= =?utf-8?q?mlBEGwujGTFh1Sbg9dbpqvSXLb+RdUld8Pu3QA+PKFBJO8j3/EeuI68SEyAZBbDzp?= =?utf-8?q?7d1jUoiTcb3ZfIyJ5OqhJE5RwCMY4o0dgijNvZy7f02oX+jeSJ6Ni9jhKL1sIm629?= =?utf-8?q?A8kRES2oG/FJlOdVhQikuUo9EY9ki/YKxmPinNVvjEnuWakIp8QtyLzSwed0tVzR3?= =?utf-8?q?1KIPjB7U1ywHkb0fG3vgx38q0m2/65OXq+gj14VyjetZthmAj7t1yx84IhZrR+cNx?= =?utf-8?q?ONnimFiF8FoKSMXNMmdvmYnTqjUzkBRs9whAOESGm92B9Cd+J2KWf4VPQkFjSXnnH?= =?utf-8?q?2UJOofqCbJ+pUvj0rmKGRkUh/Bg+09y2anzIkNl7J5W16yQI6bJNOV9z58kKvoIRZ?= =?utf-8?q?wYBmE0Xid5JTzeVgrrIgj20npncaGR9LZ72cO6t9fzxSKp9OBjaZPDGYWNkvdxJmc?= =?utf-8?q?pUKgkli21+125UDoZE0aJGUpcalopuWOP2NP9gscTfWDhr9WWC5fmlGV+MUp8i8H3?= =?utf-8?q?rKFk1kJo2wYiyqZEITywfmFTF4D8tDIDI6On/YZS4fXQ9XHk/JB630jJcFRZ4BqNq?= =?utf-8?q?u885qiQRnZ2evVvz7KxRoG/MTycmJS045zuMksd4GOS/3dohBC/FqtZhD1Ml2XDVs?= =?utf-8?q?mSNYh0WR/RaoXfkLQ/YZjfSZeXkec5jkY8CF9Hzm5bNYwFYj782Zr+euJWfrQk8LC?= =?utf-8?q?XlOkN1z0y4xkh6QKFh6C7McFGcmIB/L7mKEDwamliAEIg+ApKvGdwy1GhRADmKF1j?= =?utf-8?q?ZklCmpkCCvHndxrL4dwRO1PtsVyLI07T8wWGjYAXkYkhqxktUQ5hbZ74P1+CVTb55?= =?utf-8?q?AZ91s1qxTzV94UnzJZrDgK9tGF4DME9SvQu3T187/fZQ34msX6/tGD27Tf0yP13an?= =?utf-8?q?ZXUlh0i7KpaERsJ0ZuucH1smF8Mb75vf8RWzBimKsl423P6z78pM8uRdVQMrNz57e?= =?utf-8?q?UAuEKRvyk8pP9JjzWx6dOq+54cSpX/6VSnFDaBfoMbW86Bcn1paaA38U/WYODw59L?= =?utf-8?q?Lx5Mnnx6OkLDDisPhQWUL0OwkIKiUzBhXWEb55xWFpJQdyH9HeS22Pu8d5W+HDuAZ?= =?utf-8?q?5p5pC6xVpjTO4/xHceHXmC4Xlv5t6HG0FqAVhzlApkgxa6D7AUmbaebyIuaMmQ6Ek?= =?utf-8?q?GmYCER1HfX6solpChBwaYz42A97MuZ5P4l7gWl02rsx+7vCmdkqTAJDKVu9qmCIO1?= =?utf-8?q?Dd9Hmcx54vI4JjKCJBRsR1iXUC/7FXNKIuNzABC4oMmKvrl9WM/5vvRiVEcVX6E2X?= =?utf-8?q?9CC1BM/YarP3m7fOByRsu36sBhMCJ4k2nN330sIVPz1FWEuiMiigSax4F1Xv2lGFY?= =?utf-8?q?qk5u1IgXkniYqMtTGNrQPAfTjD78dz7augpKe39QoUGAzt6EsY9mfAkSeVsGxOJ3V?= =?utf-8?q?O4dlFzW72Ma?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: ace6a6ac-e831-4fcd-b858-08dcc1653560 X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 22:12:41.3591 (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: i0QybbHsH4sbKeumO5acDM+BcGTJQjN7HXXyftPWg7Z8L3YanpVSF8JtIcAALqmjHXpzkacVqkwSFyxAUUZOK28hFiaES0OfwSGRE7uSLaWYFdHEIGvecQHYcgJWcciY X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8601 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240820_151258_057213_152D7FAF X-CRM114-Status: GOOD ( 12.55 ) 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 From: "steve.c.clevenger.ampere" 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.c.clevenger.ampere --- .../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