From patchwork Mon Aug 26 21:35:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13778510 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 F0108C5321D for ; Mon, 26 Aug 2024 21:37:24 +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=Km8og+hiPSrPx2C2G04skv78Rnp+hmQlSQWFlkL0/rI=; b=MrqEnpwz0mWL4rYmH9oXPRSGMI RDwcJ3SGDjwZiqW16aaPgkrMfKrr79IoLtPRFHDW5CRGtpQbWEOpQnmI6GRjQtcbaPw+oqAhW4n8J Q0fwFK7miy4kF3IPQZxYqdfFsp/ph3SrPhiKe8vbBNmweazoUyqyvfhpTWTqhLGDgXhCheLUaEYyS v8pPNJ63SzkyJ0mD0JLhYye8QiEh7/8qEIQQ5lTcQ1xIps2hUq7GuPU8e5IeGoc+4bwoGI6qWzmpm lNpTIIADLAqQFAwsWpCGy6Wkf+30rsta1xNSbuBgXGCJntOkeFe9XWcrg79Y7IQMv3G8qguo4n3QU ichvdw5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihOi-00000008q14-2X81; Mon, 26 Aug 2024 21:37:12 +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 1sihNu-00000008prN-1xgz for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 21:36:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tbAAnIBred+LohYXuP2aDjR+Atakde1rH0ggUQI/edveZXHwCjaQzsZDfvDhKvMD88z93ZIMDSwiqhTFe5YCEd9tCT8m9R7k79X4nLxx/p0ISXuPFKjq9gnb5vEm2sPTpE3CI483uu0KDl5/oeMeS+Dc3osiIZVt2j9+GIpJmVrNbPlUmdvug+r0ZwreLjWTC6RpkZfZI5h7EdtTASoLMhh6hl8hv9spFjJiEvQaiB4C9e7trvmGx/2GD5QVuzpBP9Uu9ceq9l8bTmJlXm6jinDFjFP4Gkmy9w/ICyKz7ORkueTRn9X6LtgLb7h31OMGfUv1gBChaVBtTO4L2XsCsQ== 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=Km8og+hiPSrPx2C2G04skv78Rnp+hmQlSQWFlkL0/rI=; b=jiaslaN/BPb+rVO8sh5ZjaRPV1woyzaOxwVg0mw5jVqmOV3KYP2vLn3Qz+1CbDrsvj1ei7Nt26/31lFvOJ4TcwU4V2YWWWA1xF6t9P/S/uxtmCZuSpldVczWRuJ3vBEQR/OgQkcl6OBtvCM2laS32a0WzaxSmp76+VZPozQ2NiBN1nsDLYZ2S7C792CL+dTPMJ/pWtWZ+sZ3tbFjUZwWsA/bsYIKiO+zEhIf32j6P6bwXiINx2PjyGwfhEmuSPpRpekQZe/ZWC6ZlQbuMv3/ae8FQX8/xdPJMBA+bkJd15MT4FsvCJTDUS8Qr9syAVZwK2g24sjKG3wBGbwjUSaenw== 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=Km8og+hiPSrPx2C2G04skv78Rnp+hmQlSQWFlkL0/rI=; b=SQOoDXKTuK8QWZcYbfJg3omebHXWPon9jE4EOS7VWz+NhzfOrB98aqPQWRjkF/JLQkPTtqzhMeKcSlfFJ5xcwN+58cW1TrVpImDKDg4a4U0nGi9bHAaWxzPYeRf3HfT2cZQ7yMbPSBoUJ5QmTrmgYRn2uQoiCh6VX1hLWGpGJfM= 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:14 +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:14 +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 5/5] Adjust objdump start/end range per map pgoff parameter Date: Mon, 26 Aug 2024 15:35:52 -0600 Message-Id: <7bbd5ca482b052d1c52efc52742f5c2713d5c26c.1724698250.git.scclevenger@os.amperecomputing.com> 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: 965ce373-0d56-4f32-d6e6-08dcc6171c76 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: =?utf-8?q?HB2ZYvmnU+E8K1LF1Nb+MamugnYW9Bj?= =?utf-8?q?B8MTDhjkPQ+Gm5sC294RLgDx5XyQ454aONXYSDPLzES85dy2iumFeR53oCW+FwIVj?= =?utf-8?q?xOQp+pzLA7OV9OV6D01JYypwdzQTwgwrqPwHEVz+RjtNZn1Hwg1vthABW5Tuqi5os?= =?utf-8?q?b/G/AtRhBxZINknbPnthP/NTj9kQDvKT0qrONR7mbsH4hV4kivzGD86gDH5lGA8ue?= =?utf-8?q?uC7fOnpFO+fbZF31BLbtbgP8PRYJqF2Di4ADBqhphDm24SSVN9jPUfj6Gs6rCgLQY?= =?utf-8?q?Inf6IjtrSBywFoPgcltOxTwRbbDbhiWf3xnugusHYK/mzN3VHU3l72BMhtDC4lM1Z?= =?utf-8?q?oNMMEG+3GqvzN61UuHHqs5n1N/XZJar81pl8pafvTssRFB3WLw1tqfwrtoD65XT7m?= =?utf-8?q?a2hbklr6bzXLPigAW/r+xzNOEWp6e6NJfZLVIHy3cz0rhJsIBhMoXQfLEcquqgSe2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?utf-8?q?9vE0NB0eG3mnYWSstvbbSoxLOKqnHYZ2zw=3D=3D?= 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: =?utf-8?q?w0quG/lT3zMffbxVzkzVkV/Z8GZT?= =?utf-8?q?EKgCZW+WrvVmyjNOMRqm+HNqA5X8QI0YPXKzLAqY+OLkJPLE3DfOAzijjbTzbFcEj?= =?utf-8?q?0efVIwbQhFgEaoKFpPc+fMFV8pOV0iMpaMxI0NIRGg1Dk+o74DdQAosTLROXr49Ic?= =?utf-8?q?paMBKu5KfE0d4ourbPgOBbJEJsn7NJRVUclcQnRAfOLoG+V9YEp3dCpyulLWQ+TyA?= =?utf-8?q?B2jlELzqFOAx8VbKtazPH2dbaHMVZNZ7djp2hKDVV7b4BFei63dO8Om+TqnoyIfeI?= =?utf-8?q?DzLcr6nwcsEI66eUv1Ui93wXMJj7Vo1jE/rwNjF9mYjq7eHggu38JsYyjUIlDARgK?= =?utf-8?q?wc2WyGrobIJlL+W4nSNDSxBzhVspKRoe8Ymz52JGIEGnkW99b/SVEQtftZwxZIXcr?= =?utf-8?q?1DXKTl97EP8wh+WoGVkQ8RbMG3YXr6EjC1pzc70JUZxxJhNZGCPLqneMkvvbR12xK?= =?utf-8?q?/3blnqz18TUoVc2SJAfIZxSdDk8MQS6hUgDqY4z7vcCtFf6tImhaL0AyodpgK2Kfq?= =?utf-8?q?2wcHC4y6xhVweOtarq0CcT3qxy41iBKfeHEp2M25aROppFDMZvyxiPwTAg7eRDpAQ?= =?utf-8?q?129Lzwb9KiQkVIawHaWH7CHWR2niyiNFaccjqaFacrbYtwfegQYtF1wcgDR9slKdV?= =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T?= =?utf-8?q?kx0fJnSghg+i3GJlG37ExzamVpj6zbNdPIBjO3EHMtESuZRIj0S8BEeG/Ac0NwuxA?= =?utf-8?q?3jqfe7uBKvw?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 965ce373-0d56-4f32-d6e6-08dcc6171c76 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:14.4928 (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: BHjxdtH/iXuwn5VnOy0aEJLRC3G8EtmME4WloGckAt+rD0JGJmbC7pr2pdcXqdEYCZTQbyfKrXx+B5n2yEcomjGUAbadoXYsvdChk1YE5mFNaEM/lsed9BUZPX49WiP3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8410 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_143622_630254_F38847A6 X-CRM114-Status: GOOD ( 12.61 ) 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 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 --- .../perf/scripts/python/arm-cs-trace-disasm.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py index d973c2baed1c..6bf806078f9a 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"] @@ -250,13 +251,25 @@ 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 map_pgoff != None and map_pgoff != '[unknown]': + if (dso == "[kernel.kallsyms]"): + dso_vm_start = 0 + map_pgoff = '[unknown]' + else: + dso_vm_start = int(dso_start) + start_addr += map_pgoff + stop_addr += map_pgoff + map_pgoff = '[unknown]' + if (options.objdump_name != None): # It doesn't need to decrease virtual memory offset for disassembly # for kernel dso and executable file dso, so in this case we set