public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vincent Whitchurch <vincent.whitchurch@axis.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	"jbaron@akamai.com" <jbaron@akamai.com>,
	"mingo@redhat.com" <mingo@redhat.com>, kernel <kernel@axis.com>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: Re: [PATCH] dynamic debug: allow printing to trace event
Date: Wed, 22 Jul 2020 16:49:52 +0200	[thread overview]
Message-ID: <20200722144952.2mewrgebgkyr2zyf@axis.com> (raw)
In-Reply-To: <87eep3zmg9.fsf@jogness.linutronix.de>

On Wed, Jul 22, 2020 at 03:52:22PM +0200, John Ogness wrote:
> On 2020-07-21, Steven Rostedt <rostedt@goodmis.org> wrote:
> >> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> >> index 321437bbf87d..9f6d8867af7c 100644
> >> --- a/lib/dynamic_debug.c
> >> +++ b/lib/dynamic_debug.c
> [..]
> >> +static void dynamic_printk(unsigned int flags, const char *fmt, ...)
> >> +{
> >> +	if (flags & _DPRINTK_FLAGS_TRACE) {
> >> +		va_list args;
> >> +
> >> +		va_start(args, fmt);
> >> +		/*
> >> +		 * All callers include the KERN_DEBUG prefix to keep the
> >> +		 * vprintk case simple; strip it out for tracing.
> >> +		 */
> >> +		dynamic_trace(fmt + strlen(KERN_DEBUG), args);
> 
> Do we really need a separate tracing event for this? Why not just:
> 
>                 ftrace_vprintk(fmt + strlen(KERN_DEBUG), args);

Thanks, I tried that out now and it seems to work, but it results in the
trace_printk() splat (even if the feature is not used), though:

 **********************************************************
 **   NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE   **
 **                                                      **
 ** trace_printk() being used. Allocating extra memory.  **
 **                                                      **
 ** This means that this is a DEBUG kernel and it is     **
 ** unsafe for production use.                           **
 **                                                      **
 ** If you see this message and you are not debugging    **
 ** the kernel, report this immediately to your vendor!  **
 **                                                      **
 **   NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE   **
 **********************************************************

  reply	other threads:[~2020-07-22 14:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 14:11 [PATCH] dynamic debug: allow printing to trace event Vincent Whitchurch
2020-07-21 21:30 ` Steven Rostedt
2020-07-22 11:37   ` Sergey Senozhatsky
2020-07-22 13:52   ` John Ogness
2020-07-22 14:49     ` Vincent Whitchurch [this message]
2020-07-22 15:28       ` Steven Rostedt
2020-07-23 10:57         ` Vincent Whitchurch
2020-07-23 15:26           ` Steven Rostedt
2020-08-14 13:34             ` Vincent Whitchurch
2020-07-22 15:25     ` Steven Rostedt
2020-07-23 14:02       ` John Ogness
2020-07-23 14:20         ` John Ogness
2020-07-23 15:39         ` 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=20200722144952.2mewrgebgkyr2zyf@axis.com \
    --to=vincent.whitchurch@axis.com \
    --cc=corbet@lwn.net \
    --cc=jbaron@akamai.com \
    --cc=john.ogness@linutronix.de \
    --cc=kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.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