-# $OpenBSD: GENERIC,v 1.458 2018/08/19 11:42:33 anton Exp $
+# $OpenBSD: GENERIC,v 1.459 2018/08/21 18:06:12 anton Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
# mouse & keyboard multiplexor pseudo-devices
pseudo-device wsmux 2
-# kernel code coverage
-pseudo-device kcov 1
-
# Virtio devices
virtio* at pci? # Virtio PCI device
vioblk* at virtio? # Virtio block device
-# $OpenBSD: Makefile.amd64,v 1.100 2018/08/19 18:09:49 deraadt Exp $
+# $OpenBSD: Makefile.amd64,v 1.101 2018/08/21 18:06:12 anton Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
.else
CMACHFLAGS+= -mretpoline
.endif
-.if ${IDENT:M-DKCOV} && ${COMPILER_VERSION:Mclang}
-CMACHFLAGS+= -fno-ret-protector
-PROF= -fsanitize-coverage=trace-pc
-.endif
.if ${COMPILER_VERSION:Mclang}
NO_INTEGR_AS= -no-integrated-as
.endif
LINKFLAGS+= -S
.endif
+.if ${SYSTEM_OBJ:Mkcov.o} && ${COMPILER_VERSION:Mclang}
+CMACHFLAGS+= -fno-ret-protector
+PROF= -fsanitize-coverage=trace-pc
+.endif
+
%LOAD
# cc's -MD puts the source and output paths in the dependency file;
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-.if ${IDENT:M-DKCOV} && ${COMPILER_VERSION:Mclang}
+.if ${SYSTEM_OBJ:Mkcov.o} && ${COMPILER_VERSION:Mclang}
kcov.o: $S/dev/kcov.c
${NORMAL_C} -fno-sanitize-coverage=trace-pc
.endif
-# $OpenBSD: files.amd64,v 1.99 2018/08/19 18:01:05 deraadt Exp $
+# $OpenBSD: files.amd64,v 1.100 2018/08/21 18:06:12 anton Exp $
maxpartitions 16
maxusers 2 16 128
file arch/amd64/amd64/vmm.c vmm needs-flag
file arch/amd64/amd64/vmm_support.S vmm
-#
-# KCOV
-#
-pseudo-device kcov
-file dev/kcov.c kcov needs-flag
-
#
# Machine-independent SD/MMC drivers
#
-# $OpenBSD: GENERIC,v 1.834 2018/08/19 11:42:33 anton Exp $
+# $OpenBSD: GENERIC,v 1.835 2018/08/21 18:06:12 anton Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
# mouse & keyboard multiplexor pseudo-devices
pseudo-device wsmux 2
-# kernel code coverage
-pseudo-device kcov 1
-
# Virtio devices
virtio* at pci? # Virtio PCI device
vioblk* at virtio? # Virtio block device
-# $OpenBSD: Makefile.i386,v 1.125 2018/08/19 11:42:33 anton Exp $
+# $OpenBSD: Makefile.i386,v 1.126 2018/08/21 18:06:12 anton Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
.else
CMACHFLAGS+= -mretpoline
.endif
-.if ${IDENT:M-DKCOV} && ${COMPILER_VERSION:Mclang}
-PROF= -fsanitize-coverage=trace-pc
-.endif
.if ${COMPILER_VERSION:Mclang}
NO_INTEGR_AS= -no-integrated-as
.endif
LINKFLAGS+= -S
.endif
+.if ${SYSTEM_OBJ:Mkcov.o} && ${COMPILER_VERSION:Mclang}
+PROF= -fsanitize-coverage=trace-pc
+.endif
+
%LOAD
# cc's -MD puts the source and output paths in the dependency file;
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-.if ${IDENT:M-DKCOV} && ${COMPILER_VERSION:Mclang}
+.if ${SYSTEM_OBJ:Mkcov.o} && ${COMPILER_VERSION:Mclang}
kcov.o: $S/dev/kcov.c
${NORMAL_C} -fno-sanitize-coverage=trace-pc
.endif
-# $OpenBSD: files.i386,v 1.241 2018/08/19 18:01:05 deraadt Exp $
+# $OpenBSD: files.i386,v 1.242 2018/08/21 18:06:12 anton Exp $
#
# new style config file for i386 architecture
#
file arch/i386/i386/vmm.c vmm needs-flag
file arch/i386/i386/vmm_support.S vmm
-#
-# KCOV
-#
-pseudo-device kcov
-file dev/kcov.c kcov needs-flag
-
#
# IPMI
#
-# $OpenBSD: files,v 1.664 2018/07/13 09:25:22 beck Exp $
+# $OpenBSD: files,v 1.665 2018/08/21 18:06:12 anton Exp $
# $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
pseudo-device pppoe: ifnet, ether, sppp
file net/if_pppoe.c pppoe needs-flag
+pseudo-device kcov
+file dev/kcov.c kcov needs-flag
+
# XXX machine-independent SCSI files should live somewhere here, maybe
# kernel sources
-/* $OpenBSD: kcov.c,v 1.1 2018/08/19 11:42:33 anton Exp $ */
+/* $OpenBSD: kcov.c,v 1.2 2018/08/21 18:06:12 anton Exp $ */
/*
* Copyright (c) 2018 Anton Lindqvist <anton@openbsd.org>
int
kcovopen(dev_t dev, int flag, int mode, struct proc *p)
{
-#ifdef KCOV
struct kd *kd;
if (kd_lookup(minor(dev)) != NULL)
kd->kd_unit = minor(dev);
TAILQ_INSERT_TAIL(&kd_list, kd, kd_entry);
return (0);
-#else
- return (ENXIO);
-#endif
}
int
-/* $OpenBSD: kern_exit.c,v 1.167 2018/08/19 11:42:33 anton Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.168 2018/08/21 18:06:12 anton Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
#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>
#include <uvm/uvm_extern.h>
+#include "kcov.h"
+#if NKCOV > 0
+#include <sys/kcov.h>
+#endif
+
void proc_finish_wait(struct proc *, struct proc *);
void process_zap(struct process *);
void proc_free(struct proc *);
acct_process(p);
#endif
-#ifdef KCOV
+#if NKCOV > 0
kcov_exit(p);
#endif