aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace_functions.c')
-rw-r--r--kernel/trace/trace_functions.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index 13770abd7a12..a426f410c060 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -217,10 +217,11 @@ static void tracing_stop_function_trace(void)
217 217
218static int func_set_flag(u32 old_flags, u32 bit, int set) 218static int func_set_flag(u32 old_flags, u32 bit, int set)
219{ 219{
220 if (bit == TRACE_FUNC_OPT_STACK) { 220 switch (bit) {
221 case TRACE_FUNC_OPT_STACK:
221 /* do nothing if already set */ 222 /* do nothing if already set */
222 if (!!set == !!(func_flags.val & TRACE_FUNC_OPT_STACK)) 223 if (!!set == !!(func_flags.val & TRACE_FUNC_OPT_STACK))
223 return 0; 224 break;
224 225
225 if (set) { 226 if (set) {
226 unregister_ftrace_function(&trace_ops); 227 unregister_ftrace_function(&trace_ops);
@@ -230,12 +231,14 @@ static int func_set_flag(u32 old_flags, u32 bit, int set)
230 register_ftrace_function(&trace_ops); 231 register_ftrace_function(&trace_ops);
231 } 232 }
232 233
233 return 0; 234 break;
234 } else if (bit == TRACE_FUNC_OPT_PSTORE) { 235 case TRACE_FUNC_OPT_PSTORE:
235 return 0; 236 break;
237 default:
238 return -EINVAL;
236 } 239 }
237 240
238 return -EINVAL; 241 return 0;
239} 242}
240 243
241static struct tracer function_trace __read_mostly = 244static struct tracer function_trace __read_mostly =