projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2dc323b
)
bpf: Allow kfunc in tracing and syscall programs.
author
Benjamin Tissoires
<benjamin.tissoires@redhat.com>
Wed, 18 May 2022 20:59:08 +0000
(22:59 +0200)
committer
Alexei Starovoitov
<ast@kernel.org>
Sat, 21 May 2022 02:28:33 +0000
(19:28 -0700)
Tracing and syscall BPF program types are very convenient to add BPF
capabilities to subsystem otherwise not BPF capable.
When we add kfuncs capabilities to those program types, we can add
BPF features to subsystems without having to touch BPF core.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link:
https://lore.kernel.org/r/20220518205924.399291-2-benjamin.tissoires@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/btf.c
patch
|
blob
|
history
diff --git
a/kernel/bpf/btf.c
b/kernel/bpf/btf.c
index 2f0b0440131c2f64a5eac68d9eeede879ac84970..7bccaa4646e5197afe0a5d742e5bbf9e18594276 100644
(file)
--- a/
kernel/bpf/btf.c
+++ b/
kernel/bpf/btf.c
@@
-202,6
+202,8
@@
enum btf_kfunc_hook {
BTF_KFUNC_HOOK_XDP,
BTF_KFUNC_HOOK_TC,
BTF_KFUNC_HOOK_STRUCT_OPS,
+ BTF_KFUNC_HOOK_TRACING,
+ BTF_KFUNC_HOOK_SYSCALL,
BTF_KFUNC_HOOK_MAX,
};
@@
-7110,6
+7112,10
@@
static int bpf_prog_type_to_kfunc_hook(enum bpf_prog_type prog_type)
return BTF_KFUNC_HOOK_TC;
case BPF_PROG_TYPE_STRUCT_OPS:
return BTF_KFUNC_HOOK_STRUCT_OPS;
+ case BPF_PROG_TYPE_TRACING:
+ return BTF_KFUNC_HOOK_TRACING;
+ case BPF_PROG_TYPE_SYSCALL:
+ return BTF_KFUNC_HOOK_SYSCALL;
default:
return BTF_KFUNC_HOOK_MAX;
}