[coreboot] printing TSC in printk

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Sun Feb 10 16:41:25 CET 2008


On 10.02.2008 15:03, Peter Stuge wrote:
> On Sat, Feb 09, 2008 at 12:50:28PM -0800, ron minnich wrote:
>   
>> Define an option
>> PRINTK_TSC
>>     
>
> This is good. Linux has the same option.
>   

<AOL>me too</AOL>

>> What it does: each time printk would print a newline, it will
>> instead print this:
>> (16 hex digits of TSC)\n
>>     
>
> Pro: Every line has time
> Con: Time is last on the line
>   

Insertion at start for every printk will work as well unless you use
multiple prinks to fill one line. That would be the Linux concept.

>> Define a new format letter, T, such that %T as a format means
>> "time".
>>     
>
> Pro: Time can be first on line
> Con: We need to add it manually.
>
>
> Doing it like Linux would need a static variable near printk() to
> keep \n state. :\
>   

I have a patch which gives us as many static variable as we want.

>> first option allows comprehensive timing, but it will slow things
>> down a bit.
>>     
>
> This must be optional though.
>   

Indeed.

>> Second option allows us to completely tailor the printing of
>> time, but you have to explicitly add %T when you want time
>> printed.
>>
>> Comments?
>>     
>
> I think it is important that the time always is printed at the same
> position in a line, but manually having to add %T to every printk is
> impossible.
>
> Maybe the answer is a macro wrapper around printk() (why is it called
>   

Please no macros.

> print_k_ by the way, we are not the kernel) which is defined
>   

_k_oreboot? ;-)

> differently depending on the config option.
>
> If the option is set, the macro always prepends "%T " to the format
> string.
>   

Now I see what you're trying to do. Nice idea. The "%T" support patch
(see my other mail in this thread) could be used as a basis for this idea.

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/





More information about the coreboot mailing list