summaryrefslogtreecommitdiff
path: root/include/linux/bpf.h
diff options
context:
space:
mode:
authorYafang Shao <laoar.shao@gmail.com>2023-03-05 15:45:58 +0300
committerAlexei Starovoitov <ast@kernel.org>2023-03-07 20:33:41 +0300
commit90a5527d7686d3ebe0dd2a831356a6c7d7dc31bc (patch)
tree37f414130d1410aa9020d189bfbffdd24d0e52a2 /include/linux/bpf.h
parent2d5bcdcda8799cf21f9ab84598c946dd320207a2 (diff)
downloadlinux-90a5527d7686d3ebe0dd2a831356a6c7d7dc31bc.tar.xz
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/linux/bpf.h')
-rw-r--r--include/linux/bpf.h2
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;