From: James Clark <james.clark@linaro.org>
To: Leo Yan <leo.yan@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
"Liang, Kan" <kan.liang@linux.intel.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Mike Leach <mike.leach@linaro.org>,
John Garry <john.g.garry@oracle.com>,
Will Deacon <will@kernel.org>, Leo Yan <leo.yan@linux.dev>,
Ben Gainey <ben.gainey@arm.com>,
Ruidong Tian <tianruidong@linux.alibaba.com>,
Benjamin Gray <bgray@linux.ibm.com>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org,
gankulkarni@os.amperecomputing.com, coresight@lists.linaro.org,
scclevenger@os.amperecomputing.com
Subject: Re: [PATCH 1/8] perf cs-etm: Don't flush when packet_queue fills up
Date: Thu, 12 Sep 2024 16:22:11 +0100 [thread overview]
Message-ID: <c124ad7c-31be-42cb-9eeb-507d99a97891@linaro.org> (raw)
In-Reply-To: <1e55f148-37d8-4fbe-b863-d604fdfaafaf@arm.com>
On 11/09/2024 09:14, Leo Yan wrote:
>
>
> On 9/10/2024 9:28 PM, Leo Yan wrote:
>> On 9/5/2024 11:50 AM, James Clark wrote:
>>
>> [...]
>>
>>> cs_etm__flush(), like cs_etm__sample() is an operation that generates a
>>> sample and then swaps the current with the previous packet. Calling
>>> flush after processing the queues results in two swaps which corrupts
>>> the next sample. Therefore it wasn't appropriate to call flush here so
>>> remove it.
>>
>> In the cs_etm__sample(), if the period is not overflow, it is not necessarily
>> to generate instruction samples and copy back stack entries. This is why we
>> want to call cs_etm__flush() to make sure the last packet can be recorded
>> properly for instruction sample with back stacks.
>>
>> We also need to take account into the case for the end of the session - in
>> this case we need to generate samples for the last packet for complete info.
>>
>> I am wandering should we remove the cs_etm__packet_swap() from cs_etm__sample()?
>
> Sorry for typo. I meant to remove the cs_etm__packet_swap() from cs_etm__flush().
>
> Thanks,
> Leo
Turns out there was already cs_etm__end_block() for the end of the
session, but it was only called for the timeless modes. I added it for
timestamped mode too in V2.
I also kept the existing flush() function for discontinuities. I changed
my mind that the differences to cs_etm__sample() weren't relevant.
So I think we still need to keep the swap in flush() because otherwise
the next sample won't start from the right place.
next prev parent reply other threads:[~2024-09-12 15:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 10:50 [PATCH 0/8] perf: cs-etm: Coresight decode and disassembly improvements James Clark
2024-09-05 10:50 ` [PATCH 1/8] perf cs-etm: Don't flush when packet_queue fills up James Clark
2024-09-10 20:28 ` Leo Yan
2024-09-11 8:14 ` Leo Yan
2024-09-12 15:22 ` James Clark [this message]
2024-09-05 10:50 ` [PATCH 2/8] perf cs-etm: Use new OpenCSD consistency checks James Clark
2024-09-05 10:50 ` [PATCH 3/8] perf cs-etm: Remove cs_etm__flush() James Clark
2024-09-05 10:50 ` [PATCH 4/8] perf scripting python: Add function to get a config value James Clark
2024-09-05 10:50 ` [PATCH 5/8] perf scripts python cs-etm: Update to use argparse James Clark
2024-09-05 10:50 ` [PATCH 6/8] perf scripts python cs-etm: Improve arguments James Clark
2024-09-05 10:50 ` [PATCH 7/8] perf scripts python cs-etm: Add start and stop arguments James Clark
2024-09-05 10:50 ` [PATCH 8/8] perf test: cs-etm: Test Coresight disassembly script James Clark
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=c124ad7c-31be-42cb-9eeb-507d99a97891@linaro.org \
--to=james.clark@linaro.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=ben.gainey@arm.com \
--cc=bgray@linux.ibm.com \
--cc=coresight@lists.linaro.org \
--cc=gankulkarni@os.amperecomputing.com \
--cc=irogers@google.com \
--cc=john.g.garry@oracle.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=leo.yan@arm.com \
--cc=leo.yan@linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=mike.leach@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=scclevenger@os.amperecomputing.com \
--cc=suzuki.poulose@arm.com \
--cc=tianruidong@linux.alibaba.com \
--cc=will@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).