From owner-p4-projects@FreeBSD.ORG Tue Jul 18 05:44:55 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E37AC16A4DF; Tue, 18 Jul 2006 05:44:54 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 917B816A4DD for ; Tue, 18 Jul 2006 05:44:54 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3F41F43D5C for ; Tue, 18 Jul 2006 05:44:47 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6I5illI007957 for ; Tue, 18 Jul 2006 05:44:47 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6I5ilZH007954 for perforce@freebsd.org; Tue, 18 Jul 2006 05:44:47 GMT (envelope-from jb@freebsd.org) Date: Tue, 18 Jul 2006 05:44:47 GMT Message-Id: <200607180544.k6I5ilZH007954@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 101834 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2006 05:44:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=101834 Change 101834 by jb@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 __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 #include @@ -35,6 +36,10 @@ #include #include +#ifdef CPU_SNAPSHOT +#include +#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 +#ifdef CPU_SNAPSHOT +#include +#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); } }