mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
bpf: Set map_btf_{name, id} for all map types
Set map_btf_name and map_btf_id for all map types so that map fields can be accessed by bpf programs. Signed-off-by: Andrey Ignatov <rdna@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: John Fastabend <john.fastabend@gmail.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/a825f808f22af52b018dbe82f1c7d29dab5fc978.1592600985.git.rdna@fb.com
This commit is contained in:
parent
41c48f3a98
commit
2872e9ac33
14 changed files with 72 additions and 0 deletions
|
@ -613,6 +613,7 @@ static void stack_map_free(struct bpf_map *map)
|
|||
put_callchain_buffers();
|
||||
}
|
||||
|
||||
static int stack_trace_map_btf_id;
|
||||
const struct bpf_map_ops stack_trace_map_ops = {
|
||||
.map_alloc = stack_map_alloc,
|
||||
.map_free = stack_map_free,
|
||||
|
@ -621,6 +622,8 @@ const struct bpf_map_ops stack_trace_map_ops = {
|
|||
.map_update_elem = stack_map_update_elem,
|
||||
.map_delete_elem = stack_map_delete_elem,
|
||||
.map_check_btf = map_check_no_btf,
|
||||
.map_btf_name = "bpf_stack_map",
|
||||
.map_btf_id = &stack_trace_map_btf_id,
|
||||
};
|
||||
|
||||
static int __init stack_map_init(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue