From patchwork Fri Oct 11 17:17:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13832766 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 3205AD0EE12 for ; Fri, 11 Oct 2024 17:19:11 +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=jQnNZ+I3g95NNJ4SUN9rbdBCuCteFSAu09Vh2oyqlZE=; b=PfUgnXmLINqcAa6vQbUdVuYOB7 x5q5W3QhZXZ2euFP+Z1A2qNldCNrbjwreQTNhCE7Mf6gLVOGyPiP3kHPmBKZmIs3g39IPNu6vWpTO s40IYPDvdQKH2rD2hWc5XlmrgRBsPc50HoPZCFcFfUfGgz30PRiaNT5xmH6hzTfQPiaI0K8ChYARu 4Ul0xBYBqcCYv1CIWQwvRL4M3dd0kqDl4XsOxjPPwN8g3xu/GDr1hjZ9DLJGDNcG8QduNNXdGd4dh FKtlFAmzdGOukAF5ZTwxX65hZZybaZvoZaK8tKPKLBJwBV319Ds2wsCtvO7OGzDNNlKjd8r1AlaOy A3AG92Lg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1szJI1-0000000H5TN-177I; Fri, 11 Oct 2024 17:18:57 +0000 Received: from mail-dm3nam02on20704.outbound.protection.outlook.com ([2a01:111:f403:2405::704] helo=NAM02-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1szJGe-0000000H5HD-0fcd for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2024 17:17:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Yw8O7kpUYL2e0MHKLoIzkjN4FEAVKjYwCXaeKB2Mjh9BfsSDDk7MYiGOiRTU/c1ZIFFGc/7NPJOhjo+3Nk33eIcOg5liPwDjj1pX7NP/k/69eXKr2oULMLKhThn53eBIzzqF9FNnINViBbjfYKWWJK7nKBRfBXM40N3f7WUucW1xz89U6MTRGl3nV7Uj6moDR59MAeGgfjWIVEnGiLl5h8tocOnHmwyzT7i4bhCn18RZmIColbVnZ8I5ukBuD10ecq5FW2/E+OCOd+tgoLKO8oEuXZSZc9NWsDAHCxnK3wNDiX6s+r+MToB2MDJwh7KCxCgYeszE6S+iWM0Gk9xCJA== 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=jQnNZ+I3g95NNJ4SUN9rbdBCuCteFSAu09Vh2oyqlZE=; b=SCewjhlV8fnlam3UapvKoWeN8+bE/uAjaulxpxLMpytWumL7BQLHfWImQGdqqSjomYnnJ61JogO/bNcFlBxWL5kSFvmbRk8jaSy++MpJmyScwQjXkEftalwRLHNwEKirTph3r0zO40uRk1sGO6evWuHhusadrrq8WmNAoTf0Mb0Z6ms6rnkpZkr2ADosnQMu5MERB/KyOqCDFfX32wiK/6hOfd481TfaDD+AhYoeObFrla8NTDZBd5X4tkR7tltgYNP48Px5QMwU+RB6RvgzQfUY6ZriKKVLTLfFyRgnpRsAk1lH0YAir8C7xpR3nhKgRqzwyk3sgsq2uPuWnWBwag== 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=jQnNZ+I3g95NNJ4SUN9rbdBCuCteFSAu09Vh2oyqlZE=; b=pytecQ6ppqKrogunm6z3f55av7tXWgm18IWztB7r1QnCHNfEW7aKG/ck4huN07KHkASHtpBU3qo5aucXo//cAm7VRh9nwC3zandbHHskFmTOX1HtEYqT1fKCM8wX0oVdD2nubbtnI6hyruhnbBB22/NMwN4wES3dYmwzADPneCk= 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 SA3PR01MB8451.prod.exchangelabs.com (2603:10b6:806:394::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.34; Fri, 11 Oct 2024 17:17:26 +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.7982.031; Fri, 11 Oct 2024 17:17:25 +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 V9 2/2] Adjust objdump start/end range per map pgoff parameter Date: Fri, 11 Oct 2024 11:17:08 -0600 Message-Id: <6107521c4fb1d4ba2da57a6d81c17b54f259feac.1728599785.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: CH0PR03CA0311.namprd03.prod.outlook.com (2603:10b6:610:118::13) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|SA3PR01MB8451:EE_ X-MS-Office365-Filtering-Correlation-Id: dcfe851c-621a-47a0-df9c-08dcea189395 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?dmCoRd/gr94qi2eSOU0x1GlFETxz5oM?= =?utf-8?q?BrQP4OB1FIrurMonlsiAybvUUgKs+YzPKeBUWPdauvP06/0KgLzjDgHR8Ro2r4dHV?= =?utf-8?q?to0pYrJ1CcQjZLbiVqt82D8KImS+3F0xNDoxuaiUaTaLRl1NJDAafGvwSUbOfsVp2?= =?utf-8?q?VpaBww3EBtIrfTmjlUnZ3OkrBd3aryZY1j3A2QeRoioSti4d+H/tyneKCfcjb8cv7?= =?utf-8?q?y1ONPcZHGqYDbgG7QpqWATKT0Lq4If0kEO3cD1XC1spt0KNyj9gQ4dgQl9+3PGXAS?= =?utf-8?q?Ixb/wxpCGOwEeA1tx2kxDrGZ7A4KV7Tg7UK5pTM7fJshdL5CulXQ20Tm6+7NQ7BSU?= =?utf-8?q?ZqWIORprSRZUsm+A3nxcg4NPQBpdadHmNAgrc/VazpKimuB1wN2m3PQ7HtCvNE6Xl?= =?utf-8?q?/GuZkl55HtLD7b7YOUn36enpf8xomDikMyIXbSfH1QQmEs4MQslCxquWwLQdIZCn6?= =?utf-8?q?qTC81zeo/1cpynHDpmz3mqEtRO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H:PH7PR01MB8146.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?CqgYi7ojW2/v+UykFm8rZwT7SFCx?= =?utf-8?q?k2ilOM40dQUBvAAsmbsLDRgqJ7p8eOjfZGlPZJRe3Y9i5uFhAgpQ+ofsEw3a9KdxJ?= =?utf-8?q?0/i0/KSeoa98784UL7pVGUycOkJRdlwtYLYVC+FBSVuz+hfbwaolCnPoerlFEg90C?= =?utf-8?q?4HrYfh+jEjN22Zm25yHszD4LHJwRwU/rUWqdHHRzUojhdjSLTK8CmEBtpK2z2DcuS?= =?utf-8?q?f2Uajg2KD6iITMF2lDV+YHPUjMbRKePqVLmajEbhIPfo+8gA9fg3rWdiAemSR1/dR?= =?utf-8?q?kmP/nIwzufLxISN04Z8JuaaDihh2H+t6oSr3t9bm0DSRr6xqBKhml+uR1TF6NHZXT?= =?utf-8?q?PwG/ulGkijCp38R8OEDkVcOueXFW5tjMQR6+U6BALJBp1QlqfIzaAkmuR0A9oJMVp?= =?utf-8?q?r+6O0F8q7xG0DQ9ardvhzdcYyNWNHApIxiRu4YQldQZoqwC0nIhjlq7fxGXAhWGNN?= =?utf-8?q?yBJTaS7ea+7J5UGAQzRfLrJ3Xbx724/0lcOMh3ZPNzeE1ycopFnWVtnXP6zsDlNlA?= =?utf-8?q?lQRCawbAfK8iQHwlpReioPvW0f4lmOufeVZay4u1UbszB3rM+jzK9/OwFF/Dtw6KH?= =?utf-8?q?9oJKHx3U88LjTX6l1ErrF3WAWj2aaozjSJGKcdw89uc1f9RARp2zBbat9vN+iORSZ?= =?utf-8?q?sbxlU6JdBG0Jh4nAG4Kq5eTKTzAWQPwW7AcwZDPv23Bmszyyud+5cVx9ZVK1p6uLf?= =?utf-8?q?WUtW1h4HpM5CKlnhdidvSNG55xYYlL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enant-Network-Message-Id: dcfe851c-621a-47a0-df9c-08dcea189395 X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 17:17:25.7408 (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: W9tJIim4by3XtK7sjouVZg8djayfsNYeXQZNWRBak8GSoZqNR65JYx6eBYWnFxzdSuB0fN6GAstxiHaeoIVa3B6jn5tfg9e/QBZa5EpA/KrRh/fhW71PN2+kHoO/DgWr X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR01MB8451 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241011_101732_230552_A5A5423F X-CRM114-Status: GOOD ( 11.31 ) 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. A zero start_addr is filtered to prevent output of dso address range check failures. 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 Reviewed-by: Leo Yan --- tools/perf/scripts/python/arm-cs-trace-disasm.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 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..e29a4035723c 100755 --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py @@ -187,6 +187,10 @@ 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") + # check for valid map offset + if (str(map_pgoff) == '[unknown]'): + map_pgoff = 0 cpu = sample["cpu"] ip = sample["ip"] @@ -243,9 +247,10 @@ def process_event(param_dict): # Record for previous sample packet cpu_data[str(cpu) + 'addr'] = addr - # Handle CS_ETM_TRACE_ON packet if start_addr=0 and stop_addr=4 - if (start_addr == 0 and stop_addr == 4): - print("CPU%d: CS_ETM_TRACE_ON packet is inserted" % cpu) + # Filter out zero start_address. Optionally identify CS_ETM_TRACE_ON packet + if (start_addr == 0): + if ((stop_addr == 4) and (options.verbose == True)): + print("CPU%d: CS_ETM_TRACE_ON packet is inserted" % cpu) return if (start_addr < int(dso_start) or start_addr > int(dso_end)): @@ -262,13 +267,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)