Deleted Added
full compact
kern_shutdown.c (243980) kern_shutdown.c (244099)
1/*-
2 * Copyright (c) 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 21 unchanged lines hidden (view full) ---

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
35 */
36
37#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 21 unchanged lines hidden (view full) ---

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/kern/kern_shutdown.c 243980 2012-12-07 08:25:08Z alfred $");
38__FBSDID("$FreeBSD: head/sys/kern/kern_shutdown.c 244099 2012-12-10 23:11:26Z alfred $");
39
40#include "opt_ddb.h"
41#include "opt_kdb.h"
42#include "opt_panic.h"
43#include "opt_sched.h"
44#include "opt_watchdog.h"
45
46#include <sys/param.h>

--- 490 unchanged lines hidden (view full) ---

537
538 /* cpu_boot(howto); */ /* doesn't do anything at the moment */
539 cpu_reset();
540 /* NOTREACHED */ /* assuming reset worked */
541}
542
543#ifdef INVARIANTS
544static int kassert_warn_only = 0;
39
40#include "opt_ddb.h"
41#include "opt_kdb.h"
42#include "opt_panic.h"
43#include "opt_sched.h"
44#include "opt_watchdog.h"
45
46#include <sys/param.h>

--- 490 unchanged lines hidden (view full) ---

537
538 /* cpu_boot(howto); */ /* doesn't do anything at the moment */
539 cpu_reset();
540 /* NOTREACHED */ /* assuming reset worked */
541}
542
543#ifdef INVARIANTS
544static int kassert_warn_only = 0;
545#ifdef KDB
546static int kassert_do_kdb = 0;
547#endif
545#ifdef KTR
546static int kassert_do_ktr = 0;
547#endif
548static int kassert_do_log = 1;
549static int kassert_log_pps_limit = 4;
550static int kassert_log_mute_at = 0;
551static int kassert_log_panic_at = 0;
552static int kassert_warnings = 0;
553
554SYSCTL_NODE(_debug, OID_AUTO, kassert, CTLFLAG_RW, NULL, "kassert options");
555
556SYSCTL_INT(_debug_kassert, OID_AUTO, warn_only, CTLFLAG_RW | CTLFLAG_TUN,
557 &kassert_warn_only, 0,
558 "KASSERT triggers a panic (1) or just a warning (0)");
559TUNABLE_INT("debug.kassert.warn_only", &kassert_warn_only);
560
548#ifdef KTR
549static int kassert_do_ktr = 0;
550#endif
551static int kassert_do_log = 1;
552static int kassert_log_pps_limit = 4;
553static int kassert_log_mute_at = 0;
554static int kassert_log_panic_at = 0;
555static int kassert_warnings = 0;
556
557SYSCTL_NODE(_debug, OID_AUTO, kassert, CTLFLAG_RW, NULL, "kassert options");
558
559SYSCTL_INT(_debug_kassert, OID_AUTO, warn_only, CTLFLAG_RW | CTLFLAG_TUN,
560 &kassert_warn_only, 0,
561 "KASSERT triggers a panic (1) or just a warning (0)");
562TUNABLE_INT("debug.kassert.warn_only", &kassert_warn_only);
563
564#ifdef KDB
565SYSCTL_INT(_debug_kassert, OID_AUTO, do_kdb, CTLFLAG_RW | CTLFLAG_TUN,
566 &kassert_do_kdb, 0, "KASSERT will enter the debugger");
567TUNABLE_INT("debug.kassert.do_kdb", &kassert_do_kdb);
568#endif
569
561#ifdef KTR
562SYSCTL_UINT(_debug_kassert, OID_AUTO, do_ktr, CTLFLAG_RW | CTLFLAG_TUN,
563 &kassert_do_ktr, 0,
564 "KASSERT does a KTR, set this to the KTRMASK you want");
565TUNABLE_INT("debug.kassert.do_ktr", &kassert_do_ktr);
566#endif
567
568SYSCTL_INT(_debug_kassert, OID_AUTO, do_log, CTLFLAG_RW | CTLFLAG_TUN,

--- 76 unchanged lines hidden (view full) ---

645 static struct timeval lasterr;
646 static int curerr;
647
648 if (ppsratecheck(&lasterr, &curerr, kassert_log_pps_limit)) {
649 printf("KASSERT failed: %s\n", buf);
650 kdb_backtrace();
651 }
652 }
570#ifdef KTR
571SYSCTL_UINT(_debug_kassert, OID_AUTO, do_ktr, CTLFLAG_RW | CTLFLAG_TUN,
572 &kassert_do_ktr, 0,
573 "KASSERT does a KTR, set this to the KTRMASK you want");
574TUNABLE_INT("debug.kassert.do_ktr", &kassert_do_ktr);
575#endif
576
577SYSCTL_INT(_debug_kassert, OID_AUTO, do_log, CTLFLAG_RW | CTLFLAG_TUN,

--- 76 unchanged lines hidden (view full) ---

654 static struct timeval lasterr;
655 static int curerr;
656
657 if (ppsratecheck(&lasterr, &curerr, kassert_log_pps_limit)) {
658 printf("KASSERT failed: %s\n", buf);
659 kdb_backtrace();
660 }
661 }
662#ifdef KDB
663 if (kassert_do_kdb) {
664 kdb_enter(KDB_WHY_KASSERT, buf);
665 }
666#endif
653 atomic_add_int(&kassert_warnings, 1);
654}
655#endif
656
657/*
658 * Panic is called on unresolvable fatal errors. It prints "panic: mesg",
659 * and then reboots. If we are called twice, then we avoid trying to sync
660 * the disks as this often leads to recursive panics.

--- 218 unchanged lines hidden ---
667 atomic_add_int(&kassert_warnings, 1);
668}
669#endif
670
671/*
672 * Panic is called on unresolvable fatal errors. It prints "panic: mesg",
673 * and then reboots. If we are called twice, then we avoid trying to sync
674 * the disks as this often leads to recursive panics.

--- 218 unchanged lines hidden ---