PERFORCE change 101834 for review
John Birrell
jb at FreeBSD.org
Tue Jul 18 05:44:55 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=101834
Change 101834 by jb at jb_freebsd2 on 2006/07/18 05:44:15
Add some instrumentation to start capturing CPU register snapshots
from selected locations.
Affected files ...
.. //depot/projects/dtrace/src/sys/conf/files.sun4v#2 edit
.. //depot/projects/dtrace/src/sys/conf/options.sun4v#2 edit
.. //depot/projects/dtrace/src/sys/sun4v/conf/GENERIC#5 edit
.. //depot/projects/dtrace/src/sys/sun4v/include/cpu_snapshot.h#1 add
.. //depot/projects/dtrace/src/sys/sun4v/sun4v/cpu_snapshot.c#1 add
.. //depot/projects/dtrace/src/sys/sun4v/sun4v/cpu_snapshot_save.S#1 add
.. //depot/projects/dtrace/src/sys/sun4v/sun4v/interrupt.S#2 edit
.. //depot/projects/dtrace/src/sys/sun4v/sun4v/pmap.c#7 edit
Differences ...
==== //depot/projects/dtrace/src/sys/conf/files.sun4v#2 (text+ko) ====
@@ -41,6 +41,8 @@
sun4v/sun4v/bus_machdep.c standard
sun4v/sun4v/clock.c standard
sun4v/sun4v/counter.c standard
+sun4v/sun4v/cpu_snapshot.c optional cpu_snapshot
+sun4v/sun4v/cpu_snapshot_save.S optional cpu_snapshot
sun4v/sun4v/db_disasm.c optional ddb
sun4v/sun4v/db_interface.c optional ddb
sun4v/sun4v/db_trace.c optional ddb
==== //depot/projects/dtrace/src/sys/conf/options.sun4v#2 (text+ko) ====
@@ -15,3 +15,5 @@
SIMULATOR opt_simulator.h
DTRACE opt_global.h
+
+CPU_SNAPSHOT opt_cpu_snapshot.h
==== //depot/projects/dtrace/src/sys/sun4v/conf/GENERIC#5 (text+ko) ====
@@ -66,6 +66,7 @@
options KDB_TRACE
options DDB # Support DDB.
options KDTRACE # Support for DTrace.
+options CPU_SNAPSHOT # CPU register snapshots
#options GDB # Support remote GDB.
#options INVARIANTS # Enable calls of extra sanity checking
#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS
==== //depot/projects/dtrace/src/sys/sun4v/sun4v/interrupt.S#2 (text+ko) ====
@@ -28,6 +28,7 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/interrupt.S,v 1.8 2005/04/16 15:05:56 marius Exp $");
+#include "opt_cpu_snapshot.h"
#include "opt_simulator.h"
#include <machine/hypervisorvar.h>
#include <machine/asi.h>
@@ -35,6 +36,10 @@
#include <machine/ktr.h>
#include <machine/pstate.h>
+#ifdef CPU_SNAPSHOT
+#include <machine/cpu_snapshot.h>
+#endif
+
#include "assym.s"
@@ -54,6 +59,10 @@
2: wrpr %g0, PSTATE_NORMAL, %pstate
+#ifdef CPU_SNAPSHOT
+ call cpu_snapshot_save
+#endif
+
ldx [%l0 + IR_NEXT], %l1
brnz,pt %l1, 3f
stx %l1, [PCPU(IRHEAD)]
@@ -80,6 +89,10 @@
stx %l1, [%l0 + IR_NEXT]
stx %l0, [PCPU(IRFREE)]
+#ifdef CPU_SNAPSHOT
+ call cpu_snapshot_save
+#endif
+
wrpr %g0, PSTATE_KERNEL, %pstate
call %o0
==== //depot/projects/dtrace/src/sys/sun4v/sun4v/pmap.c#7 (text+ko) ====
@@ -25,6 +25,7 @@
*
* $ Exp $
*/
+#include "opt_cpu_snapshot.h"
#include "opt_kstack_pages.h"
#include "opt_msgbuf.h"
#include "opt_pmap.h"
@@ -74,6 +75,10 @@
#include <machine/hypervisor_api.h>
+#ifdef CPU_SNAPSHOT
+#include <machine/cpu_snapshot.h>
+#endif
+
#if 1
#define PMAP_DEBUG
#endif
@@ -1289,7 +1294,11 @@
goto retry;
}
- panic(" ackmask=0x%x active=0x%x\n", ackmask, curactive);
+#ifdef CPU_SNAPSHOT
+ cpu_snapshot_report(-1);
+#endif
+
+ panic(" ackmask=0x%x active=0x%x\n", ackmask, curactive);
}
}
More information about the p4-projects
mailing list