From: Leo Yan <leo.yan@arm.com>
To: James Clark <james.clark@linaro.org>,
Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>,
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 <mike.leach@linaro.org>
Subject: Re: [PATCH] perf scripts python arm-cs-trace-disasm.py: Skip disasm if address continuity is broken
Date: Thu, 8 Aug 2024 12:05:34 +0100 [thread overview]
Message-ID: <7c79c6cf-b07a-468a-9263-ea23d5fe12ee@arm.com> (raw)
In-Reply-To: <c73573e7-206e-4a6c-b6c6-27903978d0aa@linaro.org>
On 8/8/24 10:32, James Clark wrote:
[...]
>>> I suppose my only concern with this is that it hides real errors and
>>> Perf shouldn't be outputting samples that go backwards. Considering that
>>> fixing this in OpenCSD and Perf has a much wider benefit I think that
>>> should be the ultimate goal. I'm putting this on my todo list for now
>>> (including Steve's merging idea).
>>
>> In the perf's util/cs-etm.c file, it handles DISCONTINUITY with:
>>
>> case CS_ETM_DISCONTINUITY:
>> /*
>> * The trace is discontinuous, if the previous packet is
>> * instruction packet, set flag PERF_IP_FLAG_TRACE_END
>> * for previous packet.
>> */
>> if (prev_packet->sample_type == CS_ETM_RANGE)
>> prev_packet->flags |= PERF_IP_FLAG_BRANCH |
>> PERF_IP_FLAG_TRACE_END;
>>
>> I am wandering if OpenCSD has passed the correct info so Perf decoder can
>> detect the discontinuity. If yes, then the flag 'PERF_IP_FLAG_TRACE_END' will
>> be set (it is a general flag in branch sample), then we can consider use it in
>> the python script to handle discontinuous data.
>
> No OpenCSD isn't passing the correct info here. Higher up in the thread
> I suggested an OpenCSD patch that makes it detect the error earlier and
> fixes the issue. It also needs to output a discontinuity when the
> address goes backwards. So two fixes and then the script works without
> modifications.
Great! Just remind, with the fixes above, we might still need to enhance the
script to consume the PERF_IP_FLAG_TRACE_END flag, this can allow the script
to be reliable.
[...]
>> I prefer to not add force option for this case - eventually, this will consume
>> much time for reporting this kind of failure and need to root causing it. A
>> better way is we just print out the reasoning in the log and continue to dump.
>
> But in this case we've identified all the known issues that would cause
> the script to fail and we can fix them in Perf and OpenCSD. There may
> not even be any more issues that will cause the script to fail in the
> future so there's no point in softening the error IMO. That will only
> hide future issues (of which there may be none) and make root causing
> harder when it hits some other tool.
It is fine for me - with friendly logs as discussed in other replies.
Thanks,
Leo
next prev parent reply other threads:[~2024-08-08 11:05 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-19 9:26 Ganapatrao Kulkarni
2024-07-19 14:39 ` James Clark
2024-07-22 10:02 ` Ganapatrao Kulkarni
2024-07-23 13:10 ` James Clark
2024-07-23 15:26 ` Ganapatrao Kulkarni
2024-07-23 15:46 ` James Clark
2024-07-24 6:38 ` Ganapatrao Kulkarni
2024-07-24 14:45 ` James Clark
2024-08-01 10:00 ` James Clark
2024-08-01 10:28 ` Al Grant
2024-08-01 11:26 ` James Clark
2024-08-01 11:58 ` Al Grant
2024-08-01 14:58 ` James Clark
2024-08-05 12:22 ` Ganapatrao Kulkarni
2024-08-05 13:59 ` James Clark
2024-08-06 7:02 ` Ganapatrao Kulkarni
2024-08-06 9:47 ` James Clark
2024-08-06 9:57 ` James Clark
2024-08-06 15:02 ` Steve Clevenger
2024-08-06 16:14 ` James Clark
2024-08-07 12:17 ` Ganapatrao Kulkarni
2024-08-07 14:53 ` James Clark
2024-08-07 16:18 ` Ganapatrao Kulkarni
2024-08-07 19:20 ` Leo Yan
2024-08-08 4:36 ` Ganapatrao Kulkarni
2024-08-08 7:42 ` Leo Yan
2024-08-08 9:21 ` James Clark
2024-08-08 10:51 ` James Clark
2024-08-08 11:14 ` Ganapatrao Kulkarni
2024-08-08 15:01 ` Mike Leach
2024-08-07 16:48 ` Leo Yan
2024-08-08 9:32 ` James Clark
2024-08-08 11:05 ` Leo Yan [this message]
2024-08-09 14:13 ` Mike Leach
2024-08-09 15:19 ` James Clark
2024-08-19 10:59 ` Mike Leach
2024-08-23 9:03 ` James Clark
2024-08-23 9:57 ` Ganapatrao Kulkarni
2024-08-23 10:36 ` James Clark
2024-08-23 10:37 ` James Clark
2024-08-30 9:58 ` James Clark
2024-09-02 6:12 ` Ganapatrao Kulkarni
2024-08-28 9:33 ` Mike Leach
2024-08-29 13:35 ` James Clark
2024-08-08 7:54 ` Leo Yan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7c79c6cf-b07a-468a-9263-ea23d5fe12ee@arm.com \
--to=leo.yan@arm.com \
--cc=Al.Grant@arm.com \
--cc=acme@redhat.com \
--cc=coresight@lists.linaro.org \
--cc=darren@os.amperecomputing.com \
--cc=gankulkarni@os.amperecomputing.com \
--cc=james.clark@arm.com \
--cc=james.clark@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.leach@linaro.org \
--cc=scclevenger@os.amperecomputing.com \
--cc=suzuki.poulose@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®