[PATCH 0/2] perf cs-etm: Queue context packets for frontend

James Clark posted 2 patches 1 week, 6 days ago
There is a newer version of this series
tools/perf/tests/shell/coresight/Makefile          |   1 +
.../shell/coresight/context_switch_loop/.gitignore |   1 +
.../shell/coresight/context_switch_loop/Makefile   |  29 ++++
.../context_switch_loop/context_switch_loop.c      |  83 ++++++++++
.../tests/shell/coresight/context_switch_thread.sh |  48 ++++++
tools/perf/util/cs-etm-decoder/cs-etm-decoder.c    |  18 +-
tools/perf/util/cs-etm.c                           | 181 +++++++++++++--------
tools/perf/util/cs-etm.h                           |   5 +-
8 files changed, 295 insertions(+), 71 deletions(-)
[PATCH 0/2] perf cs-etm: Queue context packets for frontend
Posted by James Clark 1 week, 6 days ago
Fix thread tracking when decoding Coresight trace and add a new test for
it.

Unfortunately the test has to be added as a separate binary like the
other existing Coresight workloads which needs a bit of makefile
boilerplate. Ideally it would be a builtin Perf test workload, but Perf
has a lot of dependencies and generates a lot of trace when starting up
which makes tracing tests very slow because all that has to be decoded.

Hopefully I can find a generic way to enable Perf events at the
beginning of the workload and then I can migrate everything from
tools/perf/tests/shell/coresight to Perf test workloads, but that will
have to be done as a separate change.

Signed-off-by: James Clark <james.clark@linaro.org>
---
James Clark (1):
      perf test cs-etm: Test thread attribution

Leo Yan (1):
      perf cs-etm: Queue context packets for frontend

 tools/perf/tests/shell/coresight/Makefile          |   1 +
 .../shell/coresight/context_switch_loop/.gitignore |   1 +
 .../shell/coresight/context_switch_loop/Makefile   |  29 ++++
 .../context_switch_loop/context_switch_loop.c      |  83 ++++++++++
 .../tests/shell/coresight/context_switch_thread.sh |  48 ++++++
 tools/perf/util/cs-etm-decoder/cs-etm-decoder.c    |  18 +-
 tools/perf/util/cs-etm.c                           | 181 +++++++++++++--------
 tools/perf/util/cs-etm.h                           |   5 +-
 8 files changed, 295 insertions(+), 71 deletions(-)
---
base-commit: 09d355618f7ccc27ffc7fc668b2e232872962079
change-id: 20260515-james-cs-context-tracking-fix-754998bae7ed

Best regards,
-- 
James Clark <james.clark@linaro.org>
Re: [PATCH 0/2] perf cs-etm: Queue context packets for frontend
Posted by Arnaldo Carvalho de Melo 1 week, 3 days ago
On Tue, May 26, 2026 at 12:14:35PM +0100, James Clark wrote:
> Fix thread tracking when decoding Coresight trace and add a new test for
> it.
> 
> Unfortunately the test has to be added as a separate binary like the
> other existing Coresight workloads which needs a bit of makefile
> boilerplate. Ideally it would be a builtin Perf test workload, but Perf
> has a lot of dependencies and generates a lot of trace when starting up
> which makes tracing tests very slow because all that has to be decoded.
> 
> Hopefully I can find a generic way to enable Perf events at the
> beginning of the workload and then I can migrate everything from
> tools/perf/tests/shell/coresight to Perf test workloads, but that will
> have to be done as a separate change.
> 
> Signed-off-by: James Clark <james.clark@linaro.org>

James, there are some review comments from Sashiko, some looks
legitimate, wdyt?

- Arnaldo
Re: [PATCH 0/2] perf cs-etm: Queue context packets for frontend
Posted by James Clark 1 week, 3 days ago

On 29/05/2026 3:55 pm, Arnaldo Carvalho de Melo wrote:
> On Tue, May 26, 2026 at 12:14:35PM +0100, James Clark wrote:
>> Fix thread tracking when decoding Coresight trace and add a new test for
>> it.
>>
>> Unfortunately the test has to be added as a separate binary like the
>> other existing Coresight workloads which needs a bit of makefile
>> boilerplate. Ideally it would be a builtin Perf test workload, but Perf
>> has a lot of dependencies and generates a lot of trace when starting up
>> which makes tracing tests very slow because all that has to be decoded.
>>
>> Hopefully I can find a generic way to enable Perf events at the
>> beginning of the workload and then I can migrate everything from
>> tools/perf/tests/shell/coresight to Perf test workloads, but that will
>> have to be done as a separate change.
>>
>> Signed-off-by: James Clark <james.clark@linaro.org>
> 
> James, there are some review comments from Sashiko, some looks
> legitimate, wdyt?
> 
> - Arnaldo

Yes, and I'm waiting for Leo to take a look too. There will definitely 
be a v2.

Thanks
James