Lines Matching refs:new_expr
1171 struct metric_expr *old_expr, *new_expr; in metricgroup__copy_metric_events() local
1190 new_expr = malloc(sizeof(*new_expr)); in metricgroup__copy_metric_events()
1191 if (!new_expr) in metricgroup__copy_metric_events()
1194 new_expr->metric_expr = old_expr->metric_expr; in metricgroup__copy_metric_events()
1195 new_expr->metric_name = old_expr->metric_name; in metricgroup__copy_metric_events()
1196 new_expr->metric_unit = old_expr->metric_unit; in metricgroup__copy_metric_events()
1197 new_expr->runtime = old_expr->runtime; in metricgroup__copy_metric_events()
1203 alloc_size = sizeof(*new_expr->metric_refs); in metricgroup__copy_metric_events()
1204 new_expr->metric_refs = calloc(nr + 1, alloc_size); in metricgroup__copy_metric_events()
1205 if (!new_expr->metric_refs) { in metricgroup__copy_metric_events()
1206 free(new_expr); in metricgroup__copy_metric_events()
1210 memcpy(new_expr->metric_refs, old_expr->metric_refs, in metricgroup__copy_metric_events()
1213 new_expr->metric_refs = NULL; in metricgroup__copy_metric_events()
1219 alloc_size = sizeof(*new_expr->metric_events); in metricgroup__copy_metric_events()
1220 new_expr->metric_events = calloc(nr + 1, alloc_size); in metricgroup__copy_metric_events()
1221 if (!new_expr->metric_events) { in metricgroup__copy_metric_events()
1222 free(new_expr->metric_refs); in metricgroup__copy_metric_events()
1223 free(new_expr); in metricgroup__copy_metric_events()
1232 free(new_expr->metric_events); in metricgroup__copy_metric_events()
1233 free(new_expr->metric_refs); in metricgroup__copy_metric_events()
1234 free(new_expr); in metricgroup__copy_metric_events()
1237 new_expr->metric_events[idx] = evsel; in metricgroup__copy_metric_events()
1240 list_add(&new_expr->nd, &new_me->head); in metricgroup__copy_metric_events()