diff options
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r-- | kernel/trace/trace_events.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 3ddfd8f62c05..f99e0b3bca8c 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -574,6 +574,9 @@ int trace_set_clr_event(const char *system, const char *event, int set) | |||
574 | { | 574 | { |
575 | struct trace_array *tr = top_trace_array(); | 575 | struct trace_array *tr = top_trace_array(); |
576 | 576 | ||
577 | if (!tr) | ||
578 | return -ENODEV; | ||
579 | |||
577 | return __ftrace_set_clr_event(tr, NULL, system, event, set); | 580 | return __ftrace_set_clr_event(tr, NULL, system, event, set); |
578 | } | 581 | } |
579 | EXPORT_SYMBOL_GPL(trace_set_clr_event); | 582 | EXPORT_SYMBOL_GPL(trace_set_clr_event); |
@@ -2065,6 +2068,9 @@ event_enable_func(struct ftrace_hash *hash, | |||
2065 | bool enable; | 2068 | bool enable; |
2066 | int ret; | 2069 | int ret; |
2067 | 2070 | ||
2071 | if (!tr) | ||
2072 | return -ENODEV; | ||
2073 | |||
2068 | /* hash funcs only work with set_ftrace_filter */ | 2074 | /* hash funcs only work with set_ftrace_filter */ |
2069 | if (!enabled || !param) | 2075 | if (!enabled || !param) |
2070 | return -EINVAL; | 2076 | return -EINVAL; |
@@ -2396,6 +2402,9 @@ static __init int event_trace_enable(void) | |||
2396 | char *token; | 2402 | char *token; |
2397 | int ret; | 2403 | int ret; |
2398 | 2404 | ||
2405 | if (!tr) | ||
2406 | return -ENODEV; | ||
2407 | |||
2399 | for_each_event(iter, __start_ftrace_events, __stop_ftrace_events) { | 2408 | for_each_event(iter, __start_ftrace_events, __stop_ftrace_events) { |
2400 | 2409 | ||
2401 | call = *iter; | 2410 | call = *iter; |
@@ -2442,6 +2451,8 @@ static __init int event_trace_init(void) | |||
2442 | int ret; | 2451 | int ret; |
2443 | 2452 | ||
2444 | tr = top_trace_array(); | 2453 | tr = top_trace_array(); |
2454 | if (!tr) | ||
2455 | return -ENODEV; | ||
2445 | 2456 | ||
2446 | d_tracer = tracing_init_dentry(); | 2457 | d_tracer = tracing_init_dentry(); |
2447 | if (!d_tracer) | 2458 | if (!d_tracer) |
@@ -2535,6 +2546,8 @@ static __init void event_trace_self_tests(void) | |||
2535 | int ret; | 2546 | int ret; |
2536 | 2547 | ||
2537 | tr = top_trace_array(); | 2548 | tr = top_trace_array(); |
2549 | if (!tr) | ||
2550 | return; | ||
2538 | 2551 | ||
2539 | pr_info("Running tests on trace events:\n"); | 2552 | pr_info("Running tests on trace events:\n"); |
2540 | 2553 | ||