mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-26 11:19:06 +08:00
19
src/libbpf.c
19
src/libbpf.c
@@ -1113,6 +1113,20 @@ err_free_new_name:
|
||||
return -errno;
|
||||
}
|
||||
|
||||
int bpf_map__resize(struct bpf_map *map, __u32 max_entries)
|
||||
{
|
||||
if (!map || !max_entries)
|
||||
return -EINVAL;
|
||||
|
||||
/* If map already created, its attributes can't be changed. */
|
||||
if (map->fd >= 0)
|
||||
return -EBUSY;
|
||||
|
||||
map->def.max_entries = max_entries;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
bpf_object__probe_name(struct bpf_object *obj)
|
||||
{
|
||||
@@ -2317,6 +2331,11 @@ unsigned int bpf_object__kversion(struct bpf_object *obj)
|
||||
return obj ? obj->kern_version : 0;
|
||||
}
|
||||
|
||||
struct btf *bpf_object__btf(struct bpf_object *obj)
|
||||
{
|
||||
return obj ? obj->btf : NULL;
|
||||
}
|
||||
|
||||
int bpf_object__btf_fd(const struct bpf_object *obj)
|
||||
{
|
||||
return obj->btf ? btf__fd(obj->btf) : -1;
|
||||
|
||||
Reference in New Issue
Block a user