bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: thinker.li@gmail.com
To: bpf@vger.kernel.org, ast@kernel.org, martin.lau@linux.dev,
	song@kernel.org, kernel-team@meta.com, andrii@kernel.org,
	quentin@isovalent.com
Cc: sinquersw@gmail.com, kuifeng@meta.com,
	Kui-Feng Lee <thinker.li@gmail.com>
Subject: [PATCH bpf-next v4 1/6] libbpf: expose resolve_func_ptr() through libbpf_internal.h.
Date: Thu, 22 Feb 2024 14:26:19 -0800	[thread overview]
Message-ID: <20240222222624.1163754-2-thinker.li@gmail.com> (raw)
In-Reply-To: <20240222222624.1163754-1-thinker.li@gmail.com>

From: Kui-Feng Lee <thinker.li@gmail.com>

bpftool is going to reuse this helper function to support shadow types of
struct_ops maps.

Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
---
 tools/lib/bpf/libbpf.c          | 2 +-
 tools/lib/bpf/libbpf_internal.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 01f407591a92..ef8fd20f33ca 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -2145,7 +2145,7 @@ skip_mods_and_typedefs(const struct btf *btf, __u32 id, __u32 *res_id)
 	return t;
 }
 
-static const struct btf_type *
+const struct btf_type *
 resolve_func_ptr(const struct btf *btf, __u32 id, __u32 *res_id)
 {
 	const struct btf_type *t;
diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf/libbpf_internal.h
index ad936ac5e639..17e6d381da6a 100644
--- a/tools/lib/bpf/libbpf_internal.h
+++ b/tools/lib/bpf/libbpf_internal.h
@@ -234,6 +234,8 @@ struct btf_type;
 struct btf_type *btf_type_by_id(const struct btf *btf, __u32 type_id);
 const char *btf_kind_str(const struct btf_type *t);
 const struct btf_type *skip_mods_and_typedefs(const struct btf *btf, __u32 id, __u32 *res_id);
+/* This function is exposed to bpftool */
+const struct btf_type *resolve_func_ptr(const struct btf *btf, __u32 id, __u32 *res_id);
 
 static inline enum btf_func_linkage btf_func_linkage(const struct btf_type *t)
 {
-- 
2.34.1


  reply	other threads:[~2024-02-22 22:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 22:26 [PATCH bpf-next v4 0/6] Create shadow types for struct_ops maps in skeletons thinker.li
2024-02-22 22:26 ` thinker.li [this message]
2024-02-22 22:26 ` [PATCH bpf-next v4 2/6] libbpf: set btf_value_type_id of struct bpf_map for struct_ops thinker.li
2024-02-22 22:26 ` [PATCH bpf-next v4 3/6] libbpf: Convert st_ops->data to shadow type thinker.li
2024-02-26 22:57   ` Martin KaFai Lau
2024-02-27  0:19     ` Kui-Feng Lee
2024-02-22 22:26 ` [PATCH bpf-next v4 4/6] bpftool: generated shadow variables for struct_ops maps thinker.li
2024-02-22 22:26 ` [PATCH bpf-next v4 5/6] bpftool: Add an example for struct_ops map and shadow type thinker.li
2024-02-22 22:26 ` [PATCH bpf-next v4 6/6] selftests/bpf: Test if shadow types work correctly thinker.li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240222222624.1163754-2-thinker.li@gmail.com \
    --to=thinker.li@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=kernel-team@meta.com \
    --cc=kuifeng@meta.com \
    --cc=martin.lau@linux.dev \
    --cc=quentin@isovalent.com \
    --cc=sinquersw@gmail.com \
    --cc=song@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).