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

Geert Uytterhoeven Geert.Uytterhoeven at sonycom.com
Wed Jun 20 17:37:51 EST 2007


On Wed, 20 Jun 2007, Tony Breeds wrote:
> On Tue, Jun 19, 2007 at 09:53:56AM -0500, Olof Johansson wrote:
> > It only seems to be used in this file, so it can be static, right?
> 
> True, I was following suit with tb_to_ns_scale, tb_to_ns_shift which
> could also be static.
> 
> Here's an updated patch that makes them all static and updates the
> commit message as well.
> 
> From: Tony Breeds <tony at bakeyournoodle.com>
> 
> Modify sched_clock() to make CONFIG_PRINTK_TIME more sane.
> 
> 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 cause by the initialisation of tb_to_ns_scale in time_init(), suddenly the
> multiplication in sched_clock() now does something :).  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
> 
> Effectively including the uptime in printk()s.

Just wondering, does the INITIAL_JIFFIES mechanism to catch wrap bugs still
work after this patch?

include/linux/jiffies.h:
| /*
|  * Have the 32 bit jiffies value wrap 5 minutes after boot
|  * so jiffies wrap bugs show up earlier.
|  */
| #define INITIAL_JIFFIES ((unsigned long)(unsigned int) (-300*HZ))

With kind regards,
 
Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
 
Phone:    +32 (0)2 700 8453	
Fax:      +32 (0)2 700 8622	
E-mail:   Geert.Uytterhoeven at sonycom.com	
Internet: http://www.sony-europe.com/
 	
Sony Network and Software Technology Center Europe	
A division of Sony Service Centre (Europe) N.V.	
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium	
VAT BE 0413.825.160 · RPR Brussels	
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619


More information about the Linuxppc-dev mailing list