linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tomas Glozar" <tglozar@redhat.com>
Cc: linux-trace-kernel <linux-trace-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 03/10] rtla/tests: Add runtime tests for aa action
Date: Fri, 27 Nov 2026 16:16:33 +0000	[thread overview]
Message-ID: <sashiko-outbox-237856@kernel.org> (raw)
In-Reply-To: <20261127153206.134322-4-tglozar@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] rtla/tests: --aa-only test fails in BPF mode in
  timerlat_top_bpf_main_loop()
--

commit 3e2a3aa570e971109ae2e849934141658e12c520
Author: Tomas Glozar <tglozar@redhat.com>

rtla/tests: Add runtime tests for aa action

This commit adds runtime test cases covering the auto-analysis action for
timerlat and verifying that osnoise rejects the action.

> diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests/timerlat.t
> index 1d317c851a0fa..d4f660d32f882 100644
> --- a/tools/tracing/rtla/tests/timerlat.t
> +++ b/tools/tracing/rtla/tests/timerlat.t
> @@ -122,18 +122,31 @@ check_top_q_hist "trace output through --on-threshold trace" \
>  	"timerlat TOOL -T 2 --on-threshold trace" 2 "^  Saving trace to timerlat_trace.txt$"
>  check_top_q_hist "trace output through --on-threshold trace with custom filename" \
>  	"timerlat TOOL -T 2 --on-threshold trace,file=custom_filename.txt" 2 "^  Saving trace to custom_filename.txt$"
> +
>  check_top_q_hist "exec command" \
>  	"timerlat TOOL -T 2 --on-threshold shell,command='echo TestOutput'" 2 "^TestOutput$"
> +
> +check_top_hist "aa action" \
> +	"timerlat TOOL -T 2 -d 3s --on-threshold aa" 2 "analyzing it"
> +check_top_hist "aa action at end" \
> +	"timerlat TOOL -T 2 -d 3s --on-end aa" 2 "analyzing it"
> +check_top_hist "aa action with continue" \
> +	"timerlat TOOL -T 2 -d 3s --on-threshold aa --on-threshold continue" 0 "analyzing it"
> +check "aa action with --aa-only" \
> +	"timerlat top -d 3s --aa-only 2 --on-threshold aa --on-threshold continue" 0 "analyzing it" "Timer Latency"

[Severity: Medium]
Does the "aa action with --aa-only" test fail when run in BPF mode
(RTLA_NO_BPF=0)?

In BPF/mixed mode, timerlat_top_bpf_main_loop() takes the early return for
params->aa_only as soon as the first threshold event arrives, without
running common_threshold_handler() or checking should_continue_tracing():

tools/tracing/rtla/src/timerlat_top.c:timerlat_top_bpf_main_loop() {
	if (params->aa_only) {
		/* Auto-analysis only, just wait for stop tracing */
		timerlat_bpf_wait(-1);
		return 0;
	}
    ...
}

Because it returns before SIGALRM sets stop_tracing, run_tool() sees
stopped == true (setting return_value = FAILED, exit status 2) and skips
the end-of-run ops->analyze() call because aa_action_present(params) is
true:

tools/tracing/rtla/src/common.c:run_tool() {
    ...
	if (stopped) {
		printf("%s hit stop tracing\n", ops->tracer);
		return_value = FAILED;
	}

	if (ops->analyze && !aa_action_present(params))
		ops->analyze(tool, stopped);
    ...
}

As a result, neither the threshold actions nor end-of-run auto-analysis
run, "analyzing it" is never printed, and rtla exits with status 2 instead
of 0.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261127153206.134322-1-tglozar@redhat.com?part=3

  reply	other threads:[~2026-11-27 16:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 15:31 [RFC PATCH 00/10] rtla/timerlat: Add auto-analysis action and report spike timestamps Tomas Glozar
2026-11-27 15:31 ` [RFC PATCH 01/10] rtla: Support auto-analysis as an action Tomas Glozar
2026-11-27 16:01   ` sashiko-bot
2026-11-27 15:31 ` [RFC PATCH 02/10] rtla/tests: Add unit tests for aa action Tomas Glozar
2026-11-27 15:31 ` [RFC PATCH 03/10] rtla/tests: Add runtime " Tomas Glozar
2026-11-27 16:16   ` sashiko-bot [this message]
2026-11-27 15:32 ` [RFC PATCH 04/10] Documentation/rtla: Document " Tomas Glozar
2026-11-27 15:32 ` [RFC PATCH 05/10] rtla/trace: Add helper to read "now ts" stats field Tomas Glozar
2026-11-27 15:32 ` [RFC PATCH 06/10] rtla/trace: Add helper to gather "now ts" over a CPU set Tomas Glozar
2026-11-27 15:32 ` [RFC PATCH 07/10] rtla/trace: Allow storing start clock value of tracefs instances Tomas Glozar
2026-11-27 15:32 ` [RFC PATCH 08/10] rtla/timerlat: Save the trace clock at measurement start Tomas Glozar
2026-11-27 15:32 ` [RFC PATCH 09/10] rtla/timerlat_aa: Print time offset and seqnum of the spike Tomas Glozar
2026-11-27 15:32 ` [RFC PATCH 10/10] Documentation/rtla: Document auto-analysis timestamps Tomas Glozar

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=sashiko-outbox-237856@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tglozar@redhat.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;
as well as URLs for NNTP newsgroup(s).