mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
UPSTREAM: bpf: Add enum support to btf_ctx_access()
It allows bpf prog (e.g. tracing) to attach to a kernel function that takes enum argument. Change-Id: I5415fbd084e745291d444c159e573f030e65215e 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
This commit is contained in:
parent
ce110959ca
commit
f88cda0754
1 changed files with 1 additions and 1 deletions
|
|
@ -3683,7 +3683,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)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue