From ccde5760bac1b83cfb2bfed97748b71829cbe5d8 Mon Sep 17 00:00:00 2001 From: Daniel Müller Date: Mon, 23 May 2022 23:04:23 +0000 Subject: libbpf: Introduce libbpf_bpf_attach_type_str MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220523230428.3077108-8-deso@posteo.net --- tools/lib/bpf/libbpf.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tools/lib/bpf/libbpf.h') 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 @@ -51,6 +51,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. -- cgit