diff options
| author | Anton Lindqvist <anton@basename.se> | 2020-06-29 20:50:18 +0200 |
|---|---|---|
| committer | Anton Lindqvist <anton@basename.se> | 2020-08-02 08:41:09 +0200 |
| commit | 96dd36234d97bbf6b403f3a7f03cfc0296422879 (patch) | |
| tree | a0a9ae0c3268babc971aae8c64a5a9c3f8e554b5 /executor/executor_bsd.h | |
| parent | d895b3be2cffeab3004bc0087a9f3e2b2b790892 (diff) | |
executor: enable extra coverage on OpenBSD
Recently added[1] to the kcov implementation on OpenBSD.
[1] https://github.com/openbsd/src/commit/8430bc4bce9f93dce843b53971377b7afd96cdb1
Diffstat (limited to 'executor/executor_bsd.h')
| -rw-r--r-- | executor/executor_bsd.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/executor/executor_bsd.h b/executor/executor_bsd.h index d3ef16bce..1ca0e4ea4 100644 --- a/executor/executor_bsd.h +++ b/executor/executor_bsd.h @@ -66,6 +66,13 @@ static void cover_open(cover_t* cov, bool extra) unsigned long cover_size = kCoverSize; if (ioctl(cov->fd, KIOSETBUFSIZE, &cover_size)) fail("ioctl init trace write failed"); + if (extra) { + struct kio_remote_attach args; + args.subsystem = KCOV_REMOTE_COMMON; + args.id = 0; + if (ioctl(cov->fd, KIOREMOTEATTACH, &args)) + fail("ioctl remote attach failed"); + } size_t mmap_alloc_size = kCoverSize * (is_kernel_64_bit ? 8 : 4); #elif GOOS_netbsd uint64_t cover_size; @@ -135,6 +142,8 @@ static void cover_enable(cover_t* cov, bool collect_comps, bool extra) exitf("cover enable write trace failed, mode=%d", kcov_mode); #elif GOOS_openbsd // OpenBSD uses an pointer to an int as the third argument. + // Whether it is a regular coverage or an extra coverage, the enable + // ioctl is the same. if (ioctl(cov->fd, KIOENABLE, &kcov_mode)) exitf("cover enable write trace failed, mode=%d", kcov_mode); #elif GOOS_netbsd |
