Re: [patch 08/17] LTTng instrumentation - kernel

From: Mathieu Desnoyers
Date: Thu Jul 24 2008 - 10:30:28 EST


* Steven Rostedt (rostedt@xxxxxxxxxxx) wrote:
>
>
> On Tue, 15 Jul 2008, Mathieu Desnoyers wrote:
> >
> > /*
> > * Low level drivers may need that to know if they can schedule in
> > @@ -601,6 +603,7 @@ asmlinkage int printk(const char *fmt, .
> > int r;
> >
> > va_start(args, fmt);
> > + trace_kernel_printk(__builtin_return_address(0));
>
> BTW, ftrace.h has macros that let you use CALLER_ADDR0 for
> __builtin_return_address. It also converts it from a pointer to a long,
> but makes the code look prettier.
>

include/linux/kernel.h:#define _RET_IP_ (unsigned long)__builtin_return_address(0)

Hrm, did not see this one. So I guess we can both switch to it ?

Thanks for pointing this out,

Mathieu

>
> > r = vprintk(fmt, args);
> > va_end(args);
> >
> > @@ -677,6 +680,9 @@ asmlinkage int vprintk(const char *fmt,
> > raw_local_irq_save(flags);
> > this_cpu = smp_processor_id();
> >
> > + trace_kernel_vprintk(__builtin_return_address(0),
> > + printk_buf, printed_len);
> > +
> > /*
> > * Ouch, printk recursed into itself!
> > */
>
> -- Steve
>

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/