Thread (11 messages) 11 messages, 2 authors, 3d ago

[PATCH v5 8/8] tracing/osnoise: Refuse timerlat fd open if tracer inactive

flat view
WARM3d

From: Crystal Wood <hidden>
Date: 2026-10-24 01:56:31
Subsystem: the rest, tracing, tracing os noise / latency tracers · Maintainers: Linus Torvalds, Steven Rostedt, Masami Hiramatsu

Revision v5 (4 revisions archived).

Revisions (4)
  1. v2
  2. v3 [diff against previous]
  3. v4 [diff against previous]
  4. v5 current [diff against previous]
Besides being generally bad, allowing an fd open when there are no active
instances means that osnoise_options_write() and osnoise_cpus_write() will
leave it active during reconfiguration, causing at least WARN splats.

Signed-off-by: Crystal Wood <redacted>
---
v2: new patch
---
 kernel/trace/trace_osnoise.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index 2bc23a4c1b06..5835b9d77bb8 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -2507,7 +2507,8 @@ static int timerlat_fd_open(struct inode *inode, struct file *file)
 	 * This file is accessible only if timerlat is enabled, and
 	 * NO_OSNOISE_WORKLOAD is set.
 	 */
-	if (!timerlat_enabled() || test_bit(OSN_WORKLOAD, &osnoise_options))
+	if (!osnoise_has_registered_instances() || !timerlat_enabled() ||
+	    test_bit(OSN_WORKLOAD, &osnoise_options))
 		return -EINVAL;
 
 	guard(migrate)();
-- 
2.54.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help