]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tools/rtla: Fix --on-threshold always triggering
authorTomas Glozar <tglozar@redhat.com>
Tue, 7 Oct 2025 09:53:39 +0000 (11:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:07 +0000 (14:03 +0100)
commitf75dc8cb4117067ed2bec2b27a61ccbc4ab65f33
treee9413ea07520938eaf05178450271e80aab1d2df
parentefdb8e298907639746a283eefd699e4bfd94c100
tools/rtla: Fix --on-threshold always triggering

[ Upstream commit 417bd0d502f90a2e785e7299dae4f248b5ac0292 ]

Commit 8d933d5c89e8 ("rtla/timerlat: Add continue action") moved the
code performing on-threshold actions (enabled through --on-threshold
option) to inside the RTLA main loop.

The condition in the loop does not check whether the threshold was
actually exceeded or if stop tracing was requested by the user through
SIGINT or duration. This leads to a bug where on-threshold actions are
always performed, even when the threshold was not hit.

(BPF mode is not affected, since it uses a different condition in the
while loop.)

Add a condition that checks for !stop_tracing before executing the
actions. Also, fix incorrect brackets in hist_main_loop to match the
semantics of top_main_loop.

Fixes: 8d933d5c89e8 ("rtla/timerlat: Add continue action")
Fixes: 2f3172f9dd58 ("tools/rtla: Consolidate code between osnoise/timerlat and hist/top")
Reviewed-by: Crystal Wood <crwood@redhat.com>
Reviewed-by: Wander Lairson Costa <wander@redhat.com>
Link: https://lore.kernel.org/r/20251007095341.186923-1-tglozar@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/tracing/rtla/src/common.c