Jonathan Adams wrote: >On Tue, Apr 11, 2006 at 08:22:15AM +0800, Oliver Yang wrote: > > >>Sorry for raising the question again, maybe my question is not very clear... >> >>Actually, I need check the general register's value for a specific CPU >>on MP system. But, it seems like ::regs couldn't meet my requirement. >>Does anybody know the other way? >> >> > >Typically, you want to look at the trap frame on the active thread on the >CPU. I haven't done this on i386 in a while; can someone chime in with the >procedure? > >On sparc, you just take the active thread on the cpu, do a ::findstack on it, >take the ktl0 frame address, and do: > > addr::print struct frame fr_local[7] | ::print struct regs > > Sorry. Thank you for your response, although I'm not familiar with sparc platform.
I ask this question because sometimes ::findstack doesn't work for me on my crashdump file: > ::cpuinfo -v ID ADDR FLG NRUN BSPL PRI RNRN KRNRN SWITCH THREAD PROC 0 fec22eb4 1b 1 6 165 no no t-0 cb956de0 sched | | | RUNNING <--+ | +--> PIL THREAD READY | 6 cb956de0 EXISTS | ENABLE +--> PRI THREAD PROC 0 cca2a600 rsh ID ADDR FLG NRUN BSPL PRI RNRN KRNRN SWITCH THREAD PROC 1 cc1449c0 1f 2 0 -1 no no t-0 cc2e6de0 sched | | RUNNING <--+ +--> PRI THREAD PROC READY 60 cba61de0 sched QUIESCED 60 cbaa7de0 sched EXISTS ENABLE > cb956de0::findstack stack pointer for thread cb956de0: cb956ab8 cb956de0 0xcc9f7130() > cc2e6de0::findstack Possible stack pointers for thread cc2e6de0: cc2e6d00 (2) cc2e6d54 (2) cc2e6db8 (2) > cb956ab8,30/nap If ::findstack doesn't work, we have to check stack by stack pointer register (esp) on x86. But you know, ::regs just can output 1 cpu's register value, in above case, I couldn't get cpu 1 's register value. Someone told me that kmdb have a ::cpuregs dcmd can meet my requirement: ::cpuregs [ -c cpuid ] Display the current general-purpose register set for the current CPU or the specified cpuid. This command is only available when using kmdb. But it couldn't work under mdb, that means I couldn't use it on a kernel crash dump file. I don't know why mdb don't support ::cpuregs dcmd? -- Cheers, ---------------------------------------------------------------------- Oliver Yang | OPG Engineering Operation | Oliver.Yang at Sun.COM | x82229