Lines Matching refs:vmlinux

69 ## Getting a vmlinux.h file
71 You may notice that most of the example schedulers include a "vmlinux.h" file.
73 defined in some vmlinux binary that was compiled with
77 The header file is created using `bpftool`, by passing it a vmlinux binary
81 $ bpftool btf dump file /path/to/vmlinux format c > vmlinux.h
86 example, using vmlinux.h allows a scheduler to access fields defined directly
87 in vmlinux as follows:
90 #include "vmlinux.h"
91 // vmlinux.h is also implicitly included by scx_common.bpf.h.
95 * vmlinux.h provides definitions for struct task_struct and
104 // vmlinux.h provides the definition for struct sched_ext_ops.
112 The scheduler build system will generate this vmlinux.h file as part of the
113 scheduler build pipeline. It looks for a vmlinux file in the following
116 1. If the O= environment variable is defined, at `$O/vmlinux`
118 `$KBUILD_OUTPUT/vmlinux`
119 3. At `../../vmlinux` (i.e. at the root of the kernel tree where you're
121 3. `/sys/kernel/btf/vmlinux`
122 4. `/boot/vmlinux-$(uname -r)`
124 In other words, if you have compiled a kernel in your local repo, its vmlinux
125 file will be used to generate vmlinux.h. Otherwise, it will be the vmlinux of
143 Once you have your toolchain setup, and a vmlinux that can be used to generate
144 a full vmlinux.h file, you can compile the schedulers using `make`:
211 error: static assertion failed due to requirement 'SCX_DSQ_FLAG_BUILTIN': bpftool generated vmlinux
230 ### Stale kernel build / incomplete vmlinux.h file
232 As described above, you'll need a `vmlinux.h` file that was generated from a
233 vmlinux built with BTF, and with sched_ext support enabled. If you don't,
246 [Getting a vmlinux.h file](#getting-a-vmlinuxh-file) in order to ensure your
247 schedulers are using a vmlinux.h file that includes the requisite types.