From patchwork Fri Aug 9 09:40:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapatrao Kulkarni X-Patchwork-Id: 13758602 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 42A95C3DA4A for ; Fri, 9 Aug 2024 09:42:07 +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-Type: Content-Transfer-Encoding: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:In-Reply-To:References:List-Owner; bh=jlW2cNNZnE9ul6FF6og2+kVSdtbF4MwzEZM5rJq1Ros=; b=hxyOzNAMB2enEKAhVgE1UnNvrv hxBFPDoKaIRAfZ0wLa9lv7zXJf4QhtWwh1C3OL8cVHJvJwfsZrDr4BPiTTsWEDcvgnIACnRxDcyee Wf4ek0wpD1aP+B7PDX2jjQc5o4Y4LPelat90HP9eDnMmehQqn8Abdd1iOxKPM6QVQzyD03dBE+ZNZ 5oYamIoQLIYKtdS7sh48jGR58K+yYknV33JaTfUz7v7LVOeIp3HcNelXdbBLAn1Mtp5Hcwx9WXff/ dtlb08GhWgdwPUXJixlj3c3H2FG0iAaTdYXFhBft+pgEGqQfyyQtGQyX083ReoTnvbzxCEWfiI0+1 WH6m0EYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scM87-0000000AqaM-3aV3; Fri, 09 Aug 2024 09:41:51 +0000 Received: from mail-dm6nam10on2072e.outbound.protection.outlook.com ([2a01:111:f400:7e88::72e] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scM7X-0000000AqVl-2mOo for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 09:41:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hm//GJL3frumXB6JCNBxerriq7e2IvqqoooGstEPvD+XGFP09lZpVcLFD15c3EhR+JUe3aKaD5edtCQJjuHgx3mY4HSf7aCD7cUCDdUZ4o7SI/PZfp7Pi6A5+6pzcf/octXkRQN99pf3AhQ3zPCOj42WJQ6GtoLgbic3+qgRTXQHG2pkTyKCeSge64DTV0mVevYo7IB9TVicLabcLEPPx3Op3WwKKxhG2LgzCJzNZJi5+au7ebqCyaCeDM1C6P92mcy9wVRn/hvsPVtjNr0yvsP5nzXrlUJife/KSc8egZrbgu7btxAq8CAzo8/TKuRCsy9gVeof50VcdIb3ik+WPA== 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=jlW2cNNZnE9ul6FF6og2+kVSdtbF4MwzEZM5rJq1Ros=; b=g+cmhG/vgkwZTkveKxPR9dL9yoLAtZBrFr9A5aXp32+dcrEN9DOrWKgRuJBp2vZjWlUwSF2rbsQn0s+lABtPTCEqTSTB6HDg+91HY2AA+arFdRnOaYHB97EyNx4uEcC/+DCn6YD/P+yHLNC/dqjDacMNVjMTb08Zk23LCevuwiZqUyl6HLObq1nvWNuok/bdrDgCGtASBj/tbPQOyB2In5MeziNR8CLO/cdIiMh9Q0gl/bmMMX01xCD3UIWwppTef9YuY6eWZx7klyITg3SPX9garFFn93luuz0M9BLSrCeW1OyLL21oUodnDxtNH9PlXTvRXlZtrKlybM2lCsZveQ== 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=jlW2cNNZnE9ul6FF6og2+kVSdtbF4MwzEZM5rJq1Ros=; b=cXxyxTHTcq+5WPm5YgItgRLGzhHpZY+Fkzq6gR6sUz7RAYoblS/1Fsbc42hfm/MR3WQEsJn1XNzogcTAxnCKy1adGyTjMhUgCfbs34tCXkIXp2/qoZ5Ybg+AJghNO8MYbJkngja+Siqy0lAK//FgB3KbdXx6eW88Tp9kbYJmhaA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ2PR01MB8101.prod.exchangelabs.com (2603:10b6:a03:4f6::10) by BY1PR01MB8804.prod.exchangelabs.com (2603:10b6:a03:5b7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.32; Fri, 9 Aug 2024 09:41:09 +0000 Received: from SJ2PR01MB8101.prod.exchangelabs.com ([fe80::292:6d9c:eb9a:95c9]) by SJ2PR01MB8101.prod.exchangelabs.com ([fe80::292:6d9c:eb9a:95c9%4]) with mapi id 15.20.7849.015; Fri, 9 Aug 2024 09:41:09 +0000 From: Ganapatrao Kulkarni To: james.clark@arm.com, mike.leach@linaro.org, suzuki.poulose@arm.com Cc: leo.yan@arm.com, acme@redhat.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, darren@os.amperecomputing.com, scclevenger@os.amperecomputing.com, gankulkarni@os.amperecomputing.com Subject: [PATCH V2] perf scripts python arm-cs-trace-disasm.py: Skip disasm of discontiguous packets Date: Fri, 9 Aug 2024 02:40:47 -0700 Message-Id: <20240809094047.319917-1-gankulkarni@os.amperecomputing.com> X-Mailer: git-send-email 2.40.1 X-ClientProxiedBy: MN2PR07CA0008.namprd07.prod.outlook.com (2603:10b6:208:1a0::18) To SJ2PR01MB8101.prod.exchangelabs.com (2603:10b6:a03:4f6::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR01MB8101:EE_|BY1PR01MB8804:EE_ X-MS-Office365-Filtering-Correlation-Id: c1afb3c2-c17a-49ea-8d41-08dcb85765da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: COqfRagNe5e4GKQ0CzB1mo7HtvC2rXMQY8GpGR+USQBHXupi0PcJcl1GU+7rmeFVJkAQtDePm+TZkzWRKKGf3yCFhwXRbz6RqA/wKqq1Hg6e70YUJYS7FTItZVKBH7c6F6/PgOUno632yunX0Gh6Y50ymaHXknaRUkSmy5PCftoHJwXJCqQJ2stQX7JTdsBCx55Ic/lvxcTMa2YcqJeinMZXEb9OUQi3+138Aqw0ChHOoVF7FvjKf8n9dBy4yNf24ObGDHK9BD7OtKXW7siOnAQhF4QF1CBf+pBTR3BbqPRINbq1E80xYzi40SwQvfmpoqFr/ML/TZXlr1o0fgUvgz4BH6w41bevoBc/BZRNkZ1SdhrnZZvhXuoVR6ff8E0v0cCcBGn8ABsc9i591EosebHI5oV0GzPbEWYh2F9vF1XHSOIdBYvNXLlM901T6Ige2cROMh0JF4OTrw3klUwbALCMSfW0hi4pwvMMxJVFTLfbmgnKGY3bYc1rLhN0yYQZ2XMCpnVd737HwNYjZWniKK1AJwdzvHSVXzPS25F4pCvj3LDlPr04vvhEbqPxsEt/EaCX2UK+sEdUIIbsbFMvMgF2vuvDel/xpzWLEQ198OL8RWgfNUub5PfTB8C+i9kBUd2l8t1YqJJ+Eex2fjLqsSpyg+3O4gWM3fi7/74VEO252rb4lufnj02O8J9OEYNn4rC8hfIcM7352r09pMNeACSQ6DN/C7L+mCchMqcRpja62yGcROyY3yFJyPR463L34ZC4SdWYNKuz5a3FMUrF9qxHY98t3JwuIYZ+CX/NZ5FWJRP5TOJv4NVQUD3eB1wQiUaeYgkeFjJddeTP4JiEDuHFU8uejY8ASbhrT/r5WrPsso2WvRjLNvN6cRP25RPl58r9BRQo8ALBVK3pfM4cTFoDalF3dCHnQIJxJgvC1+3p+bBOGUqW/bgw4EzjC+8uSzhef/0W3Bw0vJSaSbrLid9LrEz/YoSV4zYCCbtOHeFpFb1LsC/0bPEKkroLpZ/edpddZfqsSTXhG54wq9xjn49dxVdlPrE0vwOKhy5nQB36Urd43Dk29L1bOPNkUyCmoai1iYNKhzB0noehC3BXSLi8NJOmKz5l5maisQPyt8MMudjApsWsQ5yyqvMDu58lw4Ylmqsj9T9224kEC379bHb/l8OG46dRKY5PEFB2TLL+81r/F8+vcJBn8SV3cfdWVTMQZv9VsNw8kCcSFGo72wossTjMRM5jGEJUCRFf6fbRv5AFqqgbYyT7/lLBdLwiYznGEV4O/3yr3/6aAkp3Q+wZvqAdVqroirBRL697SXiPry6pl1qPfqT3FuR9CMvlOiFlwkkJ/ZMVjzWzeipONse831OpDIb2s3dw4Pa2rqs= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR01MB8101.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(52116014)(376014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NGspTUwzN+HgpzF0qveS2MlFdP76g6BJEmxPOQZjDc23D9h9DxmISuGb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NRUYCT4Rs5GBm8jHAHCmbp7Oh078KTXDO1A3JubAu+w1ugzN0Mq3arB355C7VbhkHLZ97WgyB06ksvjPUbYbJtg8iXjiAcVUtuDuhDEMxBMhfoi8TkRg9tgRh7mEKPZtzU4FWfzcdrO1BmlyaRoaEa13zWDc5D9J/vp2XRRbjLVKoVepDTrfIAGQ28ePMEJhPILl2pbDdA3jBxLsVJP1cHTb6xh9LUDczjAGzBqtfzUeFJVDCOBqykJMdfRtEO33ZIt017oruL3aev0Mk3xoBcAuMsA9CVvp4nmbEsaMmgZugQCIv/UfOQmdQnSuw3rFyzYC80o6Xb80LzirA8MlUSMDm/wykGrubnTU6ncbmS7Wwe0yazChSO/H8z8FObp1442f10GY2xDBl5aPzMcjvAok4ZZVSrmUCkZIidvz1UJe+fBzG5Xs7MozdSSqOL06Yd4wXlfLJdG6qCHJQzTyGWWPgvEr/bRxn2RHpaxZxGvh+b2gMMrfJdKWpZToXmDO/LHFQwBjvKS8HhV X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1afb3c2-c17a-49ea-8d41-08dcb85765da X-MS-Exchange-CrossTenant-AuthSource: SJ2PR01MB8101.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 09:41:09.1837 (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: PmC/L8A4Z6+VaMuMzNuD6odq7SgmiYdUyjAFZ56DTTn/mFNVaVcM+CwMYTtus0Yt13CeCORs/kozR1RHgQBV047hc69Cq6lRD0OhC9etk5oo8J6d1TnS/YZYKAozQ2Bv X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR01MB8804 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240809_024115_743184_EC496267 X-CRM114-Status: GOOD ( 13.19 ) 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 Script uses contiguous address range of adjacent packets to generate the tracing. When there is a continuity brake due to discontiguous branch address, it is resulting in to a perf tool crash(segfault). This is expected bhehaviour since the decoder is not expecting the discontiguous packets. Adding an option "force" to allow the decoder to continue and complete the tracing without application crash by dropping the discontiguous packets from decoding. Signed-off-by: Ganapatrao Kulkarni Reviewed-by: Leo Yan --- Changes since V1: Updated patch as per discussions[1]. [1] https://lore.kernel.org/linux-arm-kernel/ce4af204-874f-404c-a7aa-42dc6693d072@linaro.org/T/ tools/perf/scripts/python/arm-cs-trace-disasm.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py index d973c2baed1c..65d59db3bcec 100755 --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py @@ -36,7 +36,10 @@ option_list = [ help="Set path to objdump executable file"), make_option("-v", "--verbose", dest="verbose", action="store_true", default=False, - help="Enable debugging log") + help="Enable debugging log"), + make_option("-f", "--force", dest="force", + action="store_true", default=False, + help="Force decoder to continue") ] parser = OptionParser(option_list=option_list) @@ -257,6 +260,13 @@ def process_event(param_dict): 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 (stop_addr < start_addr): + if (options.verbose or not options.force): + print("Packet Discontinuity detected [stop_add:0x%x start_addr:0x%x ] for dso %s" % (stop_addr, start_addr, dso)) + print("Use option '-f' following the script for force mode") + if (options.force): + return + 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