From patchwork Thu Sep 5 22:28:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13793047 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 5634BCE7AA1 for ; Thu, 5 Sep 2024 22:33: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=gQI6vLsSQ0lgbkgvDRirR2m1bIxppjDlCXwnX/HohjY=; b=z3J/WiuwexISOv08pTLW6hbmy1 ugxeMkEC3EQy6xz5OjjVygZV6lfofWP/NeZWrq/KKBD9rlXr5dznm+C6mH/TP8fm8gAa+mfCC9gVi eYsnwv/AbFJmRgAfCgGLAnzLbUY81nvIKCIFQpsMko96hraM9yDXnm2NtDm2HglV8Azadp178U8U2 LWltRdtqBhTTV9T379jA+n5iINBn4idoDIpOve8i4xHK9MYUYEpPpHJzkfGDpkdi4gZ2hZ/WVuTnu W4gDBuMhIwv/XDvhrlRpHlhp5xDJzwrlKwZ9REgRiaiNGoMFXJON6EUvbY4+pROUL+CCSkeOq7Qmn 7EOA4ZSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smL2w-0000000A1us-2GEC; Thu, 05 Sep 2024 22:33:46 +0000 Received: from mail-eastusazlp170100000.outbound.protection.outlook.com ([2a01:111:f403:c101::] helo=BL2PR02CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smKyM-0000000A1JA-0y8n for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 22:29:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jHVK8Bqdo30yuKRmlmgaLyaIWop+CzNRTiXzBibMOk5NukjYYgMQV3i3TyseI22O5/G2i6HCOvFISKaPheYiVx8yMi87/SgjXC7ZwA0xWU0aYZ7/DlHmpTYeDvn/ubNDwttUNh6DVxe3YsfqGV7vFMZk0mH8qa3MuzbUp5438F7vxAuocRukgc/s91hzQNCCMhkwu8JyWTq1lRljf/LW5DZtA0E+2kJkutyOhI7vdzAhLt4Q/rQa3+vvV5oqGsbmwOC1JlDZ4uzB9dOo74rGA4c9daUE2QcHoIWuGwAX5CapLlGFqbvwIUFCdmJoKtjQw1fLN3q+DBCdlU4rzK5ICQ== 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=gQI6vLsSQ0lgbkgvDRirR2m1bIxppjDlCXwnX/HohjY=; b=jLqR/DkbYgFmLtHU4JcmX/i7N5GKW/kLibQBNSzI2E0VLGyTLhJhxs4x5XxDAsxBHo/9p1xDHKBd5vTUFn+LfVb6PGB3Rz2ghIV31bvDVza+9Zwa9TutJpf3Zh7R6eT9QYjXiZFuohC/JBC8gJdjMHSOZ2d/5KCR/lRixo+p7Vj3ck+DiGsZQcQ5P7BAayUJBtRwwLBCK0WiGhKtmVO0KH8r2cOX+pTVeQscjlqJDm/j4kI7tpnotUV/17ZYrnPgnw6cCzX3Qp3Y43Kt/lrSx/K65ruX2+9RWzgDplhfM+neYLSYKX5DefXMJnyJqyE/QL38c91zILfE8cCZ6YFyMw== 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=gQI6vLsSQ0lgbkgvDRirR2m1bIxppjDlCXwnX/HohjY=; b=GjRgyKJso3FVufNs7AiW8vJePLu5RHLm7gwUNbDoEtP9ceAOopwylHCn1GuD2s29M7SIjzNamyBrZ4bM9G5G0auqXdIqK9Fu9fOkfUlOVP3YFLYw4dkxRRQbmEJgJe78VthLWrMlJniix9DzmOUMnKiPidIAZXZkjcF6qisb0GA= 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 PH0PR01MB6501.prod.exchangelabs.com (2603:10b6:510:15::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27; Thu, 5 Sep 2024 22:28:49 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%5]) with mapi id 15.20.7918.024; Thu, 5 Sep 2024 22:28:49 +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 V7 0/4] arm-cs-trace-disasm.py/perf must accommodate non-zero DSO text offset Date: Thu, 5 Sep 2024 16:28:29 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: CH2PR18CA0056.namprd18.prod.outlook.com (2603:10b6:610:55::36) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|PH0PR01MB6501:EE_ X-MS-Office365-Filtering-Correlation-Id: 7f43f9a6-b148-4374-f80d-08dccdfa1d39 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: zMFxKvepyis9BAI811NO9oTpP8MN58+glH7humzZoPyQJ1JiISAmkt1bAZlckQiszgH9XPy0C3jE8hOYmCfgP5G/w3ysRqhVhc+fcym5X38Ds9LAP+ILo49aec+0F7jIIWxWNmgP8uqwgifvbLLzWrH0l6MJPRXzrbL3zv1KM9mvGM5XuBJVDzDE5RjZQLBE32AFWKGeJBZpKAbmGfGRjYA3WqAAMqo8xSPw1PYmCckalej3niUVpC6YQchjld6DkN4MEumC6W+i1NUeDctz4H718v/RNm6TGZNBTuTlFFakEjCRrKtLA3VgcXYlgty/5vH2yu2hafBEQpEFCuXS6se0ObPMuoU9vhtOT7ClrygcPlw/xUYHaCHT2yPkc6vJxPBm6edvWMDHxEagrAARPGEPs5v8ZQVgnZTxSUtoLgLN9tv/UsXitqq23DscRn5Ewf4FlEjnsDb9QiMHvwvEF6jHTkG06Ua5SbAIDML1ueWCxPmgEXqdVatzbbbRQwA+6SVE0J+tkmDTUmjq9wA1wEsaZrb3bClGE1CFMFjmShOUTm4Kd01Zz/k6815vg3RE1SqIM77GFH8ps1G+jLS3+xrg8Q3dQ1wERz+9hPyzOb2qCMkBgPRZ5F4axOPplzzWRLsZR1mfIs9fBpxT5MXEc3tzlPmAbLhjt4fqKDbib3CYzExGhT39dTgC56RUtDhxw0anDScYWjD3W815m86v16fDsLRu3Pd4CWF5Gm9CzdCeC3g3XNtM3cDYcKbq6r4cn7NkqmCVJ2OnvJ/YQDHVCPXSP1NPWuHnQs5l0xKm7R/weMAofcnzg7BKdgEO6EynDW3Sc1xblqUBVhcW/3WtsGh860SXtlaj8NAWQFwW6j64wbB7u6XDb+9baH+sVtXfSaK6Mim9ln97XDlu/IXdZE8parJtBRnimdOZDT+G4tedXj4xTF4ZiNEZoTVJv1s/eqP4X73g0eCf4ZtzwUVk8ThPoIoam+N/avRHfEIsMvAAtfqscZNQn4NFGpSqRgAkMkPD9N6/HtR74yX+vOaO3r1mcNVHVNgHvr9SjDg90oZ9TrTAPXLaax2L/zYbMoPM3klYSMkf3AbYuw7hQ6GR16H/m5r9USqBoGSVueJpRzI4SbKwkPZBqDv9gGAM9e/GNGLMtfN+R7svjr6JnrXcThx89Xcm5BKXojsiFEYf4uhKYGI6h8YjY+x8SZdeL9SM+iMWnoD4vwrLozEB6HxH7jqar0JMudo66YUVvbN1zj6mU8xS4ON3VSjeV1p5tDEQyW8b+NnOp5o6YN0vOj6BxXxaKANmVQQVE1wwhtd7nuMkMH4TmqCBZUqyO3TE5k0vwtT+l+hn9LE1jz2ph/I2ufz2xX/HrG50b/xuOLde9x4= 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)(52116014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Dk4EnJ6SHUo0KWh+5P8BKmGC3FNSo0g4kbuKOvH1+2Koo/Ffb2xY8pESP/SlJORrzgBmA+81BumaGd748bWAMChWMwEiGSt3blN2lypCQv0Q7dkG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wVMQG4Gj22I547sWIIT3x0no3M4OXoG8Lpp+82boWEQnVB91VyBL+F2ASiT2Z8b7ZT7RB61jBBEIn66kFtXnqF5TQ1gxldwS9BeV+p2xsG7JxehicRb2SF+nbvgTK6b4gxHqZaOEiuRr4DU/vnj5lJrIvfdn6ZAQxjRKIgrmEaIQqIRM4za91s9DUBlbQwMhKw0nV9wTpUAw2By4fPLmC6VxhB7fN5FvsaNf2zUz8LvMGr0gI+WhqAL95zSeasFXTxG7flqvBYFAYH1YDaU20zlNfc7HUwkwC0jEuDo8tOQRcaMPiCSwd0zeNYSRTSSFxCmUWE+KgmyIEEchUHR57EbnwYC1nQpGROd5SnUPdmPde7xzfpvD/KfvvVjTs5EydLjuXh7FjGJu2MEaIjhmkVPm/xEsL8Dlteu2OzCaNAw5+YsiFoyvR2JvNBLFlngdkJnOizhqtawnfyEozjx2o8CWNa3R X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f43f9a6-b148-4374-f80d-08dccdfa1d39 X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 22:28:49.6591 (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: p07/Uw373K6AOy9p/s8BfMiu/5G140gSBJzEpwGs4FSJofGEMNikbbIF9XQB3WWnHONq1DFH+q2E5p+nvg5+OZODFZ3LJkdiCbMHtFl7N1HFbIqO/PdZqdX8PAqNig6o X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6501 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_152902_294061_B4B13A95 X-CRM114-Status: UNSURE ( 9.38 ) 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 V7: - In arm-cs-trace-disasm.py, fix print message core dump resulting from mixed type arithmetic. - Modify CS_ETM_TRACE_ON filter to filter zero start_addr. The CS_ETM_TRACE_ON message is changed to print only in verbose mode. - Removed verbose mode only notification for start_addr/stop_addr outside of dso address range. Changes in V6: - In arm-cs-trace-disasm.py, zero map_pgoff for kernel files. Add map_pgoff to start/end address for dso not found message. - Added "Reviewed-by" trailer for patches 1-3 previously reviewed by Leo Yan in V4 and V5. 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 | 14 +++-- 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, 83 insertions(+), 10 deletions(-)