From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB9E022AE7A for ; Thu, 20 Nov 2025 23:26:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763681195; cv=none; b=fIMBVh1wDj/qiUsLiyHTlGQNvXgtzAfwtIluEXqn2NR0tN0l3IYExmd6gg8oJuh0xp15zUaK6jmdTUxFisnvn47PZL2iTQ01HT8MgBnkPWP4yJDFstH10haA/5jzCKZgA+/mX/TCBD8R4LP1Ik9S6LZJig8LZQT2Z+E0HWWvQPA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763681195; c=relaxed/simple; bh=9Au3x4awW5uZitP4Ye3MX2Pl9UMbnoQhLlkwDmH8bJY=; h=Message-ID:Date:From:To:Cc:Subject; b=najpCb390UFuRJGQqMznyGO6WvuR316YWVWwZhDBAbyqM4K/DGtIjq/sieuNXdcN3SLSf1KYncYukCpXma+k99CWL3FZk+6ttV5TIgFZZo9TYUjgo0XKm68quulZCI681Av0A8cAR5SGFUuPiaPgHItOe/3sEhymq2aQUsA00Hs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=grBPt8+d; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="grBPt8+d" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88CB5C113D0; Thu, 20 Nov 2025 23:26:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763681194; bh=9Au3x4awW5uZitP4Ye3MX2Pl9UMbnoQhLlkwDmH8bJY=; h=Date:From:To:Cc:Subject:From; b=grBPt8+dbBmIRl6f4cXiHgFIeWWRUSUNH49mg7ZDAWSXdlxvfirm26+L6kTaiEvXg 40lAKDwbZjaOzpFzEIbs6GCfivakpRtg4B2VL4LSEdN2CCkYfTIE2fYBfg4qzwaiyp 8d8nsU58OFEOMdYxjZfgMQtjm8H2oPujzD0H2qrjoZX8BUaXugwOhxOyZaX+vu1UNV t77LT4dcaxxCL+GbH3NeHBLZTijFc5lsA9YSC9XkUoH1ZPVVleFRmB1znQRUdnQHwM VDfbpXW3M/0I3ft3f99PcQq3IIwWXYce6q+zBijxesxvvWnlYMvRJad+Ao8huiQKhV iJKYD5wwCyqxQ== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1vME3P-000000041qE-1jr4; Thu, 20 Nov 2025 18:27:07 -0500 Message-ID: <20251120232323.271532418@kernel.org> User-Agent: quilt/0.68 Date: Thu, 20 Nov 2025 18:23:23 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur Subject: [for-next][PATCH 00/16] rtla: Updates for v6.19 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Fixes and minor cleanups for RTLA for v6.19: - Add for_each_monitored_cpu() helper In multiple places, RTLA tools iterate over the list of CPUs running tracer threads. Use single helper instead of repeating the for/if combination. - Remove unused variable option_index in argument parsing RTLA tools use getopt_long() for argument parsing. For its last argument, an unused variable "option_index" is passed. Remove the variable and pass NULL to getopt_long() to shorten the naturally long parsing functions, and make them more readable. - Fix unassigned nr_cpus after code consolidation In recent code consolidation, timerlat tool cleanup, previously implemented separately for each tool, was moved to a common function timerlat_free(). The cleanup relies on nr_cpus being set. This was not done in the new function, leaving the variable uninitialized. Initialize the variable properly, and remove silencing of compiler warning for uninitialized variables. - Stop tracing on user latency in BPF mode Despite the name, rtla-timerlat's -T/--thread option sets timerlat's stop_tracing_total_us option, which also stops tracing on return-from-user latency, not only on thread latency. Implement the same behavior also in BPF sample collection stop tracing handler to avoid a discrepancy and restore correspondence of behavior with the equivalent option of cyclictest. - Fix threshold actions always triggering A bug in threshold action logic caused the action to execute even if tracing did not stop because of threshold. Fix the logic to stop correctly. - Fix few minor issues in tests Extend tests that were shown to need it to 5s, fix osnoise test calling timerlat by mistake, and use new, more reliable output checking in timerlat's "top stop at failed action" test. - Do not print usage on argument parsing error RTLA prints the entire usage message on encountering errors in argument parsing, like a malformed CPU list. The usage message has gotten too long. Instead of printing it, use newly added fatal() helper function to simply exit with the error message, excluding the usage. - Fix unintuitive -C/--cgroup interface "-C cgroup" and "--cgroup cgroup" are invalid syntax, despite that being a common way to specify an option with argument. Moreover, using them fails silently and no cgroup is set. Create new helper function to unify the handling of all such options and allow all of: -Xsomething -X=something -X something as well as the equivalent for the long option. - Fix -a overriding -t argument filename Fix a bug where -a following -t custom_file.txt overrides the custom filename with the default timerlat_trace.txt. - Stop tracing correctly on multiple events at once In some race scenarios, RTLA BPF sample collection might send multiple stop tracing events via the BPF ringbuffer at once. Compare the number of events for != 0 instead of == 1 to cover for this scenario and stop tracing properly. git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git tools/for-next Head SHA1: 368434d20d021aac8071bd08b1a471c588ce9ccd Costa Shulyupin (8): tools/rtla: Add for_each_monitored_cpu() helper tools/rtla: Remove unused optional option_index tools/rtla: Fix unassigned nr_cpus tools/rtla: Add fatal() and replace error handling pattern tools/rtla: Replace timerlat_top_usage("...") with fatal("...") tools/rtla: Replace timerlat_hist_usage("...") with fatal("...") tools/rtla: Replace osnoise_top_usage("...") with fatal("...") tools/rtla: Replace osnoise_hist_usage("...") with fatal("...") Crystal Wood (2): rtla/tests: Don't rely on matching ^1ALL rtla/timerlat: Exit top main loop on any non-zero wait_retval Ivan Pravdin (2): rtla: Fix -C/--cgroup interface rtla: Fix -a overriding -t argument Tomas Glozar (4): rtla/timerlat_bpf: Stop tracing on user latency tools/rtla: Fix --on-threshold always triggering rtla/tests: Extend action tests to 5s rtla/tests: Fix osnoise test calling timerlat ---- Documentation/tools/rtla/common_options.rst | 2 +- tools/tracing/rtla/Makefile.rtla | 2 +- tools/tracing/rtla/src/common.c | 24 +++-- tools/tracing/rtla/src/common.h | 4 + tools/tracing/rtla/src/osnoise_hist.c | 136 +++++++++---------------- tools/tracing/rtla/src/osnoise_top.c | 106 +++++++------------- tools/tracing/rtla/src/timerlat.bpf.c | 3 + tools/tracing/rtla/src/timerlat.c | 12 +-- tools/tracing/rtla/src/timerlat_hist.c | 148 +++++++++------------------- tools/tracing/rtla/src/timerlat_top.c | 116 ++++++++-------------- tools/tracing/rtla/src/timerlat_u.c | 12 +-- tools/tracing/rtla/src/utils.c | 41 ++++++++ tools/tracing/rtla/src/utils.h | 2 + tools/tracing/rtla/tests/osnoise.t | 6 +- tools/tracing/rtla/tests/timerlat.t | 6 +- 15 files changed, 247 insertions(+), 373 deletions(-)