bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ihor Solodrai <ihor.solodrai@linux.dev>
To: Eduard Zingerman <eddyz87@gmail.com>,
	dwarves@vger.kernel.org, alan.maguire@oracle.com,
	acme@kernel.org
Cc: bpf@vger.kernel.org, andrii@kernel.org, ast@kernel.org,
	kernel-team@meta.com
Subject: Re: [PATCH dwarves v2 2/2] btf_encoder: factor out btf_encoder__add_bpf_kfunc()
Date: Tue, 4 Nov 2025 20:04:58 -0800	[thread overview]
Message-ID: <31a3eee0-a3f1-48e4-a577-be4496831647@linux.dev> (raw)
In-Reply-To: <da133e69429c39871b6f4f586ca9843c9e35048e.camel@gmail.com>



On 11/4/25 5:55 PM, Eduard Zingerman wrote:
> On Tue, 2025-11-04 at 15:35 -0800, Ihor Solodrai wrote:
> 
> [...]
> 
>> @@ -1411,6 +1397,28 @@ static int32_t btf_encoder__add_func(struct btf_encoder *encoder,
>>  		return -1;
>>  	}
>>  
>> +	return btf_fn_id;
>> +}
>> +
>> +static int btf_encoder__add_bpf_kfunc(struct btf_encoder *encoder,
>> +				      struct btf_encoder_func_state *state)
>> +{
> 
> As with previous iteration, 'state' has a link to 'encoder', so there
> is no need to pass it as a parameter.

You're right. I fixed this up in the first patch, but haven't noticed 
the same thing in the second. Will fix and send a v3.

> 
>> +	int btf_fn_id, err;
>> +
>> +	if (encoder->tag_kfuncs && encoder->encode_attributes)
>> +		if (btf__add_bpf_arena_type_tags(encoder->btf, state) < 0)
>> +			return -1;
>> +
>> +	btf_fn_id = btf_encoder__add_func(encoder, state);
>> +	if (btf_fn_id < 0)
>> +		return -1;
>> +
>> +	if (encoder->tag_kfuncs && !encoder->skip_encoding_decl_tag) {
>> +		err = btf__tag_kfunc(encoder->btf, state->elf, btf_fn_id);
>> +		if (err < 0)
>> +			return -1;
>> +	}
>> +
>>  	return 0;
>>  }
> 
> [...]


      reply	other threads:[~2025-11-05  4:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04 23:35 [PATCH dwarves v2 0/2] btf_encoder: refactor emission of BTF funcs Ihor Solodrai
2025-11-04 23:35 ` [PATCH dwarves v2 1/2] btf_encoder: refactor btf_encoder__add_func_proto Ihor Solodrai
2025-11-05  1:45   ` Eduard Zingerman
2025-11-04 23:35 ` [PATCH dwarves v2 2/2] btf_encoder: factor out btf_encoder__add_bpf_kfunc() Ihor Solodrai
2025-11-05  1:55   ` Eduard Zingerman
2025-11-05  4:04     ` Ihor Solodrai [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=31a3eee0-a3f1-48e4-a577-be4496831647@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 \
    /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).