Lines Matching refs:vmlinux
76 ## Getting a vmlinux.h file
78 You may notice that most of the example schedulers include a "vmlinux.h" file.
80 defined in some vmlinux binary that was compiled with
84 The header file is created using `bpftool`, by passing it a vmlinux binary
88 $ bpftool btf dump file /path/to/vmlinux format c > vmlinux.h
93 example, using vmlinux.h allows a scheduler to access fields defined directly
94 in vmlinux as follows:
97 #include "vmlinux.h"
98 // vmlinux.h is also implicitly included by scx_common.bpf.h.
102 * vmlinux.h provides definitions for struct task_struct and
111 // vmlinux.h provides the definition for struct sched_ext_ops.
119 The scheduler build system will generate this vmlinux.h file as part of the
120 scheduler build pipeline. It looks for a vmlinux file in the following
123 1. If the O= environment variable is defined, at `$O/vmlinux`
125 `$KBUILD_OUTPUT/vmlinux`
126 3. At `../../vmlinux` (i.e. at the root of the kernel tree where you're
128 3. `/sys/kernel/btf/vmlinux`
129 4. `/boot/vmlinux-$(uname -r)`
131 In other words, if you have compiled a kernel in your local repo, its vmlinux
132 file will be used to generate vmlinux.h. Otherwise, it will be the vmlinux of
150 Once you have your toolchain setup, and a vmlinux that can be used to generate
151 a full vmlinux.h file, you can compile the schedulers using `make`:
218 error: static assertion failed due to requirement 'SCX_DSQ_FLAG_BUILTIN': bpftool generated vmlinux…
237 ### Stale kernel build / incomplete vmlinux.h file
239 As described above, you'll need a `vmlinux.h` file that was generated from a
240 vmlinux built with BTF, and with sched_ext support enabled. If you don't,
253 [Getting a vmlinux.h file](#getting-a-vmlinuxh-file) in order to ensure your
254 schedulers are using a vmlinux.h file that includes the requisite types.