mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 11:06:41 -05:00
stack_tracer: move sysctl registration to kernel/trace/trace_stack.c
Move stack_tracer_enabled into trace_stack_sysctl_table. This is part of a greater effort to move ctl tables into their respective subsystems which will reduce the merge conflicts in kernel/sysctl.c. Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Joel Granados <joel.granados@kernel.org>
This commit is contained in:
@@ -569,8 +569,6 @@ static inline void arch_ftrace_set_direct_caller(struct ftrace_regs *fregs,
|
||||
|
||||
#ifdef CONFIG_STACK_TRACER
|
||||
|
||||
extern int stack_tracer_enabled;
|
||||
|
||||
int stack_trace_sysctl(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos);
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
#include <asm/nmi.h>
|
||||
#include <asm/stacktrace.h>
|
||||
#include <asm/io.h>
|
||||
#endif
|
||||
#ifdef CONFIG_SPARC
|
||||
@@ -1652,15 +1651,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",
|
||||
|
||||
@@ -32,7 +32,7 @@ static arch_spinlock_t stack_trace_max_lock =
|
||||
DEFINE_PER_CPU(int, disable_stack_tracer);
|
||||
static DEFINE_MUTEX(stack_sysctl_mutex);
|
||||
|
||||
int stack_tracer_enabled;
|
||||
static int stack_tracer_enabled;
|
||||
|
||||
static void print_max_stack(void)
|
||||
{
|
||||
@@ -578,3 +578,23 @@ static __init int stack_trace_init(void)
|
||||
}
|
||||
|
||||
device_initcall(stack_trace_init);
|
||||
|
||||
|
||||
static const struct ctl_table trace_stack_sysctl_table[] = {
|
||||
{
|
||||
.procname = "stack_tracer_enabled",
|
||||
.data = &stack_tracer_enabled,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = stack_trace_sysctl,
|
||||
},
|
||||
};
|
||||
|
||||
static int __init init_trace_stack_sysctls(void)
|
||||
{
|
||||
register_sysctl_init("kernel", trace_stack_sysctl_table);
|
||||
return 0;
|
||||
}
|
||||
subsys_initcall(init_trace_stack_sysctls);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user