From: Yonghong Song <yonghong.song@linux.dev>
To: Alan Maguire <alan.maguire@oracle.com>,
Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
dwarves@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, David Faust <david.faust@oracle.com>,
"Jose E . Marchesi" <jose.marchesi@oracle.com>,
kernel-team@fb.com
Subject: [PATCH dwarves v2 1/2] btf_encoder: Refactor elf_functions__new() with struct btf_encoder as argument
Date: Sat, 29 Nov 2025 20:03:45 -0800 [thread overview]
Message-ID: <20251130040345.2636661-1-yonghong.song@linux.dev> (raw)
In-Reply-To: <20251130040340.2636458-1-yonghong.song@linux.dev>
For elf_functions__new(), replace original argument 'Elf *elf' with
'struct btf_encoder *encoder' for future use.
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
---
btf_encoder.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/btf_encoder.c b/btf_encoder.c
index b37ee7f..3486fa3 100644
--- a/btf_encoder.c
+++ b/btf_encoder.c
@@ -186,11 +186,13 @@ static inline void elf_functions__delete(struct elf_functions *funcs)
static int elf_functions__collect(struct elf_functions *functions);
-struct elf_functions *elf_functions__new(Elf *elf)
+struct elf_functions *elf_functions__new(struct btf_encoder *encoder)
{
struct elf_functions *funcs;
+ Elf *elf;
int err;
+ elf = encoder->cu->elf;
funcs = calloc(1, sizeof(*funcs));
if (!funcs) {
err = -ENOMEM;
@@ -1541,7 +1543,7 @@ static struct elf_functions *btf_encoder__elf_functions(struct btf_encoder *enco
funcs = elf_functions__find(encoder->cu->elf, &encoder->elf_functions_list);
if (!funcs) {
- funcs = elf_functions__new(encoder->cu->elf);
+ funcs = elf_functions__new(encoder);
if (funcs)
list_add(&funcs->node, &encoder->elf_functions_list);
}
--
2.47.3
next prev parent reply other threads:[~2025-11-30 4:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-30 4:03 [PATCH dwarves v2 0/2] pahole: Replace or add functions with true signatures in btf Yonghong Song
2025-11-30 4:03 ` Yonghong Song [this message]
2025-11-30 4:03 ` [PATCH dwarves v2 2/2] " Yonghong Song
2025-12-08 16:22 ` Alan Maguire
2025-12-09 12:05 ` Yonghong Song
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=20251130040345.2636661-1-yonghong.song@linux.dev \
--to=yonghong.song@linux.dev \
--cc=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=arnaldo.melo@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=david.faust@oracle.com \
--cc=dwarves@vger.kernel.org \
--cc=jose.marchesi@oracle.com \
--cc=kernel-team@fb.com \
/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).