Re: CONFIG_PRINTK_TIME woes

Nick Piggin
2005-08-21T11:25:10Z

Andrew Morton wrote:

>
> yup.
>
>
>>Why not use something like do_gettimeofday? (or I'm sure one
>>of our time keepers can suggest the right thing to use).
>
>
> do_gettimeofday() takes locks, so a) we can't do printk from inside it and

Dang, yeah maybe this is the showstopper.

> b) if you do a printk-from-interupt and the interrupted code was running
> do_gettimeofday(), deadlock.
>

What about just using jiffies, then?

Really, sched_clock() is very broken for this (I know you're
not arguing against that).

It can go backwards when called twice from the same CPU, and the
number returned by one CPU need have no correlation with that
returned by another.

However, I understand you probably just want something quick and
dirty for 2.6.13 and would be happy just if it isn't more broken
than before ;)

--
SUSE Labs, Novell Inc.

Send instant messages to your online friends http://au.messenger.yahoo.com