Linux Perf Users
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: James Clark <james.clark@linaro.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Mike Leach <mike.leach@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Suyash Mahar <smahar@meta.com>, Amir Ayupov <aaupov@fb.com>
Subject: Re: [PATCH v2 11/14] perf tests: Check CoreSight IRQ entry and exit
Date: Thu, 29 Oct 2026 18:03:35 +0000	[thread overview]
Message-ID: <20261029180335.GD9176@e132581.arm.com> (raw)
In-Reply-To: <d371220f-9ad2-41ca-a2a5-930c46801c31@linaro.org>

On Tue, Sep 29, 2026 at 01:22:55PM +0100, James Clark wrote:
> 
> On 23/09/2026 16:21, Leo Yan wrote:
> > Add an AArch64 branch_not_taken_loop workload and a CoreSight shell test
> > checking IRQ entry and exit PCs. Use cpu-clock generates timer
> > interrupts.
> > 
> > Retry at different timer frequencies and skip if no complete pair is
> > captured.
> 
> Maybe we need to look into storing existing recordings somewhere or
> committing small ones into the repo again. This test took 3 minutes to run
> on my N1SDP, which is 3x longer than the entire Coresight suite, and then it
> skipped anyway:
> 
> 173: CoreSight IRQ entry and exit:
> ---- start ----
> test child forked, pid 6804
> Recording timer IRQs at 1000 Hz
> No complete exception entry/exit pair
> No complete IRQ pair in this recording
> Recording timer IRQs at 4000 Hz
> No complete exception entry/exit pair
> No complete IRQ pair in this recording
> Recording timer IRQs at 10000 Hz
> No complete exception entry/exit pair
> No complete IRQ pair in this recording
> [Skip] No complete IRQ pair after three recordings
> ---- end(-2) ----
> 173: CoreSight IRQ entry and exit
> 
> 
> Really this test is only looking for how a single exception on a single
> branch is decoded, it shouldn't be affected by how it was recorded. Even a
> few bytes of trace would be enough to test it. Or maybe we could add some
> kind of unit test framework that mocks out OpenCSD and allows us to script
> how different packets affect the decoder?

As discussed I will reduce the loop in branch_not_taken_loop.c and
don't skip the test if no IRQ pair found.

> > +++ b/tools/perf/tests/shell/coresight/irq_entry_exit.sh
> > @@ -0,0 +1,37 @@
> > +#!/bin/bash
> > +# SPDX-License-Identifier: GPL-2.0
> > +# CoreSight IRQ entry and exit (exclusive)
> > +
> > +# shellcheck source=../lib/coresight_exception.sh
> 
> No need for these anymore, see https://lore.kernel.org/linux-perf-users/20260921-james-perf-shellcheck-source-v1-1-adcfc107c997@linaro.org/

Will do.

> > +record_trace_with_cpu_clock()
> > +{
> > +	local clock_opts=()
> > +
> > +	record_freq=$1
> > +	shift
> > +
> > +	# A zero frequency omits the cpu-clock event.
> > +	if [ "$record_freq" -gt 0 ]; then
> > +		# Generate timer IRQs without delivering a signal to the workload.
> > +		clock_opts=(-e cpu-clock:u -F "$record_freq")
> > +	fi
> > +
> > +	# FIFO control bounds the trace to the workload.
> > +	# --kcore supplies the running kernel's instructions for decoding.
> > +	taskset -c "$cpu" perf record -B --no-bpf-event --per-thread --kcore \
> > +		-e cs_etm/timestamp=0/uk "${clock_opts[@]}" \
> > +		-m,4M -D -1 --control fifo:"$tmpdir/ctl","$tmpdir/ack" \
> > +		-o "$tmpdir/data" -- \
> > +		perf test --record-ctl fifo:"$tmpdir/ctl","$tmpdir/ack" -w "$@" \
> > +		> "$tmpdir/record.log" 2>&1
> 
> There's a shellcheck warning here:
> 
>   (warning): Word is of the form "A"B"C" (B indicated). Did you mean "ABC"
> or "A\"B\"C"?
> 
> You can avoid it by passing the whole path as "$cf" and "$af" like the other
> coresight tests.

Will do. Thanks for suggestions!

  reply	other threads:[~2026-10-29 18:03 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23 15:21 [PATCH v2 00/14] perf cs-etm: Fix bogus branch samples on exceptions Leo Yan
2026-09-23 15:21 ` [PATCH v2 01/14] perf sample: Allow decoders to supply branch return addresses Leo Yan
2026-09-23 15:29   ` sashiko-bot
2026-09-24 13:00   ` Adrian Hunter
2026-09-23 15:21 ` [PATCH v2 02/14] perf intel-pt: Preserve return addresses for asynchronous branches Leo Yan
2026-09-23 15:43   ` sashiko-bot
2026-09-24 13:00   ` Adrian Hunter
2026-09-23 15:21 ` [PATCH v2 03/14] perf cs-etm: Break branch history when instruction memory is unavailable Leo Yan
2026-09-23 15:46   ` sashiko-bot
2026-09-23 15:21 ` [PATCH v2 04/14] perf cs-etm: Centralize packet ISA initialization Leo Yan
2026-09-23 15:50   ` sashiko-bot
2026-09-23 15:21 ` [PATCH v2 05/14] perf cs-etm: Use the recorded instruction size for A32 and A64 Leo Yan
2026-09-23 16:01   ` sashiko-bot
2026-09-29 13:55   ` James Clark
2026-10-29 16:28     ` Leo Yan
2026-09-23 15:21 ` [PATCH v2 06/14] perf cs-etm: Mark branches that were not taken Leo Yan
2026-09-23 16:09   ` sashiko-bot
2026-09-23 15:21 ` [PATCH v2 07/14] perf cs-etm: Factor out final instruction sample synthesis Leo Yan
2026-09-23 16:13   ` sashiko-bot
2026-09-23 15:21 ` [PATCH v2 08/14] perf cs-etm: Centralize branch sample synthesis checks Leo Yan
2026-09-23 16:18   ` sashiko-bot
2026-09-23 15:21 ` [PATCH v2 09/14] perf cs-etm: Classify exception calls using the exception packet Leo Yan
2026-09-23 16:24   ` sashiko-bot
2026-09-29 14:08   ` James Clark
2026-10-29 17:41     ` Leo Yan
2026-09-23 15:21 ` [PATCH v2 10/14] perf cs-etm: Synthesize exception entries separately from branches Leo Yan
2026-09-23 16:36   ` sashiko-bot
2026-09-23 15:21 ` [PATCH v2 11/14] perf tests: Check CoreSight IRQ entry and exit Leo Yan
2026-09-23 16:40   ` sashiko-bot
2026-09-29 12:22   ` James Clark
2026-10-29 18:03     ` Leo Yan [this message]
2026-09-23 15:21 ` [PATCH v2 12/14] perf tests: Check CoreSight syscall " Leo Yan
2026-09-23 16:46   ` sashiko-bot
2026-09-23 15:21 ` [PATCH v2 13/14] perf tests: Check CoreSight abort " Leo Yan
2026-09-23 16:49   ` sashiko-bot
2026-09-23 15:21 ` [PATCH v2 14/14] perf tests: Check CoreSight emulated instruction " Leo Yan
2026-09-23 16:56   ` sashiko-bot
2026-09-29 14:41 ` [PATCH v2 00/14] perf cs-etm: Fix bogus branch samples on exceptions 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=20261029180335.GD9176@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=aaupov@fb.com \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mike.leach@arm.com \
    --cc=namhyung@kernel.org \
    --cc=smahar@meta.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