Thread (9 messages) 9 messages, 4 authors, 2025-07-31

Re: [PATCH] tracing/probes: Allow use of BTF names to dereference pointers

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2025-07-31 22:14:56
Also in: bpf, lkml

On Thu, 31 Jul 2025 23:52:45 +0200
Jiri Olsa [off-list ref] wrote:
quoted
+int btf_find_offset(char *arg, long *offset_p)
+{
+	const struct btf_type *t;
+	struct btf *btf;
+	long offset = 0;
+	char *ptr;
+	int ret;
+	s32 id;
+
+	ptr = strchr(arg, '.');
+	if (!ptr)
+		return -EINVAL;
+
+	*ptr = '\0';
+
+	id = bpf_find_btf_id(arg, BTF_KIND_STRUCT, &btf);  
hi,
I think you need to call btf_put(btf) before return
I think you're correct ;-)

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help