hm, I don't see that.. so, what you do is:Hi Jirka,+ ref = &metric->metric_ref;
+ ref->metric_name = pe->metric_name;
+ ref->metric_expr = pe->metric_expr;
+ list_add_tail(&metric->list, compound_list);
+
+ rc = expr__find_other(pe->metric_expr, NULL, pctx, 0);
so this might add new items to pctx->ids, I think you needI thought that I was doing this. Indeed, this code is very much like
to restart the iteration as we do it in __resolve_metric
otherwise you could miss some new keys
__resolve_metric();)
So expr__find_other() may add a new item to pctx->ids, and we always iterate
again, and try to lookup any pmu_events, *, above. If none exist, then we
hashmap__for_each_entry_safe((&pctx->ids) ....) {
rc = expr__find_other(pe->metric_expr, NULL, pctx, 0);
}
and what I think we need to do is:
hashmap__for_each_entry_safe((&pctx->ids) ....) {
rc = expr__find_other(pe->metric_expr, NULL, pctx, 0);
break;
}
each time you resolve another metric, you need to restart
the pctx->ids iteration, because there will be new items,
and we are in the middle of it