Lines Matching refs:new_expr

1556 		struct metric_expr *old_expr, *new_expr;  in metricgroup__copy_metric_events()  local
1575 new_expr = malloc(sizeof(*new_expr)); in metricgroup__copy_metric_events()
1576 if (!new_expr) in metricgroup__copy_metric_events()
1579 new_expr->metric_expr = old_expr->metric_expr; in metricgroup__copy_metric_events()
1580 new_expr->metric_name = strdup(old_expr->metric_name); in metricgroup__copy_metric_events()
1581 if (!new_expr->metric_name) in metricgroup__copy_metric_events()
1584 new_expr->metric_unit = old_expr->metric_unit; in metricgroup__copy_metric_events()
1585 new_expr->runtime = old_expr->runtime; in metricgroup__copy_metric_events()
1591 alloc_size = sizeof(*new_expr->metric_refs); in metricgroup__copy_metric_events()
1592 new_expr->metric_refs = calloc(nr + 1, alloc_size); in metricgroup__copy_metric_events()
1593 if (!new_expr->metric_refs) { in metricgroup__copy_metric_events()
1594 free(new_expr); in metricgroup__copy_metric_events()
1598 memcpy(new_expr->metric_refs, old_expr->metric_refs, in metricgroup__copy_metric_events()
1601 new_expr->metric_refs = NULL; in metricgroup__copy_metric_events()
1607 alloc_size = sizeof(*new_expr->metric_events); in metricgroup__copy_metric_events()
1608 new_expr->metric_events = calloc(nr + 1, alloc_size); in metricgroup__copy_metric_events()
1609 if (!new_expr->metric_events) { in metricgroup__copy_metric_events()
1610 free(new_expr->metric_refs); in metricgroup__copy_metric_events()
1611 free(new_expr); in metricgroup__copy_metric_events()
1620 free(new_expr->metric_events); in metricgroup__copy_metric_events()
1621 free(new_expr->metric_refs); in metricgroup__copy_metric_events()
1622 free(new_expr); in metricgroup__copy_metric_events()
1625 new_expr->metric_events[idx] = evsel; in metricgroup__copy_metric_events()
1628 list_add(&new_expr->nd, &new_me->head); in metricgroup__copy_metric_events()