From 35abe809de4d150d519eb1b2324e391e28cbbb89 Mon Sep 17 00:00:00 2001 From: jhb Date: Tue, 24 Jan 2006 22:23:45 +0000 Subject: [PATCH] - Add a new KTR_SUBSYS in place of KTR_SPARE1 to serve as a subsystem placeholder similar to KTR_DEV. Explain the use of KTR_DEV and KTR_SUBSYS in a comment as well. - Retire KTR_WITNESS and instead have KTR_WITNESS default to off but use KTR_SUBSYS if it is enabled. --- sys/kern/subr_witness.c | 6 ++++++ sys/sys/ktr.h | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 6e6c78a9903..f6eb9214ff9 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -103,6 +103,12 @@ __FBSDID("$FreeBSD$"); #include +#if 0 +#define KTR_WITNESS KTR_SUBSYS +#else +#define KTR_WITNESS 0 +#endif + /* Easier to stay with the old names. */ #define lo_list lo_witness_data.lod_list #define lo_witness lo_witness_data.lod_witness diff --git a/sys/sys/ktr.h b/sys/sys/ktr.h index 4a996fcaa1c..3d6d98d1c2b 100644 --- a/sys/sys/ktr.h +++ b/sys/sys/ktr.h @@ -38,13 +38,18 @@ /* * Trace classes + * + * Two of the trace classes (KTR_DEV and KTR_SUBSYS) are special in that + * they are really placeholders so that indvidual drivers and subsystems + * can map their internal tracing to the general class when they wish to + * have tracing enabled and map it to 0 when they don't. */ #define KTR_GEN 0x00000001 /* General (TR) */ #define KTR_NET 0x00000002 /* Network */ #define KTR_DEV 0x00000004 /* Device driver */ #define KTR_LOCK 0x00000008 /* MP locking */ #define KTR_SMP 0x00000010 /* MP general */ -#define KTR_SPARE1 0x00000020 /* Unused */ +#define KTR_SUBSYS 0x00000020 /* Subsystem. */ #define KTR_PMAP 0x00000040 /* Pmap tracing */ #define KTR_MALLOC 0x00000080 /* Malloc tracing */ #define KTR_TRAP 0x00000100 /* Trap processing */ @@ -60,7 +65,7 @@ #define KTR_VFS 0x00040000 /* VFS events */ #define KTR_VOP 0x00080000 /* Auto-generated vop events */ #define KTR_VM 0x00100000 /* The virtual memory system */ -#define KTR_WITNESS 0x00200000 +#define KTR_SPARE1 0x00200000 /* Unused */ #define KTR_RUNQ 0x00400000 /* Run queue */ #define KTR_CONTENTION 0x00800000 /* Lock contention */ #define KTR_UMA 0x01000000 /* UMA slab allocator */ -- 2.45.0