Skip to content

Commit cbef91d

Browse files
aspskAlexei Starovoitov
authored andcommitted
libbpf: Recognize insn_array map type
Teach libbpf about the existence of the new instruction array map. Signed-off-by: Anton Protopopov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 18a187b commit cbef91d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ static const char * const map_type_name[] = {
190190
[BPF_MAP_TYPE_USER_RINGBUF] = "user_ringbuf",
191191
[BPF_MAP_TYPE_CGRP_STORAGE] = "cgrp_storage",
192192
[BPF_MAP_TYPE_ARENA] = "arena",
193+
[BPF_MAP_TYPE_INSN_ARRAY] = "insn_array",
193194
};
194195

195196
static const char * const prog_type_name[] = {

tools/lib/bpf/libbpf_probes.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ static int probe_map_create(enum bpf_map_type map_type)
364364
case BPF_MAP_TYPE_SOCKHASH:
365365
case BPF_MAP_TYPE_REUSEPORT_SOCKARRAY:
366366
break;
367+
case BPF_MAP_TYPE_INSN_ARRAY:
368+
key_size = sizeof(__u32);
369+
value_size = sizeof(struct bpf_insn_array_value);
370+
break;
367371
case BPF_MAP_TYPE_UNSPEC:
368372
default:
369373
return -EOPNOTSUPP;

0 commit comments

Comments
 (0)