From mboxrd@z Thu Jan 1 00:00:00 1970 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 F24BCC3DA7F for ; Wed, 7 Aug 2024 19:21:48 +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:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:Cc:To:Subject:From:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FyIGLI69SBvjq8aZmNdP7np6KddpK3yLbP4/SAMhk98=; b=APfv5ZE6pSS2N9pxB1L3poyWPW 1G4y4DfcpeA17oSHZlqYJM2wA+x+Y1GwZ7thyWv/jrFzLCVt+7IhL4GjkkRFc0uBNlP9OddNxhAh/ akQSzcs79yqffxT9eCruJkJ0TaoeBvE4IFSVsrb2V87MI2JCbp6qtUu8NdySE9LgQW4NhBmIulcdz qJ9rwj4mRowK7ZdPDnG4Q8w5JAMnl75P+kDwqlWFvDDz2RiZS1HFm5TqqlSwg61m5/Ix8ZqtT7cQl Q+WVAh+18OaKxVelXt2mlzW3ibIl13yecmFoCVv0Wdm1cmNJzaMWzMoqFu0MsLRaG6+92aGxQyt6+ Pxkdp9zg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbmDv-000000063aC-3LAU; Wed, 07 Aug 2024 19:21:27 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbmDN-000000063WI-0a2n for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2024 19:20:55 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 79B6AFEC; Wed, 7 Aug 2024 12:21:16 -0700 (PDT) Received: from [10.57.68.109] (unknown [10.57.68.109]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B815D3F71E; Wed, 7 Aug 2024 12:20:48 -0700 (PDT) Message-ID: Date: Wed, 7 Aug 2024 20:20:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Leo Yan Subject: Re: [PATCH] perf scripts python arm-cs-trace-disasm.py: Skip disasm if address continuity is broken To: Ganapatrao Kulkarni , James Clark , scclevenger@os.amperecomputing.com Cc: acme@redhat.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, darren@os.amperecomputing.com, james.clark@arm.com, suzuki.poulose@arm.com, Al.Grant@arm.com, Mike Leach References: <20240719092619.274730-1-gankulkarni@os.amperecomputing.com> <8f6f221b-4c9a-42e1-b8ce-1f492caee184@linaro.org> <0a697a54-5dd8-4351-a651-991724690db2@os.amperecomputing.com> <543813f6-cb1f-4759-b26f-75246750814d@linaro.org> <00fac24c-d664-4ebb-8c60-f4697b7f76c1@linaro.org> <8b53a424-19f7-4042-a2db-e1c5d051f9cc@os.amperecomputing.com> <6adf84fa-b755-4d7a-957a-9bf01e442238@linaro.org> <6f535bb6-2cee-48e6-93f1-ea19887bae74@os.amperecomputing.com> <027c76a9-9bd4-43e9-a170-8391a0037291@linaro.org> <3d7a6f93-0555-48fa-99cb-bf26b53c2da5@os.amperecomputing.com> <4ba157c2-4a56-4d77-9a15-071e46adc33b@os.amperecomputing.com> Content-Language: en-US In-Reply-To: <4ba157c2-4a56-4d77-9a15-071e46adc33b@os.amperecomputing.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240807_122053_292405_286D7085 X-CRM114-Status: GOOD ( 11.30 ) 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 On 8/7/2024 5:18 PM, Ganapatrao Kulkarni wrote: > Is below diff with force option looks good? > > diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py > b/tools/perf/scripts/python/arm-cs-trace-disasm.py > index d973c2baed1c..efe34f308beb 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,12 @@ 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 == True or options.force): > +                       print("Packet Discontinuity detected [stop_add:0x%x start_addr:0x%x ] for dso %s" % (stop_addr, start_addr, dso)) > +               if (options.force): > +                       return I struggled a bit for the code - it is confused that force mode bails out and the non-force mode continues to run. I prefer to always bail out for the discontinuity case, as it is pointless to continue in this case. if (stop_addr <= start_addr): print("Packet Discontinuity detected [stop_add:0x%x start_addr:0x%x ] for dso %s" % \ (stop_addr, start_addr, dso)) return Thanks, Leo