public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H . Peter Anvin" <hpa@zytor.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Subject: Re: [PATCH tip/master] tracing/probes: Fix a warning message to show correct maximum length
Date: Tue, 7 Feb 2017 08:41:48 +0100	[thread overview]
Message-ID: <20170207074148.GA24528@gmail.com> (raw)
In-Reply-To: <148643715974.9770.191313097974521280.stgit@devbox>


* Masami Hiramatsu <mhiramat@kernel.org> wrote:

> Since tracing/*probe_events will accept a probe definition
> up to 4096 - 2 ('\n' and '\0') bytes, it must show 4094 instead
> of 4096 in warning message.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
>  kernel/trace/trace_probe.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
> index 8c0553d..7138fea 100644
> --- a/kernel/trace/trace_probe.c
> +++ b/kernel/trace/trace_probe.c
> @@ -673,8 +673,9 @@ ssize_t traceprobe_probes_write(struct file *file, const char __user *buffer,
>  			*tmp = '\0';
>  			size = tmp - kbuf + 1;
>  		} else if (done + size < count) {
> +			/* This can accept WRITE_BUFSIZE - 2 ('\n' + '\0') */
>  			pr_warn("Line length is too long: Should be less than %d\n",
> -				WRITE_BUFSIZE);
> +				WRITE_BUFSIZE - 2);

The message should also indicate which kernel subsystem generated it - which is 
useful if the message is not immediately noticed in the kernel log.

You can do this by having something like this at the top of the trace_probe file:

  #define pr_fmt(fmt) "trace_probe: " fmt

Thanks,

	Ingo

  reply	other threads:[~2017-02-07  7:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07  3:12 [PATCH tip/master] tracing/probes: Fix a warning message to show correct maximum length Masami Hiramatsu
2017-02-07  7:41 ` Ingo Molnar [this message]
2017-02-07 11:02   ` Masami Hiramatsu
2017-02-07 11:21   ` [PATCH tip/master] tracing/probe: Show subsystem name in messages Masami Hiramatsu
2017-02-14 20:07     ` 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=20170207074148.GA24528@gmail.com \
    --to=mingo@kernel.org \
    --cc=ananth@linux.vnet.ibm.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --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