[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250731181503.2662c1c7@gandalf.local.home>
Date: Thu, 31 Jul 2025 18:15:03 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Jiri Olsa <olsajiri@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>, Linux trace kernel
<linux-trace-kernel@...r.kernel.org>, bpf@...r.kernel.org, Masami Hiramatsu
<mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Mark Rutland <mark.rutland@....com>, Peter Zijlstra <peterz@...radead.org>,
Namhyung Kim <namhyung@...nel.org>, Takaya Saeki <takayas@...gle.com>,
Douglas Raillard <douglas.raillard@....com>, Tom Zanussi
<zanussi@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>, Thomas
Gleixner <tglx@...utronix.de>, Ian Rogers <irogers@...gle.com>,
aahringo@...hat.com
Subject: Re: [PATCH] tracing/probes: Allow use of BTF names to dereference
pointers
On Thu, 31 Jul 2025 23:52:45 +0200
Jiri Olsa <olsajiri@...il.com> wrote:
> > +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
Powered by blists - more mailing lists