aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf.h
diff options
context:
space:
mode:
authorDaniel Müller <[email protected]>2022-05-23 23:04:20 +0000
committerAndrii Nakryiko <[email protected]>2022-06-02 23:26:20 +0000
commit3e6dc0207b33edf90be4d5cbbaf06223aa38e50b (patch)
tree02f5d230dab359044df88907a0366bdeb78d801f /tools/lib/bpf/libbpf.h
parentbpftool: Use libbpf_bpf_prog_type_str (diff)
downloadkernel-3e6dc0207b33edf90be4d5cbbaf06223aa38e50b.tar.gz
kernel-3e6dc0207b33edf90be4d5cbbaf06223aa38e50b.zip
libbpf: Introduce libbpf_bpf_map_type_str
This change introduces a new function, libbpf_bpf_map_type_str, to the public libbpf API. The function allows users to get a string representation for a bpf_map_type enum variant. Signed-off-by: Daniel Müller <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Acked-by: Quentin Monnet <[email protected]> Acked-by: Yonghong Song <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r--tools/lib/bpf/libbpf.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 11b5f8ce8031..6c5b077351c6 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -52,6 +52,15 @@ enum libbpf_errno {
LIBBPF_API int libbpf_strerror(int err, char *buf, size_t size);
/**
+ * @brief **libbpf_bpf_map_type_str()** converts the provided map type value
+ * into a textual representation.
+ * @param t The map type.
+ * @return Pointer to a static string identifying the map type. NULL is
+ * returned for unknown **bpf_map_type** values.
+ */
+LIBBPF_API const char *libbpf_bpf_map_type_str(enum bpf_map_type t);
+
+/**
* @brief **libbpf_bpf_prog_type_str()** converts the provided program type
* value into a textual representation.
* @param t The program type.