mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-31 05:39:06 +08:00
19
src/libbpf.c
19
src/libbpf.c
@@ -1113,6 +1113,20 @@ err_free_new_name:
|
|||||||
return -errno;
|
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
|
static int
|
||||||
bpf_object__probe_name(struct bpf_object *obj)
|
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;
|
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)
|
int bpf_object__btf_fd(const struct bpf_object *obj)
|
||||||
{
|
{
|
||||||
return obj->btf ? btf__fd(obj->btf) : -1;
|
return obj->btf ? btf__fd(obj->btf) : -1;
|
||||||
|
|||||||
@@ -89,6 +89,9 @@ LIBBPF_API int bpf_object__load(struct bpf_object *obj);
|
|||||||
LIBBPF_API int bpf_object__unload(struct bpf_object *obj);
|
LIBBPF_API int bpf_object__unload(struct bpf_object *obj);
|
||||||
LIBBPF_API const char *bpf_object__name(struct bpf_object *obj);
|
LIBBPF_API const char *bpf_object__name(struct bpf_object *obj);
|
||||||
LIBBPF_API unsigned int bpf_object__kversion(struct bpf_object *obj);
|
LIBBPF_API unsigned int bpf_object__kversion(struct bpf_object *obj);
|
||||||
|
|
||||||
|
struct btf;
|
||||||
|
LIBBPF_API struct btf *bpf_object__btf(struct bpf_object *obj);
|
||||||
LIBBPF_API int bpf_object__btf_fd(const struct bpf_object *obj);
|
LIBBPF_API int bpf_object__btf_fd(const struct bpf_object *obj);
|
||||||
|
|
||||||
LIBBPF_API struct bpf_program *
|
LIBBPF_API struct bpf_program *
|
||||||
@@ -294,6 +297,7 @@ LIBBPF_API int bpf_map__set_priv(struct bpf_map *map, void *priv,
|
|||||||
bpf_map_clear_priv_t clear_priv);
|
bpf_map_clear_priv_t clear_priv);
|
||||||
LIBBPF_API void *bpf_map__priv(struct bpf_map *map);
|
LIBBPF_API void *bpf_map__priv(struct bpf_map *map);
|
||||||
LIBBPF_API int bpf_map__reuse_fd(struct bpf_map *map, int fd);
|
LIBBPF_API int bpf_map__reuse_fd(struct bpf_map *map, int fd);
|
||||||
|
LIBBPF_API int bpf_map__resize(struct bpf_map *map, __u32 max_entries);
|
||||||
LIBBPF_API bool bpf_map__is_offload_neutral(struct bpf_map *map);
|
LIBBPF_API bool bpf_map__is_offload_neutral(struct bpf_map *map);
|
||||||
LIBBPF_API void bpf_map__set_ifindex(struct bpf_map *map, __u32 ifindex);
|
LIBBPF_API void bpf_map__set_ifindex(struct bpf_map *map, __u32 ifindex);
|
||||||
LIBBPF_API int bpf_map__pin(struct bpf_map *map, const char *path);
|
LIBBPF_API int bpf_map__pin(struct bpf_map *map, const char *path);
|
||||||
|
|||||||
@@ -130,7 +130,9 @@ LIBBPF_0.0.2 {
|
|||||||
bpf_probe_helper;
|
bpf_probe_helper;
|
||||||
bpf_probe_map_type;
|
bpf_probe_map_type;
|
||||||
bpf_probe_prog_type;
|
bpf_probe_prog_type;
|
||||||
|
bpf_map__resize;
|
||||||
bpf_map_lookup_elem_flags;
|
bpf_map_lookup_elem_flags;
|
||||||
|
bpf_object__btf;
|
||||||
bpf_object__find_map_fd_by_name;
|
bpf_object__find_map_fd_by_name;
|
||||||
bpf_get_link_xdp_id;
|
bpf_get_link_xdp_id;
|
||||||
btf__dedup;
|
btf__dedup;
|
||||||
|
|||||||
Reference in New Issue
Block a user