Lines Matching refs:new_expr
1791 struct metric_expr *old_expr, *new_expr; in metricgroup__copy_metric_events() local
1810 new_expr = malloc(sizeof(*new_expr)); in metricgroup__copy_metric_events()
1811 if (!new_expr) in metricgroup__copy_metric_events()
1814 new_expr->metric_expr = old_expr->metric_expr; in metricgroup__copy_metric_events()
1815 new_expr->metric_threshold = old_expr->metric_threshold; in metricgroup__copy_metric_events()
1816 new_expr->metric_name = strdup(old_expr->metric_name); in metricgroup__copy_metric_events()
1817 if (!new_expr->metric_name) in metricgroup__copy_metric_events()
1820 new_expr->metric_unit = old_expr->metric_unit; in metricgroup__copy_metric_events()
1821 new_expr->runtime = old_expr->runtime; in metricgroup__copy_metric_events()
1827 alloc_size = sizeof(*new_expr->metric_refs); in metricgroup__copy_metric_events()
1828 new_expr->metric_refs = calloc(nr + 1, alloc_size); in metricgroup__copy_metric_events()
1829 if (!new_expr->metric_refs) { in metricgroup__copy_metric_events()
1830 free(new_expr); in metricgroup__copy_metric_events()
1834 memcpy(new_expr->metric_refs, old_expr->metric_refs, in metricgroup__copy_metric_events()
1837 new_expr->metric_refs = NULL; in metricgroup__copy_metric_events()
1843 alloc_size = sizeof(*new_expr->metric_events); in metricgroup__copy_metric_events()
1844 new_expr->metric_events = calloc(nr + 1, alloc_size); in metricgroup__copy_metric_events()
1845 if (!new_expr->metric_events) { in metricgroup__copy_metric_events()
1846 zfree(&new_expr->metric_refs); in metricgroup__copy_metric_events()
1847 free(new_expr); in metricgroup__copy_metric_events()
1856 zfree(&new_expr->metric_events); in metricgroup__copy_metric_events()
1857 zfree(&new_expr->metric_refs); in metricgroup__copy_metric_events()
1858 free(new_expr); in metricgroup__copy_metric_events()
1861 new_expr->metric_events[idx] = evsel; in metricgroup__copy_metric_events()
1864 list_add(&new_expr->nd, &new_me->head); in metricgroup__copy_metric_events()