Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/crash revert kernhist patch accidentally committed



details:   https://anonhg.NetBSD.org/src/rev/51f24dc7249c
branches:  trunk
changeset: 809059:51f24dc7249c
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jun 16 23:48:20 2015 +0000

description:
revert kernhist patch accidentally committed

diffstat:

 usr.sbin/crash/Makefile |   4 +-
 usr.sbin/crash/crash.c  |  51 +-----------------------------------------------
 2 files changed, 4 insertions(+), 51 deletions(-)

diffs (104 lines):

diff -r 40480ae38e0a -r 51f24dc7249c usr.sbin/crash/Makefile
--- a/usr.sbin/crash/Makefile   Tue Jun 16 23:44:44 2015 +0000
+++ b/usr.sbin/crash/Makefile   Tue Jun 16 23:48:20 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.30 2015/06/16 23:04:14 christos Exp $
+#      $NetBSD: Makefile,v 1.31 2015/06/16 23:48:20 christos Exp $
 
 PROG=          crash
 MAN=           crash.8
@@ -34,7 +34,7 @@
 
 CPPFLAGS+=     -I${.CURDIR} -I${.OBJDIR} -I${S} -fno-strict-aliasing
 CPPFLAGS+=     -DDDB_VERBOSE_HELP -DDB_MAX_LINE=10000000 -D_KMEMUSER
-CPPFLAGS+=     -UDB_MACHINE_COMMANDS -DKERNHIST -DDDB
+CPPFLAGS+=     -UDB_MACHINE_COMMANDS
 
 # ddb files from kernel
 .PATH: $S/ddb
diff -r 40480ae38e0a -r 51f24dc7249c usr.sbin/crash/crash.c
--- a/usr.sbin/crash/crash.c    Tue Jun 16 23:44:44 2015 +0000
+++ b/usr.sbin/crash/crash.c    Tue Jun 16 23:48:20 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crash.c,v 1.9 2015/06/16 23:04:14 christos Exp $       */
+/*     $NetBSD: crash.c,v 1.10 2015/06/16 23:48:20 christos Exp $      */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: crash.c,v 1.9 2015/06/16 23:04:14 christos Exp $");
+__RCSID("$NetBSD: crash.c,v 1.10 2015/06/16 23:48:20 christos Exp $");
 #endif /* not lint */
 
 #include <ddb/ddb.h>
@@ -39,7 +39,6 @@
 #include <sys/fcntl.h>
 #include <sys/mman.h>
 #include <sys/ioctl.h>
-#include <sys/kernhist.h>
 
 #include <machine/frame.h>
 
@@ -73,8 +72,6 @@
        { .n_name = "_osrelease" },
 #define        X_PANICSTR      1
        { .n_name = "_panicstr" },
-#define        X_KERN_HISTORIES        2
-       { .n_name = "_kern_histories" },
        { .n_name = NULL },
 };
 
@@ -304,50 +301,6 @@
        putc(c, ofp);
 }
 
-#define FMTLEN 1024
-#define FNLEN 128
-
-void
-kernhist_dump(struct kern_history *l)
-{
-       unsigned int lcv;
-       struct kern_history kh;
-       struct kern_history_ent ke;
-       char fmt[FMTLEN];
-       char fn[FNLEN];
-
-       db_read_bytes((db_addr_t)l, sizeof(kh), (char *)&kh);
-       lcv = kh.f;
-       do {
-               db_read_bytes((db_addr_t)&kh.e[lcv], sizeof(ke), (char *)&ke);
-               if (ke.fmt) {
-                       db_read_bytes((db_addr_t)ke.fmt, sizeof(fmt), fmt);
-                       db_read_bytes((db_addr_t)ke.fn, sizeof(fn), fn);
-                       fmt[sizeof(fmt) - 1] = '\0';
-                       fn[sizeof(fmt) - 1] = '\0';
-                       ke.fmt = fmt;
-                       ke.fn = fn;
-                       kernhist_entry_print(&ke);
-               }
-               lcv = (lcv + 1) % kh.n;
-       } while (lcv != kh.f);
-}
-
-void
-kernhist_print(void (*pr)(const char *, ...))
-{
-       struct kern_history_head khh;
-
-       if (nl[X_KERN_HISTORIES].n_value == 0) {
-               warnx("kernhist is not available");
-               return;
-       }
-
-       db_read_bytes(nl[X_KERN_HISTORIES].n_value, sizeof(khh), (char *)&khh);
-
-       kernhist_dump(LIST_FIRST(&khh));
-}
-
 __dead static void
 usage(void)
 {



Home | Main Index | Thread Index | Old Index