Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/sparc64 count ECC corrected traps with evcn...



details:   https://anonhg.NetBSD.org/src/rev/3a70711ae661
branches:  trunk
changeset: 778157:3a70711ae661
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat Mar 17 23:47:13 2012 +0000

description:
count ECC corrected traps with evcnt(9).

diffstat:

 sys/arch/sparc64/sparc64/trap.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r 90264e032ec5 -r 3a70711ae661 sys/arch/sparc64/sparc64/trap.c
--- a/sys/arch/sparc64/sparc64/trap.c   Sat Mar 17 23:35:28 2012 +0000
+++ b/sys/arch/sparc64/sparc64/trap.c   Sat Mar 17 23:47:13 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.170 2012/03/17 22:19:53 mrg Exp $ */
+/*     $NetBSD: trap.c,v 1.171 2012/03/17 23:47:13 mrg Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.170 2012/03/17 22:19:53 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.171 2012/03/17 23:47:13 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -159,6 +159,10 @@
 #define Debugger()
 #endif
 
+struct evcnt ecc_corrected =
+        EVCNT_INITIALIZER(EVCNT_TYPE_MISC,0,"ECC","corrected");
+EVCNT_ATTACH_STATIC(ecc_corrected);
+
 /*
  * Initial FPU state is all registers == all 1s, everything else == all 0s.
  * This makes every floating point register a signalling NaN, with sign bit
@@ -1653,7 +1657,7 @@
        stxa(0, ASI_AFSR, ldxa(0, ASI_AFSR));
        membar_Sync();
        intr_restore(s);
-       /* XXX: count the error */
+       ecc_corrected.ev_count++;
        snprintb(buf, sizeof(buf), AFSR_BITS, afsr);
        printf("corrected ECC error: pc %p afsr %"PRIx64" (%s) addr %"PRIx64"\n", (void *)pc, afsr, buf, afar);
 



Home | Main Index | Thread Index | Old Index