[openwrt/openwrt] kernel: add TIMERLAT_TRACER kernel config option

LEDE Commits lede-commits at lists.infradead.org
Sat Jan 24 13:56:26 PST 2026


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3ddee7edc491db04008f6eacbb2446e1fb5a13fb

commit 3ddee7edc491db04008f6eacbb2446e1fb5a13fb
Author: Thomas Richard <thomas.richard at bootlin.com>
AuthorDate: Mon Jan 5 16:32:44 2026 +0100

    kernel: add TIMERLAT_TRACER kernel config option
    
    This adds the TIMERLAT_TRACER kernel configuration option. The timelat
    tracer helps to find sources of wakeup latencies of real-time threads.
    
    Signed-off-by: Thomas Richard <thomas.richard at bootlin.com>
    Link: https://github.com/openwrt/openwrt/pull/21413
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 config/Config-kernel.in | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index cb6e49d393..177640d351 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -482,6 +482,33 @@ config KERNEL_OSNOISE_TRACER
 	  To enable this tracer, echo in "osnoise" into the current_tracer
 	  file.
 
+config KERNEL_TIMERLAT_TRACER
+	bool "Timerlat tracer"
+	depends on KERNEL_FTRACE
+	help
+	  The timerlat tracer aims to help the preemptive kernel developers
+	  to find sources of wakeup latencies of real-time threads.
+
+	  The tracer creates a per-cpu kernel thread with real-time priority.
+	  The tracer thread sets a periodic timer to wakeup itself, and goes
+	  to sleep waiting for the timer to fire. At the wakeup, the thread
+	  then computes a wakeup latency value as the difference between
+	  the current time and the absolute time that the timer was set
+	  to expire.
+
+	  The tracer prints two lines at every activation. The first is the
+	  timer latency observed at the hardirq context before the
+	  activation of the thread. The second is the timer latency observed
+	  by the thread, which is the same level that cyclictest reports. The
+	  ACTIVATION ID field serves to relate the irq execution to its
+	  respective thread execution.
+
+	  The tracer is build on top of osnoise tracer, and the osnoise:
+	  events can be used to trace the source of interference from NMI,
+	  IRQs and other threads. It also enables the capture of the
+	  stacktrace at the IRQ context, which helps to identify the code
+	  path that can cause thread delay.
+
 config KERNEL_HIST_TRIGGERS
 	bool "Histogram triggers"
 	depends on KERNEL_FTRACE




More information about the lede-commits mailing list