mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86_64: print processor number in show_regs
@ 2005-07-15 10:56 Zwane Mwaikambo
  2005-07-15 11:04 ` Zwane Mwaikambo
  0 siblings, 1 reply; 4+ messages in thread
From: Zwane Mwaikambo @ 2005-07-15 10:56 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Andrew Morton, Linux Kernel

Up to date i've been using the GS value to determine the processor number 
in dumps from show_regs, however this can be cumbersome to do if you don't 
have the vmlinux to verify with the address of cpu_pda, how about the 
following? I considered using hard_smp_processor_id for robustness but we 
already dereference current so we're already relying on MSR_GS_BASE being 
sane.

Signed-off-by: Zwane Mwaikambo <zwane@arm.linux.org.uk>

Index: linux-2.6.13-rc2-mm1/arch/x86_64/kernel/process.c
===================================================================
RCS file: /home/cvsroot/linux-2.6.13-rc2-mm1/arch/x86_64/kernel/process.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 process.c
--- linux-2.6.13-rc2-mm1/arch/x86_64/kernel/process.c	10 Jul 2005 04:38:46 -0000	1.1.1.1
+++ linux-2.6.13-rc2-mm1/arch/x86_64/kernel/process.c	15 Jul 2005 10:54:42 -0000
@@ -272,7 +272,7 @@ void __show_regs(struct pt_regs * regs)
 
 	printk("\n");
 	print_modules();
-	printk("Pid: %d, comm: %.20s %s %s\n", 
+	printk("CPU: %d Pid: %d, comm: %.20s %s %s\n", smp_processor_id(),
 	       current->pid, current->comm, print_tainted(), system_utsname.release);
 	printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip);
 	printk_address(regs->rip); 

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

* Re: [PATCH] x86_64: print processor number in show_regs
  2005-07-15 10:56 [PATCH] x86_64: print processor number in show_regs Zwane Mwaikambo
@ 2005-07-15 11:04 ` Zwane Mwaikambo
  2005-07-15 11:49   ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Zwane Mwaikambo @ 2005-07-15 11:04 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Andrew Morton, Linux Kernel

On Fri, 15 Jul 2005, Zwane Mwaikambo wrote:

> Up to date i've been using the GS value to determine the processor number 
> in dumps from show_regs, however this can be cumbersome to do if you don't 
> have the vmlinux to verify with the address of cpu_pda, how about the 
> following? I considered using hard_smp_processor_id for robustness but we 
> already dereference current so we're already relying on MSR_GS_BASE being 
> sane.
> 
> Signed-off-by: Zwane Mwaikambo <zwane@arm.linux.org.uk>

Sorry, i sent off an older patch, here is the correct one;

Index: linux-2.6.13-rc2-mm1/arch/x86_64/kernel/process.c
===================================================================
RCS file: /home/cvsroot/linux-2.6.13-rc2-mm1/arch/x86_64/kernel/process.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 process.c
--- linux-2.6.13-rc2-mm1/arch/x86_64/kernel/process.c	10 Jul 2005 04:38:46 -0000	1.1.1.1
+++ linux-2.6.13-rc2-mm1/arch/x86_64/kernel/process.c	15 Jul 2005 11:00:28 -0000
@@ -311,6 +311,7 @@ void __show_regs(struct pt_regs * regs)
 
 void show_regs(struct pt_regs *regs)
 {
+	printk("CPU %d:", smp_processor_id());
 	__show_regs(regs);
 	show_trace(&regs->rsp);
 }

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

* Re: [PATCH] x86_64: print processor number in show_regs
  2005-07-15 11:04 ` Zwane Mwaikambo
@ 2005-07-15 11:49   ` Andi Kleen
  2005-07-15 11:58     ` Zwane Mwaikambo
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2005-07-15 11:49 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: Andrew Morton, Linux Kernel

On Fri, 15 Jul 2005 05:04:57 -0600 (MDT)
Zwane Mwaikambo <zwane@arm.linux.org.uk> wrote:


>  void show_regs(struct pt_regs *regs)
>  {
> +	printk("CPU %d:", smp_processor_id());

Isn't there a space after the : missing here?

-Andi

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

* Re: [PATCH] x86_64: print processor number in show_regs
  2005-07-15 11:49   ` Andi Kleen
@ 2005-07-15 11:58     ` Zwane Mwaikambo
  0 siblings, 0 replies; 4+ messages in thread
From: Zwane Mwaikambo @ 2005-07-15 11:58 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Andrew Morton, Linux Kernel

On Fri, 15 Jul 2005, Andi Kleen wrote:

> On Fri, 15 Jul 2005 05:04:57 -0600 (MDT)
> Zwane Mwaikambo <zwane@arm.linux.org.uk> wrote:
> 
> 
> >  void show_regs(struct pt_regs *regs)
> >  {
> > +	printk("CPU %d:", smp_processor_id());
> 
> Isn't there a space after the : missing here?

I don't believe so, there is a \n in the first line of 
__show_regs

	Zwane


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

end of thread, other threads:[~2005-07-15 11:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-15 10:56 [PATCH] x86_64: print processor number in show_regs Zwane Mwaikambo
2005-07-15 11:04 ` Zwane Mwaikambo
2005-07-15 11:49   ` Andi Kleen
2005-07-15 11:58     ` Zwane Mwaikambo

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

all inboxes | Powered by JetHome®