From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com,
rostedt@goodmis.org, srostedt@redhat.com, tglx@linutronix.de
Cc: kosaki.motohiro@jp.fujitsu.com,
linux-tip-commits@vger.kernel.org, hpa@zytor.com,
mingo@redhat.com, rostedt@goodmis.org, srostedt@redhat.com,
tglx@linutronix.de
Subject: Re: [tip:tracing/urgent] tracing: Add pipe_close interface
Date: Wed, 9 Dec 2009 15:35:46 +0900 (JST) [thread overview]
Message-ID: <20091209153204.F4CD.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <tip-c521efd1700a8c0f7ce26f011f5eaecca17fabfa@git.kernel.org>
> Commit-ID: c521efd1700a8c0f7ce26f011f5eaecca17fabfa
> Gitweb: http://git.kernel.org/tip/c521efd1700a8c0f7ce26f011f5eaecca17fabfa
> Author: Steven Rostedt <srostedt@redhat.com>
> AuthorDate: Mon, 7 Dec 2009 09:06:24 -0500
> Committer: Steven Rostedt <rostedt@goodmis.org>
> CommitDate: Mon, 7 Dec 2009 12:01:35 -0500
>
> 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>
> ---
> kernel/trace/trace.c | 4 ++++
> kernel/trace/trace.h | 2 ++
> 2 files changed, 6 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);
> +
What's happen if pipe_close is NULL? Wny following straightforward check
is wrong?
I mean the above description explain pipe_close is only useful if plugin
allocate something at pipe_open. then allowing NULL seems natural.
if (iter->trace->pipe_close)
iter->trace->pipe_close(iter);
just nit.
next parent reply other threads:[~2009-12-09 6:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <tip-c521efd1700a8c0f7ce26f011f5eaecca17fabfa@git.kernel.org>
2009-12-09 6:35 ` KOSAKI Motohiro [this message]
2009-12-09 14:08 ` Steven Rostedt
2009-12-09 14:16 ` Ingo Molnar
2009-12-10 7:48 ` [tip:tracing/core] tracing: Only call pipe_close if pipe_close is defined tip-bot for Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091209153204.F4CD.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=srostedt@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome