summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Richard2026-01-05 12:54:42 +0000
committerHauke Mehrtens2026-01-24 21:54:29 +0000
commit9a584c631e30d8d7eb36d12483ef504e2c528d1b (patch)
tree0bde6085de434ff12746b906be8af083c1144c48
parent2530c99981db4a9015a9f9e4b3754be4dec78c90 (diff)
downloadopenwrt-9a584c631e30d8d7eb36d12483ef504e2c528d1b.tar.gz
kernel: add HWLAT_TRACER kernel config option
This adds the HWLAT_TRACER kernel configuration option. The hwlat tracer allows to detect hardware latencies. Signed-off-by: Thomas Richard <thomas.richard@bootlin.com> Link: https://github.com/openwrt/openwrt/pull/21413 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--config/Config-kernel.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index 870e53206a..86d99bd49b 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -413,6 +413,41 @@ config KERNEL_PREEMPT_TRACER
enabled. This option and the irqs-off timing option can be
used together or separately.)
+config KERNEL_HWLAT_TRACER
+ bool "Tracer to detect hardware latencies (like SMIs)"
+ depends on KERNEL_FTRACE
+ help
+ This tracer, when enabled will create one or more kernel threads,
+ depending on what the cpumask file is set to, which each thread
+ spinning in a loop looking for interruptions caused by
+ something other than the kernel. For example, if a
+ System Management Interrupt (SMI) takes a noticeable amount of
+ time, this tracer will detect it. This is useful for testing
+ if a system is reliable for Real Time tasks.
+
+ Some files are created in the tracing directory when this
+ is enabled:
+
+ hwlat_detector/width - time in usecs for how long to spin for
+ hwlat_detector/window - time in usecs between the start of each
+ iteration
+
+ A kernel thread is created that will spin with interrupts disabled
+ for "width" microseconds in every "window" cycle. It will not spin
+ for "window - width" microseconds, where the system can
+ continue to operate.
+
+ The output will appear in the trace and trace_pipe files.
+
+ When the tracer is not running, it has no affect on the system,
+ but when it is running, it can cause the system to be
+ periodically non responsive. Do not run this tracer on a
+ production system.
+
+ To enable this tracer, echo in "hwlat" into the current_tracer
+ file. Every time a latency is greater than tracing_thresh, it will
+ be recorded into the ring buffer.
+
config KERNEL_HIST_TRIGGERS
bool "Histogram triggers"
depends on KERNEL_FTRACE