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