[PATCH/RFC] Modify sched_clock() to make CONFIG_PRINTK_TIME more sane.

Olof Johansson olof at lixom.net
Wed Jun 20 00:53:56 EST 2007


Hi,

On Tue, Jun 19, 2007 at 04:35:57PM +1000, Tony Breeds wrote:
> When booting a current kernel with CONFIG_PRINTK_TIME enabled you'll
> see messages like:
> 
> [    0.000000] time_init: decrementer frequency = 188.044000 MHz
> [    0.000000] time_init: processor frequency   = 1504.352000 MHz
> [3712914.436297] Console: colour dummy device 80x25
> 
> This patch modifies sched_clock() to report the offset since the machine booted
> so the same printk's now look like:
> 
> [    0.000000] time_init: decrementer frequency = 188.044000 MHz
> [    0.000000] time_init: processor frequency   = 1504.352000 MHz
> [    0.000135] Console: colour dummy device 80x25
> 
> Effectivly including the uptime in printk()s.

Nice!

> Index: working/arch/powerpc/kernel/time.c
> ===================================================================
> --- working.orig/arch/powerpc/kernel/time.c
> +++ working/arch/powerpc/kernel/time.c
> @@ -115,6 +115,7 @@ EXPORT_SYMBOL_GPL(rtc_lock);
>  
>  u64 tb_to_ns_scale;
>  unsigned tb_to_ns_shift;
> +unsigned long boot_tb;

It only seems to be used in this file, so it can be static, right?


-Olof



More information about the Linuxppc-dev mailing list