diff options
author | Daniel Müller <deso@posteo.net> | 2022-05-23 23:04:23 +0000 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2022-06-02 16:26:26 -0700 |
commit | ccde5760bac1b83cfb2bfed97748b71829cbe5d8 (patch) | |
tree | ec08ffa3fb8dbd2db50efdbeb1ad2cd0f7a6e6e4 /tools/lib/bpf/libbpf.h | |
parent | 2e98964bd6e283568730b1a4da3b1e4da3306a8e (diff) | |
download | lwn-ccde5760bac1b83cfb2bfed97748b71829cbe5d8.tar.gz lwn-ccde5760bac1b83cfb2bfed97748b71829cbe5d8.zip |
libbpf: Introduce libbpf_bpf_attach_type_str
This change introduces a new function, libbpf_bpf_attach_type_str, to
the public libbpf API. The function allows users to get a string
representation for a bpf_attach_type variant.
Signed-off-by: Daniel Müller <deso@posteo.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Quentin Monnet <quentin@isovalent.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220523230428.3077108-8-deso@posteo.net
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r-- | tools/lib/bpf/libbpf.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index 6c5b077351c6..37a234b141c6 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_attach_type_str()** converts the provided attach type + * value into a textual representation. + * @param t The attach type. + * @return Pointer to a static string identifying the attach type. NULL is + * returned for unknown **bpf_attach_type** values. + */ +LIBBPF_API const char *libbpf_bpf_attach_type_str(enum bpf_attach_type t); + +/** * @brief **libbpf_bpf_map_type_str()** converts the provided map type value * into a textual representation. * @param t The map type. |