summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authoranton <anton@cvs.openbsd.org>2018-08-19 11:42:34 +0000
committeranton <anton@cvs.openbsd.org>2018-08-19 11:42:34 +0000
commitccc7f034a58f63768110e9b4b82324eee3597706 (patch)
treec9496c52dfbf2469806099cdfbb26e5d108f4c88 /sys/kern
parent63e6caa26564e0dc0de5c358a1401413ea2b7e8c (diff)
Add kcov(4), a kernel code coverage tracing driver. It's used in conjunction
with the syzkaller kernel fuzzer. So far, 8 distinct panics have been found and fixed. This effort will continue. kcov is limited to architectures using Clang as their default compiler and is not enabled by default. With help from mpi@, thanks! ok kettenis@ mpi@ visa@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_exit.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 4e1f1dee000..4bacf19e3de 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.166 2018/08/13 15:26:17 visa Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.167 2018/08/19 11:42:33 anton Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -56,6 +56,7 @@
#include <sys/filedesc.h>
#include <sys/signalvar.h>
#include <sys/sched.h>
+#include <sys/kcov.h>
#include <sys/ktrace.h>
#include <sys/pool.h>
#include <sys/mutex.h>
@@ -189,6 +190,10 @@ exit1(struct proc *p, int rv, int flags)
acct_process(p);
#endif
+#ifdef KCOV
+ kcov_exit(p);
+#endif
+
#ifdef KTRACE
/* release trace file */
if (pr->ps_tracevp)