Skip to contentSkip to conversation

Oopser

parisc-linux Matthew Wilcox 3 participants 5 messages Jan 13, 2001 – Jan 14, 2001

lore
Share & tools
lore
#0 lore raw

I'm interested in having a useful debugging tool written by someone who knows the processor really well. What I basically want to be able to do is call oopser(10 * HZ) and have the machine reliably crash in 10 seconds time (and do a register dump). that would at least tell me where the kernel's got to.

it'd be most useful if it worked with interrupts disabled, but even something which required interrupts to be enabled would be of some use.

Signature · 1 line
Revolutions do not require corporate support.
#1 lore raw
Quoted 6 lines · Matthew Wilcox

I'm interested in having a useful debugging tool written by someone who knows the processor really well. What I basically want to be able to do is call oopser(10 * HZ) and have the machine reliably crash in 10 seconds time (and do a register dump). that would at least tell me where the kernel's got to.

static inline void oopser(unsigned long t)

{
	unsigned long flags;
	unsigned long addr=(unsigned long) -8L;

	mdelay((t * 1000)/HZ);

	/* Oopsy doopsy willy fall down and go boom :^) */
        asm volatile(
		"       rsm     2,%0
			ldwx    0(%2),%1"
		: "=&r" (flags), "=r" (t) : "r" (addr) );
}

mdelay watches CR16 and doesn't need (or even want) interrupts enabled. If you want a register dump to console, call panic or steal^H^H^H^H^Hborrow code from panic.
Otherwise it'll be in the HPMC portion of the PIM dump. If it's truly inlined, GR2 and PC will be preserved.

I'm pretty sure -8L (reset vector?) won't work - but anything in 0xF-space (I/O space) which isn't ever used by platform devices should work. Offhand I can't pick an address for all platforms.

grant

Quoted 10 lines

it'd be most useful if it worked with interrupts disabled, but even something which required interrupts to be enabled would be of some use.

Signature · 5 lines
Revolutions do not require corporate support.

---------------------------------------------------------------------------
To unsubscribe: send e-mail to [email protected] with
`unsubscribe' as the subject.

Grant Grundler
Unix Systems Enablement Lab
+1.408.447.7253

#2 lore raw
Quoted 5 lines · Grant Grundler
Quoted 5 lines

I'm interested in having a useful debugging tool written by someone who knows the processor really well. What I basically want to be able to do is call oopser(10 * HZ) and have the machine reliably crash in 10 seconds time (and do a register dump). that would at least tell me where the kernel's got to.

Sorry, I wasn't precise enough. I want the rest of the kernel to continue until the 10 seconds is up.

Signature · 1 line
Revolutions do not require corporate support.
#3 lore raw
Quoted 2 lines

Sorry, I wasn't precise enough. I want the rest of the kernel to continue until the 10 seconds is up.

The only way I've ever done this is to set a timer for 10 seconds, and have the hander for said timer be panic, or reboot, or whatever you want it to do...

That's going to require that timer interrupts work.

(I think MPE/iX _STILL_ has a routine in the kernel called delayed_reboot...)

lamont

#4 lore raw
Quoted 7 lines · LaMont Jones

The only way I've ever done this is to set a timer for 10 seconds, and have the hander for said timer be panic, or reboot, or whatever you want it to do...

That's going to require that timer interrupts work.

(I think MPE/iX _STILL_ has a routine in the kernel called delayed_reboot...)

jsm pointed out that i can get what i want by toc'ing the machine. which i did know at one point... it was how i debugged the c3k. doh.

Signature · 1 line
Revolutions do not require corporate support.