From patchwork Thu Sep 5 22:28:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13793044 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 3BDE4CE7AA1 for ; Thu, 5 Sep 2024 22:31:05 +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=Cff4uCMC8cc4jDYyIiCXot/dKLhp7rkFHt5dIeaRS7c=; b=i03oTevWzzFpQ3/y7RvHsfo1mB rB3Ornl7fB4r7UTmar+amR1kRYRhx23XkIDSo8yijetwSzdfpD9aC4sC2Zu32/vPYWixafIgAEIOn hnCVGwbY9Uv8L96qOoGUljUazkfqAcKZmNgcI+LOVDb/9ODgGk5oyyRyaVqRXeMQnvf9ZcblXqz6G gk3Edx+myyHUKK8EVl3rii0xogd1VzMKsuEiS7vtJOAsnhXUr/Y+HxrWr1CAAu99p1T/nVCm7Hb86 CBfZzuLjmCxjltUk3D7001jyuTP6nPUu3NZzvl0w4jAEtl7XRRxSrEJU90VEi0qlM80656cwX/y5y 27ttLJ+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smL09-0000000A1Uj-2p3o; Thu, 05 Sep 2024 22:30:53 +0000 Received: from mail-eastusazlp170100000.outbound.protection.outlook.com ([2a01:111:f403:c101::] helo=BL2PR02CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smKyH-0000000A1JA-2oKE for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 22:28:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GXrsrBOXc5D499vmFNkQxzaltlUMAEwsCbBJks7om09KIVyKzG/YUyQEOqwItnvCqBfqdYxhOP420BV8PAj1UJUJPq6Mixl9MxXFJfRJvaHcdQVey+1IYfDsOYSbAI5T0rcwzGOBklmUtqoOnw1IzoZkeYwqv9OwKJKU0gR3xcRrozTbL4PxwbNZGgrLqvfN3cdOOwJjJH42A2ecHa0mVeQRQEv5YYoc/OI/CA0bscTetwC4pw7X14AF/V34kvOtJwC+sSYULt15UiZPGOauKOpa9ntOuhhXm8X3Zux/pXr/Dcp3iJqPdQ1kwqIm1wx04FLA+tosU+lgekKf4lyoLg== 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=Cff4uCMC8cc4jDYyIiCXot/dKLhp7rkFHt5dIeaRS7c=; b=PXVHcvB8GdBVtTus9EBBZ4QpwyxDE9Y0YksNv57fggP/tu16RpYmpCodBc5V9SFnDG4OYX6OfqJGVPrOwTE5nMvfUNoIVj6fK0cFhzrX3IJ0z/WcZ6LQes9/UKaUzZTXXwXbD6CgDcekCdY0CWQ/LoiVuC9VkN7r5eUairvemjzcridLfHzaEj7WSSNan6HndH0JK3nN2HDOLdQQ4jQ/ZFMyey6nxTa/jY01EzZlk5Fs4rVuvxQ6PgY+0ayhkZ6ena479iPaWkIhWTUCaBIsnpgxRs3bgTGaKJoLsBNsZAkPUEVhx8po3XxmucdvJg/dT2Y1HyoN+W2F8v160taxCg== 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=Cff4uCMC8cc4jDYyIiCXot/dKLhp7rkFHt5dIeaRS7c=; b=AIIX/5obUcmjskOYbLBXJ7sVqH6eUC0eZ1PZMfmNJpMF2jKbYDqlkwjdI/fnBtg+vCWjdDIeGdqd/ioMd0Um16xeY6JYwo3HDU/N9nJUclxgAkfQ7pDl91Ppup0krI1HLZeX21/Uq92yrGK1pKOzQ0Nk4jzpIxid3TaVrb93c0w= 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 PH0PR01MB6501.prod.exchangelabs.com (2603:10b6:510:15::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27; Thu, 5 Sep 2024 22:28:42 +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 22:28:42 +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 V7 4/4] Adjust objdump start/end range per map pgoff parameter Date: Thu, 5 Sep 2024 16:28:25 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: CH2PR18CA0056.namprd18.prod.outlook.com (2603:10b6:610:55::36) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|PH0PR01MB6501:EE_ X-MS-Office365-Filtering-Correlation-Id: 01649d40-1d00-447b-367c-08dccdfa1899 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?4dwTRzGD9d6zgT48o/0xE28z+TYEwOp?= =?utf-8?q?DCHbJB5GEtLkdIWdlt5xg2BCzK5fAzMApku9BMAxvAdNwgjn+pnuLojVkxn5hYAsU?= =?utf-8?q?89qqhhqDnKqw/UulGpW1Ob1x48L86bUaFdIojIlrZucsCvhIbHQz+E7MVCpQNp5qf?= =?utf-8?q?LcsvDvwOYV0Gj9NJr+Nz901Wuvsq+9UQ5S0ewhfl57CNooxN4So2TjxdfggPMVFxX?= =?utf-8?q?zu+4Y3bLYUeZa5E3ROALa+CZY3cOjrwQUIpjxdXzqy71wVLsLi3C+kHuIYxQr8VHd?= =?utf-8?q?+x2T+GD4DXDZAlnniuoe45D02ETn/aMavrhdrDro+kjHeztiBqJdz/H1y/a/+SFXJ?= =?utf-8?q?C54yE46jN5QoAWU3hMdCcTwHiIaezvIigv1yOmCzDsgL1WMz4WLkZEMsprke/PIIn?= =?utf-8?q?tXyf06F1+7eI7gef2AR4KfLLxGXxrKPI8X1+KCoRxXoofT0u9g2yA68w0IW+vLexk?= =?utf-8?q?ZM9Kc+SHU3Rfjfe65yOglsd8PIGOv5aBIoeynKRO3+M7La6T9kd0WAXySM6EqjlEU?= =?utf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LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR01MB8146.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?W7jfuyBk4H83zlykPclJ/DQ3c0zB?= =?utf-8?q?kNIE0J3Uzqie10snAlRZwTWC5kG4owfHVMavsOOtRZ8feScqVLqaqdQIAmWp9wxWW?= =?utf-8?q?uCZlBRPNA1mii2hsJkxwCt9KQ9NdoCfYx4ijmDsId5HprDsd2UxV7nj7ge59NTaaL?= =?utf-8?q?IYtpiQGJjET5fzPF8xTOBrKIPo+xuzZKY3NMJYqUNcE6ntu2q2axYQA45byeQQ9+/?= =?utf-8?q?oFUZB8X8hKKpqOrQg1YVL5+nEA3OGQyKNMTZO5UN0XizkvfRMWfwbZ/Enc90SrMvh?= =?utf-8?q?U0fillW4WYPBJHYhooz2b4n2n+TPbWXSTDbRVOcvBdOtH7B2TV2WxId5o1J8J9ptu?= =?utf-8?q?1+W5+ukfhRoritJa8RSbK2LlAw0J5yJJRBaV87ODjJcUqfcO9lAniQblOwUMwblpq?= =?utf-8?q?C8yIUWLYzlmh1k5mkW+tFwAh49AA8QwmWE/UmdOi/UOiweERVlF5mK4/b7pGRIve1?= =?utf-8?q?KE60Yhh2CRK64lOg8zdFiIcUbtFNrITd79CJ+/bl6E2EZvl29sgP/WS9vE/3D3FeA?= =?utf-8?q?KimwA1Fvz7cxn1ORNH1O7zo4cU+rIyFTK2nq8kEXJxgFSah8hKi+79SjZEjii1QG3?= =?utf-8?q?RSJKmpMD+o646mMhHndcTgTen8I08s0y3u+05z5CLGaUPDKuwwxdTxcp6yWY3BniA?= =?utf-8?q?0ielqfpPHXfvqIxAHkoVlDAYaF+7dlgxw+6mVEB/S8OhD9BRuK4zACHI/GtIImwhW?= =?utf-8?q?hYrjMz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Q?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01649d40-1d00-447b-367c-08dccdfa1899 X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 22:28:41.9187 (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: CcFXkS9kJjW0gOMdn9D2eTNGzAs3kf31rgQCoWbMycMUsVBfoMdInSeDZuuWR0Rhspx9oukNbAvucqb4uEFmujQb2kPBBKPybQhxTpdlhQ3Rqg387EHZ1l3x6DLT1ieh X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6501 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_152857_789988_EC887177 X-CRM114-Status: GOOD ( 10.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 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 | 14 +++++++++----- 1 file changed, 9 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..a867e0db02b8 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"] @@ -243,9 +244,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 +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 + int(map_pgoff), stop_addr + int(map_pgoff))) print_srccode(comm, param_dict, sample, symbol, dso)