public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org
Cc: daniel@iogearbox.net, martin.lau@linux.dev, kernel-team@fb.com,
	yonghong.song@linux.dev, eddyz87@gmail.com
Subject: [PATCH bpf-next v3 02/13] bpf: save subprogram name in bpf_subprog_info
Date: Fri, 10 Apr 2026 02:29:06 -0700	[thread overview]
Message-ID: <20260410-patch-set-v3-2-1f5826dc0ef2@gmail.com> (raw)
In-Reply-To: <20260410-patch-set-v3-0-1f5826dc0ef2@gmail.com>

Subprogram name can be computed from function info and BTF, but it is
convenient to have the name readily available for logging purposes.
Update comment saying that bpf_subprog_info->start has to be the first
field, this is no longer true, relevant sites access .start field
by it's name.

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
---
 include/linux/bpf_verifier.h | 2 +-
 kernel/bpf/verifier.c        | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
index 15f7f9f35be9..cec6054d6333 100644
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@ -664,7 +664,7 @@ enum priv_stack_mode {
 };
 
 struct bpf_subprog_info {
-	/* 'start' has to be the first field otherwise find_subprog() won't work */
+	const char *name; /* name extracted from BTF */
 	u32 start; /* insn idx of function entry point */
 	u32 linfo_idx; /* The idx to the main_prog->aux->linfo */
 	u32 postorder_start; /* The idx to the env->cfg.insn_postorder */
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index dd81cfbad680..cd2a56308e59 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -19682,6 +19682,7 @@ static int check_btf_func(struct bpf_verifier_env *env,
 			goto err_free;
 		}
 
+		env->subprog_info[i].name = btf_name_by_offset(btf, type->name_off);
 		bpfptr_add(&urecord, urec_size);
 	}
 

-- 
2.53.0

  parent reply	other threads:[~2026-04-10  9:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10  9:29 [PATCH bpf-next v3 00/13] bpf: static stack liveness data flow analysis Eduard Zingerman
2026-04-10  9:29 ` [PATCH bpf-next v3 01/13] bpf: share several utility functions as internal API Eduard Zingerman
2026-04-10  9:29 ` Eduard Zingerman [this message]
2026-04-10  9:29 ` [PATCH bpf-next v3 03/13] bpf: Add spis_*() helpers for 4-byte stack slot bitmasks Eduard Zingerman
2026-04-10  9:29 ` [PATCH bpf-next v3 04/13] bpf: make liveness.c track stack with 4-byte granularity Eduard Zingerman
2026-04-10  9:29 ` [PATCH bpf-next v3 05/13] bpf: 4-byte precise clean_verifier_state Eduard Zingerman
2026-04-10  9:29 ` [PATCH bpf-next v3 06/13] bpf: prepare bpf_liveness api for use by static analysis pass Eduard Zingerman
2026-04-10  9:57   ` bot+bpf-ci
2026-04-10  9:29 ` [PATCH bpf-next v3 07/13] bpf: introduce forward arg-tracking dataflow analysis Eduard Zingerman
2026-04-10 10:10   ` bot+bpf-ci
2026-04-10  9:29 ` [PATCH bpf-next v3 08/13] bpf: simplify liveness to use (callsite, depth) keyed func_instances Eduard Zingerman
2026-04-10  9:29 ` [PATCH bpf-next v3 09/13] bpf: change logging scheme for live stack analysis Eduard Zingerman
2026-04-10  9:57   ` bot+bpf-ci
2026-04-10  9:29 ` [PATCH bpf-next v3 10/13] selftests/bpf: update existing tests due to liveness changes Eduard Zingerman
2026-04-10  9:29 ` [PATCH bpf-next v3 11/13] selftests/bpf: adjust verifier_log buffers Eduard Zingerman
2026-04-10  9:29 ` [PATCH bpf-next v3 12/13] selftests/bpf: add new tests for static stack liveness analysis Eduard Zingerman
2026-04-10  9:29 ` [PATCH bpf-next v3 13/13] bpf: poison dead stack slots Eduard Zingerman

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=20260410-patch-set-v3-2-1f5826dc0ef2@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=martin.lau@linux.dev \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox