Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1232023ybg; Tue, 2 Jun 2020 04:53:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYFbk5BpyHkZHe+O7HwXSSOpG11Tx7uPtFMRf3+VmOkUDCVVpsQtqnT5hi/I7Np06QrY/m X-Received: by 2002:aa7:c69a:: with SMTP id n26mr6091778edq.2.1591098827846; Tue, 02 Jun 2020 04:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591098827; cv=none; d=google.com; s=arc-20160816; b=t2jYrsDbtizQZmrO0gmKzMD3XGlbLr3SiaVlUUqhV+c6XSrsQVbuQ/WaInffoQS2qE liPOkp+t0cG81ItoUJfqmX3sowiNkkDkiMq4BWl81wWIYLjhYSHKe9QZrj4gGhnbvDxm 1h6XKNj8X5+PqdrKIP2a2MC0P8FoqB0TAxseUz6FcLjpzAfj0EYD08x8T6+BP1bpd8WX 16aXHamgYo736xHYYd7jIpPxvWAEq5Hb6k78PA874uORmzMKLqteMitSq5c63Cy/+dFD LK60blID/yw3nj1YmsauxCFhdcdaj20sb8O4MtH/40tGiuhSdm+1GBr3jA8sNlRVgM// pvKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bSlbuidLYDetBwSiwuXcEvs0KZsaQ27b13HtmKfo2Ng=; b=KRx5Xpu9famUm+29z/tWKuBGd2zjCk15OdEW7AZYtOxE6Slm7Tta99nPwNeolRJ6f8 ewO5jE+XddDoFydvfyYxQpEhTq+VY0P5MPCw9myjjF3Whl6Ie3FqVKBtq7qf/wVG9j5Z 5YtH7gbxM+HWlXGMDh8YUdATlpo/ZUuGaFPqLTgJbz1FxmxTMnoVA8BEO03GYJSZSDkU JTqKsCdUZQ4ucQUUX/NH70JpD9rN4tt4dMEVZGz+28OVJZZY0+9Z8ZCVRkLyOuZTfTD2 Ol3kHx7BUw578vSI5wjBuFFJVm4ELxpvT/dQiZ4Dn2l58khZzBm5fDdsEx/4ADCMcvwQ gXVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz17si1394426ejb.243.2020.06.02.04.53.25; Tue, 02 Jun 2020 04:53:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728080AbgFBLv0 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 2 Jun 2020 07:51:26 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:22258 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727863AbgFBLvY (ORCPT ); Tue, 2 Jun 2020 07:51:24 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-27-HgSuWPNbPmOd7xNLz4q4_A-1; Tue, 02 Jun 2020 07:51:14 -0400 X-MC-Unique: HgSuWPNbPmOd7xNLz4q4_A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B63D2107ACF4; Tue, 2 Jun 2020 11:51:12 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.195.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B1F610013D7; Tue, 2 Jun 2020 11:51:10 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Ian Rogers , Stephane Eranian , Andi Kleen Subject: [PATCH 05/13] perf tools: Factor out parse_groups function Date: Tue, 2 Jun 2020 13:50:47 +0200 Message-Id: <20200602115055.1168446-6-jolsa@kernel.org> In-Reply-To: <20200602115055.1168446-1-jolsa@kernel.org> References: <20200602115055.1168446-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Factor out the parse_groups function, it will be used for new test interface coming in following changes. Signed-off-by: Jiri Olsa --- tools/perf/util/metricgroup.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index 9a90afb4428c..47afe5867f9b 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -709,14 +709,12 @@ static void metricgroup__free_egroups(struct list_head *group_list) } } -int metricgroup__parse_groups(const struct option *opt, - const char *str, - bool metric_no_group, - bool metric_no_merge, - struct rblist *metric_events) +static int parse_groups(struct evlist *perf_evlist, const char *str, + bool metric_no_group, + bool metric_no_merge, + struct rblist *metric_events) { struct parse_events_error parse_error; - struct evlist *perf_evlist = *(struct evlist **)opt->value; struct strbuf extra_events; LIST_HEAD(group_list); int ret; @@ -742,6 +740,18 @@ int metricgroup__parse_groups(const struct option *opt, return ret; } +int metricgroup__parse_groups(const struct option *opt, + const char *str, + bool metric_no_group, + bool metric_no_merge, + struct rblist *metric_events) +{ + struct evlist *perf_evlist = *(struct evlist **)opt->value; + + return parse_groups(perf_evlist, str, metric_no_group, + metric_no_merge, metric_events); +} + bool metricgroup__has_metric(const char *metric) { struct pmu_events_map *map = perf_pmu__find_map(NULL); -- 2.25.4