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 3457E3595F for ; Sat, 25 Jan 2025 16:31:42 +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=1737822703; cv=none; b=CLiedmd9E1myRs62CnQ13hxclBP+aCOIgeXUjLRVKcYRx1JtV0N1LeQ5HfFF440yvP9eS1FUoWokwfg/Kww7Y2jSzhxJidI6t0HdH6dfQ8Ru5vadr9EGGSl1fSw5Yo1bB/bDOp2U1XpVqISPff3pgRt4c9Mz8dT7CrBJK22itw8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737822703; c=relaxed/simple; bh=hPH8/HcpRY5RWHviSA8hhMFbZhwiAB0Xkmpvq8XvSsg=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=PhNml3VYKZkWQG7A7RgS4MiEwwWHn6qzLK6Zi62PKdEOOZZKEL2shRZRFlpFLw3EOo1f9ERHTYx7GEZ34QaZQQDN51XC85dzQtbkvsBqqVsyaYzL/PebQDFH0OoyHw8MlXhUtAQ+3VKRu+ZS6O7mru8dCmK306DJPdPU6D8yl9A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6610C4CED6; Sat, 25 Jan 2025 16:31:41 +0000 (UTC) Date: Sat, 25 Jan 2025 11:31:54 -0500 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Masami Hiramatsu , Mathieu Desnoyers , Costa Shulyupin , Gabriele Monaco , Tomas Glozar , John Kacur Subject: [GIT PULL] rv: tools/rtla: Updates for 6.14 Message-ID: <20250125113154.5caec693@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Linus, rv: tools/rtla: Updates for 6.14 - Add a test suite to test the tool Add a small test suite that can be used to test rtla's basic features to at least have something to test when applying changes. - Automate manual steps in monitor creation While creating a new monitor in RV, besides generating code from dot2k, there are a few manual steps which can be tedious and error prone, like adding the tracepoints, makefile lines and kconfig, or selecting events that start the monitor in the initial state. Updates were made to try and automate as much as possible among those steps to make creating a new RV monitor much quicker. It is still requires to select proper tracepoints, this step is harder to automate in a general way and, in several cases, would still need user intervention. - Have rtla timerlat hist and top set OSNOISE_WORKLOAD flag Have both rtla-timerlat-hist and rtla-timerlat-top set OSNOISE_WORKLOAD to the proper value ("on" when running with -k, "off" when running with -u) every time the option is available instead of setting it only when running with -u. This prevents rtla timerlat -k from giving no results when NO_OSNOISE_WORKLOAD is set, either manually or by an abnormally exited earlier run of rtla timerlat -u. - Stop rtla timerlat on signal properly when overloaded There is an issue where if rtla is run on machines with a high number of CPUs (100+), timerlat can generate more samples than rtla is able to process via tracefs_iterate_raw_events. This is especially common when the interval is set to 100us (rteval and cyclictest default) as opposed to the rtla default of 1000us, but also happens with the rtla default. Currently, this leads to rtla hanging and having to be terminated with SIGTERM. SIGINT setting stop_tracing is not enough, since more and more events are coming and tracefs_iterate_raw_events never exits. To fix this: Stop the timerlat tracer on SIGINT/SIGALRM to ensure no more events are generated when rtla is supposed to exit. Also on receiving SIGINT/SIGALRM twice, abort iteration immediately with tracefs_iterate_stop, making rtla exit right away instead of waiting for all events to be processed. - Account for missed events Due to tracefs buffer overflow, it can happen that rtla misses events, making the tracing results inaccurate. Count both the number of missed events and the total number of processed events, and display missed events as well as their percentage. The numbers are displayed for both osnoise and timerlat, even though for the earlier, missed events are generally not expected. For hist, the number is displayed at the end of the run; for top, it is displayed on each printing of the top table. - Changes to make osnoise more robust There was a dependency in the code that the first field of the osnoise_tool structure was the trace field. If that that ever changed, then the code work break. Change the code to encapsulate this dependency where the code that uses the structure does not have this dependency. Please pull the latest trace-tools-v6.14 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-tools-v6.14 Tag SHA1: a24dfa90dd5bd124328d33375a42e064e514a002 Head SHA1: cf186201118c953c3a0256312a186b3d24ffdb9f Costa Shulyupin (1): tools/rtla: Add osnoise_trace_is_off() Gabriele Monaco (8): verification/dot2k: Fix template directory detection verification/dot2k: Unify main.c templates verification/dot2k: More robust template variables verification/dot2k: Add support for name and description options rv: Simplify manual steps in monitor creation verification/dot2k: Simplify manual steps in monitor creation verification/dot2k: Auto patch current kernel source verification/dot2k: Implement event type detection Tomas Glozar (13): tools/rtla: Add basic test suite rtla: Add trace_instance_stop rtla/timerlat_hist: Stop timerlat tracer on signal rtla/timerlat_top: Stop timerlat tracer on signal rtla/timerlat_hist: Abort event processing on second signal rtla/timerlat_top: Abort event processing on second signal rtla/osnoise: Distinguish missing workload option rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads rtla: Count missed trace events rtla: Count all processed events rtla: Add function to report missed events rtla: Report missed event count ---- kernel/trace/rv/Kconfig | 27 +-- kernel/trace/rv/Makefile | 3 + kernel/trace/rv/monitors/wip/Kconfig | 12 ++ kernel/trace/rv/monitors/wip/wip.c | 2 +- kernel/trace/rv/monitors/wip/wip_trace.h | 15 ++ kernel/trace/rv/monitors/wwnr/Kconfig | 11 + kernel/trace/rv/monitors/wwnr/wwnr.c | 2 +- kernel/trace/rv/monitors/wwnr/wwnr_trace.h | 16 ++ kernel/trace/rv/rv.c | 2 +- .../events/rv.h => kernel/trace/rv/rv_trace.h | 26 +-- tools/tracing/rtla/Makefile | 4 +- tools/tracing/rtla/src/osnoise.c | 38 +++- tools/tracing/rtla/src/osnoise.h | 2 + tools/tracing/rtla/src/osnoise_hist.c | 5 +- tools/tracing/rtla/src/osnoise_top.c | 5 +- tools/tracing/rtla/src/timerlat_hist.c | 37 +++- tools/tracing/rtla/src/timerlat_top.c | 40 +++- tools/tracing/rtla/src/trace.c | 65 ++++-- tools/tracing/rtla/src/trace.h | 4 +- tools/tracing/rtla/tests/engine.sh | 48 +++++ tools/tracing/rtla/tests/hwnoise.t | 21 ++ tools/tracing/rtla/tests/osnoise.t | 19 ++ tools/tracing/rtla/tests/timerlat.t | 27 +++ tools/verification/dot2/automata.py | 36 +++- tools/verification/dot2/dot2c.py | 4 +- tools/verification/dot2/dot2k | 17 +- tools/verification/dot2/dot2k.py | 226 ++++++++++++++++++--- tools/verification/dot2/dot2k_templates/Kconfig | 6 + tools/verification/dot2/dot2k_templates/main.c | 91 +++++++++ .../dot2/dot2k_templates/main_global.c | 91 --------- .../dot2/dot2k_templates/main_per_cpu.c | 91 --------- .../dot2/dot2k_templates/main_per_task.c | 91 --------- tools/verification/dot2/dot2k_templates/trace.h | 13 ++ 33 files changed, 691 insertions(+), 406 deletions(-) create mode 100644 kernel/trace/rv/monitors/wip/Kconfig create mode 100644 kernel/trace/rv/monitors/wip/wip_trace.h create mode 100644 kernel/trace/rv/monitors/wwnr/Kconfig create mode 100644 kernel/trace/rv/monitors/wwnr/wwnr_trace.h rename include/trace/events/rv.h => kernel/trace/rv/rv_trace.h (79%) create mode 100644 tools/tracing/rtla/tests/engine.sh create mode 100644 tools/tracing/rtla/tests/hwnoise.t create mode 100644 tools/tracing/rtla/tests/osnoise.t create mode 100644 tools/tracing/rtla/tests/timerlat.t create mode 100644 tools/verification/dot2/dot2k_templates/Kconfig create mode 100644 tools/verification/dot2/dot2k_templates/main.c delete mode 100644 tools/verification/dot2/dot2k_templates/main_global.c delete mode 100644 tools/verification/dot2/dot2k_templates/main_per_cpu.c delete mode 100644 tools/verification/dot2/dot2k_templates/main_per_task.c create mode 100644 tools/verification/dot2/dot2k_templates/trace.h ---------------------------