Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+21 -13
-2
include/linux/ftrace.h
··· 569 569 570 570 #ifdef CONFIG_STACK_TRACER 571 571 572 - extern int stack_tracer_enabled; 573 - 574 572 int stack_trace_sysctl(const struct ctl_table *table, int write, void *buffer, 575 573 size_t *lenp, loff_t *ppos); 576 574
-10
kernel/sysctl.c
··· 58 58 59 59 #ifdef CONFIG_X86 60 60 #include <asm/nmi.h> 61 - #include <asm/stacktrace.h> 62 61 #include <asm/io.h> 63 62 #endif 64 63 #ifdef CONFIG_SPARC ··· 1649 1650 .maxlen = sizeof (int), 1650 1651 .mode = 0644, 1651 1652 .proc_handler = proc_dointvec, 1652 - }, 1653 - #endif 1654 - #ifdef CONFIG_STACK_TRACER 1655 - { 1656 - .procname = "stack_tracer_enabled", 1657 - .data = &stack_tracer_enabled, 1658 - .maxlen = sizeof(int), 1659 - .mode = 0644, 1660 - .proc_handler = stack_trace_sysctl, 1661 1653 }, 1662 1654 #endif 1663 1655 #ifdef CONFIG_MODULES
+21 -1
kernel/trace/trace_stack.c
··· 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 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 +