From: Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
yrl.pp-manager.tt@hitachi.com
Subject: Re: [RFC][PATCH 2/2] tracing: Do not return EINVAL in snapshot when not allocated
Date: Thu, 07 Mar 2013 15:12:59 +0900 [thread overview]
Message-ID: <51382FEB.2010301@hitachi.com> (raw)
In-Reply-To: <20130306135122.481660396@goodmis.org>
(03/06/2013 10:49 PM), Steven Rostedt wrote:
> From: "Steven Rostedt (Red Hat)"<srostedt@redhat.com>
>
> To use the tracing snapshot feature, writing a '1' into the snapshot
> file causes the snapshot buffer to be allocated if it has not already
> been allocated and dose a 'swap' with the main buffer, so that the
> snapshot now contains what was in the main buffer, and the main buffer
> now writes to what was the snapshot buffer.
>
> To free the snapshot buffer, a '0' is written into the snapshot file.
>
> To clear the snapshot buffer, any number but a '0' or '1' is written
> into the snapshot file. But if the file is not allocated it returns
> -EINVAL error code. This is rather pointless. It is better just to
> do nothing and return success.
>
> Cc: Hiraku Toyooka<hiraku.toyooka.gu@hitachi.com>
> Signed-off-by: Steven Rostedt<rostedt@goodmis.org>
> ---
Acked-by: Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
> kernel/trace/trace.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 9e3120b..1f835a8 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -4167,8 +4167,6 @@ tracing_snapshot_write(struct file *filp, const char __user *ubuf, size_t cnt,
> default:
> if (current_trace->allocated_snapshot)
> tracing_reset_online_cpus(&max_tr);
> - else
> - ret = -EINVAL;
> break;
> }
>
> -- 1.7.10.4 .
>
prev parent reply other threads:[~2013-03-07 6:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 13:49 [RFC][PATCH 0/2] tracing: Better snapshot handling and documentation Steven Rostedt
2013-03-06 13:49 ` [RFC][PATCH 1/2] tracing: Add help of snapshot feature when snapshot is empty Steven Rostedt
2013-03-07 6:12 ` Hiraku Toyooka
2013-03-06 13:49 ` [RFC][PATCH 2/2] tracing: Do not return EINVAL in snapshot when not allocated Steven Rostedt
2013-03-07 6:12 ` Hiraku Toyooka [this message]
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=51382FEB.2010301@hitachi.com \
--to=hiraku.toyooka.gu@hitachi.com \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
--cc=yrl.pp-manager.tt@hitachi.com \
/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