From patchwork Wed Aug 28 23:17:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13782087 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 20634C7114C for ; Wed, 28 Aug 2024 23:22: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=S4kXjmyo86JTD/IQw/bB0THRSQfH7h/hHx5M3CvHMM4=; b=f8v8De3W7OdzU7OLAfy+iBgACg JGcHWBflTe1OjnO1i/UK8xp6lxw1I4BkaTcwWhsLMXBUQ600Tk9+KH061DG0RHv6YM5072fg9j1II h/TfDH+6ZAa3sYLpR9MFA4xOv6qoBOxqIFW4akReWWLtYamdLCBOnP+LRSVLBwHZGXFYwd9bFU60a PtVHhZaAsd9vB73B6KtpZ1lT4LeBt98gp/ViGm909ev/nnNBN0UmkZUrAN0HuPjVsqFMaT1w/AihA zHNmXvPrapuR6nmQGSfpfKQPBz2zFya5kR3bTaBuXX81obwSp7R2mvRNZFwAVUzPl866ewjzygnwN m4oxq91w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjRzg-0000000HKLF-3Zs3; Wed, 28 Aug 2024 23:22:28 +0000 Received: from mail-dm6nam11on20708.outbound.protection.outlook.com ([2a01:111:f403:2415::708] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjRvj-0000000HJho-0ort for linux-arm-kernel@lists.infradead.org; Wed, 28 Aug 2024 23:18:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mIoV5HVqWYeRkMlXDVhfcU6rFZrhvE9xjH5SdKIgWQegpwpMbyE8IR6GeGACQis49erEt/hMcAxAhcBRJSabsJxwtBBAyBng8zil6YURon6P+GPszGD8w6tSO4FkA+zq1nM5XAoxsAZWE+uWm5iC84taVE+mhtlEUiabVSOHroMRjG2zDAyXKgP823aSb36mzksqKEDMfrftk8XGaFJD4Pttv3FXn/yaJwFvftBDxzFQi5BWY2s1I/wYVGJ5cCBbEt25upWCrbxMXUsBti7TnX1C5u38eTHHQ5lGWjCf8IyFTPbSf7ZL/4pIj/86ZnMBDjIyVEexuhJLEpXbqCyrNw== 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=S4kXjmyo86JTD/IQw/bB0THRSQfH7h/hHx5M3CvHMM4=; b=CuGrHHxyKtPrkXQjHa1yLnRrUEUWXL+1qAB8h5aDSOqLF88ayxTKMByDVpAADIthJezMST2N8o6eR4/WFsWm2QBZPnYH3ORRi7owrY/Ee+RiaUC8o47/UYQGPrlkiJdif0b0J0i4cKx4BVRbB1IbfPF5qPG+4/UP6ZxaIjz0GUMOLvRVwQDAtz8RdKN0alrR3EJg41XZqOBhTWfVqS1J3oxFXcWEYywmtEonATJ+C5sZP86c/1HfnIY5sIwaDQyfxv0q1R6oXOR4pr8Upuuzj9+lN3XmPMyOdQHCeBx8P+DElJuDLLqnbZmUp8xDRJ0Pn29E76MmA1xRNBwmrgJQGw== 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=S4kXjmyo86JTD/IQw/bB0THRSQfH7h/hHx5M3CvHMM4=; b=AET66BKPzi7yKBM0Og1UcnS+UAxD3ChIc4A/3/j+x5RYWuyYL+jg8f77keKNHLdGLooIOjx05iU0O9pglhoA4xUJQaFFBkntjb/GuYQVCPZ1j693609EgAYKH/hJ1fq22gO0Z7kAetETVpzImDsk9FMzz+tXPDbcp1DnwU5jNE0= 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 PH0PR01MB7895.prod.exchangelabs.com (2603:10b6:510:28a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Wed, 28 Aug 2024 23:18:20 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%4]) with mapi id 15.20.7897.027; Wed, 28 Aug 2024 23:18:19 +0000 From: Steve Clevenger To: leo.yan@arm.com, james.clark@linaro.org, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, ilkka@os.amperecomputing.com, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V5 0/4] arm-cs-trace-disasm.py/perf must accommodate non-zero DSO text offset Date: Wed, 28 Aug 2024 17:17:59 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: BL1PR13CA0109.namprd13.prod.outlook.com (2603:10b6:208:2b9::24) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|PH0PR01MB7895:EE_ X-MS-Office365-Filtering-Correlation-Id: a19caa1f-e3a4-4128-87c2-08dcc7b7b44e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|366016|376014|38350700014; X-Microsoft-Antispam-Message-Info: 2l9z9nVNsiOJf1uFdzXyiFfWuBbE8IlfHRq0o70siiNjjFkfQJ32njxRpcnuCcYa9JMtIyJzqpAxsfoPLWBLTwovKSrmY2ip1TWASQw98VjS3bu/1xtopLBt9nlQVHL8o64ryTmvteGLDN5Q3Apl+kXHZyOsNjTb1CnM3Z7lnZW/OPO4uIp+PHSUJ7BV5pPH129lVMdwT8RWMedp1HHsnwdDM0EKNhi8J32wTf26apPybYUinrvfYT6oWlo5WkHsj0k7bIcf5ZFwVeZl6ZRQN+9kn2pc42oqEoLXZ5AgB71C1ffIMFMnX+mWqBlJE8lhn5fNfZBqbsObrh2fi1UofSZw9TZfvTlIXkaXlIP/emzeCL+yGOVeCgzNz1O6Fh+HZsu8TWMEH/pGFS36wk6Rtc6ogwdh1BmpALlM2lcn9VQMbkN639OkTVFyYA/3H/Ji8Tvl0y7a8U2L5ZQYRb8wlHFIyo3OryPDAgb2qb2EbtewJ8f1iBOeU+550JgVRrx/HzbqL28s+ZrnN1AqiTc1ClA/tAc+To3nzlylx47US2hqJPC8T4EvAXrZUQpf5ONqv/Ht8Sjf1nQscQXk+BP9/aW1DU5njQwe+bwR4xXeCZssH4rd9onOIRU2sKxLEn8dy3o9Nc8K7cG75RsoihHw2mMwq7H9FW95KmVfeGNrNY9AmZiskRPh3VjaNAblPZgSC8QzsW2rGzOKjfqTnR0X0D/0JVJvM90qdUqlCKCMAyD9VzmDtlpJL6goW9Ca3BG3ox2X67g+aBueUYnIhWn1NOBpoSxCkvREnl8nUhg+8RYnp5Y0EVy7jSy/EQrRFqV7dXsGXFCqq9dIVzSKhJraeNfcfy1GmlnH/juf2pW0vL00ZJcACeLLNM8s92p9sf9M9d41Euq0HqMExO7u9ChxXi1RbDqOlGcG6o6wYPczBrWPA4r4H1vHB5PVGak3mQ5QrJo7bPqf+h7SrryRGW6dWJJWuT9yvMX/wx91yR4Ts5QyP2uUOs8iGlP7dYofgBqLr7OhAoneVsxcN6HE/dXpzdcoGhf/VVazEozo4jvBt812026P2BpuT9YAfxgdP9uY1Nv6M6+oqeWyCZanczuppd0vVWW6TzejooTffzlfbbcUUoFhk2D7HIWxIELTPqH9kwlMOh2ytvz3/UF1wgE2GjluDiCkK/BU8pa9KEF7iuGj0l8yJrTFYOumjmj338MGUh7t5LCZ2N9jps0v+5Px8nwpaIxGfpIHJ/d3xSj7Xk/x5MvcSuTouReNhNXD+l8X37YVB1j/0llHuCZz9TzJX0dbK4nXhk6Oc+/i7vXbgzmf2qM6j/Bvl+CHkxRhm/lmzpmLTMdKOZeLXsf4i3S3BfBeImsJg1HtA2Iav6GSU3g= 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)(52116014)(1800799024)(366016)(376014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xQvORNO/Rm9TDkvs4X0wq6OTEvlJSCwRJ/lUpVczazOPZGm7IKATHRkueSy0CiiavEbK4aPZRlc5heaQLY+PS01JpcXbUUO9XA8g9OBy/b1W3lgkGiF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WNg/mwqX1te7TM3zmhnH6mOAG5KQX3fAypyiPyeb/jmzlF2p0Jl0FnZW5Jxr5fTN2BTXEdIsRsy/RTCZSpWF+w/+lvLOcZlbfuCvZQqIqZCQiZoKSvAF9Dx0EzxW8l/35PvJJAk69bqVdqJrcdppPHqURwhp+qQQTHZGl7e3wL1LEHU+5hTMKyXaU97hYMbf+5ObpR06wF9pMVeXaIm2998kg7C6PUjWWEH7rj9LGUdDKF3+Bdbtxc3m2A6xJg7Z9JClftXavP9/OaW4Gesxq/YxFaSSO2d0snpkj9iHFbcNqKskLf8/zjItUctOvAhDl7+Av+3yfzrtBr9Mdyi8Kghe2uEjbL69hkgsugT6/uDDuiGfF5PDE5i24Fd5fNWpaziTZnuYD7EXZBOglLqd1ldXDUr/BAydlUuygeNVLr2luZRrTm+znYGLn1orVmB9ElfhUjhd2pvYj+h5WUrnqQ01fUemXwLHT2JoGS X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: a19caa1f-e3a4-4128-87c2-08dcc7b7b44e X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 23:18:19.9469 (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: XQ8Vbdie0VVYvj/9CiE1kEoCl0XHKe2DeYtWerqX+xF9pMwG9jkuX4hiCcDYJkEoM7DcWQJGHwKNQY8w4gti5NgFRhWdUiwOWNrxSNn/yZhlyGUXryg7KwHRYkk9vIbq X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7895 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240828_161823_356857_9953F858 X-CRM114-Status: UNSURE ( 8.86 ) 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 V5: - In symbol-elf.c, branch to exit_close label if open file. - In trace_event_python.c, correct indentation. set_sym_in_dict call parameter "map_pgoff" renamed as "addr_map_pgoff" to match local naming. Changes in V4: - In trace-event-python.c, fixed perf-tools-next merge problem. Changes in V3: - Rebased to linux-perf-tools branch. - Squash symbol-elf.c and symbol.h into same commit. - In map.c, merge dso__is_pie() call into existing if statement. - In arm-cs-trace-disasm.py, remove debug artifacts. Changes in V2: - In dso__is_pie() (symbol-elf.c), Decrease indentation, add null pointer checks per Leo Yan review. - Updated mailing list distribution Steve Clevenger (4): Add dso__is_pie call to identify ELF PIE 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 | 9 ++- tools/perf/util/map.c | 4 +- .../scripting-engines/trace-event-python.c | 13 +++- tools/perf/util/symbol-elf.c | 61 +++++++++++++++++++ tools/perf/util/symbol.h | 1 + 5 files changed, 80 insertions(+), 8 deletions(-) Reviewed-by: Leo Yan