Thread (16 messages) flat view 16 messages, 4 authors, 2025-03-06
STALE566d

[PATCH 4/8] stack_tracer: move sysctl registration to kernel/trace/trace.c

From: Joel Granados <joel.granados@kernel.org>
Date: 2025-02-18 09:56:46
Also in: b4-sent, linux-acpi, linux-fsdevel, linux-perf-users, linux-s390, lkml, sparclinux
Subsystem: proc sysctl, the rest, tracing · Maintainers: Kees Cook, Joel Granados, Linus Torvalds, Steven Rostedt, Masami Hiramatsu

Squash with ftrace:
Move stac_tracer_enabled into trace_sysctl_table while keeping the
CONFIG_STACK_TRACER ifdef. This is part of a greater effort to move ctl
tables into their respective subsystems which will reduce the merge
conflicts in kerenel/sysctl.c.

Signed-off-by: Joel Granados <joel.granados@kernel.org>
---
 kernel/sysctl.c      | 10 ----------
 kernel/trace/trace.c |  9 +++++++++
 2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index baa250e223a2..dc3747cc72d4 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -68,7 +68,6 @@
 
 #ifdef CONFIG_X86
 #include <asm/nmi.h>
-#include <asm/stacktrace.h>
 #include <asm/io.h>
 #endif
 #ifdef CONFIG_SPARC
@@ -1674,15 +1673,6 @@ static const struct ctl_table kern_table[] = {
 		.proc_handler	= proc_dointvec,
 	},
 #endif
-#ifdef CONFIG_STACK_TRACER
-	{
-		.procname	= "stack_tracer_enabled",
-		.data		= &stack_tracer_enabled,
-		.maxlen		= sizeof(int),
-		.mode		= 0644,
-		.proc_handler	= stack_trace_sysctl,
-	},
-#endif
 #ifdef CONFIG_MODULES
 	{
 		.procname	= "modprobe",
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index abfc0e56173b..17b449f9e330 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -166,6 +166,15 @@ static const struct ctl_table trace_sysctl_table[] = {
 		.mode		= 0644,
 		.proc_handler	= tracepoint_printk_sysctl,
 	},
+#ifdef CONFIG_STACK_TRACER
+	{
+		.procname	= "stack_tracer_enabled",
+		.data		= &stack_tracer_enabled,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= stack_trace_sysctl,
+	},
+#endif
 };
 
 static int __init init_trace_sysctls(void)
-- 
2.44.2

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help