Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (c) 2024 Meta Platforms, Inc. and affiliates.
4 */
5
6#include <scx/common.bpf.h>
7
8char _license[] SEC("license") = "GPL";
9
10u64 vtime_test;
11
12void BPF_STRUCT_OPS(maybe_null_running, struct task_struct *p)
13{}
14
15bool BPF_STRUCT_OPS(maybe_null_fail_yield, struct task_struct *from,
16 struct task_struct *to)
17{
18 bpf_printk("Yielding to %s[%d]", to->comm, to->pid);
19
20 return false;
21}
22
23SEC(".struct_ops.link")
24struct sched_ext_ops maybe_null_fail = {
25 .yield = (void *) maybe_null_fail_yield,
26 .enable = (void *) maybe_null_running,
27 .name = "maybe_null_fail_yield",
28};