Re: [PATCH 2/2] tracing/function-graph-tracer: improve duration output

From: Frédéric Weisbecker
Date: Wed Dec 03 2008 - 10:45:08 EST

2008/12/3 Steven Rostedt <rostedt@xxxxxxxxxxx>:
> On Wed, 3 Dec 2008, Fr?d?ric Weisbecker wrote:
>> I proposed a solution for ftrace_printk (which I planned to implement
>> this evening).
>> Since we are in a C-style output, that would be good to put the ftrace_printk
>> as /* C comments */ inside just below the function that called it.
>> Like this:
>> func_that_called_ftrace_printk {
>> /* Message from ftrace_printk */
>> }
>> This way we keep the idea of comment which comes along the role of
>> ftrace_printk and we know
>> which function called it, at which depth.....
>> Do you like it this way?
> Yes definitely. I thought we already decided to do it that way ;-)

A proposition about this. I want to use __ftrace_printk, make it
generic for both function tracers and have a way to store the current
One solution: changing the print_entry to have the ip available for
function-tracer and depth available for return-function_tracer.

struct print_entry {
struct trace_entry ent;
union {
unsigned long ip;
unsigned long depth;
} from;
char buf[];

We could make __ftrace_printk verify which tracer is running.

If normal tracer then
trace_vprintk(__builtin_return_address(0), .....)
else if graph-tracer
trace_vprintk(current->curr_ret_stack, ......)

This way we can even forget the ip argument of __trace_printk.
I prefer to ask before changing an exported symbol API....
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at