From patchwork Tue Aug 20 22:11:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13770608 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 3FF64C3DA4A for ; Tue, 20 Aug 2024 22:13:54 +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=ZFvWZRecnX0N1ux2PHO8A48Q6TMXZBkQUslN0TESaiY=; b=liLaKgIyZErFts5jaOBFpVM3B4 XDHVjH4F0XGJj0958fxbiCXL62JTnSduZW5GKgiUjTltz7TSUHvizPekxdZdVeOGrZ0nXLicpjJDu SNHXp/5RAMxr5VuLfK6zO558VR1zImwZgUKDaH38FpiebesejFHuv/y0ErLsXFtNE8Br25mbI6oG7 FkZyZgzVsX7TnQ6JM3j081IZ7BHEkXyBw1QaW92giggfe5oC2RtctnVnbpDWOYm0lUIf+sIjf6h9h SQxPDWtUKE6WpCy+wy4HdpcRqxr3ga15XLwuya9JQhlpmkWeaUEQf1P3FRCUj8iuClHcegFtMWUTj C5R/BmaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX6l-00000006mPa-17s6; Tue, 20 Aug 2024 22:13:43 +0000 Received: from mail-westusazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c000::1] helo=BYAPR05CU005.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX61-00000006mCF-4AO3 for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 22:12:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=I5yM/SmJe6IK+h7HDCFXIxi+VgUX6YRyqeDvBENgf+P4OXoIpGy0+NL5WUo8ROS6nhYQwF9nMfuI03QVNJym0BzwQDkKONqwRNO9bS7L4C/ntwX03B6HcmHs3o3gF2TRf0lU37PumdHWpKZbGt1x7XXFK5KOJMWg/Uy5PmTcreBRXB1BknOBaSn05RPHz899/AahN/oZRgLmVSkGphZGDB2zjzQqc5iGP5D1leUjsBFx8drgn0I/j0TZ96gcwjUP/ZZElMHdPLhfGKE+Q8u8daetyrZC/CzuP6xAE504r5WR6IbTrYe0kD1fb1d3wHa7u6JRc6lW2yzDn1a2iR//TQ== 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=ZFvWZRecnX0N1ux2PHO8A48Q6TMXZBkQUslN0TESaiY=; b=Kg+SSW6zH1eQAkDEq6mmcYQVFuh82qkHVsXn32Bswi5jMGdfqs5DQV435sQNcwatTpSNEzxWXRmzVP+HFbU4X5UP9o/RDqaWaDpQwqG3Nkl8dtkAXFtcdAPxw/4ZzTVb0K0MyAedlJpKjNYwHsAuOmH66ZsszosMe5pexftpJNKPLj9FaAdg60EmO4Y8QHl3Jq5a80OfiPpLIs5n/S24e9Jw0XewG0fpyxhnin6tqEABscIFSVFfDeBNRrL6p5EToO7U1ChFGWlgx7TxryxhQlArssxKx6JMVNzfuzhn+4AUxb6CGaJKKNB6lHJVWknozXjrUTHYoedb4m2+UqMv2w== 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=ZFvWZRecnX0N1ux2PHO8A48Q6TMXZBkQUslN0TESaiY=; b=ZygTGB3ucG1c9YB3j7BavIv4lPra2HxicUBFk8uCis736Mpeej5QUs0Y97Mm6o+VB+iKcVSj96Z4n30gl6scNjPuM53YjrQeSVz0jyIeLxCe6O9PbudMYbePtz/sNEBERkmg3pXK1y9J/s3PHAWxhJvS7M1aRjHmT7CJCn4fkz0= 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 CYYPR01MB8601.prod.exchangelabs.com (2603:10b6:930:c5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug 2024 22:12:41 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%6]) with mapi id 15.20.7897.014; Tue, 20 Aug 2024 22:12:41 +0000 From: Steve Clevenger To: james.clark@arm.com, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@linaro.org, ilkka@os.ampercomputing.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "steve.c.clevenger.ampere" Subject: [PATCH 5/5] Adjust objdump start/end range per map pgoff parameter Date: Tue, 20 Aug 2024 16:11:31 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: YQXP288CA0033.CANP288.PROD.OUTLOOK.COM (2603:10b6:c00:41::30) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|CYYPR01MB8601:EE_ X-MS-Office365-Filtering-Correlation-Id: ace6a6ac-e831-4fcd-b858-08dcc1653560 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: =?utf-8?q?PFj5Bugl8edTYjCSAtVTt5dbIDsY0aZ?= =?utf-8?q?DlSyQakakCaR7WE0acQJLNK/FmSr4HJh5V7t8ylCFcBOIlHMVsnoYtT+B66C2kH/P?= =?utf-8?q?+rXBVOo1F5JvTzq7LZpovCMY2YvhIZ3U6Kj8Pn3KI0qhpTeiNZ5zyvd2WPmGaN3vR?= =?utf-8?q?YdMXyX2E9U5fTaQuEiA3bv1xqVpUTnCTcZD0mC9nc1nZyWyC8NgHXPiObcpRhsfkh?= =?utf-8?q?QdY8ylWyqkD9TXKm9yZr+nrhTYtY+ZBzhvqjl9Ek6N5ZzDIPBkqAK7y3kuIsKWp3h?= =?utf-8?q?HYygxd91vX6w3797LxS8dy90syVBnGrF4JNUbjx7paR3b+R8xm1pz/robx3Hr7yUA?= =?utf-8?q?mBGwuiUEnWymyPmU77zVw+zNLD5fN0SS4Ou9gnkvn4PXwDZFYuBnRBpYKM1LhOi4B?= =?utf-8?q?yRlBHu5hltNFEW0BU1ufCdyOWmtfLS31wQS9uDIoyfTzD40WnzKnJ6rBD5a4fHoeP?= =?utf-8?q?jrNwpBKBHbsigFo0LhKCAKq4kqy18ubZlRNITNLJ4sjaNhMtj0Z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ispam-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: =?utf-8?q?Nt3DEs2huG2ut8vZLpxHJiPBYSlM?= =?utf-8?q?s4dsQYH+WmzZ/YPItrQR73h0XUmzHboJ3nJzyjFPpHrYEUSLjPkwu1H+kUHi2DT5W?= =?utf-8?q?LU12myZHBlr1HGjhvuZqmiDfhPJ0ptNmvei5jEfsl7OqHSK873E89OzAWADc6iCns?= =?utf-8?q?ikB+GlrUDaRp8fRuL+ZCEUZ3M7uPeYmGxq7/iRXLvYSFct/tEHKpaQGOLbW7KZH5d?= =?utf-8?q?mlBEGwujGTFh1Sbg9dbpqvSXLb+RdUld8Pu3QA+PKFBJO8j3/EeuI68SEyAZBbDzp?= =?utf-8?q?7d1jUoiTcb3ZfIyJ5OqhJE5RwCMY4o0dgijNvZy7f02oX+jeSJ6Ni9jhKL1sIm629?= =?utf-8?q?A8kRES2oG/FJlOdVhQikuUo9EY9ki/YKxmPinNVvjEnuWakIp8QtyLzSwed0tVzR3?= =?utf-8?q?1KIPjB7U1ywHkb0fG3vgx38q0m2/65OXq+gj14VyjetZthmAj7t1yx84IhZrR+cNx?= =?utf-8?q?ONnimFiF8FoKSMXNMmdvmYnTqjUzkBRs9whAOESGm92B9Cd+J2KWf4VPQkFjSXnnH?= =?utf-8?q?2UJOofqCbJ+pUvj0rmKGRkUh/Bg+09y2anzIkNl7J5W16yQI6bJNOV9z58kKvoIRZ?= =?utf-8?q?wYBmE0Xid5JTzeVgrrIgj20npncaGR9LZ72cO6t9fzxSKp9OBjaZPDGYWNkvdxJmc?= =?utf-8?q?pUKgkli21+125UDoZE0aJGUpcalopuWOP2NP9gscTfWDhr9WW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sGxOJ3V?= =?utf-8?q?O4dlFzW72Ma?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: ace6a6ac-e831-4fcd-b858-08dcc1653560 X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 22:12:41.3591 (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: i0QybbHsH4sbKeumO5acDM+BcGTJQjN7HXXyftPWg7Z8L3YanpVSF8JtIcAALqmjHXpzkacVqkwSFyxAUUZOK28hFiaES0OfwSGRE7uSLaWYFdHEIGvecQHYcgJWcciY X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8601 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240820_151258_057213_152D7FAF X-CRM114-Status: GOOD ( 12.55 ) 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 From: "steve.c.clevenger.ampere" 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.c.clevenger.ampere --- .../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