SCX eBPF macro scx_bpf_dsq_move_to_local
The scx_bpf_dsq_move_to_local
macro handles the renaming of scx_bpf_consume
to scx_bpf_dsq_move_to_local
gracefully.
Definition
#define scx_bpf_dsq_move_to_local(dsq_id) \
(bpf_ksym_exists(scx_bpf_dsq_move_to_local) ? \
scx_bpf_dsq_move_to_local((dsq_id)) : \
scx_bpf_consume___compat((dsq_id)))
Usage
This macro has the same name as the scx_bpf_dsq_move_to_local
kfunc, which will cause the pre-processor to emit this macro instead of just the kfunc. It checks at runtime if the kernel has the scx_bpf_dsq_move_to_local
kfunc, and if it does, it calls it. If it doesn't, it calls the scx_bpf_consume___compat
kfunc instead.
These two kfuncs are functionally equivalent, but a rename happened since the name dispatch
was overloaded and confusing.
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome