From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753157AbdBGHly (ORCPT ); Tue, 7 Feb 2017 02:41:54 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33800 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751450AbdBGHlx (ORCPT ); Tue, 7 Feb 2017 02:41:53 -0500 Date: Tue, 7 Feb 2017 08:41:48 +0100 From: Ingo Molnar To: Masami Hiramatsu Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Peter Zijlstra , Ananth N Mavinakayanahalli , Thomas Gleixner , "H . Peter Anvin" , Steven Rostedt , Ravi Bangoria Subject: Re: [PATCH tip/master] tracing/probes: Fix a warning message to show correct maximum length Message-ID: <20170207074148.GA24528@gmail.com> References: <148643715974.9770.191313097974521280.stgit@devbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <148643715974.9770.191313097974521280.stgit@devbox> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Masami Hiramatsu 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 > --- > 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