Source-Changes-HG archive

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

[src/trunk]: src/share/man/man9 document crashme(9) functionality.



details:   https://anonhg.NetBSD.org/src/rev/998253594a60
branches:  trunk
changeset: 447380:998253594a60
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Jan 09 04:02:26 2019 +0000

description:
document crashme(9) functionality.

XXX: install me

diffstat:

 share/man/man9/crashme.9 |  104 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 104 insertions(+), 0 deletions(-)

diffs (108 lines):

diff -r b40a1258808f -r 998253594a60 share/man/man9/crashme.9
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man9/crashme.9  Wed Jan 09 04:02:26 2019 +0000
@@ -0,0 +1,104 @@
+.\" $NetBSD: crashme.9,v 1.1 2019/01/09 04:02:26 mrg Exp $
+.\"
+.\" Copyright (c) 2019 Matthew R. Green
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. The name of the author may not be used to endorse or promote products
+.\"    derived from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd January 7, 2019
+.Dt CRASHME 9
+.Os
+.Sh NAME
+.Nm crashme ,
+.Nm crashme_add ,
+.Nm crashme_remove
+.Nd in-kernel testing of crash handling
+.Sh SYNOPSIS
+.In sys/crashme.h
+.Ft int
+.Fn crashme_add "crashme_node *cn"
+.Ft int
+.Fn crashme_remove "crashme_node *cn"
+.Sh DESCRIPTION
+The
+.Nm
+functions provide access to dynamically add and remove crashme nodes.
+These nodes are simply named callbacks that are expected to cause the
+system to crash.
+.Pp
+The crashme functionality is only available in kernels with the
+.Xr options 4
+.Dv DEBUG
+option set.
+.Pp
+Each crashme node is maintained in a crashme_node structure which
+has the following public members:
+.Bd -literal
+typedef int (*crashme_fn)(int);
+
+typedef struct crashme_node {
+       const char      *cn_name;
+       const char      *cn_longname;
+       crashme_fn       cn_fn;
+} crashme_node;
+.Ed
+.Pp
+The
+caller must fill in the
+.Fa cn_name ,
+.Fa cn_longname ,
+and
+.Fa cn_fn
+members.
+.Pp
+The
+.Ar flags
+parameter is passed from sysctl.
+The return value is 0 upon success or non zero for failure.
+.Sh SYSCTL SUPPORT
+The following
+.Xr sysctl 8
+variables are provided by the
+.Nm
+subsystem:
+.Bl -tag -width "123456" -offset indent
+.It Ic debug.crashme_enable
+Must be set to 1 for any
+.Nm
+node to be executed.
+.It Ic debug.crashme.panic
+Basic panic node.
+.It Ic debug.crashme.null_deref
+Derefence NULL node.
+.Sh SEE ALSO
+.Xr options 4 ,
+.Xr panic 9
+.Sh HISTORY
+The
+.Nm
+driver
+appeared in
+.Nx 9.0 .
+.Sh AUTHORS
+.An Matthew R. Green .



Home | Main Index | Thread Index | Old Index