- "monotonic");
-
-SYSCTL_PROC(_kern_monotonic, OID_AUTO, supported,
- CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MASKED | CTLFLAG_LOCKED,
- (void *)MT_SUPPORTED, sizeof(int), mt_sysctl, "I",
- "whether monotonic is supported");
-
-SYSCTL_PROC(_kern_monotonic, OID_AUTO, debug,
- CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MASKED,
- (void *)MT_DEBUG, sizeof(int), mt_sysctl, "I",
- "whether monotonic is printing debug messages");
-
-SYSCTL_PROC(_kern_monotonic, OID_AUTO, pmis,
- CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MASKED | CTLFLAG_LOCKED,
- (void *)MT_PMIS, sizeof(uint64_t), mt_sysctl, "Q",
- "how many PMIs have been seen");
-
-SYSCTL_PROC(_kern_monotonic, OID_AUTO, retrograde_updates,
- CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MASKED | CTLFLAG_LOCKED,
- (void *)MT_RETROGRADE, sizeof(uint64_t), mt_sysctl, "Q",
- "how many times a counter appeared to go backwards");
-
-SYSCTL_PROC(_kern_monotonic, OID_AUTO, task_thread_counting,
- CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MASKED,
- (void *)MT_TASK_THREAD, sizeof(int), mt_sysctl, "I",
- "task and thread counting enabled");
-
-SYSCTL_PROC(_kern_monotonic, OID_AUTO, kdebug_test,
- CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MASKED | CTLFLAG_LOCKED,
- (void *)MT_KDBG_TEST, sizeof(int), mt_sysctl, "O",
- "test that kdebug integration works");
-
-SYSCTL_PROC(_kern_monotonic, OID_AUTO, fixed_cpu_perf,
- CTLFLAG_RW | CTLFLAG_MASKED | CTLFLAG_LOCKED,
- (void *)MT_FIX_CPU_PERF, sizeof(uint64_t) * 2, mt_sysctl, "O",
- "overhead of accessing the current CPU's counters");
-
-SYSCTL_PROC(_kern_monotonic, OID_AUTO, fixed_thread_perf,
- CTLFLAG_RW | CTLFLAG_MASKED | CTLFLAG_LOCKED,
- (void *)MT_FIX_THREAD_PERF, sizeof(uint64_t) * 2, mt_sysctl, "O",
- "overhead of accessing the current thread's counters");
-
-SYSCTL_PROC(_kern_monotonic, OID_AUTO, fixed_task_perf,
- CTLFLAG_RW | CTLFLAG_MASKED | CTLFLAG_LOCKED,
- (void *)MT_FIX_TASK_PERF, sizeof(uint64_t) * 2, mt_sysctl, "O",
- "overhead of accessing the current task's counters");
+ "monotonic");
+
+#define MT_SYSCTL(NAME, ARG, FLAGS, SIZE, SIZESTR, DESC) \
+ SYSCTL_PROC(_kern_monotonic, OID_AUTO, NAME, \
+ CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_LOCKED | (FLAGS), \
+ (void *)(ARG), SIZE, mt_sysctl, SIZESTR, DESC)
+
+MT_SYSCTL(supported, MT_SUPPORTED, 0, sizeof(int), "I",
+ "whether monotonic is supported");
+MT_SYSCTL(debug, MT_DEBUG, CTLFLAG_MASKED, sizeof(int), "I",
+ "whether monotonic is printing debug messages");
+MT_SYSCTL(pmis, MT_PMIS, 0, sizeof(uint64_t), "Q",
+ "number of PMIs seen");
+MT_SYSCTL(retrograde_updates, MT_RETROGRADE, 0, sizeof(uint64_t), "Q",
+ "number of times a counter appeared to go backwards");
+MT_SYSCTL(task_thread_counting, MT_TASK_THREAD, 0, sizeof(int), "I",
+ "whether task and thread counting is enabled");
+MT_SYSCTL(kdebug_test, MT_KDBG_TEST, CTLFLAG_MASKED, sizeof(int), "O",
+ "whether task and thread counting is enabled");
+MT_SYSCTL(fixed_cpu_perf, MT_FIX_CPU_PERF, CTLFLAG_MASKED,
+ sizeof(uint64_t) * 2, "O",
+ "overhead of accessing the current CPU's counters");
+MT_SYSCTL(fixed_thread_perf, MT_FIX_THREAD_PERF, CTLFLAG_MASKED,
+ sizeof(uint64_t) * 2, "O",
+ "overhead of accessing the current thread's counters");
+MT_SYSCTL(fixed_task_perf, MT_FIX_TASK_PERF, CTLFLAG_MASKED,
+ sizeof(uint64_t) * 2, "O",
+ "overhead of accessing the current task's counters");