[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190227132130.GF18893@krava>
Date: Wed, 27 Feb 2019 14:21:30 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Song Liu <songliubraving@...com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
ast@...nel.org, daniel@...earbox.net, kernel-team@...com,
peterz@...radead.org, acme@...hat.com, jolsa@...nel.org,
namhyung@...nel.org
Subject: Re: [PATCH v4 perf,bpf 06/15] perf, bpf: save bpf_prog_info in a
rbtree in perf_env
On Mon, Feb 25, 2019 at 04:20:10PM -0800, Song Liu wrote:
SNIP
> @@ -38,6 +116,12 @@ void perf_env__exit(struct perf_env *env)
> zfree(&env->memory_nodes);
> }
>
> +static void init_bpf_rb_trees(struct perf_env *env)
> +{
> + env->bpf_progs.prog_infos = RB_ROOT;
> + init_rwsem(&env->bpf_progs.lock);
> +}
> +
> int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[])
> {
> int i;
> @@ -59,6 +143,7 @@ int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[])
>
> env->nr_cmdline = argc;
>
> + init_bpf_rb_trees(env);
this souldn't be in perf_env__set_cmdline,
it's there to set the cmdline
struct bpf_progs is first in perf_env that
needs other than zero initialization, so
I think we need to add perf_env__init function,
that will do that for all the paths that uses
perf_env
jirka
Powered by blists - more mailing lists