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.

tracing: Move trace sysctls into trace.c

Move trace ctl tables into their own const array in
kernel/trace/trace.c. The sysctl table register is called with
subsys_initcall placing if after its original place in proc_root_init.
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.

Signed-off-by: Joel Granados <joel.granados@kernel.org>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>

+35 -32
-7
include/linux/ftrace.h
··· 1298 1298 #ifdef CONFIG_TRACING 1299 1299 enum ftrace_dump_mode; 1300 1300 1301 - #define MAX_TRACER_SIZE 100 1302 - extern char ftrace_dump_on_oops[]; 1303 1301 extern int ftrace_dump_on_oops_enabled(void); 1304 - extern int tracepoint_printk; 1305 1302 1306 1303 extern void disable_trace_on_warning(void); 1307 - extern int __disable_trace_on_warning; 1308 - 1309 - int tracepoint_printk_sysctl(const struct ctl_table *table, int write, 1310 - void *buffer, size_t *lenp, loff_t *ppos); 1311 1304 1312 1305 #else /* CONFIG_TRACING */ 1313 1306 static inline void disable_trace_on_warning(void) { }
-24
kernel/sysctl.c
··· 44 44 #include <linux/nfs_fs.h> 45 45 #include <linux/acpi.h> 46 46 #include <linux/reboot.h> 47 - #include <linux/ftrace.h> 48 47 #include <linux/kmod.h> 49 48 #include <linux/capability.h> 50 49 #include <linux/binfmts.h> ··· 1659 1660 .maxlen = sizeof(int), 1660 1661 .mode = 0644, 1661 1662 .proc_handler = stack_trace_sysctl, 1662 - }, 1663 - #endif 1664 - #ifdef CONFIG_TRACING 1665 - { 1666 - .procname = "ftrace_dump_on_oops", 1667 - .data = &ftrace_dump_on_oops, 1668 - .maxlen = MAX_TRACER_SIZE, 1669 - .mode = 0644, 1670 - .proc_handler = proc_dostring, 1671 - }, 1672 - { 1673 - .procname = "traceoff_on_warning", 1674 - .data = &__disable_trace_on_warning, 1675 - .maxlen = sizeof(__disable_trace_on_warning), 1676 - .mode = 0644, 1677 - .proc_handler = proc_dointvec, 1678 - }, 1679 - { 1680 - .procname = "tracepoint_printk", 1681 - .data = &tracepoint_printk, 1682 - .maxlen = sizeof(tracepoint_printk), 1683 - .mode = 0644, 1684 - .proc_handler = tracepoint_printk_sysctl, 1685 1663 }, 1686 1664 #endif 1687 1665 #ifdef CONFIG_MODULES
+35 -1
kernel/trace/trace.c
··· 120 120 121 121 cpumask_var_t __read_mostly tracing_buffer_mask; 122 122 123 + #define MAX_TRACER_SIZE 100 123 124 /* 124 125 * ftrace_dump_on_oops - variable to dump ftrace buffer on oops 125 126 * ··· 143 142 char ftrace_dump_on_oops[MAX_TRACER_SIZE] = "0"; 144 143 145 144 /* When set, tracing will stop when a WARN*() is hit */ 146 - int __disable_trace_on_warning; 145 + static int __disable_trace_on_warning; 146 + 147 + int tracepoint_printk_sysctl(const struct ctl_table *table, int write, 148 + void *buffer, size_t *lenp, loff_t *ppos); 149 + static const struct ctl_table trace_sysctl_table[] = { 150 + { 151 + .procname = "ftrace_dump_on_oops", 152 + .data = &ftrace_dump_on_oops, 153 + .maxlen = MAX_TRACER_SIZE, 154 + .mode = 0644, 155 + .proc_handler = proc_dostring, 156 + }, 157 + { 158 + .procname = "traceoff_on_warning", 159 + .data = &__disable_trace_on_warning, 160 + .maxlen = sizeof(__disable_trace_on_warning), 161 + .mode = 0644, 162 + .proc_handler = proc_dointvec, 163 + }, 164 + { 165 + .procname = "tracepoint_printk", 166 + .data = &tracepoint_printk, 167 + .maxlen = sizeof(tracepoint_printk), 168 + .mode = 0644, 169 + .proc_handler = tracepoint_printk_sysctl, 170 + }, 171 + }; 172 + 173 + static int __init init_trace_sysctls(void) 174 + { 175 + register_sysctl_init("kernel", trace_sysctl_table); 176 + return 0; 177 + } 178 + subsys_initcall(init_trace_sysctls); 147 179 148 180 #ifdef CONFIG_TRACE_EVAL_MAP_FILE 149 181 /* Map of enums to their values, for "eval_map" file */