diff options
author | 2020-04-15 14:50:14 +0000 | |
---|---|---|
committer | 2020-04-15 14:50:14 +0000 | |
commit | a96fa468072f94c3ff56d3c1a6eb4927fa76813e (patch) | |
tree | ed6c9ebd1e01c89f85d72a5f4367b2b302564912 | |
parent | When device is (re-)opened, call dev_ctlsync() if there's no control device (diff) | |
download | wireguard-openbsd-a96fa468072f94c3ff56d3c1a6eb4927fa76813e.tar.xz wireguard-openbsd-a96fa468072f94c3ff56d3c1a6eb4927fa76813e.zip |
Stop including <machine/param.h> and <machine/vmparam.h>.
There's no need to redefine the INKERNEL() macro in userland because
stacktrace_save_at() only saves kernel stack traces.
If we decide to use the same interface to unwind & save userland stack
traces we can simply indicate that in the "struct stacktrace".
Discussed with deraadt@ and kettenis@
-rw-r--r-- | usr.sbin/btrace/btrace.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/usr.sbin/btrace/btrace.c b/usr.sbin/btrace/btrace.c index 7a1e0d0de2d..4d9f316850a 100644 --- a/usr.sbin/btrace/btrace.c +++ b/usr.sbin/btrace/btrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: btrace.c,v 1.12 2020/03/27 16:22:26 cheloha Exp $ */ +/* $OpenBSD: btrace.c,v 1.13 2020/04/15 14:50:14 mpi Exp $ */ /* * Copyright (c) 2019 - 2020 Martin Pieuchot <mpi@openbsd.org> @@ -605,10 +605,6 @@ builtin_nsecs(struct dt_evt *dtev) return TIMESPEC_TO_NSEC(&dtev->dtev_tsp); } -#include <machine/vmparam.h> -#include <machine/param.h> -#define INKERNEL(va) ((va) >= VM_MIN_KERNEL_ADDRESS) - const char * builtin_stack(struct dt_evt *dtev, int kernel) { @@ -617,19 +613,12 @@ builtin_stack(struct dt_evt *dtev, int kernel) size_t i; int n = 0; - if (st->st_count == 0) + if (!kernel || st->st_count == 0) return ""; for (i = 0; i < st->st_count; i++) { - if (INKERNEL(st->st_pc[i])) { - if (!kernel) - continue; - n += kelf_snprintsym(buf + n, sizeof(buf) - 1 - n, - st->st_pc[i]); - } else if (!kernel) { - n += snprintf(buf + n, sizeof(buf) - 1 - n, "0x%lx\n", - st->st_pc[1]); - } + n += kelf_snprintsym(buf + n, sizeof(buf) - 1 - n, + st->st_pc[i]); } return buf; |