hum, where? you call expr__find_other and continue to nextSure, but we will restart anyway.So expr__find_other() may add a new item to pctx->ids, and we always iteratehm, I don't see that.. so, what you do is:
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
pctx->ids item
Regardless of this, I don't think what I am doing is safe, i.e. adding newit'll always add items in the middle of the iteration
items in the middle of the iter, so I will change in the way you suggest.