BPF List
 help / color / mirror / Atom feed
From: Alan Maguire <alan.maguire@oracle.com>
To: Daniel Xu <dxu@dxuuu.xyz>
Cc: acme@kernel.org, jolsa@kernel.org, quentin@isovalent.com,
	andrii.nakryiko@gmail.com, ast@kernel.org, daniel@iogearbox.net,
	bpf@vger.kernel.org
Subject: Re: [PATCH dwarves v4 2/2] pahole: Inject kfunc decl tags into BTF
Date: Wed, 13 Mar 2024 09:36:40 +0000	[thread overview]
Message-ID: <f9ab9ab3-c3cb-4a63-bc4e-102b9f6925a9@oracle.com> (raw)
In-Reply-To: <tqkiee5rc3szutsobuuttgpv4ejjhnjbcfhkdozkrvxcjrp6zf@2mvkkhhbn7vj>

On 13/03/2024 03:17, Daniel Xu wrote:
> Hi Alan,
> 
> On Wed, Feb 28, 2024 at 05:57:01PM -0700, Daniel Xu wrote:
>> Hi Alan,
>>
>> On Thu, Feb 08, 2024 at 10:00:15AM +0000, Alan Maguire wrote:
>>> On 04/02/2024 18:40, Daniel Xu wrote:
> 
> [...]
> 
>>>
>>> Then all you'd need to do is iterate over BTF functions, using
>>> btf_encoder__find_function() to get a function and associated ELF info
>>> by name.
>>
>> Didn't know about this, thanks. I'll take a look at if the patch can use
>> the existing function metadata. That should get rid of
>> btf_encoder__collect_btf_funcs() if it works.
> 
> I experimented with this a bit and I'm not sure if it's a good approach.
> 
> Here are the two commits:
> 
>         https://pastes.dxuuu.xyz/xo9jwk
>         https://pastes.dxuuu.xyz/xmzew5
> 
> Basically my approach was to fan-in all the function info collected by
> the different threads. I don't think it'll work cuz some of the data
> (the name in particular) in struct elf_function belongs to the thread's
> struct btf_encoder instance. Which is all freed by btf_encoder__delete()
> before btf_encoder__encode().
> 
> It could probably be fixed, but doesn't seem very clean to me. So I
> think it'll be better to keep the code as-is. Unless you were thinking
> something different.
> 

Thanks for trying! We may end up revisiting the freeing of ELF
function/variable info in the future if we add address information from
symbols into BTF, but since that's not there yet, it makes sense to do
your collection separately.

Alan

      reply	other threads:[~2024-03-13  9:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-04 18:40 [PATCH dwarves v4 0/2] pahole: Inject kfunc decl tags into BTF Daniel Xu
2024-02-04 18:40 ` [PATCH dwarves v4 1/2] pahole: Add --btf_feature=decl_tag_kfuncs feature Daniel Xu
2024-02-06 12:47   ` Jiri Olsa
2024-02-06 14:14     ` Alan Maguire
2024-02-04 18:40 ` [PATCH dwarves v4 2/2] pahole: Inject kfunc decl tags into BTF Daniel Xu
2024-02-05 16:54   ` Eduard Zingerman
2024-02-05 23:31   ` Eduard Zingerman
2024-02-28 16:07     ` Daniel Xu
2024-02-28 21:33       ` Eduard Zingerman
2024-03-15 19:43         ` Daniel Xu
2024-02-08 10:00   ` Alan Maguire
2024-02-29  0:57     ` Daniel Xu
2024-03-13  3:17       ` Daniel Xu
2024-03-13  9:36         ` Alan Maguire [this message]

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=f9ab9ab3-c3cb-4a63-bc4e-102b9f6925a9@oracle.com \
    --to=alan.maguire@oracle.com \
    --cc=acme@kernel.org \
    --cc=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dxu@dxuuu.xyz \
    --cc=jolsa@kernel.org \
    --cc=quentin@isovalent.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