[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190307140540.GB7233@krava>
Date: Thu, 7 Mar 2019 15:05:40 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Song Liu <songliubraving@...com>
Cc: bpf@...r.kernel.org, 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 v6 perf,bpf 08/15] perf, bpf: save btf in a rbtree in
perf_env
On Tue, Mar 05, 2019 at 11:13:52PM -0800, Song Liu wrote:
SNIP
> /* purge data in bpf_progs.infos tree */
> static void perf_env__purge_bpf(struct perf_env *env)
> {
> @@ -82,6 +133,19 @@ static void perf_env__purge_bpf(struct perf_env *env)
> rb_erase_init(&node->rb_node, root);
> free(node);
> }
> +
> + root = &env->bpf_progs.btfs;
> + next = rb_first(root);
> +
> + while (next) {
> + struct btf_node *node;
> +
> + node = rb_entry(next, struct btf_node, rb_node);
> + next = rb_next(&node->rb_node);
> + rb_erase_init(&node->rb_node, root);
hum rb_erase should be enough when we are removingfreeing the node right
after.. also for the struct bpf_prog_info_node up
jirka
> + free(node);
> + }
SNIP
Powered by blists - more mailing lists