From: Tony Breeds <hidden> Date: 2007-07-04 04:04:15
This is set of 3 patches that have been sent through the list as RFCs. I
believe that I've addressed any feedback that was raised. Each of the patches
is independant of the other and order is not important.
More feedback is always welcome.
Yours Tony
linux.conf.au http://linux.conf.au/ || http://lca2008.linux.org.au/
Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!
From: Tony Breeds <hidden> Date: 2007-07-04 04:04:16
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
Effectivly including the uptime in printk()s.
This patch makes tb_to_ns_scale and tb_to_ns_shift static and read_mostly for
good meassure.
Signed-off-by: Tony Breeds <redacted>
---
There looks to be other variables that could be made static, I think
that's a job for another day though.
arch/powerpc/kernel/time.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
Index: working/arch/powerpc/kernel/time.c
===================================================================
@@ -735,7 +736,7 @@ unsigned long long sched_clock(void){if(__USE_RTC())returnget_rtc();-returnmulhdu(get_tb(),tb_to_ns_scale)<<tb_to_ns_shift;+returnmulhdu(get_tb()-boot_tb,tb_to_ns_scale)<<tb_to_ns_shift;}intdo_settimeofday(structtimespec*tv)
@@ -960,6 +961,8 @@ void __init time_init(void)}tb_to_ns_scale=scale;tb_to_ns_shift=shift;+/* Save the current timebase to pretty up CONFIG_PRINTK_TIME */+boot_tb=get_tb();tm=get_boot_time();
@@ -184,6 +184,11 @@ $(obj)/zImage.initrd.%: vmlinux $(wrappe$(obj)/zImage.%:vmlinux$(wrapperbits)$(callif_changed,wrap,$*)+# This cannot be in the root of $(src) as the zImage rule always adds a $(obj)+# prefix+$(obj)/vmlinux.strip:vmlinux+$(STRIP)-s-R.comment$<-o$@+$(obj)/zImage.iseries:vmlinux$(STRIP)-s-R.comment$<-o$@
@@ -215,6 +220,11 @@ $(obj)/treeImage.initrd.%: vmlinux $(dts$(obj)/treeImage.%:vmlinux$(dts)$(wrapperbits)$(callif_changed,wrap,treeboot-$*,$(dts))+# If there isn't a platform selected then just strip the vmlinux.+ifeq (,$(image-y))+image-y:=vmlinux.strip+endif+$(obj)/zImage:$(addprefix$(obj)/, $(image-y))@rm-f$@;ln$<$@$(obj)/zImage.initrd:$(addprefix$(obj)/, $(initrd-y))
From: Tony Breeds <hidden> Date: 2007-07-04 04:04:16
Signed-off-by: Tony Breeds <redacted>
---
This didn't get musch feedback the first time I posted it, so it's either
perfect ;P or it got missed.
arch/powerpc/kernel/vmlinux.lds.S | 6 ++++++
include/asm-powerpc/cache.h | 2 ++
2 files changed, 8 insertions(+)
Index: working/arch/powerpc/kernel/vmlinux.lds.S
===================================================================
From: Michael Ellerman <hidden> Date: 2007-07-04 04:27:48
On Wed, 2007-07-04 at 14:04 +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 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
Effectivly including the uptime in printk()s.
Is this what other archs do?
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
From: Tony Breeds <hidden> Date: 2007-07-04 04:40:54
On Wed, Jul 04, 2007 at 02:27:48PM +1000, Michael Ellerman wrote:
Is this what other archs do?
They either use jiffies, or AFAICT an external counter that is
initialised to 0 at system powerup.
Yours Tony
linux.conf.au http://linux.conf.au/ || http://lca2008.linux.org.au/
Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!