KTRPOINT(), with its references to struct proc and struct process members, 
is only useful inside the kernel, so let's move it to the #ifdef _KERNEL 
part.

ok?

Index: sys/ktrace.h
===================================================================
RCS file: /data/src/openbsd/src/sys/sys/ktrace.h,v
retrieving revision 1.30
diff -u -p -r1.30 ktrace.h
--- sys/ktrace.h        7 Jun 2016 06:12:37 -0000       1.30
+++ sys/ktrace.h        18 Jun 2016 04:27:44 -0000
@@ -59,12 +59,6 @@ struct ktr_header {
 };
 
 /*
- * Test for kernel trace point
- */
-#define KTRPOINT(p, type)      \
-       ((p)->p_p->ps_traceflag & (1<<(type)) && ((p)->p_flag & P_INKTR) == 0)
-
-/*
  * ktrace record types
  */
 
@@ -200,6 +194,12 @@ int        utrace(const char *, const void *, s
 __END_DECLS
 
 #else
+
+/*
+ * Test for kernel trace point
+ */
+#define KTRPOINT(p, type)      \
+       ((p)->p_p->ps_traceflag & (1<<(type)) && ((p)->p_flag & P_INKTR) == 0)
 
 void ktrgenio(struct proc *, int, enum uio_rw, struct iovec *, ssize_t);
 void ktrnamei(struct proc *, char *);

Reply via email to