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.
Unified · Split
| @@ -569,8 +569,6 @@ static inline void arch_ftrace_set_direct_caller(struct ftrace_regs *fregs, · 568 unmodified lines | |||
| 569 | 569 | ||
| 570 | #ifdef CONFIG_STACK_TRACER | 570 | #ifdef CONFIG_STACK_TRACER |
| 571 | 571 | ||
| 572 | extern int stack_tracer_enabled; | ||
| 573 | |||
| 574 | int stack_trace_sysctl(const struct ctl_table *table, int write, void *buffer, | 572 | int stack_trace_sysctl(const struct ctl_table *table, int write, void *buffer, |
| 575 | size_t *lenp, loff_t *ppos); | 573 | size_t *lenp, loff_t *ppos); |
| 576 | 574 | ||
| @@ -58,7 +58,6 @@ · 57 unmodified lines | |||
| 58 | 58 | ||
| 59 | #ifdef CONFIG_X86 | 59 | #ifdef CONFIG_X86 |
| 60 | #include <asm/nmi.h> | 60 | #include <asm/nmi.h> |
| 61 | #include <asm/stacktrace.h> | ||
| 62 | #include <asm/io.h> | 61 | #include <asm/io.h> |
| 63 | #endif | 62 | #endif |
| 64 | #ifdef CONFIG_SPARC | 63 | #ifdef CONFIG_SPARC |
| @@ -1652,15 +1651,6 @@ static const struct ctl_table kern_table[] = { · 1587 unmodified lines | |||
| 1652 | .proc_handler = proc_dointvec, | 1651 | .proc_handler = proc_dointvec, |
| 1653 | }, | 1652 | }, |
| 1654 | #endif | 1653 | #endif |
| 1655 | #ifdef CONFIG_STACK_TRACER | ||
| 1656 | { | ||
| 1657 | .procname = "stack_tracer_enabled", | ||
| 1658 | .data = &stack_tracer_enabled, | ||
| 1659 | .maxlen = sizeof(int), | ||
| 1660 | .mode = 0644, | ||
| 1661 | .proc_handler = stack_trace_sysctl, | ||
| 1662 | }, | ||
| 1663 | #endif | ||
| 1664 | #ifdef CONFIG_MODULES | 1654 | #ifdef CONFIG_MODULES |
| 1665 | { | 1655 | { |
| 1666 | .procname = "modprobe", | 1656 | .procname = "modprobe", |
| @@ -32,7 +32,7 @@ static arch_spinlock_t stack_trace_max_lock = · 31 unmodified lines | |||
| 32 | DEFINE_PER_CPU(int, disable_stack_tracer); | 32 | DEFINE_PER_CPU(int, disable_stack_tracer); |
| 33 | static DEFINE_MUTEX(stack_sysctl_mutex); | 33 | static DEFINE_MUTEX(stack_sysctl_mutex); |
| 34 | 34 | ||
| 35 | int stack_tracer_enabled; | 35 | static int stack_tracer_enabled; |
| 36 | 36 | ||
| 37 | static void print_max_stack(void) | 37 | static void print_max_stack(void) |
| 38 | { | 38 | { |
| @@ -578,3 +578,23 @@ static __init int stack_trace_init(void) · 539 unmodified lines | |||
| 578 | } | 578 | } |
| 579 | 579 | ||
| 580 | device_initcall(stack_trace_init); | 580 | device_initcall(stack_trace_init); |
| 581 | |||
| 582 | |||
| 583 | static const struct ctl_table trace_stack_sysctl_table[] = { | ||
| 584 | { | ||
| 585 | .procname = "stack_tracer_enabled", | ||
| 586 | .data = &stack_tracer_enabled, | ||
| 587 | .maxlen = sizeof(int), | ||
| 588 | .mode = 0644, | ||
| 589 | .proc_handler = stack_trace_sysctl, | ||
| 590 | }, | ||
| 591 | }; | ||
| 592 | |||
| 593 | static int __init init_trace_stack_sysctls(void) | ||
| 594 | { | ||
| 595 | register_sysctl_init("kernel", trace_stack_sysctl_table); | ||
| 596 | return 0; | ||
| 597 | } | ||
| 598 | subsys_initcall(init_trace_stack_sysctls); | ||
| 599 | |||
| 600 | |||