mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Steven Rostedt <srostedt@redhat.com>
Subject: Re: [PATCH v2 2/2] ftrace: printk formatting infrastructure
Date: Fri, 1 Aug 2008 10:52:55 -0700	[thread overview]
Message-ID: <20080801105255.82a6520f.randy.dunlap@oracle.com> (raw)
In-Reply-To: <alpine.DEB.1.10.0808011248080.31922@gandalf.stny.rr.com>

On Fri, 1 Aug 2008 12:53:17 -0400 (EDT) Steven Rostedt wrote:

> 
> On Fri, 1 Aug 2008, Randy Dunlap wrote:
> 
> > On Fri, 01 Aug 2008 12:26:41 -0400 Steven Rostedt wrote:
> > 
> > > +/**
> > > + * ftrace_printk - printf formatting in the ftrace buffer
> > > + * @fmt - the printf format for printing.
> > 
> >     * @fmt: the printf format for printing
> >     * @ip: <description>
> > 
> > > + *
> > > + * Note: __ftrace_printk is an internal function for ftrace_printk and
> > > + *       the @ip is passed in via the ftrace_printk macro.
> 
> The above note actually explains this ;-)

I read that.

> Should I move the description to the ftrace_printk macro?

Probably.

> In include/linux/ftrace.h you see:
> 
> #ifdef CONFIG_TRACING
> [...]
> # define ftrace_printk(x...) __ftrace_printk(_THIS_IP_, x)
> extern int
> __ftrace_printk(unsigned long ip, const char *fmt, ...)
>         __attribute__ ((format (printf, 2, 3)));
> #else
> [...]
> static inline int
> ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 
> 0)))
> {
>         return 0;
> }
> #endif
> 
> The true API is ftrace_printk(const char *fmt) and the __ftrace_printk
> version should not be used.
> 
> Do you still think I should document the @ip?

Just move the kernel-doc to the macro then.

> I could also just remove the passing of _THIS_IP_ and use _RET_IP_ 
> inside of ftrace_printk but the _THIS_IP_ seems to be more accurate 
> especially when we have stack unwinding returns.
> 
> -- Steve
> 
> 
> 
> > > + *
> > > + * This function allows a kernel developer to debug fast path sections
> > > + * that printk is not appropriate for. By scattering in various
> > > + * printk like tracing in the code, a developer can quickly see
> > > + * where problems are occurring.
> > > + *
> > > + * This is intended as a debugging tool for the developer only.
> > > + * Please reframe from leaving ftrace_printks scattered around in
> > > + * your code.
> > > + */
> > > +int __ftrace_printk(unsigned long ip, const char *fmt, ...)
> > > +{


---
~Randy
Linux Plumbers Conference, 17-19 September 2008, Portland, Oregon USA
http://linuxplumbersconf.org/

  reply	other threads:[~2008-08-01 17:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-01 16:26 [PATCH v2 0/2] ftrace: printk formatted recording Steven Rostedt
2008-08-01 16:26 ` [PATCH v2 1/2] ftrace: new continue entry - separate out from trace_entry Steven Rostedt
2008-08-01 16:26 ` [PATCH v2 2/2] ftrace: printk formatting infrastructure Steven Rostedt
2008-08-01 16:43   ` Randy Dunlap
2008-08-01 16:53     ` Steven Rostedt
2008-08-01 17:52       ` Randy Dunlap [this message]
2008-08-01 18:17         ` [PATCH v2 3/2] ftrace: ftrace_printk doc moved Steven Rostedt
2008-08-01 20:34           ` Randy Dunlap
2008-08-01 20:42             ` Steven Rostedt
2008-08-01 20:45             ` [PATCH v3 " Steven Rostedt
2008-08-01 20:49               ` Randy Dunlap
2008-08-15 15:00 ` [PATCH v2 0/2] ftrace: printk formatted recording Ingo Molnar
2008-08-15 15:49   ` [PATCH] ftrace: build fix Ingo Molnar

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=20080801105255.82a6520f.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=srostedt@redhat.com \
    --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

Powered by JetHome