summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-12-07 09:06:24 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-12-07 12:01:35 -0500
commitc521efd1700a8c0f7ce26f011f5eaecca17fabfa (patch)
tree8dd9f8171222e856aafa5db1c1a150098327d409 /kernel/trace/trace.c
parent6ec22f9b037fc0c2e00ddb7023fad279c365324d (diff)
downloadop-kernel-dev-c521efd1700a8c0f7ce26f011f5eaecca17fabfa.zip
op-kernel-dev-c521efd1700a8c0f7ce26f011f5eaecca17fabfa.tar.gz
tracing: Add pipe_close interface
An ftrace plugin can add a pipe_open interface when the user opens trace_pipe. But if the plugin allocates something within the pipe_open it can not free it because there exists no pipe_close. The hook to the trace file open has a corresponding close. The closing of the trace_pipe file should also have a corresponding close. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 874f289..f804b40 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2898,6 +2898,10 @@ static int tracing_release_pipe(struct inode *inode, struct file *file)
else
cpumask_clear_cpu(iter->cpu_file, tracing_reader_cpumask);
+
+ if (iter->trace->pipe_open)
+ iter->trace->pipe_close(iter);
+
mutex_unlock(&trace_types_lock);
free_cpumask_var(iter->started);
OpenPOWER on IntegriCloud