Skip to content

Commit

Permalink
ftrace: ftrace_printk doc moved
Browse files Browse the repository at this point in the history
Based on Randy Dunlap's suggestion, the ftrace_printk kernel-doc belongs
with the ftrace_printk macro that should be used. Not with the
__ftrace_printk internal function.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Oct 14, 2008
1 parent dd0e545 commit 2f2c99d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
19 changes: 18 additions & 1 deletion include/linux/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,24 @@ static inline void __ftrace_enabled_restore(int enabled)
#ifdef CONFIG_TRACING
extern void
ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);
# define ftrace_printk(x...) __ftrace_printk(_THIS_IP_, x)

/**
* ftrace_printk - printf formatting in the ftrace buffer
* @fmt: the printf format for printing
*
* Note: __ftrace_printk is an internal function for ftrace_printk and
* the @ip is passed in via the ftrace_printk macro.
*
* 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 refrain from leaving ftrace_printks scattered around in
* your code.
*/
# define ftrace_printk(fmt...) __ftrace_printk(_THIS_IP_, fmt)
extern int
__ftrace_printk(unsigned long ip, const char *fmt, ...)
__attribute__ ((format (printf, 2, 3)));
Expand Down
16 changes: 0 additions & 16 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -3075,22 +3075,6 @@ static __init void tracer_init_debugfs(void)
(sizeof(struct trace_field) - offsetof(struct trace_field, print.buf))
#define TRACE_CONT_BUF_SIZE sizeof(struct trace_field)

/**
* ftrace_printk - printf formatting in the ftrace buffer
* @fmt - the printf format for printing.
*
* Note: __ftrace_printk is an internal function for ftrace_printk and
* the @ip is passed in via the ftrace_printk macro.
*
* 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, ...)
{
struct trace_array *tr = &global_trace;
Expand Down

0 comments on commit 2f2c99d

Please sign in to comment.