projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
275517f
)
bpf: Add enum support to btf_ctx_access()
author
Martin KaFai Lau
<kafai@fb.com>
Thu, 9 Jan 2020 00:34:59 +0000
(16:34 -0800)
committer
Alexei Starovoitov
<ast@kernel.org>
Thu, 9 Jan 2020 16:46:18 +0000
(08:46 -0800)
It allows bpf prog (e.g. tracing) to attach
to a kernel function that takes enum argument.
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link:
https://lore.kernel.org/bpf/20200109003459.3855366-1-kafai@fb.com
kernel/bpf/btf.c
patch
|
blob
|
history
diff --git
a/kernel/bpf/btf.c
b/kernel/bpf/btf.c
index 497ecf62d79d0b9f4d2f802333a7cce6f68f2bf1..6a5ccb748a723d29de6f0cbdd49c652a5ea1738c 100644
(file)
--- a/
kernel/bpf/btf.c
+++ b/
kernel/bpf/btf.c
@@
-3677,7
+3677,7
@@
bool btf_ctx_access(int off, int size, enum bpf_access_type type,
/* skip modifiers */
while (btf_type_is_modifier(t))
t = btf_type_by_id(btf, t->type);
- if (btf_type_is_int(t))
+ if (btf_type_is_int(t)
|| btf_type_is_enum(t)
)
/* accessing a scalar */
return true;
if (!btf_type_is_ptr(t)) {