File: bpf_test_modorder_x.c

package info (click to toggle)
linux 6.17.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,734,892 kB
  • sloc: ansic: 26,684,085; asm: 271,195; sh: 147,401; python: 75,980; makefile: 57,306; perl: 36,943; xml: 19,562; cpp: 5,899; yacc: 4,909; lex: 2,943; awk: 1,556; sed: 29; ruby: 25
file content (39 lines) | stat: -rw-r--r-- 877 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// SPDX-License-Identifier: GPL-2.0
#include <linux/bpf.h>
#include <linux/btf.h>
#include <linux/module.h>
#include <linux/init.h>

__bpf_kfunc_start_defs();

__bpf_kfunc int bpf_test_modorder_retx(void)
{
	return 'x';
}

__bpf_kfunc_end_defs();

BTF_KFUNCS_START(bpf_test_modorder_kfunc_x_ids)
BTF_ID_FLAGS(func, bpf_test_modorder_retx);
BTF_KFUNCS_END(bpf_test_modorder_kfunc_x_ids)

static const struct btf_kfunc_id_set bpf_test_modorder_x_set = {
	.owner = THIS_MODULE,
	.set = &bpf_test_modorder_kfunc_x_ids,
};

static int __init bpf_test_modorder_x_init(void)
{
	return register_btf_kfunc_id_set(BPF_PROG_TYPE_SCHED_CLS,
					 &bpf_test_modorder_x_set);
}

static void __exit bpf_test_modorder_x_exit(void)
{
}

module_init(bpf_test_modorder_x_init);
module_exit(bpf_test_modorder_x_exit);

MODULE_DESCRIPTION("BPF selftest ordertest module X");
MODULE_LICENSE("GPL");