On 05/16/2012 08:08 AM, Wolfgang Denk wrote:
> Dear Tim,
> 
> In message <4fb2c002.5030...@am.sony.com> you wrote:
>> Support same log buffer or tracing buffer in both bootloader and kernel
>>
>> ; Summary: Support same log buffer or tracing buffer in both bootloader and 
>> kernel
>> ; Proposer: Tim Bird - Sony Network Entertainment
>>
>> == Description ==
>> It would be nice to share log buffer or trace buffers between the bootloader 
>> and the kernel,
>> so that either log messages or trace events (respectively) could be 
>> coalesced from both sources in a
>> unified view.
> 
> This has been a standard feature in U-Boot for many years.  
> 
> The corresponding Linux code is also available; see for example
> https://lkml.org/lkml/2009/1/21/250
> and commit 212f61c in git://git.denx.de/linux-denx.git
> 
> The code has recently been resubmitted by Heiko Schocher, and as far
> as I can tell it is supposed to hit mainline any time soon.
> 
>> It appears that U-boot uses a log-buffer format similar to the Linux kernel.
> 
> Not only similar, but identical (which is intentional).
> 
>> Note that this is useful for on-box analysis (using 'dmesg' locally, and 
>> getting both
>> bootloader and kernel messages).  It  is obvious that someone with a serial 
>> console
> 
> It actually works round-trip: i. e. you can see in U-Boot the last
> log messages of the previously running kernel, which may be helpful if
> messages were written to the log buffer, but the kernel crashed before
> these could be processed otherwise.  And as long as you don't clear
> the log buffer, you can still read these messages in Linux after
> rebooting (assuming sane hardware which does not lose memory content
> during a warmboot - U-Boot takes care to preserve this information
> during a reboot).
> 
>> Handling trace events in a coalesced fashion is a whole other issue.
> ...
>> * Does u-boot support any tracing code similar to ftrace?
> 
> No, U-Boot does not support any such feature (yet).
> 
>> == Scope ==
>> Unknown
> 
> Scope should be small.  As mentioned, the patches are queued.
> 
>> == Contractor Candidates ==
>> No one so far.
> 
> I would recommend Heiko Schocher here, who has been working on this in
> several iterations before, and who submitted the most recent set of
> patches.

Thanks.  This is very helpful.

Are you aware of the churn going on right now with regards to the
kernel printk code?  Kay Sievers has proposed a structured logging
system, which will alter the format of the messages as they are
stored in the log buffer.  I don't know if it will be backwards
compatible with the stuff you have in U-boot or not.  This has not
been mainlined yet, but it's probably worth following what is going
on there.

See http://thread.gmane.org/gmane.linux.kernel/1277619

=============================
Tim Bird
Architecture Group Chair, CE Workgroup of the Linux Foundation
Senior Staff Engineer, Sony Network Entertainment
=============================

_______________________________________________
Celinux-dev mailing list
Celinux-dev@lists.celinuxforum.org
https://lists.celinuxforum.org/mailman/listinfo/celinux-dev

Reply via email to