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.
Showing the changes to kernel/trace/trace_stack.c (1 of 3 files). Show all
Unified · Split
| @@ -32,7 +32,7 @@ static arch_spinlock_t stack_trace_max_lock = · 31 unmodified lines | ||
| 32 | 32 | DEFINE_PER_CPU(int, disable_stack_tracer); |
| 33 | 33 | static DEFINE_MUTEX(stack_sysctl_mutex); |
| 34 | 34 | |
| 35 | −int stack_tracer_enabled; | |
| 35 | +static int stack_tracer_enabled; | |
| 36 | 36 | |
| 37 | 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 | 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 | + | |