diff options
-rw-r--r-- | tools/sched_ext/include/scx/compat.bpf.h | 8 | ||||
-rw-r--r-- | tools/sched_ext/scx_qmap.bpf.c | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/tools/sched_ext/include/scx/compat.bpf.h b/tools/sched_ext/include/scx/compat.bpf.h index 266f94fe479b..9252e1a00556 100644 --- a/tools/sched_ext/include/scx/compat.bpf.h +++ b/tools/sched_ext/include/scx/compat.bpf.h @@ -183,7 +183,15 @@ static inline bool __COMPAT_is_enq_cpu_selected(u64 enq_flags) bpf_ktime_get_ns()) /* + * v6.15: Introduce event counters. * + * Preserve the following macro until v6.17. + */ +#define __COMPAT_scx_bpf_events(events, size) \ + (bpf_ksym_exists(scx_bpf_events) ? \ + scx_bpf_events(events, size) : ({})) + +/* * v6.15: Introduce NUMA-aware kfuncs to operate with per-node idle * cpumasks. * diff --git a/tools/sched_ext/scx_qmap.bpf.c b/tools/sched_ext/scx_qmap.bpf.c index a6c6be308315..45fd643d2ca0 100644 --- a/tools/sched_ext/scx_qmap.bpf.c +++ b/tools/sched_ext/scx_qmap.bpf.c @@ -774,7 +774,7 @@ static int monitor_timerfn(void *map, int *key, struct bpf_timer *timer) if (print_shared_dsq) dump_shared_dsq(); - scx_bpf_events(&events, sizeof(events)); + __COMPAT_scx_bpf_events(&events, sizeof(events)); bpf_printk("%35s: %llu", "SCX_EV_SELECT_CPU_FALLBACK", scx_read_event(&events, SCX_EV_SELECT_CPU_FALLBACK)); |