pub struct RawTracePointRunOptions {
pub args: [u64; 12],
pub cpu: Option<u32>,
}Expand description
Options for running a RawTracePoint program test via BPF_PROG_TEST_RUN.
The kernel’s bpf_prog_test_run_raw_tp handler (v5.10, commit b84e6faeed1)
is far more restrictive than the skb/XDP path:
data_in,data_out,ctx_out,repeat,batch_sizemust all be zero/NULL; passing any of them returnsEINVAL.ctx_inis the only data path: a packed array ofu64tracepoint arguments.- CPU pinning via
BPF_F_TEST_RUN_ON_CPUis supported and is the primary reason to useBPF_PROG_TEST_RUNwith raw tracepoints.
This struct deliberately omits the forbidden fields so misuse is a
compile-time error rather than a runtime EINVAL.
Fields§
§args: [u64; 12]Fake tracepoint arguments, up to 12 u64 values.
Each element corresponds to one tracepoint argument in order. The kernel
copies the entire array into ctx_in before calling the program, which
reads them via ctx.arg(n). Unused slots default to zero.
The array size of 12 matches the kernel’s maximum: the longest tracepoint
in the kernel takes 12 arguments. See
net/bpf/test_run.c.
cpu: Option<u32>If Some(cpu), pin execution to that CPU via BPF_F_TEST_RUN_ON_CPU.
The only flag the kernel accepts for raw tracepoints; batch_size and
all other TestRunAttrs knobs return EINVAL.