All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: acme@kernel.org, ast@kernel.org, andrii@kernel.org,
	eddyz87@gmail.com, qmo@kernel.org, dwarves@vger.kernel.org,
	daniel@iogearbox.net, ihor.solodrai@linux.dev,
	yonghong.song@linux.dev, song@kernel.org, martin.lau@linux.dev,
	memxor@gmail.com, emil@etsalapatis.com, bpf@vger.kernel.org,
	nsc@kernel.org, puranjay@kernel.org, yatsenko@meta.com
Subject: Re: [PATCH v5 dwarves 05/10] pahole: Support inline BTF location encoding
Date: Fri, 9 Oct 2026 15:12:20 +0200	[thread overview]
Message-ID: <asjoNE3H9ZqL4rsR@krava> (raw)
In-Reply-To: <20261002174043.3823987-6-alan.maguire@oracle.com>

On Fri, Oct 02, 2026 at 06:40:33PM +0100, Alan Maguire wrote:

SNIP

> +static int btf_encoder__add_inline_expansion(struct btf_encoder *encoder,
> +					     struct inline_expansion *ie)
> +{
> +	struct ftype *ftype;
> +	struct loc *loc;
> +	struct parameter *param;
> +	uint32_t section_idx, section_offset;
> +	int err;
> +
> +	if (!ie->function || !ie->name ||
> +	    !btf_encoder__inline_addr_to_section(encoder, ie->ip.addr,
> +						 &section_idx, &section_offset))
> +		return 0;

hi,
we get inline locations also from .init.text, which then fail kprobe
address validation.. is there some usecase for keeping .init.text
locations?

I currently disable them in kprobe_multi change I have on top of this,
but I wonder we could just drop them completely in here with something
like:

	if (strstarts(encoder->secinfo[section_idx].name, ".init"))
		return 0;

thanks,
jirka


> +	ftype = &ie->function->proto;
> +	loc = calloc(1, sizeof(*loc));
> +	if (!loc)
> +		return -ENOMEM;
> +	loc->name = strdup(ie->name);
> +	if (!loc->name) {
> +		err = -ENOMEM;
> +		goto out;
> +	}
> +	loc->section_idx = section_idx;
> +	loc->section_offset = section_offset;
> +	loc->nparams = ftype->nr_parms + (ftype->unspec_parms ? 1 : 0);
> +	loc->params = calloc(loc->nparams ? loc->nparams : 1, sizeof(*loc->params));
> +	if (!loc->params) {
> +		err = -ENOMEM;
> +		goto out;
> +	}
> +	inline_expansion__for_each_parameter(ie, param) {
> +		if (param->idx < loc->nparams)
> +			btf_encoder__add_loc_param(param, encoder->addr_base,
> +						   &loc->params[param->idx]);
> +	}
> +	err = btf_encoder__save_func(encoder, ie->function, NULL, loc);
> +	loc = NULL; /* save_func owns loc after this point, including on error */
> +	if (!err)
> +		return 0;
> +out:
> +	loc__delete(loc);
> +	return err;
> +}
> +

SNIP

  reply	other threads:[~2026-10-09 13:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 17:40 [PATCH v5 dwarves 00/10] Encoding of inline functions using BTF Alan Maguire
2026-10-02 17:40 ` [PATCH v5 dwarves 01/10] dwarf_loader: Add parameter list to inline expansions Alan Maguire
2026-10-02 17:40 ` [PATCH v5 dwarves 02/10] dwarf_loader: Recode inline expansion parameter types Alan Maguire
2026-10-02 17:40 ` [PATCH v5 dwarves 03/10] dwarf_loader: Resolve inline expansion names during recoding Alan Maguire
2026-10-02 17:40 ` [PATCH v5 dwarves 04/10] dwarf_loader: Collect inline expansion location data Alan Maguire
2026-10-02 17:40 ` [PATCH v5 dwarves 05/10] pahole: Support inline BTF location encoding Alan Maguire
2026-10-09 13:12   ` Jiri Olsa [this message]
2026-10-09 17:32     ` Alan Maguire
2026-10-11 10:57       ` Jiri Olsa
2026-10-02 17:40 ` [PATCH v5 dwarves 06/10] btf_loader: Add "inline" annotation for inlined functions Alan Maguire
2026-10-02 17:40 ` [PATCH v5 dwarves 07/10] btf_loader: Record inline sites in CU for BTF Alan Maguire
2026-10-02 17:40 ` [PATCH v5 dwarves 08/10] pfunct: Print inline site information Alan Maguire
2026-10-02 17:40 ` [PATCH v5 dwarves 09/10] tests: Validate inline BTF encoding Alan Maguire
2026-10-02 17:40 ` [PATCH v5 dwarves 10/10] man-pages: Document --inline_sites option Alan Maguire
2026-10-03 10:13 ` [PATCH v5 dwarves 00/10] Encoding of inline functions using BTF 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=asjoNE3H9ZqL4rsR@krava \
    --to=olsajiri@gmail.com \
    --cc=acme@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dwarves@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=nsc@kernel.org \
    --cc=puranjay@kernel.org \
    --cc=qmo@kernel.org \
    --cc=song@kernel.org \
    --cc=yatsenko@meta.com \
    --cc=yonghong.song@linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.