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 DD9E7CA0EC5 for ; Fri, 30 Aug 2024 10:03:33 +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:From:References:Cc:To:Subject: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=mK8Ziwx48ZLun9eMEMGl1IMQeFQSPXpJOVp3edXBndA=; b=bk8TA95GHXGv503ORcap/ndbWo o63KyxpA8r2BdbFs8ygb2crOnPUFlbzqmX1IcdMn4AU7F0p50QaEeLpoRZMVJg8JFWccmGS9gczRe st3RnEoQM5msGj+AQzxyLZy+BOva3DWM4rxY+Q3i2rHoswfMKZYdXdG/FjpSnzrhLGgvaA/4jljPv FNTb5AJ+DyMyn6YWrMx/7zzmEAFk7fyWJZDlIpYg+gMgvP27YS/keixUwV10EuenPXiC4mg4uf6ZD w7F2FoTZb6GEQiSupjKTtDaBnO+Uc0OVX7dAPTfoSdKcqErDe4WhPNGCgTmUVMuxJR9+HFzUJwik0 C1p1RFRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjyTQ-00000005hG4-1DVn; Fri, 30 Aug 2024 10:03:20 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjyOd-00000005fbN-2MCX for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 09:58:25 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-42812945633so14329855e9.0 for ; Fri, 30 Aug 2024 02:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725011902; x=1725616702; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mK8Ziwx48ZLun9eMEMGl1IMQeFQSPXpJOVp3edXBndA=; b=A6RxJyRSi2Qdz0PqU3QYpyO00C04Hf0RIwUDZHex2VpZNYAN3Z9JcHqD6q7K/CQRTG 9dS75VVeUDq0Qoz+AAzJwaOTS3SWU9qm7LHh00e1Nzu/uhrKIVswQJhaddvGWGp/JuDM b/k8tUZpeKyYwZHgXb4acp+MpgT4p0amJhY/9rxkj5todRIqjG/aXlAkLB+OXJ6eBNID RiyGkzexjsHGsulvYa0HTk6/yjdiFJoCuVn7Avu+hOH7/2Bd0SCxtzRLZU1tqTloL4Mi 87TklpL8Z6+sr35cg/6YlJ34yR9X6FWTas+UlpUGAn4UJTfgiQ4Qa00I9Hm10K+zQCeA MxFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725011902; x=1725616702; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mK8Ziwx48ZLun9eMEMGl1IMQeFQSPXpJOVp3edXBndA=; b=pB8drE5XA4dEoAbtEP7+qS7ZNGlZzvnEiCJswopUq1lL1FFjwIYNuN6VPA4dhJXcNs ZRS5EXUr/+UFpU15G5JmkNmmJMP078/TpT7uOzu9t/aJgqA/7i2fOBjXQdP3at15TZ2l mVlLs2ZKLHhAb28twOmgXaZ0NnVa0poEVTfJmWmJ5g4+ZKFGlG037jCz4w93FC9vhCMC YsEkhNzCkJI2bBi8ygy/5n7ZBWB1DNLcY2zv83PT9wGkIjdeTuiCf2l2cZBQYCszAhfb UYNAyp+g6ASJiDo3loQR9eebJu/KYCMtO0jMkwtrt6hL7sreWItoocvNtNFttcs1i5q4 oZvQ== X-Forwarded-Encrypted: i=1; AJvYcCX9KY9nBCy7iFzRazthyP+A+ox/Su8RG+oZrMrCsnQKA1UeP8dae+vHZE889mi4Ouj+foPUf/OCPc73Ab+jZ3Ks@lists.infradead.org X-Gm-Message-State: AOJu0YwZciMgz307cRff7+xXs9BSy5xf9PZwdNRk3R6MCyeOItIhKKl7 14fCcMn07+mXSIoUlfn1BmhFQY30y4L1OyBW3QwcjNSD2YryLrIzvmIg8YpOXxQ= X-Google-Smtp-Source: AGHT+IHXWFppzEMO2FQFtiexm/hflVeUc7nTy9Cnb3zVw2dmZw6g9Sd2w7f3/H3Ooqd+K8VqAuPnKg== X-Received: by 2002:a05:600c:1c83:b0:428:2e9:6573 with SMTP id 5b1f17b1804b1-42bb025bfebmr44911705e9.17.1725011901252; Fri, 30 Aug 2024 02:58:21 -0700 (PDT) Received: from [192.168.1.3] ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bbd1eee1bsm9060265e9.9.2024.08.30.02.58.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Aug 2024 02:58:20 -0700 (PDT) Message-ID: Date: Fri, 30 Aug 2024 10:58:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] perf scripts python arm-cs-trace-disasm.py: Skip disasm if address continuity is broken To: Ganapatrao Kulkarni , Mike Leach Cc: Leo Yan , scclevenger@os.amperecomputing.com, 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 References: <20240719092619.274730-1-gankulkarni@os.amperecomputing.com> <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> <4dd7f210-c03e-4203-b8e9-1c26a7f8fe79@arm.com> <27912fc6-8419-4828-82a7-dacde5b4a759@linaro.org> <36f947ef-c2a7-486a-b905-f0529308b06e@linaro.org> <51661f76-c02a-49fb-8d68-53a8549acd19@os.amperecomputing.com> Content-Language: en-US From: James Clark In-Reply-To: <51661f76-c02a-49fb-8d68-53a8549acd19@os.amperecomputing.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_025823_645864_BC4BF67E X-CRM114-Status: GOOD ( 22.41 ) 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 23/08/2024 10:57 am, Ganapatrao Kulkarni wrote: > > Hi James/Mike, > > On 23-08-2024 02:33 pm, James Clark wrote: >> >> >> On 19/08/2024 11:59 am, Mike Leach wrote: >>> Hi, >>> >>> A new branch of OpenCSD is available - ocsd-consistency-checks-1.5.4-rc1 >>> >>> Testing I managed to do confirms the N atom on unconditional branches >>> appear to work. I do not have a test case for the range >>> discontinuities. >>> >>> The checks are enabled using operation flags on decoder creation. See >>> the docs for details. >>> >>> Mike >>> >> >> Hi Mike, >> >> I tested the new OpenCSD and I don't see the error anymore in the >> disassembly script. I'm not sure if we need to go any further and add >> the backwards check, it looks like just a later symptom and the checks >> that you've added already prevent it. >> >> If you release a new version I can send the perf patch. I was going to >> use these flags if that looks right to you? As far as I know that's the >> set that can be always on and won't fail on bad hardware? >> >> I also assumed that ETM4_OPFLG_PKTDEC_AA64_OPCODE_CHK can be given even >> for etmv3 and it's just a nop? >> >> diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c >> b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c >> index e917985bbbe6..90967fd807e6 100644 >> --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c >> +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c >> @@ -685,9 +685,14 @@ cs_etm_decoder__create_etm_decoder(struct >> cs_etm_decoder_params *d_params, >>                  return 0; >> >>          if (d_params->operation == CS_ETM_OPERATION_DECODE) { >> +               int decode_flags = OCSD_CREATE_FLG_FULL_DECODER; >> +#ifdef OCSD_OPFLG_N_UNCOND_DIR_BR_CHK >> +               decode_flags |= OCSD_OPFLG_N_UNCOND_DIR_BR_CHK | >> OCSD_OPFLG_CHK_RANGE_CONTINUE | >> +                               ETM4_OPFLG_PKTDEC_AA64_OPCODE_CHK; >> +#endif >>                  if (ocsd_dt_create_decoder(decoder->dcd_tree, >>                                             decoder->decoder_name, >> -                                          OCSD_CREATE_FLG_FULL_DECODER, >> +                                          decode_flags, >>                                             trace_config, &csid)) >>                          return -1; >> > > I tried Mike's branch with above James's patch and still the segfault is > happening to us. > Looks like the Perf bug is only on the timestamped decode path, you can force timeless as a workaround. Timestamps aren't used by the disassembly script anyway: --itrace=Zb Full command: perf script -i ./kcore -s python:tools/perf/scripts/python/arm-cs-\ trace-disasm.py --itrace=Zb -- -k ./kcore/kcore_dir/kcore You can also disable timestamps when recording then you don't need the itrace option. This will save you a lot of data anyway. But I'm still working on the proper fix.