From patchwork Mon Sep 9 21:30:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13797614 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 7A237ECE589 for ; Mon, 9 Sep 2024 21:35:38 +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=iZxRyQX91aCNe2kRtYdGf4y7mmJPYNbti5BlN8s6eN4=; b=TyRXAv/V1vGGhqVrLD4NZs07gU yLAtUNyK9ox1IvCKWke20GsKVtaj/Nz/OjBQ8Dy2zxZWmNZHFQNhEqHDa+iwnt3l0xIOGjklmH4+t 3E6MuurqXmeDhSSyCM0V1pjvdvyaVT8n72oM26ke/zAYTyzb+LvjL33vRzt7TzsJaTdLsxNbMMYJ7 IQobxvWQcBIRRc4i246SRgMlYpEE+9R8PVXMRTXyu6h2PZlitTiB6JPbfTHgPOQf/ldmbJdmu+4qu JbeQmvXDSWyJbO/xwv1pUbQmL20vdlr4BQBFpCBwTZDpPCOfCTfWCA3TG6RZBt049cHiwnPEorljn CW+iiBtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snm2f-00000003NN4-2ZK5; Mon, 09 Sep 2024 21:35:25 +0000 Received: from mail-dm6nam11on2070c.outbound.protection.outlook.com ([2a01:111:f403:2415::70c] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1snlxu-00000003Mr9-28dA for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 21:30:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=udKicyBekrh/G5a21ChY/lUIWUKhhosBcIU59XikWKYtxC/Uz6J4Z/u6tORETgBm98ArNEK0Rh8ryelay7EDd7hQ6CPbXT4WHmHhNsvP4x8PUnwimJBd9UNwSM8iCdoygq5kLt6SFQ2ICG5mHKQ4OUDMIKGX/ynwrkv9/zimmGQehOyK2sZ0topXKNp1tK51Y+ZHTn10Td8RdwEuj2TabtkSBh8IbMNy6IVBcWq0jwC6vX/xfnCRCyr1G9N4AhI1cHoMA08yAOc/2ejR0N+Ff7VHl4VmSiBXWPLuXd2AbNQ/IphpQ8n1OMI9sp4QCgvZm/qQhz21HcF55Ha1F00OPg== 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=iZxRyQX91aCNe2kRtYdGf4y7mmJPYNbti5BlN8s6eN4=; b=NVbvaEnh8i0HUj85j123PWI/bFQCNFymOy6sbWIvcInteQlYX/CAkYBKqDeKZ4SMqU7qYWHKZ4+/fIsns3Pt9MIN3ycSNkNpQxRxNbF/7PAUYK1pQ1MKUIgdkd8Aj7q7iWx451NlVe2e6cgY97LwbVzpeqm0C1UYGF2LdJCrV6thfLi+1DTtbFI1k252S/P0MSeVsiMRUrsv00bdSSCkS1fAZXghSKrbKkUBvkdHGNJbbv44jOTGqgZzuuqcHubCuvcIqE2hoynehBCKA/MkewfoRh9zVqUWi+00/TOmLV6YeKTP0JqFqB70FnOzqOY0dxmtiN951gkAdf1VZ4hVGA== 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=iZxRyQX91aCNe2kRtYdGf4y7mmJPYNbti5BlN8s6eN4=; b=HfrXmyNUZ2BK6L1SYgDNkwRs2XeKJ4XZ/tE699l3MoZdXqbKFXJTaoM65awFjr40J5TDDM8SvOXR/lwCURWOR2k8HfbFuzWr49nh1k9PGrv1+M90aDJFbCwGgIWcD6SsH6sBVfzBOa0yKTwb24x93vFFJ/27+8YugWieHK61kQY= 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 DM4PR01MB7618.prod.exchangelabs.com (2603:10b6:8:61::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.23; Mon, 9 Sep 2024 21:30:24 +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; Mon, 9 Sep 2024 21:30:24 +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 V8 0/4] arm-cs-trace-disasm.py/perf must accommodate non-zero DSO text offset Date: Mon, 9 Sep 2024 15:30:02 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: CH3P220CA0010.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:1e8::20) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|DM4PR01MB7618:EE_ X-MS-Office365-Filtering-Correlation-Id: 7f7cbe7d-2ae5-4264-ddf4-08dcd1169d7d 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: DVc0+etKFVdcysgOh1yX2dMMDdwBA3Omq50upfCPqiZc0DYkX6Iv7IEm4nJuZsHN7j6X6niaKwjjnVYYYXkAGo8Lkd1FHSmcu4fmDMPg/yob2tCHQZHEYvA09lBNQ1AaQ/03BzTdTxo96g6eqQunBg9EZ+9LYEdV0ZoWOYi0/hTPSTN3lOp1fSKrI9Gsfd6qIUFgawBJXJ0tmEVj9VO3UvUGgVuiWxKnUpw55C1aNPQrFUE7WpStaqGhNNyQ71ILCWxmUvd1Z/SA11RaZBAAIF5l+7DjHayEnDTf8rEc8KVPk6+C4884nCbc52D11WO041JxO24EOFbGQwkmpkM+evBpW0/HfDODV3uSc8bonEl6vYj0hFsjfvndprKUEsVIWzDhKCZMSste/gNt85ENgNrkhHKe2YeKj9bWxvQRybEeBwDTMjD4FgEHP7jAHdCsggcz9S1zSYGdl1gQcQn2ahR+lSbd25AvTGzvBIYiXruB54YDX3Sk13ioZeBPX4GA7s+TV1tNgY+hf3opI2Tj5iKBLMYcy20ei/TVOzdfPWlCF6Mv0bmN93NYL2D3L68CqfbyWM735+tuxLr7X1Qz+ZKqz2V1SdDHcv2W47oBErIRdq1D66ZJAGV6kBlKYpBm3iOBAK6jRO0lJTrL+GXD8UhEY5W3JhWjwkMpYQ35WHu14B/JCnd0zk0H+tKzfxwbxIU3KYwNKJOguB/Nuxkls3YW3kZL7cTFZSz8lOPY3/ziLpei45DkXHY3FyoKplJJZxQAzbIm3s4YVnfNodtUr1rzrrtCyJ9d7SvlODTqKvBhQl6I1Sp0cdRW1NL3DbBUaTpRpw35H7yIpOxX2fJz4Y0uAgytlBf9j9COaWOWMeRJ5fl/NN0HojXmlVFpw546tGZYnfSJovNeyt3QUkzWRZpeDcKgDdBx4D4ap6EEBSjN/bsBkKpgBu02aZcViI6VYOEmOPWXbL/7SiZ73+LY879RJQkktBjAj5p64Yu/fGSv9j38sXgPVIi+lTo7k7lR2VyrTXfDrfCtxSO4UmEYyyZ96zKfeBsF0K+52Kmg/0p9e6fek8Sl+IzaNJmIVZt4yAJmTyWwYsgiSMGnVZeRZkpMTSwtTGJ6j7qLgYbTrwq0ht9zaaoEBcZ+WbJGY6Qj3bqogsZeo8pYQUZgfPmHv0DSHK13GGGiujrbGW9179e/DNyX4UH/5Ws2w8SrwXL409+P7GnJPV4ywXj7CVh+39GZHatKPqUXihL5rlncJF7/metglffmXSGP0certBfCGaQRWVMwrlwWs69vf6Asg3C6/LPSmBh8+zrTjvNMljhYoJWCr7ZkDGG+1Pbiixk1TQWffn6RIW9rN63Pw9K4qfoNHR5/IxMgqgb0tHEZGig= 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: Opz4Ney8//TuW8Y0gHYYEm8YihxmeI7mI5DTtXmh8Ylnz8a81xqBdDCIJL89vl+9CSf+b758uFwQiI8GTNGyQ/d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i8jDcm7tHMxtqLFSTNCLj5aM3z+wtlscwpBOEEkYsn5Bqghu41oY6LoVwPboSiAJK+dQtgLdEc2Q0vWlYNImltvqUySSeqh+tZ2vSfmp4eYQ4hjXhQqR087BA68GWOHvO+Bh0efhWQDsBqyuk4wPCZoW302OS+WpDRh71pcpWJPw2wr8X8U/kNU/Q3NNxcJW0mg0yjCHPmIJQznsH6Vpj+Ob6er9omSS2Twd1uMFoByyxbvFI3IoXnFpwwa/MskqE2frScECMHurGNq+7160MhS3Sm+UzV79rboqtcyvaButYz3EP8wkVDInTx864UDK6Nt6ed+a3yTbxyl7WG58z25uFdY7Z5oqfaa3z/n5B8DhwXPN94iIc9zupWDcM1nWYuPo+JQXzLttFK9uVThZj5Wfo7N2BoD5ZroD8g3AkDvLWiZmQzJ8LHqW4qN9BY07PbBm0BKerxynukfKAky287NuaAb2dDZC6kT/9BEW8NoKN3Tb4 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f7cbe7d-2ae5-4264-ddf4-08dcd1169d7d X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2024 21:30:24.2599 (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: VMrww3n9gfOWzLNJY7p9jU3lyW9hSH+N2X8W+8ZdgdwzbFWnym60FgY8ktqZCVKBg5Stq3XjERiOlIAY65kMrhK8IqH1oK/Nw311WrFO9FgUFsxOnrhZT5ZGk6BEPswY X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR01MB7618 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_143030_573778_2A5F557B X-CRM114-Status: GOOD ( 10.18 ) 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 V8: - in arm-cs-trace-disasm.py, ensure map_pgoff is not converted to string. - Remove map_pgoff integer conversion in dso not found print message. 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 | 17 ++++-- 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, 86 insertions(+), 10 deletions(-)