lkml.org 
[lkml]   [2019]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9 perf,bpf 06/15] perf, bpf: save bpf_prog_info in a rbtree in perf_env
On Mon, Mar 11, 2019 at 10:30:42PM -0700, Song Liu wrote:

SNIP

> +/* purge data in bpf_progs.infos tree */
> +static void perf_env__purge_bpf(struct perf_env *env)
> +{
> + struct rb_root *root;
> + struct rb_node *next;
> +
> + down_write(&env->bpf_progs.lock);
> +
> + root = &env->bpf_progs.infos;
> + next = rb_first(root);
> +
> + while (next) {
> + struct bpf_prog_info_node *node;
> +
> + node = rb_entry(next, struct bpf_prog_info_node, rb_node);
> + next = rb_next(&node->rb_node);
> + rb_erase(&node->rb_node, root);
> + free(node);
> + }

env->bpf_progs.infos_cnt = 0; ?

but it's probably not needed given the current usage

jirka

> + up_write(&env->bpf_progs.lock);
> +}

SNIP

\
 
 \ /
  Last update: 2019-03-12 14:11    [W:0.159 / U:71.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site