From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756821AbYHARyj (ORCPT ); Fri, 1 Aug 2008 13:54:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751964AbYHARyb (ORCPT ); Fri, 1 Aug 2008 13:54:31 -0400 Received: from rgminet01.oracle.com ([148.87.113.118]:64987 "EHLO rgminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751909AbYHARyb (ORCPT ); Fri, 1 Aug 2008 13:54:31 -0400 Date: Fri, 1 Aug 2008 10:52:55 -0700 From: Randy Dunlap To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Andrew Morton , Steven Rostedt Subject: Re: [PATCH v2 2/2] ftrace: printk formatting infrastructure Message-Id: <20080801105255.82a6520f.randy.dunlap@oracle.com> In-Reply-To: References: <20080801162639.175407419@goodmis.org> <20080801163737.420519487@goodmis.org> <20080801094331.626195c8.randy.dunlap@oracle.com> Organization: Oracle Linux Eng. X-Mailer: Sylpheed 2.5.0 (GTK+ 2.12.0; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: > > > > > + * > > > + * 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/