diff options
author | Yafang Shao <laoar.shao@gmail.com> | 2023-03-05 12:45:58 +0000 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-03-07 09:33:41 -0800 |
commit | 90a5527d7686d3ebe0dd2a831356a6c7d7dc31bc (patch) | |
tree | 37f414130d1410aa9020d189bfbffdd24d0e52a2 /include | |
parent | 2d5bcdcda8799cf21f9ab84598c946dd320207a2 (diff) |
bpf: add new map ops ->map_mem_usage
Add a new map ops ->map_mem_usage to print the memory usage of a
bpf map.
This is a preparation for the followup change.
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Link: https://lore.kernel.org/r/20230305124615.12358-2-laoar.shao@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/bpf.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index d3456804f7aa..9059520bbb5e 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -161,6 +161,8 @@ struct bpf_map_ops { bpf_callback_t callback_fn, void *callback_ctx, u64 flags); + u64 (*map_mem_usage)(const struct bpf_map *map); + /* BTF id of struct allocated by map_alloc */ int *map_btf_id; |