All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Tomas Glozar <tglozar@redhat.com>, John Kacur <jkacur@redhat.com>,
	stable@vger.kernel.org, Wander Lairson Costa <wander@redhat.com>
Subject: [for-next][PATCH 04/16] rtla/timerlat_bpf: Stop tracing on user latency
Date: Thu, 20 Nov 2025 18:23:27 -0500	[thread overview]
Message-ID: <20251120232707.946976394@kernel.org> (raw)
In-Reply-To: 20251120232323.271532418@kernel.org

From: Tomas Glozar <tglozar@redhat.com>

rtla-timerlat allows a *thread* latency threshold to be set via the
-T/--thread option. However, the timerlat tracer calls this *total*
latency (stop_tracing_total_us), and stops tracing also when the
return-to-user latency is over the threshold.

Change the behavior of the timerlat BPF program to reflect what the
timerlat tracer is doing, to avoid discrepancy between stopping
collecting data in the BPF program and stopping tracing in the timerlat
tracer.

Cc: stable@vger.kernel.org
Fixes: e34293ddcebd ("rtla/timerlat: Add BPF skeleton to collect samples")
Reviewed-by: Wander Lairson Costa <wander@redhat.com>
Link: https://lore.kernel.org/r/20251006143100.137255-1-tglozar@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
---
 tools/tracing/rtla/src/timerlat.bpf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/tracing/rtla/src/timerlat.bpf.c b/tools/tracing/rtla/src/timerlat.bpf.c
index 084cd10c21fc..e2265b5d6491 100644
--- a/tools/tracing/rtla/src/timerlat.bpf.c
+++ b/tools/tracing/rtla/src/timerlat.bpf.c
@@ -148,6 +148,9 @@ int handle_timerlat_sample(struct trace_event_raw_timerlat_sample *tp_args)
 	} else {
 		update_main_hist(&hist_user, bucket);
 		update_summary(&summary_user, latency, bucket);
+
+		if (thread_threshold != 0 && latency_us >= thread_threshold)
+			set_stop_tracing();
 	}
 
 	return 0;
-- 
2.51.0



  parent reply	other threads:[~2025-11-20 23:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 23:23 [for-next][PATCH 00/16] rtla: Updates for v6.19 Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 01/16] tools/rtla: Add for_each_monitored_cpu() helper Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 02/16] tools/rtla: Remove unused optional option_index Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 03/16] tools/rtla: Fix unassigned nr_cpus Steven Rostedt
2025-11-20 23:23 ` Steven Rostedt [this message]
2025-11-20 23:23 ` [for-next][PATCH 05/16] tools/rtla: Fix --on-threshold always triggering Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 06/16] rtla/tests: Extend action tests to 5s Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 07/16] rtla/tests: Fix osnoise test calling timerlat Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 08/16] tools/rtla: Add fatal() and replace error handling pattern Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 09/16] tools/rtla: Replace timerlat_top_usage("...") with fatal("...") Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 10/16] tools/rtla: Replace timerlat_hist_usage("...") " Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 11/16] tools/rtla: Replace osnoise_top_usage("...") " Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 12/16] tools/rtla: Replace osnoise_hist_usage("...") " Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 13/16] rtla: Fix -C/--cgroup interface Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 14/16] rtla: Fix -a overriding -t argument Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 15/16] rtla/tests: Dont rely on matching ^1ALL Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 16/16] rtla/timerlat: Exit top main loop on any non-zero wait_retval Steven Rostedt

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=20251120232707.946976394@kernel.org \
    --to=rostedt@kernel.org \
    --cc=jkacur@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglozar@redhat.com \
    --cc=wander@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.