diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace_events.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index f82d92dbd614..32b9895af239 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -415,14 +415,14 @@ static void put_system(struct ftrace_subsystem_dir *dir) | |||
415 | /* | 415 | /* |
416 | * __ftrace_set_clr_event(NULL, NULL, NULL, set) will set/unset all events. | 416 | * __ftrace_set_clr_event(NULL, NULL, NULL, set) will set/unset all events. |
417 | */ | 417 | */ |
418 | static int __ftrace_set_clr_event(struct trace_array *tr, const char *match, | 418 | static int |
419 | const char *sub, const char *event, int set) | 419 | __ftrace_set_clr_event_nolock(struct trace_array *tr, const char *match, |
420 | const char *sub, const char *event, int set) | ||
420 | { | 421 | { |
421 | struct ftrace_event_file *file; | 422 | struct ftrace_event_file *file; |
422 | struct ftrace_event_call *call; | 423 | struct ftrace_event_call *call; |
423 | int ret = -EINVAL; | 424 | int ret = -EINVAL; |
424 | 425 | ||
425 | mutex_lock(&event_mutex); | ||
426 | list_for_each_entry(file, &tr->events, list) { | 426 | list_for_each_entry(file, &tr->events, list) { |
427 | 427 | ||
428 | call = file->event_call; | 428 | call = file->event_call; |
@@ -448,6 +448,17 @@ static int __ftrace_set_clr_event(struct trace_array *tr, const char *match, | |||
448 | 448 | ||
449 | ret = 0; | 449 | ret = 0; |
450 | } | 450 | } |
451 | |||
452 | return ret; | ||
453 | } | ||
454 | |||
455 | static int __ftrace_set_clr_event(struct trace_array *tr, const char *match, | ||
456 | const char *sub, const char *event, int set) | ||
457 | { | ||
458 | int ret; | ||
459 | |||
460 | mutex_lock(&event_mutex); | ||
461 | ret = __ftrace_set_clr_event_nolock(tr, match, sub, event, set); | ||
451 | mutex_unlock(&event_mutex); | 462 | mutex_unlock(&event_mutex); |
452 | 463 | ||
453 | return ret; | 464 | return ret; |
@@ -2367,11 +2378,11 @@ early_event_add_tracer(struct dentry *parent, struct trace_array *tr) | |||
2367 | 2378 | ||
2368 | int event_trace_del_tracer(struct trace_array *tr) | 2379 | int event_trace_del_tracer(struct trace_array *tr) |
2369 | { | 2380 | { |
2370 | /* Disable any running events */ | ||
2371 | __ftrace_set_clr_event(tr, NULL, NULL, NULL, 0); | ||
2372 | |||
2373 | mutex_lock(&event_mutex); | 2381 | mutex_lock(&event_mutex); |
2374 | 2382 | ||
2383 | /* Disable any running events */ | ||
2384 | __ftrace_set_clr_event_nolock(tr, NULL, NULL, NULL, 0); | ||
2385 | |||
2375 | down_write(&trace_event_sem); | 2386 | down_write(&trace_event_sem); |
2376 | __trace_remove_event_dirs(tr); | 2387 | __trace_remove_event_dirs(tr); |
2377 | debugfs_remove_recursive(tr->event_dir); | 2388 | debugfs_remove_recursive(tr->event_dir); |