[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <A3C4DDC9-8E20-488C-A273-E3AE163A9774@fb.com>
Date: Wed, 17 Apr 2019 16:49:13 +0000
From: Song Liu <songliubraving@...com>
To: Jiri Olsa <jolsa@...nel.org>
CC: Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
lkml <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH] perf bpf: Return NULL when RB tree lookup fails in
perf_env__find_btf()
> On Apr 17, 2019, at 7:55 AM, Jiri Olsa <jolsa@...nel.org> wrote:
>
> We currently don't return NULL in case we don't find the
> bpf_prog_info_node, fixing that.
>
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
> Cc: Namhyung Kim <namhyung@...nel.org>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Song Liu <songliubraving@...com>
> Fixes: 3792cb2ff43b ("perf bpf: Save BTF in a rbtree in perf_env")
> Link: http://lkml.kernel.org/n/tip-99g9rg4p20a1o99vr0nkjhq8@git.kernel.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Acked-by: Song Liu <songliubraving@...com>
Thanks again for the fix!
> ---
> tools/perf/util/env.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
> index 34a363f2e71b..9494f9dc61ec 100644
> --- a/tools/perf/util/env.c
> +++ b/tools/perf/util/env.c
> @@ -111,10 +111,12 @@ struct btf_node *perf_env__find_btf(struct perf_env *env, __u32 btf_id)
> else if (btf_id > node->id)
> n = n->rb_right;
> else
> - break;
> + goto out;
> }
> + node = NULL;
>
> up_read(&env->bpf_progs.lock);
> +out:
> return node;
> }
>
> --
> 2.17.2
>
Powered by blists - more mailing lists