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 1/3] btf_encoder: Refactor elf_functions__new() with struct btf_encoder as argument
Date: Tue, 11 Nov 2025 09:04:29 -0800 [thread overview]
Message-ID: <20251111170429.287170-1-yonghong.song@linux.dev> (raw)
In-Reply-To: <20251111170424.286892-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 03bc3c7..1c69577 100644
--- a/btf_encoder.c
+++ b/btf_encoder.c
@@ -187,11 +187,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;
@@ -1509,7 +1511,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-11 17:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 17:04 [PATCH dwarves 0/3] pahole: Replace or add functions with true signatures in btf Yonghong Song
2025-11-11 17:04 ` Yonghong Song [this message]
2025-11-11 17:04 ` [PATCH dwarves 2/3] bpf_encoder: Refactor a helper elf_function__check_and_push_sym() Yonghong Song
2025-11-11 17:04 ` [PATCH dwarves 3/3] pahole: Replace or add functions with true signatures in btf Yonghong Song
2025-11-13 16:45 ` [PATCH dwarves 0/3] " Alan Maguire
2025-11-13 17:36 ` Alexei Starovoitov
2025-11-14 15:57 ` Alan Maguire
2025-11-14 20:11 ` Alexei Starovoitov
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=20251111170429.287170-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