diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2026-01-24 06:22:01 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2026-01-29 18:11:56 +0000 |
| commit | 783b8a0fd880255a8315db7f59d0450bd7276f4d (patch) | |
| tree | f619d6e37ec1cd98b2d9ce6ebd80e9984f89ad9a | |
| parent | 9409e86980302cd495376861de3475b78734bc37 (diff) | |
kern/sched: deduplicate dtrace hook vars
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54831
| -rw-r--r-- | sys/kern/sched_4bsd.c | 6 | ||||
| -rw-r--r-- | sys/kern/sched_shim.c | 6 | ||||
| -rw-r--r-- | sys/kern/sched_ule.c | 6 | ||||
| -rw-r--r-- | sys/sys/sched.h | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 57d6f87a4dce..317b47da2cca 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -66,12 +66,6 @@ #include <dev/hwt/hwt_hook.h> #endif -#ifdef KDTRACE_HOOKS -#include <sys/dtrace_bsd.h> -int __read_mostly dtrace_vtime_active; -dtrace_vtime_switch_func_t dtrace_vtime_switch_func; -#endif - /* * INVERSE_ESTCPU_WEIGHT is only suitable for statclock() frequencies in * the range 100-256 Hz (approximately). diff --git a/sys/kern/sched_shim.c b/sys/kern/sched_shim.c index 4f000d8ace0c..ec5c42c37aab 100644 --- a/sys/kern/sched_shim.c +++ b/sys/kern/sched_shim.c @@ -120,6 +120,12 @@ SDT_PROBE_DEFINE(sched, , , remain__cpu); SDT_PROBE_DEFINE2(sched, , , surrender, "struct thread *", "struct proc *"); +#ifdef KDTRACE_HOOKS +#include <sys/dtrace_bsd.h> +int __read_mostly dtrace_vtime_active; +dtrace_vtime_switch_func_t dtrace_vtime_switch_func; +#endif + static char sched_name[32] = "ULE"; SET_DECLARE(sched_instance_set, struct sched_selection); diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 33a578814e0e..ccad7947c4f5 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -72,12 +72,6 @@ #include <dev/hwt/hwt_hook.h> #endif -#ifdef KDTRACE_HOOKS -#include <sys/dtrace_bsd.h> -int __read_mostly dtrace_vtime_active; -dtrace_vtime_switch_func_t dtrace_vtime_switch_func; -#endif - #include <machine/cpu.h> #include <machine/smp.h> diff --git a/sys/sys/sched.h b/sys/sys/sched.h index e4bd5211c1ae..08d8636aaa68 100644 --- a/sys/sys/sched.h +++ b/sys/sys/sched.h @@ -245,6 +245,12 @@ SDT_PROBE_DECLARE(sched, , , on__cpu); SDT_PROBE_DECLARE(sched, , , remain__cpu); SDT_PROBE_DECLARE(sched, , , surrender); +#ifdef KDTRACE_HOOKS +#include <sys/dtrace_bsd.h> +extern int dtrace_vtime_active; +extern dtrace_vtime_switch_func_t dtrace_vtime_switch_func; +#endif + /* * Fixup scheduler state for proc0 and thread0 */ |
