public inbox for dwarves@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ihor Solodrai" <ihor.solodrai@linux.dev>
To: "Alan Maguire" <alan.maguire@oracle.com>,
	dwarves@vger.kernel.org, bpf@vger.kernel.org
Cc: acme@kernel.org, ast@kernel.org, andrii@kernel.org,
	eddyz87@gmail.com, mykolal@fb.com, kernel-team@meta.com
Subject: Re: [PATCH dwarves v4 0/6] btf_encoder: emit type tags for bpf_arena pointers
Date: Mon, 24 Mar 2025 18:47:54 +0000	[thread overview]
Message-ID: <458b2ae24972021b99e99c2bad19b524672b0ac0@linux.dev> (raw)
In-Reply-To: <68a594e38c00ff3dd30d0a13fb1e1de71f19954c@linux.dev>

On 3/24/25 11:07 AM, Ihor Solodrai wrote:
> On 3/23/25 4:11 AM, Alan Maguire wrote:
>> [...]
>>
>> hi Ihor, I took a look at the series and merged it with latest next
>> branch; results are in
>>
>> https://web.git.kernel.org/pub/scm/devel/pahole/pahole.git/log/?h=next.attributes-v4
>>
>> ...if you want to take a look.
>>
>> There are a few small things I think that it would be good to resolve
>> before landing this.
>>
>> First, when testing this with -DLIBBPF_EMBEDDED=OFF and a packaged
>> libbpf 1.5 - which means we wouldn't have the latest attributes-related
>> libbpf function; I saw:
>>
>>   BTF     .tmp_vmlinux1.btf.o
>> btf__add_type_attr is not available, is libbpf < 1.6?
>> error: failed to encode function 'bbr_cwnd_event': invalid proto
>> Failed to encode BTF
>>   NM      .tmp_vmlinux1.syms
>
> Hi Alan. Thanks for testing. This is my mistake, I should've checked
> for attributes feature here:
>
> @@ -731,6 +812,10 @@ static int32_t btf_encoder__add_func_proto(struct btf_encoder *encoder, struct f
>  
>  	assert(ftype != NULL || state != NULL);
>  
> +	if (is_kfunc_state(state) && encoder->tag_kfuncs)
> +		if (btf__add_bpf_arena_type_tags(encoder->btf, state) < 0)
> +			return -1;

Actually, I added this check in a different patch so the failure must
have happened in a different place.

In any case, the point remains that it's better to check for feature
availability (hence for API availability) in one place. Your
suggestion to add a feature check makes sense to me. Thank you.

> [...]

  reply	other threads:[~2025-03-24 18:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28 19:46 [PATCH dwarves v4 0/6] btf_encoder: emit type tags for bpf_arena pointers Ihor Solodrai
2025-02-28 19:46 ` [PATCH dwarves v4 1/6] btf_encoder: refactor btf_encoder__tag_kfuncs() Ihor Solodrai
2025-02-28 19:46 ` [PATCH dwarves v4 2/6] btf_encoder: use __weak declarations of version-dependent libbpf API Ihor Solodrai
2025-02-28 19:53   ` Ihor Solodrai
2025-03-06 17:14     ` Alan Maguire
2025-02-28 19:46 ` [PATCH dwarves v4 3/6] pahole: sync with libbpf mainline Ihor Solodrai
2025-02-28 19:46 ` [PATCH dwarves v4 4/6] btf_encoder: emit type tags for bpf_arena pointers Ihor Solodrai
2025-02-28 19:46 ` [PATCH dwarves v4 5/6] pahole: introduce --btf_feature=attributes Ihor Solodrai
2025-02-28 19:46 ` [PATCH dwarves v4 6/6] man-pages: describe attributes and remove reproducible_build Ihor Solodrai
2025-03-20 16:32 ` [PATCH dwarves v4 0/6] btf_encoder: emit type tags for bpf_arena pointers Ihor Solodrai
2025-03-20 20:34   ` Alan Maguire
2025-03-23 11:11     ` Alan Maguire
2025-03-24 18:07       ` Ihor Solodrai
2025-03-24 18:47         ` Ihor Solodrai [this message]
2025-03-25  9:59           ` Alan Maguire
2025-03-26 17:41             ` Ihor Solodrai
2025-03-27  8:22               ` Alan Maguire
2025-03-27 15:33                 ` Ihor Solodrai
2025-03-27 15:40                   ` Alan Maguire

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=458b2ae24972021b99e99c2bad19b524672b0ac0@linux.dev \
    --to=ihor.solodrai@linux.dev \
    --cc=acme@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dwarves@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=mykolal@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