Skip to main content

Module compat

Module compat 

Source

Re-exportsΒ§

use anyhow::Context; πŸ”’
use anyhow::Result; πŸ”’
use anyhow::anyhow; πŸ”’
use anyhow::bail; πŸ”’
use libbpf_rs::AsRawLibbpf; πŸ”’
use libbpf_rs::OpenObject; πŸ”’
use libbpf_rs::OpenProgramImpl; πŸ”’
use libbpf_rs::ProgramImpl; πŸ”’
use log::debug; πŸ”’
use log::error; πŸ”’
use log::info; πŸ”’
use log::warn; πŸ”’
use std::env; πŸ”’
use std::env; πŸ”’
use std::ffi::CStr; πŸ”’
use std::ffi::CString; πŸ”’
use std::ffi::OsStr; πŸ”’
use std::ffi::c_void; πŸ”’
use std::io; πŸ”’
use std::io::BufRead; πŸ”’
use std::io::BufReader; πŸ”’
use std::mem::size_of; πŸ”’
use std::os::fd::AsFd; πŸ”’
use std::os::fd::AsRawFd; πŸ”’
use std::os::fd::BorrowedFd; πŸ”’
use std::os::fd::FromRawFd; πŸ”’
use std::os::fd::OwnedFd; πŸ”’
use std::slice::from_raw_parts; πŸ”’
use libbpf_rs::libbpf_sys::*; πŸ”’

ModulesΒ§

enums_abi πŸ”’

StructsΒ§

ARENA_FETCH_BITOPS
The JIT lowers fetching AND, OR and XOR on arena pointers.
BPF_PROG_STREAM_OPEN πŸ”’
LIB_FEATURES
Every probed kernel feature: its name, its bit in the scx_lib_features rodata word or zero when only userspace consults it, and whether the running kernel has it.
PROG_STREAM_OPEN_SUPPORTED
prog_stream_open() works, so BPF streams can be polled.
ProbeInsn πŸ”’
A raw BPF instruction for the load probes below, laid out as the kernel reads it: the two register nibbles follow the host’s bitfield order.
ProgStreamOpenAttr πŸ”’
ROOT_PREFIX
SCX_OPS_ALLOW_QUEUED_WAKEUP
SCX_OPS_ALWAYS_ENQ_IMMED
SCX_OPS_BUILTIN_IDLE_PER_NODE
SCX_OPS_ENQ_BLOCKED
SCX_OPS_ENQ_EXITING
SCX_OPS_ENQ_LAST
SCX_OPS_ENQ_MIGRATION_DISABLED
SCX_OPS_KEEP_BUILTIN_IDLE
SCX_OPS_SWITCH_PARTIAL
SCX_OPS_TID_TO_TASK
SCX_PICK_IDLE_CORE
SCX_PICK_IDLE_IN_NODE
VMLINUX_BTF πŸ”’

ConstantsΒ§

BPF_F_ARENA_SCALAR
BPF_PROG_LOAD flag under which a load or store through a plain scalar is an arena access, from 4c651a91bdfc in bpf-next. Not yet in the uapi header libbpf-sys 1.7 ships.
BPF_F_STREAM_NONBLOCK πŸ”’
DEBUGFS πŸ”’
PROBE_ADDR_SPACE_CAST πŸ”’
PROBE_ATOMIC_DW πŸ”’
PROBE_ATOMIC_OR_FETCH πŸ”’
PROBE_EXIT πŸ”’
PROBE_LD_IMM64 πŸ”’
PROBE_MOV64_IMM πŸ”’
PROBE_MOV64_REG πŸ”’
PROCFS_MOUNTS πŸ”’
SCX_LIB_FEAT_ARENA_FETCH_BITOPS
TRACEFS πŸ”’

FunctionsΒ§

btf_enum πŸ”’
btf_enum64 πŸ”’
btf_kflag πŸ”’
btf_kind πŸ”’
btf_members πŸ”’
btf_name_str_by_offset πŸ”’
btf_params πŸ”’
btf_type_plus_1 πŸ”’
btf_vlen πŸ”’
check_min_requirements
cond_kprobe_attach
cond_kprobe_enable
cond_kprobe_load
cond_kprobes_enable
cond_tracepoint_enable
cond_tracepoints_enable
debugfs_mount
Returns the debugfs mount point.
function_tracer_available
Whether the kernel supports function tracing (CONFIG_FUNCTION_TRACER), needed for fentry/fexit BPF programs to load or attach. /proc/sys/kernel/ftrace_enabled only exists when it’s compiled in, so its presence is a cheap proxy.
get_fs_mount
Returns the mount point for a filesystem type.
has_rodata_var
Whether an open object has the rodata variable name.
in_kallsyms
is_sched_ext_enabled
ksym_exists
load_vmlinux_btf πŸ”’
malformed_scx_kfuncs
Scan the running kernel’s vmlinux BTF for scx kfuncs whose public-facing prototype still carries the implicit aux (struct bpf_prog_aux *) argument.
probe_arena_fetch_bitops πŸ”’
A fetching OR on arena memory, which the verifier rejects where the JIT has no lowering for it. The JITs accept the fetching AND, OR and XOR as a group, so one probe covers all three. The arena has to be mapped before the load because the verifier requires its user address to be known.
probe_insn πŸ”’
probe_prog_load πŸ”’
Load insns as a GPL program of prog_type with the BPF_F_* flags.
probe_prog_stream_open πŸ”’
prog_stream_open
Open a read-only descriptor on one of prog’s streams, stream_id being BPF_STREAM_STDOUT or BPF_STREAM_STDERR. Reads block unless nonblock. poll(2) reports POLLIN for data and POLLHUP once the program is freed, with buffered data still readable. A kernel without the command fails with EINVAL.
read_enum
read_enum_any
Read an enum value from the first BTF enum type that contains it.
recover_truncated_enum64 πŸ”’
recover_truncated_enum64_from πŸ”’
Recover the true value of a 64-bit enum enumerator whose kernel BTF entry was truncated to its low 32 bits.
rodata_var πŸ”’
Offset and size of the rodata variable name in an open object’s BTF, None when the object has no such variable.
set_lib_features
Hand the probed features to the BPF side of an open object and log them, at info when the kernel lacks any of them and at debug otherwise.
set_rodata_var
Write value over the rodata variable name of an open object. Returns false when the object has no such variable.
struct_has_field
tracefs_mount
Returns the tracefs mount point.
tracepoint_exists
tracer_available