From patchwork Mon Aug 26 21:35:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13778525 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 7B367C54732 for ; Mon, 26 Aug 2024 21:44:27 +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=dF4CYNTIu0NqhJYudqQhlCpPTWvHVbPzYHOfnd9s5jE=; b=jPWBQwRiJDV1lHoxPUkcxlbC0O zWRntUmAKNqRcrLJIkvxcLMxzfg0Jo4RHcOvaFYFBRn9+ovALQc8qcD7+UxcVDb7qwH9Gx06jAN2c 1kKjfioRKQHhapxZ+G7SXobgxF0BH1s16XlOmxO8Oe0JfpmNhZdMaWUOE4+NnycugRHQxnM+cLfCA Q/gWfI1PW+olYnOvGkTsdpqYEFNg0wLBWlOYMh7GIv3Xjqjat4vRN9nS9qYt3dYFKtg78WK06DNHe 7dgt4tRLQGjFhzVNYVU7uk44TPW/4uKRp7gKojuSZGQNXys8L0EO0dK0qdCWOMk0jSMO8gWg9XS9n LZ/anLFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihVX-00000008rGH-1Dbi; Mon, 26 Aug 2024 21:44:15 +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 1sihO3-00000008prN-38tf for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 21:36:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZARjnmlo8HyEowPZhQbADL26iJccZmtF3ivEozqx6+RXoyHzAKinsdEBOPVWiXazW/IE/Qq3QxqFjRTWaIxZILfcR42XCXlzzKz4zj6YF8iXAv8uDA1OZKKXUwHEYlfVzIJw0bTFnINmvp/uFn55vuQCqW1GgDntl6sFAi0ycjUTzw9BP5rYo+AAovW7YEUxfvExKuP+yr7PGtK93Fo+cvxPPJ+B84TbPOspm46tHXHVJxl0MApmz/vrvg9f3NSZQAK6QGQIkVmb6OvhHDQIdrWageCOqPOGd8aIvFuItSmGqVPw+J/5WHdn+CTJX3yAz8z86NFmC4qz7GrnHbbKcg== 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=dF4CYNTIu0NqhJYudqQhlCpPTWvHVbPzYHOfnd9s5jE=; b=hz7icNZBeSrQiWOfZWtXFVzyQEwDmaXu78BvuKoeOwCgjvzA3znFbxZUlevoHk9du1BHYXOCqUSYK9s44+43GigEYiuO0ohxjAvhrVd35OwD19d4MdFB9KPjSgN5t2v05ZWGlv4U1G27cyPCI9LknAqMWkuGnGIjNvwWdg8+lZK0RmCQ1ZWdtbJGeU3DwoiTkAML+xH+7rvklpNa4kcaurhNoYTEFs5iNlM3/l503A6YiH1pnYrup8DoSGRHloSZVbybD/+r3Ts655sEV/NhvxHi79lyQQOSVQDU4KY/eqtw/DbFq6pRi+W/gfd5OcVjprycrKxmuaYPvQ5nGwrlXQ== 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=dF4CYNTIu0NqhJYudqQhlCpPTWvHVbPzYHOfnd9s5jE=; b=mPGuSbq+Ex6X4iyfy/pSnKFWXealKEVgX3RuNoLxOA7nyn3TlVuiT1JK9dvqgq0xOQvbMkzoI4pzo2OtaIoTOqv7GvSZCqJebrAmhiziLBk7PZv7YvqxkVIyiuREhcuhWPLmv8tI9RA6EgcL6Yt0upu3fpl3VMAW67Kn+qsPuXE= 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:27 +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:27 +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 0/5] arm-cs-trace-disasm.py/perf must accommodate non-zero DSO text offset Date: Mon, 26 Aug 2024 15:35:57 -0600 Message-Id: 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: 33a44154-0443-4ced-9ae3-08dcc6172405 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: t0cphHd8G+nOOT/f37r2Wtei7833mXbHKciBB5W38EcVkXUUENPwTV+uTVDK1D4vr3XoH/+YDUlaZMXHECWgJT7AFdmiHLPLQcO35YdFChQMkMk31M0dV0jLmc2dI7CXIpycUhEAtjOo7z2qd/mImHgNOakqcPc483jghlCiN9spL0uzLNh0D6AHTQAm5YRTHp7v3ngxGXz4Iet3yRXSNgzSetbEHf/YIvUJPItCybEwyzozCizW7Ss1wE0KjJ2UZkJwAi7GwO0bnfMiqrkgN31PyuwNDaVk9fkBQq33fael4osDI0Gtd83OyviKm1peQSF8qQK+Xf6ZmnVCp97eNb8US4IEFv0keJDgvSLFNgwx7HyKN6yzBWyykGS+PC3EOgPGJtlie7nLiEIzf7ePbg1x/L5BzBIE0q4cBrNN6c5jjLe1yN77KOdk+wksNWHN9vkSgNkkgOQpSrYvNqyoravYSbYoKrx4Eyq2Va+0ks1R9kQ3mfmvE8/3RXB/UZTCrOCBzL3kQjPknbcdNCZH/sOI3EqmpualAeDlRIoZ6SFNiesfFft1d2PGIsMrsKwP8n/N6QylY0HSNTqZ2NE0WSw1OthiRAAWSb8ABbrwrAyQJUIiSWsL+Omisnmu5vGRMtqT8alKAtlpFJedb05KWYbemani4IT+V0NRPEu+t/ZrNXKlucDNpIVItpDoha2EtpjNc9zFZGq5oJ8WpWoWQBcyUn7lfn2beDRfKLX/9HyFqwIvBiDs8ctQH3dNYMULnhQ+Qsz/YLBDNsYT9zHsMUZ4e7pnokUZD/nH17W8dAi7RycqZMo4/6AerKkW4cGgRM4O/KdGeNbnSHj5ab2d+m85eJry9d08WOmvQEbat0E1eUXqIIr2UMoja0R5G7j2QAydMeR54hUtRFD6rmwA4noTJa+mguQHfEm3so3a65YidoCLPqijSk1fRWEByey6iK4q8XgaLTEzyyq72WQhKvOHOOamZjHwSZ0gwBNX0AbUp2bwAT+do2GKTKXjVLrIqy9q09wxd0xVaJM6ROxft/+YIgHbzZ9akfs8hTFQeIwshXPDft8MVkGYsP6Uy7wOdI/ACqzJpkgILN+018Jzm3xDQTKi9x7jGyaWy3/xf3xRFlCSf3/fqukRrreSvk2iUJw20e4XQT0AjKT+zKZ+k1dhq/jwEXFSprr1bbc9MkCiQtUfo5uUvdDl0CL7OJV+VDxVaV70jfuXKTh4B0gTC2br9eorNGcGGYI4OHXGFANaxoYnqUXc2I0nb3wtdUAbHwjEb8G+vne1xNtPRpymmF+y8UBHAhCDjr6FgzQFpjJ/IQtiZRMRUAZlDLYX+a4FSCPXnrggSoDvKtlrJpALzb4ZFj0OK7Af+giC0dGYx8U= 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: cIqLiHbVFvPdJxRP6vgdLGnTeh8VoR9atwI1dOFXKxJC5SEO5H8c27s6QGLEwPmpJ3gFgRXWw/Hk9YqgwA4NT3gFjs2NcmmctOCY1pg1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9KIjcKVdqbXIkYyOk2zLI1rqmVa7RMOsRc++VO9YTSOranolgq4L80Z3blfghSLBfNoLbWS0RrK+RqVHtSOCG9VrznjK9iS9nt5/bDLM4/kSq8K4kRlxopy76PenuAYc6KLHFNzXng7uwk2jHMyamWHaBf1xI/3Fae5FUUW38V6jicz0RiUUSxbLbERqI2LG5+++RRnY4J8IoAO8SqbkfKZXh54MIG6OP1XnB1L1o9zxOtVRZ4RFPl7yxZbc8fXi1YlXquXS0ReiX4AidJzDSYZ7acjLrX10iskJ4zcSrv5pYhGNY0T4x2avm4C7SlQv54V3M+K10i5UvQeOM0nhyZ3+43vS7WiCmuvdEB6jCmIDeX+zhfli5p8XcXEcCRtNWFz0pSw/+qcXd2WPZyLBK+YXTzPa7wUm1yNZ6k2J8pfSqcwnHyd8ebAHuIcgRKqiGArKLmObB2d3ddRu7T07tOxqIV+XNfBb X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33a44154-0443-4ced-9ae3-08dcc6172405 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:27.2319 (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: A6iQe9PGrqrj8MlGBglrdgsyExaLAJgQg4xzR2cDOlSMzyCJwfSmWugVV3kk3LOHr4Ke+UI9kJPXbBmfzbKAr6ERefmHOBXw26suL5w9UkHKM8Kht8bwqWKc9nNRHe5P X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8410 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_143631_827639_AB114D8C X-CRM114-Status: UNSURE ( 8.77 ) 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 Fedora 37 distributed shared binary and executable mapped files show a zero text section offset. Starting with the Fedora 38 distribution, the shared binary and executable mapped files show a non-zero text section offset for some binaries. The text offset parameter is never passed into the arm-cs-trace-disasm.py script to allow the script to adjust the start/end address range passed to objdump. This adjustment is required to correctly offset into the dso text section. Not doing so results in an incorrect user instruction trace display for Fedora 38 (and later) user trace output. Steve Clevenger (5): Add dso__is_pie call to identify ELF PIE Add dso__is_pie prototype Force MAPPING_TYPE__IDENTIY for PIE Add map pgoff to python dictionary based on MAPPING_TYPE Adjust objdump start/end range per map pgoff parameter .../scripts/python/arm-cs-trace-disasm.py | 17 +++++- tools/perf/util/map.c | 5 +- .../scripting-engines/trace-event-python.c | 13 +++- tools/perf/util/symbol-elf.c | 60 +++++++++++++++++++ tools/perf/util/symbol.h | 1 + 5 files changed, 90 insertions(+), 6 deletions(-)