The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] printk: Print cpuid along with the timestamp with CONFIG_PRINTK_TIME
@ 2008-09-18 19:37 Ravikiran G Thirumalai
  2008-09-18 19:51 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Ravikiran G Thirumalai @ 2008-09-18 19:37 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

I found it useful to have the cpuid of the printing cpu along with the
timestamp -- especially while debugging hangs during bootups.

I don't know why this hasn't been implemened in the kernel yet, and
cannot think of a strong reason not to have it.  Yes, the cpuid prefix will
take 5 more characters per line,  but having  the cpuid info is worth it,
I think.

Thanks,
Kiran

---


Add cpuid information to printk if CONFIG_PRINTK_TIME is enabled.
This information is useful to debug hangs and bootup issues.

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>

Index: linux-git/kernel/printk.c
===================================================================
--- linux-git.orig/kernel/printk.c	2008-09-16 15:37:48.000000000 -0700
+++ linux-git/kernel/printk.c	2008-09-18 12:27:10.489662938 -0700
@@ -739,9 +739,10 @@ asmlinkage int vprintk(const char *fmt, 
 
 				t = cpu_clock(printk_cpu);
 				nanosec_rem = do_div(t, 1000000000);
-				tlen = sprintf(tbuf, "[%5lu.%06lu] ",
+				tlen = sprintf(tbuf, "[%5lu.%06lu:%d] ",
 						(unsigned long) t,
-						nanosec_rem / 1000);
+						nanosec_rem / 1000,
+						printk_cpu);
 
 				for (tp = tbuf; tp < tbuf + tlen; tp++)
 					emit_log_char(*tp);

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-09-19 18:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-18 19:37 [PATCH] printk: Print cpuid along with the timestamp with CONFIG_PRINTK_TIME Ravikiran G Thirumalai
2008-09-18 19:51 ` Andrew Morton
2008-09-19  0:35   ` Ravikiran G Thirumalai
2008-09-19 17:15     ` Marcin Slusarz
2008-09-19 18:39       ` Ravikiran G Thirumalai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox