{
struct pmu_event *pe;
struct egroup *eg;
+ LIST_HEAD(list);
int i, ret;
bool has_match = false;
has_match = true;
eg = NULL;
- ret = add_metric(group_list, pe, metric_no_group, &eg);
+ ret = add_metric(&list, pe, metric_no_group, &eg);
if (ret)
return ret;
* included in the expression.
*/
ret = resolve_metric(metric_no_group,
- group_list, map);
+ &list, map);
if (ret)
return ret;
}
if (!has_match)
return -EINVAL;
- list_for_each_entry(eg, group_list, nd) {
+ list_for_each_entry(eg, &list, nd) {
if (events->len > 0)
strbuf_addf(events, ",");
&eg->pctx);
}
}
+
+ list_splice(&list, group_list);
return 0;
}