Re: [PATCH v2 04/10] perf util: Add rbtree node_delete ops

Jiri Olsa
2017-11-28T11:12:29Z

On Mon, Nov 27, 2017 at 10:07:24PM +0800, Jin Yao wrote:

SNIP

> @@ -124,13 +137,25 @@ static struct saved_value *saved_value_lookup(struct perf_evsel *evsel,
> return NULL;
> }
>
> +void runtime_stat__init(struct runtime_stat *stat)
> +{
> + struct rblist *rblist = &stat->value_list;
> +
> + rblist__init(rblist);
> + rblist->node_cmp = saved_value_cmp;
> + rblist->node_new = saved_value_new;
> + rblist->node_delete = saved_value_delete;
> +}
> +
> +void runtime_stat__free(struct runtime_stat *stat)
> +{
> + rblist__reset(&stat->value_list);
> +}
> +
> void perf_stat__init_shadow_stats(void)
> {
> have_frontend_stalled = pmu_have_event("cpu", "stalled-cycles-frontend");
> - rblist__init(&runtime_saved_values);
> - runtime_saved_values.node_cmp = saved_value_cmp;
> - runtime_saved_values.node_new = saved_value_new;
> - /* No delete for now */

hum, you should you remove this at the switching point
to keep it bisectable.. now it crashes:

[jolsa@krava perf]$ sudo ./perf stat -M Summary --metric-only -a sleep 1
Segmentation fault

jirka