From patchwork Mon Sep 9 21:29:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13797610 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 39A12ECE589 for ; Mon, 9 Sep 2024 21:31:42 +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=1DspkEFSv57JVf2Naez3yZOfaGnypSIhtJnIVYOHXKU=; b=slAvape5oFZ2f/dPup1MAQAWDq quLkoJinv7hOho87cxu2o1fJeWOma7ZAEhv2jTzXgb9p1DYLC01AKAUKt9djX1YY3F/Ma1NE3N1ld t4V6p6J4fBgS+jO4Cmy9prKnkjJSG/FfdWnbfEhtmyRLVqANEBeVsDP9qeGi7WrcIOfTgUf0peENZ De26OyH+PRxKUH6W+Kg/DsecOHgREZ8RjWDifdbR804nqYOct5+6mk4czCfFz4So8HHeJNw+aFvSU 92ilY0MrBowMQa9t/JZNBJXlneGVSolci7/51kfuELAzavgfZTxdobS5m8Hll/lWWS9Nskqh7Rg2f idgaBJgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snlym-00000003Mtx-242b; Mon, 09 Sep 2024 21:31:24 +0000 Received: from mail-dm6nam10on20719.outbound.protection.outlook.com ([2a01:111:f400:7e88::719] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1snlxl-00000003MpL-2TWZ for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 21:30:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vmDW6ZPFf/L98xkr79ycWNYlNpycbP6Jzou0X7/19NnAkVMbKbTZlAI2mpR3vFwZyVfsZY8Y65voRCrkLJeK+hNUlxg4ZLqdqn/9yh2KxPpN7V8BMR20jZhKK7tgDT65MIsWoa1H2wXUlXYCSd4Pz27P8gL1f1H6cNaaO/CHbJik7/dY+646HUQMedjd0Irgg6vlJfa/23oz7MISSiqecr4iuZSRC5w780v4BDiF9oleLY3IyLR7JbCfYnUoRLpjnlJjBQDUH9Vd078HoYwDgGDAwzxLPpv19YttHandlgzNgG4Cbn6jkbc4E83pRH+FBCSWqmFVHzGFM9CMV02S3Q== 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=1DspkEFSv57JVf2Naez3yZOfaGnypSIhtJnIVYOHXKU=; b=l2OFXObYJYeuRB3C8AjPI5vVaEFJYwfP9FS4ISWeLByg2etOpKvkDNrisI4YSagR66lV7ItICMva6B1nEjYVRwhDOucAni3RchnbW/2uLJPfIggbyekEUwtoPXTt2ZTj3WyU4VVCn/F80nKFwtgxTvROunae9QT/Uv9ZSBejB3YSgvPAAZePhJ/xYCyHLfkG1QyTW/0yT3oPMnRtpoCzqtGf0kHPDl96BY3/eMVOIQuQeevLjyX07kQCEyGni/P2viXda4Kt1098WvKC8XFDaAb1ObN/vGO4lbcF1PK7R+rGxpN6RUcVZLQJ0gOAHiCZ5Sv2kIll33beld+1Uhq4MA== 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=1DspkEFSv57JVf2Naez3yZOfaGnypSIhtJnIVYOHXKU=; b=I9jBADTk2WrT2912iV+RFPZmATzP4rjIIrGjNZNSLrVlPHPih0VCEa6gE2qg8NG+C9Jx8h2Pf6325FOWfIh9J5wl3JvuLpd+VMD/YQKYj8rSC6TG7JJWt2j3CbVRS+XvT51z4cvRM25aQXtW/DB2iCjQZN4I1Y0iIxpKV1LiFP8= 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 DM8PR01MB6919.prod.exchangelabs.com (2603:10b6:8:14::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.24; Mon, 9 Sep 2024 21:30:15 +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:15 +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 4/4] Adjust objdump start/end range per map pgoff parameter Date: Mon, 9 Sep 2024 15:29:58 -0600 Message-Id: <6013572cde82955faf0d3a7ef7dcd415ce843c84.1725667397.git.scclevenger@os.amperecomputing.com> 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_|DM8PR01MB6919:EE_ X-MS-Office365-Filtering-Correlation-Id: 765df24b-9fc8-42a3-0960-08dcd1169839 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?TTudJTRwz8OSKJmejsnDlTI+p/nhumo?= =?utf-8?q?qZfqyfvBvXsFp0UvjL+aVwj6XkcbXYw1vUBIUYsvLmByzzUKfs5TGYeXcgIE4Eq4s?= =?utf-8?q?TfWh8ozQCH9fFQFuir2HhcjvC8tIx2PUJ9QUX6JXJoAzscqr7QfSME0W3hTxj6Nhs?= =?utf-8?q?ejKCDERqqJHJTxek/fOxz4wC8JhTTrFr1Nrsk+q970GOsayLG2VQcdzEg9MCajZzb?= =?utf-8?q?g0ixsACLHCuTbx7u/7ZUF6GWKM3y76BZbvUh7HZZUcedw/+yiabc5kR1+Ph6rW5r8?= =?utf-8?q?zkqGtwe3/8/Rd5yEJjg9J/EyN3VN8lQN6+7XhhRHmxKvMPwbGdltmipj6DGFuah2O?= =?utf-8?q?Glkx9lUOrv6s5GsMfo9IVCGVEs5q3oQ5RhPu9WDyjL2VwmxyJOuPyqgC1PGWlOtQG?= =?utf-8?q?TFdzhaQxgJLPMBMAkWYqUEL+f4nVgDIkwMidvyBh8Rrl4voyIekIIl+gaI8SCYTAB?= =?utf-8?q?3xoP8KqeukOud3okVr9dSqHUxOg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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)(376014)(52116014)(1800799024)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?IVWZh1R7evbi7ntbNG7NGDmr+UIb?= =?utf-8?q?e5nLJuJlDUsci88qc9thuQjFbrx7gmoHem85FPDCCviIn/yLhinDE8yZA/Ul5mdMX?= =?utf-8?q?t9krKZxw/5XBpIGRmwhsn4mYfGyyLBipH5+nbc0p2vZ0BCDVOBGfCVoZ+xOxcbnCy?= =?utf-8?q?Ju/3+PdsDuKG0Rm9/zYu5ssDIhQtKox11/Q1HifP8J6jGfYHwR3Q10ZnPhNsL2b9x?= =?utf-8?q?5UqGsPfOw9yLXC2+8DvPf+HH6e3m2xeW/Tys8qxRsBzmMzQUQcycFwg6sNL5tK36f?= =?utf-8?q?Gynco0Y50OTsyeQFLVuZtSlVnn39AVxvZHxM0T7/x/UfZZ5NfktkpB3oUc3KTEOOP?= =?utf-8?q?24E3xmMzQfVnBjuQNo/iG5AvD2LuLtrax7NJ5aFJMn35I0bGHcqe9yTPF/3e1nzDo?= =?utf-8?q?KKFXmF3+4YhHzbdzkV4lCe1OZL4WxSUucCZCAJYRO0TKmnuPn/KiszbeahjNAw/Mc?= =?utf-8?q?keH/qGNSLDOVebvtafY3+Op5fo6PXD1d63PLYvw/k0FU2WqlXGlhCnFlljl77v9+C?= =?utf-8?q?IsHFMbzRXxBWrhWjiFy/Sr8dNaS2lH3RhQebxlyJCYGx7rfnLU1ESIK904u4tYjXL?= =?utf-8?q?YAcGWlGmk1Li487778SrgPssYTP8Qgwk3Hzd6t6SBEGNhIwSWKXimbng/rZFquyJP?= =?utf-8?q?ChIbTK/IIiJiVyVqAOnFUod8nefuTGbw4Utjq/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cRHvTq09l+AEpwD/?= =?utf-8?q?B0zNGpLpJZu?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 765df24b-9fc8-42a3-0960-08dcd1169839 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:15.5205 (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: Htl05bYsXN3ElLS1pwNLcytADFavW5fw8AxQ4MUdNPzKLq/8WOTKePTG5Nhi0JBw5aYr0hpXkiT5XDmPSGl/gAqQY4cpJKbYkvBjQo6pKYuFiqjwPz0vk8pFw0CDLQTR X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR01MB6919 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_143021_662798_66B15539 X-CRM114-Status: GOOD ( 11.49 ) 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 --- .../perf/scripts/python/arm-cs-trace-disasm.py | 17 ++++++++++++----- 1 file changed, 12 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..0d97fcf51b91 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,11 @@ 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 and stop_addr=4. + 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 +268,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)