Skip to content

Commit e4240db

Browse files
rtla/timerlat_bpf: Stop tracing on user latency
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: e34293d ("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>
1 parent b4275b2 commit e4240db

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tools/tracing/rtla/src/timerlat.bpf.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ int handle_timerlat_sample(struct trace_event_raw_timerlat_sample *tp_args)
148148
} else {
149149
update_main_hist(&hist_user, bucket);
150150
update_summary(&summary_user, latency, bucket);
151+
152+
if (thread_threshold != 0 && latency_us >= thread_threshold)
153+
set_stop_tracing();
151154
}
152155

153156
return 0;

0 commit comments

Comments
 (0)