diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-10-12 01:12:21 +0200 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-10-13 02:43:00 +0200 |
commit | aa07d71f1bc7ea20e442e812b5de9d632b7f84c6 (patch) | |
tree | 126ec8caf3491a1c6029249ae718f70bffa131f4 /kernel/trace/trace_events.c | |
parent | tracing: Get trace_array reference for available_tracers files (diff) | |
download | linux-aa07d71f1bc7ea20e442e812b5de9d632b7f84c6.tar.xz linux-aa07d71f1bc7ea20e442e812b5de9d632b7f84c6.zip |
tracing: Have trace events system open call tracing_open_generic_tr()
Instead of having the trace events system open call open code the taking of
the trace_array descriptor (with trace_array_get()) and then calling
trace_open_generic(), have it use the tracing_open_generic_tr() that does
the combination of the two. This requires making tracing_open_generic_tr()
global.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to '')
-rw-r--r-- | kernel/trace/trace_events.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index b89cdfe20bc1..9613a757c902 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -1440,28 +1440,17 @@ static int system_tr_open(struct inode *inode, struct file *filp) struct trace_array *tr = inode->i_private; int ret; - if (tracing_is_disabled()) - return -ENODEV; - - if (trace_array_get(tr) < 0) - return -ENODEV; - /* Make a temporary dir that has no system but points to tr */ dir = kzalloc(sizeof(*dir), GFP_KERNEL); - if (!dir) { - trace_array_put(tr); + if (!dir) return -ENOMEM; - } - - dir->tr = tr; - ret = tracing_open_generic(inode, filp); + ret = tracing_open_generic_tr(inode, filp); if (ret < 0) { - trace_array_put(tr); kfree(dir); return ret; } - + dir->tr = tr; filp->private_data = dir; return 0; |