aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/ktr.h
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2005-12-06 16:37:01 +0000
committerMarius Strobl <marius@FreeBSD.org>2005-12-06 16:37:01 +0000
commit3e4e0e14f6d6a2d0e3c75c8925c5eb4ed7e11e13 (patch)
treeb27b0c8209986e2392fa77c9cef09b3fd632cf74 /sys/sys/ktr.h
parent81ee23464263186a33be4f14fdaa0808c5fa9378 (diff)
downloadsrc-3e4e0e14f6d6a2d0e3c75c8925c5eb4ed7e11e13.tar.gz
src-3e4e0e14f6d6a2d0e3c75c8925c5eb4ed7e11e13.zip
Extend the scope of #ifndef LOCORE to also cover the prototype of
ktr_tracepoint() and the macros using it. This allows this header to be included in .S files for obtaining the KTR_* class macros directly and providing a default value for KTR_COMPILE in case it's not specified in the kernel config file including defining it to 0 when not using 'options KTR' at all. Requested by: ru Reviewed by: ru
Notes
Notes: svn path=/head/; revision=153174
Diffstat (limited to 'sys/sys/ktr.h')
-rw-r--r--sys/sys/ktr.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/sys/ktr.h b/sys/sys/ktr.h
index 6e074c418657..9d6546015856 100644
--- a/sys/sys/ktr.h
+++ b/sys/sys/ktr.h
@@ -86,9 +86,14 @@
#define KTR_CT8 0x80000000
/* Trace classes to compile in */
+#ifdef KTR
#ifndef KTR_COMPILE
#define KTR_COMPILE (KTR_ALL)
#endif
+#else /* !KTR */
+#undef KTR_COMPILE
+#define KTR_COMPILE 0
+#endif /* KTR */
/* Trace classes that can not be used with KTR_ALQ */
#define KTR_ALQ_MASK (KTR_WITNESS)
@@ -121,7 +126,6 @@ extern int ktr_verbose;
extern volatile int ktr_idx;
extern struct ktr_entry ktr_buf[];
-#endif /* !LOCORE */
#ifdef KTR
void ktr_tracepoint(u_int mask, const char *file, int line,
@@ -141,8 +145,6 @@ void ktr_tracepoint(u_int mask, const char *file, int line,
#define CTR4(m, format, p1, p2, p3, p4) CTR6(m, format, p1, p2, p3, p4, 0, 0)
#define CTR5(m, format, p1, p2, p3, p4, p5) CTR6(m, format, p1, p2, p3, p4, p5, 0)
#else /* KTR */
-#undef KTR_COMPILE
-#define KTR_COMPILE 0
#define CTR0(m, d)
#define CTR1(m, d, p1)
#define CTR2(m, d, p1, p2)
@@ -184,4 +186,6 @@ void ktr_tracepoint(u_int mask, const char *file, int line,
#define ITR6(d, p1, p2, p3, p4, p5, p6)
#endif
+#endif /* !LOCORE */
+
#endif /* !_SYS_KTR_H_ */