diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/Kconfig | 9 | ||||
-rw-r--r-- | kernel/trace/trace_events.c | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index f61be3015783..a508b9d2adb8 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig | |||
@@ -49,6 +49,11 @@ config FTRACE_NMI_ENTER | |||
49 | default y | 49 | default y |
50 | 50 | ||
51 | config EVENT_TRACING | 51 | config EVENT_TRACING |
52 | select CONTEXT_SWITCH_TRACER | ||
53 | bool | ||
54 | |||
55 | config CONTEXT_SWITCH_TRACER | ||
56 | select MARKERS | ||
52 | bool | 57 | bool |
53 | 58 | ||
54 | config TRACING | 59 | config TRACING |
@@ -176,10 +181,10 @@ config SCHED_TRACER | |||
176 | This tracer tracks the latency of the highest priority task | 181 | This tracer tracks the latency of the highest priority task |
177 | to be scheduled in, starting from the point it has woken up. | 182 | to be scheduled in, starting from the point it has woken up. |
178 | 183 | ||
179 | config CONTEXT_SWITCH_TRACER | 184 | config ENABLE_CONTEXT_SWITCH_TRACER |
180 | bool "Trace process context switches" | 185 | bool "Trace process context switches" |
181 | select TRACING | 186 | select TRACING |
182 | select MARKERS | 187 | select CONTEXT_SWITCH_TRACER |
183 | help | 188 | help |
184 | This tracer gets called from the context switch and records | 189 | This tracer gets called from the context switch and records |
185 | all switching of tasks. | 190 | all switching of tasks. |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 9e91c4ad7c8b..9b246eb01d5f 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -85,6 +85,7 @@ static void ftrace_clear_events(void) | |||
85 | 85 | ||
86 | if (call->enabled) { | 86 | if (call->enabled) { |
87 | call->enabled = 0; | 87 | call->enabled = 0; |
88 | tracing_stop_cmdline_record(); | ||
88 | call->unregfunc(); | 89 | call->unregfunc(); |
89 | } | 90 | } |
90 | } | 91 | } |
@@ -99,12 +100,14 @@ static void ftrace_event_enable_disable(struct ftrace_event_call *call, | |||
99 | case 0: | 100 | case 0: |
100 | if (call->enabled) { | 101 | if (call->enabled) { |
101 | call->enabled = 0; | 102 | call->enabled = 0; |
103 | tracing_stop_cmdline_record(); | ||
102 | call->unregfunc(); | 104 | call->unregfunc(); |
103 | } | 105 | } |
104 | break; | 106 | break; |
105 | case 1: | 107 | case 1: |
106 | if (!call->enabled) { | 108 | if (!call->enabled) { |
107 | call->enabled = 1; | 109 | call->enabled = 1; |
110 | tracing_start_cmdline_record(); | ||
108 | call->regfunc(); | 111 | call->regfunc(); |
109 | } | 112 | } |
110 | break; | 113 | break; |
@@ -1058,6 +1061,7 @@ static void trace_module_remove_events(struct module *mod) | |||
1058 | found = true; | 1061 | found = true; |
1059 | if (call->enabled) { | 1062 | if (call->enabled) { |
1060 | call->enabled = 0; | 1063 | call->enabled = 0; |
1064 | tracing_stop_cmdline_record(); | ||
1061 | call->unregfunc(); | 1065 | call->unregfunc(); |
1062 | } | 1066 | } |
1063 | if (call->event) | 1067 | if (call->event) |
@@ -1262,11 +1266,13 @@ static __init void event_trace_self_tests(void) | |||
1262 | } | 1266 | } |
1263 | 1267 | ||
1264 | call->enabled = 1; | 1268 | call->enabled = 1; |
1269 | tracing_start_cmdline_record(); | ||
1265 | call->regfunc(); | 1270 | call->regfunc(); |
1266 | 1271 | ||
1267 | event_test_stuff(); | 1272 | event_test_stuff(); |
1268 | 1273 | ||
1269 | call->unregfunc(); | 1274 | call->unregfunc(); |
1275 | tracing_stop_cmdline_record(); | ||
1270 | call->enabled = 0; | 1276 | call->enabled = 0; |
1271 | 1277 | ||
1272 | pr_cont("OK\n"); | 1278 | pr_cont("OK\n"); |