diff options
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 815c878f409b..d7dfc7efc4bf 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -73,7 +73,8 @@ static struct tracer_flags dummy_tracer_flags = { | |||
73 | .opts = dummy_tracer_opt | 73 | .opts = dummy_tracer_opt |
74 | }; | 74 | }; |
75 | 75 | ||
76 | static int dummy_set_flag(u32 old_flags, u32 bit, int set) | 76 | static int |
77 | dummy_set_flag(struct trace_array *tr, u32 old_flags, u32 bit, int set) | ||
77 | { | 78 | { |
78 | return 0; | 79 | return 0; |
79 | } | 80 | } |
@@ -3339,13 +3340,14 @@ static int tracing_trace_options_show(struct seq_file *m, void *v) | |||
3339 | return 0; | 3340 | return 0; |
3340 | } | 3341 | } |
3341 | 3342 | ||
3342 | static int __set_tracer_option(struct tracer *trace, | 3343 | static int __set_tracer_option(struct trace_array *tr, |
3343 | struct tracer_flags *tracer_flags, | 3344 | struct tracer_flags *tracer_flags, |
3344 | struct tracer_opt *opts, int neg) | 3345 | struct tracer_opt *opts, int neg) |
3345 | { | 3346 | { |
3347 | struct tracer *trace = tr->current_trace; | ||
3346 | int ret; | 3348 | int ret; |
3347 | 3349 | ||
3348 | ret = trace->set_flag(tracer_flags->val, opts->bit, !neg); | 3350 | ret = trace->set_flag(tr, tracer_flags->val, opts->bit, !neg); |
3349 | if (ret) | 3351 | if (ret) |
3350 | return ret; | 3352 | return ret; |
3351 | 3353 | ||
@@ -3357,8 +3359,9 @@ static int __set_tracer_option(struct tracer *trace, | |||
3357 | } | 3359 | } |
3358 | 3360 | ||
3359 | /* Try to assign a tracer specific option */ | 3361 | /* Try to assign a tracer specific option */ |
3360 | static int set_tracer_option(struct tracer *trace, char *cmp, int neg) | 3362 | static int set_tracer_option(struct trace_array *tr, char *cmp, int neg) |
3361 | { | 3363 | { |
3364 | struct tracer *trace = tr->current_trace; | ||
3362 | struct tracer_flags *tracer_flags = trace->flags; | 3365 | struct tracer_flags *tracer_flags = trace->flags; |
3363 | struct tracer_opt *opts = NULL; | 3366 | struct tracer_opt *opts = NULL; |
3364 | int i; | 3367 | int i; |
@@ -3367,8 +3370,7 @@ static int set_tracer_option(struct tracer *trace, char *cmp, int neg) | |||
3367 | opts = &tracer_flags->opts[i]; | 3370 | opts = &tracer_flags->opts[i]; |
3368 | 3371 | ||
3369 | if (strcmp(cmp, opts->name) == 0) | 3372 | if (strcmp(cmp, opts->name) == 0) |
3370 | return __set_tracer_option(trace, trace->flags, | 3373 | return __set_tracer_option(tr, trace->flags, opts, neg); |
3371 | opts, neg); | ||
3372 | } | 3374 | } |
3373 | 3375 | ||
3374 | return -EINVAL; | 3376 | return -EINVAL; |
@@ -3440,7 +3442,7 @@ static int trace_set_options(struct trace_array *tr, char *option) | |||
3440 | 3442 | ||
3441 | /* If no option could be set, test the specific tracer options */ | 3443 | /* If no option could be set, test the specific tracer options */ |
3442 | if (!trace_options[i]) | 3444 | if (!trace_options[i]) |
3443 | ret = set_tracer_option(tr->current_trace, cmp, neg); | 3445 | ret = set_tracer_option(tr, cmp, neg); |
3444 | 3446 | ||
3445 | mutex_unlock(&trace_types_lock); | 3447 | mutex_unlock(&trace_types_lock); |
3446 | 3448 | ||
@@ -5689,7 +5691,7 @@ trace_options_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
5689 | 5691 | ||
5690 | if (!!(topt->flags->val & topt->opt->bit) != val) { | 5692 | if (!!(topt->flags->val & topt->opt->bit) != val) { |
5691 | mutex_lock(&trace_types_lock); | 5693 | mutex_lock(&trace_types_lock); |
5692 | ret = __set_tracer_option(topt->tr->current_trace, topt->flags, | 5694 | ret = __set_tracer_option(topt->tr, topt->flags, |
5693 | topt->opt, !val); | 5695 | topt->opt, !val); |
5694 | mutex_unlock(&trace_types_lock); | 5696 | mutex_unlock(&trace_types_lock); |
5695 | if (ret) | 5697 | if (ret) |