From patchwork Thu Sep 5 00:11:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13791557 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 D2F68CD4F4A for ; Thu, 5 Sep 2024 00:13:33 +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=3Vde1RhZn4Nnk8Yd4s26pbPnI2jqVYJavvhAarBMb1k=; b=hMkuLwGByz3EwcpVQLoc/Fc4Gh Ugz7bvdIFWS7b32vVh0O5zmBOMimzJuKqsSTRVU5/Os6vlcZCQmJmyYoYZSJz+l/6DZdo2sALQqzw hNxOAUg3bKnYm9frvoPulAIH/3XiQH94tBCdG6opo/oX60KnR5mzBlgto86o0S5Q0csr7t/WKyoeD kC48gN7MuNxqtgMDjqy/axhEEyisxF2sVR2Gh3QPk1Q84V0bzcrSLml0rG+0dum/QVIU6V/SfAH5+ GwayQquI42KSoNqAbdcwZRineCRzYYF8xYcAFZqtsrUShvSo44qqPYMwIqoxOhkyJMydYuEs7CxCY oNjrPbFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm07j-00000006SMe-2GC6; Thu, 05 Sep 2024 00:13:19 +0000 Received: from mail-centralusazlp170110009.outbound.protection.outlook.com ([2a01:111:f403:c111::9] helo=DM5PR21CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm06l-00000006SFz-3diI for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 00:12:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HofWpih6/Wb/90HwQUN5vl1IhBxqGZ8mDTRR/qteaKmOp3YBU+0BGcoVHPNHp1mwDKaUHD1ywlYScBNYROG8dxwx9t6ug68gf3UtzbKiZo5VyU9jOUHj5XumgNdWx9BxdLvVXVXGL6rMe7slA9EsG4n3QcezglikRmDy4LkYnutAD2JVmxG2ii286jkZypE2j+OFQzQqHkmflD8qFaRp5RV04YbA7urEJftBjnzvfPIYXu/7fQye4wGC1m66V+y3ZmCkLjZuBiUQzr6WiCyArhMkSiEVQcbmnUIFBF6oFXxAqwCL8Ik95xWdxb2q+teQx611KkH0xL51lxxQt0vQYw== 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=3Vde1RhZn4Nnk8Yd4s26pbPnI2jqVYJavvhAarBMb1k=; b=weKPsU9LUFKQGqCrsY5yUh1+dZ06wvCG9XyZxzAscT9TidfRYgA0bwjJ9TmORxtwjp4NP+TmGNgyF/yzgZTN+S8ZYUVsC77Fq2ZP/YEfnDi2oswpu+R1xXW57b6se93SPD/eHQdIEwIT+yTcN0Z/qVFmhgU4wLoY/GTMozZIk3V5unavVQVChpmEjsSNvordaj2cX7M+1L4uzVCh+83Suqh8HdeivI2nZKC8veOtvva7g1KGlNgQa+6PLaXGjHUfYYshvZjnvNVSTGdUx0yrMU/h67rkioP1WILnd2byyKDypPNnJ97ax6UZttaRjA6jSX+kgHYH7JSUzT2AgGMG3A== 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=3Vde1RhZn4Nnk8Yd4s26pbPnI2jqVYJavvhAarBMb1k=; b=RkrbwVyNKb2pJVSrRmIpPLvlcmYBBx3NxtEy1TCNv1gWT5ZAgtlsLvcBrN7klSiqt9WkhSmVt5LHh69Or2HaOw/6rVqySjf9Dlt/BtTULITw2gypATXu8HZBe5BlHhu5i+WiJ1aAKkVPD2eaE2OPaUF8iHhIae71Lj0eUKNnMpI= 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 MW6PR01MB8365.prod.exchangelabs.com (2603:10b6:303:248::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.28; Thu, 5 Sep 2024 00:12:07 +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 00:12:07 +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 V6 4/4] Adjust objdump start/end range per map pgoff parameter Date: Wed, 4 Sep 2024 18:11:29 -0600 Message-Id: <110501d82b12ea7909eb7d02899ef60ea42c7e19.1725493961.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: CH2PR07CA0050.namprd07.prod.outlook.com (2603:10b6:610:5b::24) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|MW6PR01MB8365:EE_ X-MS-Office365-Filtering-Correlation-Id: 51043bb3-635b-4dac-ff2c-08dccd3f60cd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Q6z0VwZtaW6bb0q8uHtzqvsgR4AfUmY?= =?utf-8?q?tEdGjSaoP92YnB07hQkuJI3ZMLFym38IkD59NMGoSM4CZPes87wodkDYz19QG3va1?= =?utf-8?q?sFetyn1BWHT3w1GED1VAXbBPFmxfIf92FQppsmp/GIwJVRTxeLame95aIdwxqdwLW?= =?utf-8?q?ilca8W3VRTROcdAjnqUTFLoEey2XNZy1Smx7APP88jnaCtkKURO5aIKGa6J2XyPO0?= =?utf-8?q?bdE33CDUu5Slh7ejodw7/mADTO2hU7tvJX6bthqnshEN9OS/hFJSjOC7mv5sWSHJR?= =?utf-8?q?d8pKmGDhRA2Yl8O7jYQ7HTWMzolavQB04VdXY+zb5Ud6mCbVLooeaA7GHsRQaqWR2?= =?utf-8?q?3hwydnLKd/G3Q4aMX9W+U62tZKGtd3ufZe1wAxpzNlg2JY2hlY5qf4nS/o8p0rIng?= =?utf-8?q?9v0iltbVDmgOwGDGQAgDQTKhJTuvat9Wz4z07m5y+Y9DVkX0mvvmIEwQipeW/7fb+?= =?utf-8?q?K1SbjVYoQJ+lZDlSqYNImoPKRiBW+FbqQ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-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)(366016)(52116014)(376014)(1800799024)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?IBqMhG96G4oZV6WTSzHQUQv55XlW?= =?utf-8?q?JT13bJdqvTAzlXyQhxDzqZUqipzy5ifQc83O6gZ4uzy0t2R+QvyoYVt24L5TaK+BI?= =?utf-8?q?vRU2hUVmGoaSUaQN4m7f9JvUgQdkPj/C1NikYwwzzLfV3zPbplgA2Mi5SkH54IVs4?= =?utf-8?q?FGWieK8xp3JFpSapRe1h8ZE+TSRZoIMm6KPrL0WfG0g4DkOFxIjsejykVWfXTFPSg?= =?utf-8?q?9papNw4uvF3tKCH2FLMdg0YRAfrIr814S4JGy8jKV0UBabshO7mPQgOG4G3wylm+b?= =?utf-8?q?9O7lTKJvOd730MwtBXsLZYp980f3/QQbmRWn1Jv92MLzCbcWVfgv4rlxObgKKGx3P?= =?utf-8?q?bqi/Y7fkAbPqFfYp13rZI4RoWhmJt8Solx1ZgzYyk04ynENMD/r5lAK8B961ADQon?= =?utf-8?q?zvnwQKbxb2cVKejihJMOsw/f4tDXEk6MJzdgYo4cRFLv6tfCazxD6wbuJsHcZD1zl?= =?utf-8?q?plI4CIWcqQUTbK/eFK/G2wbAyVR95LwK1A/33A3MbGrIefALU3yThHg0eiuLD8+3I?= =?utf-8?q?nP1IzxvfcGn+DYkuJvzUb92vplP1ba1Rm8UkszWqOXtIMizhCODnV41Ht3LkQZ4x0?= =?utf-8?q?jyOPDcc+/qBeyTbIgRzcP7thoMU+ddPKilj2rK3nx/Df28tjzKsCq1OIVmxg8Bva6?= =?utf-8?q?YeognfT0sQ3ZW9f6xqcn9y7pZ883csGfQLJGEeJURVCuQuY7GB6O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A?= =?utf-8?q?3cqB69sGsnU?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51043bb3-635b-4dac-ff2c-08dccd3f60cd X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 00:12:07.2079 (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: ZpgTQDpSy+jrjlEA4B2WoaujFYv1AOg9iHBIp9rzxOFBONAhkwsB/bPKHzzqRWvFbKOc0vs+6El92oXyi6HYxYKo+s/gtg7M31zan1I0ukqGjZoTS0d1HlMaHeksGe9l X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR01MB8365 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240904_171219_944971_AA354A60 X-CRM114-Status: GOOD ( 11.10 ) 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 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 Clevenger --- tools/perf/scripts/python/arm-cs-trace-disasm.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py index 7aff02d84ffb..35a2ab60ca12 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"] @@ -249,11 +250,13 @@ 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 (options.objdump_name != None): @@ -262,13 +265,14 @@ def process_event(param_dict): # vm_start to zero. if (dso == "[kernel.kallsyms]" or dso_start == 0x400000): dso_vm_start = 0 + map_pgoff = 0 else: dso_vm_start = int(dso_start) dso_fname = get_dso_file_path(dso, dso_bid) if path.exists(dso_fname): - print_disam(dso_fname, dso_vm_start, start_addr, stop_addr) + print_disam(dso_fname, dso_vm_start, start_addr + map_pgoff, stop_addr + map_pgoff) else: - print("Failed to find dso %s for address range [ 0x%x .. 0x%x ]" % (dso, start_addr, stop_addr)) + print("Failed to find dso %s for address range [ 0x%x .. 0x%x ]" % (dso, start_addr + map_pgoff, stop_addr + map_pgoff)) print_srccode(comm, param_dict, sample, symbol, dso)