summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authoranton <anton@openbsd.org>2018-08-19 11:42:33 +0000
committeranton <anton@openbsd.org>2018-08-19 11:42:33 +0000
commitaf589a788f87bb883e79b26b36531d73da1037ef (patch)
tree449e32d37728e170a11a01ddbaa9c5b102744aac /sys/kern/kern_exit.c
parentAdd support for multiple PCI segments. Only really implemented for arm64 (diff)
downloadwireguard-openbsd-af589a788f87bb883e79b26b36531d73da1037ef.tar.xz
wireguard-openbsd-af589a788f87bb883e79b26b36531d73da1037ef.zip
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/kern_exit.c')
-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)