mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: Add the missing types in the logs
@ 2026-01-28  8:58 Feng Yang
  2026-01-28 14:10 ` Mykyta Yatsenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Feng Yang @ 2026-01-28  8:58 UTC (permalink / raw)
  To: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song,
	john.fastabend, kpsingh, sdf, haoluo, jolsa
  Cc: bpf, linux-kernel

From: Feng Yang <yangfeng@kylinos.cn>

Add the missing types to avoid such uninformative errors as shown below:
R1 type=ptr_ expected=ptr_

Signed-off-by: Feng Yang <yangfeng@kylinos.cn>
---
 kernel/bpf/log.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/kernel/bpf/log.c b/kernel/bpf/log.c
index a0c3b35de2ce..6fee3d8b3703 100644
--- a/kernel/bpf/log.c
+++ b/kernel/bpf/log.c
@@ -473,14 +473,26 @@ const char *reg_type_str(struct bpf_verifier_env *env, enum bpf_reg_type type)
 			strscpy(postfix, "_or_null");
 	}
 
-	snprintf(prefix, sizeof(prefix), "%s%s%s%s%s%s%s",
+	snprintf(prefix, sizeof(prefix), "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
 		 type & MEM_RDONLY ? "rdonly_" : "",
 		 type & MEM_RINGBUF ? "ringbuf_" : "",
 		 type & MEM_USER ? "user_" : "",
 		 type & MEM_PERCPU ? "percpu_" : "",
 		 type & MEM_RCU ? "rcu_" : "",
 		 type & PTR_UNTRUSTED ? "untrusted_" : "",
-		 type & PTR_TRUSTED ? "trusted_" : ""
+		 type & PTR_TRUSTED ? "trusted_" : "",
+		 type & MEM_UNINIT ? "uninit_" : "",
+		 type & DYNPTR_TYPE_LOCAL ? "dynptr_local_" : "",
+		 type & DYNPTR_TYPE_RINGBUF ? "dynptr_ringbuf_" : "",
+		 type & MEM_FIXED_SIZE ? "fixed_size_" : "",
+		 type & MEM_ALLOC ? "alloc_" : "",
+		 type & NON_OWN_REF ? "non_own_ref_" : "",
+		 type & DYNPTR_TYPE_SKB ? "dynptr_skb_" : "",
+		 type & DYNPTR_TYPE_XDP ? "dynptr_xdp_" : "",
+		 type & MEM_ALIGNED ? "aligned_" : "",
+		 type & MEM_WRITE ? "write_" : "",
+		 type & DYNPTR_TYPE_SKB_META ? "dynptr_skb_meta_" : "",
+		 type & DYNPTR_TYPE_FILE ? "dynptr_file_" : ""
 	);
 
 	snprintf(env->tmp_str_buf, TMP_STR_BUF_LEN, "%s%s%s",
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-28 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-28  8:58 [PATCH bpf-next] bpf: Add the missing types in the logs Feng Yang
2026-01-28 14:10 ` Mykyta Yatsenko
2026-01-28 14:45 ` kernel test robot
2026-01-28 15:26 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®