From: Namhyung Kim <namhyung.kim@lge.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Namhyung Kim <namhyung@kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] tracing: Check cpu file on tracing_release()
Date: Wed, 10 Apr 2013 09:36:00 +0900 [thread overview]
Message-ID: <5164B3F0.2030506@lge.com> (raw)
In-Reply-To: <1365553863.25498.84.camel@gandalf.local.home>
Hi Steve,
2013-04-10 오전 9:31, Steven Rostedt 쓴 글:
> On Wed, 2013-04-10 at 09:18 +0900, Namhyung Kim wrote:
>> From: Namhyung Kim <namhyung.kim@lge.com>
>>
>> It looks like tracing_release() lacks checking iter->cpu_file so that
>> closing a per_cpu trace file would attempt to close all cpu buffers.
>>
>> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
>> ---
>> kernel/trace/trace.c | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
>> index 7270460cfe3c..0beddcb80509 100644
>> --- a/kernel/trace/trace.c
>> +++ b/kernel/trace/trace.c
>> @@ -2883,7 +2883,13 @@ static int tracing_release(struct inode *inode, struct file *file)
>> WARN_ON(!tr->ref);
>> tr->ref--;
>>
>> - for_each_tracing_cpu(cpu) {
>> + if (iter->cpu_file == RING_BUFFER_ALL_CPUS) {
>> + for_each_tracing_cpu(cpu) {
>> + if (iter->buffer_iter[cpu])
>
> Only the cpu that is assigned gets buffer_iter[cpu] set. The other
> buffer_iter[cpus] will simply be ignored.
You meant iter->cpu_file != RING_BUFFER_ALL_CPUS case, right?
So why bother trying to check other cpus then?
Thanks,
Namhyung
next prev parent reply other threads:[~2013-04-10 0:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-10 0:18 [PATCH 1/3] tracing: Get rid of unneeded key calculation in ftrace_hash_move() Namhyung Kim
2013-04-10 0:18 ` [PATCH 2/3] tracing: Check return value of tracing_init_dentry() Namhyung Kim
2013-04-10 0:18 ` [PATCH 3/3] tracing: Check cpu file on tracing_release() Namhyung Kim
2013-04-10 0:31 ` Steven Rostedt
2013-04-10 0:36 ` Namhyung Kim [this message]
2013-04-10 0:46 ` Steven Rostedt
2013-04-10 1:30 ` Namhyung Kim
2013-04-10 1:47 ` Steven Rostedt
2013-04-10 1:55 ` [PATCH] tracing: Check result of ring_buffer_read_prepare() Namhyung Kim
2013-04-13 3:00 ` 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=5164B3F0.2030506@lge.com \
--to=namhyung.kim@lge.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@kernel.org \
--cc=rostedt@goodmis.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.