Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp10660ybg; Tue, 2 Jun 2020 14:50:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEz/Fv8gHAy/1FeN3ujfXroHmUYF02ZkgOc3r6olRdNVJN5zlNbT8IzHACpGxOW1z721D9 X-Received: by 2002:a50:9547:: with SMTP id v7mr29883666eda.78.1591134631065; Tue, 02 Jun 2020 14:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591134631; cv=none; d=google.com; s=arc-20160816; b=Y8RrSrG6vEbF60s0W7z84boFjOmw/ZhKdn8wFlqWrX+JGudu+voayzHv+k68eWg7cZ 6Yfj+VgHH2ftFWizk1y42zKK2HgH0zdNpV/PZlyab0HuSdhmDRib0IpvcgQN4TavertC pkmqKCcdmd+0YUXxc2yFRHKasnbIRRn1K5RjxXVSmszg4/IOvir3BoBkEgr9MQURis/D k4bxO0Pwl8P7nSvva4qvOvTk7SJTVzNJU3bjdwwZsSgRTYvHViRYoVTL1sPPxQJst77I yILKmue+Df+hKQmM0Uz6c4Zgi8S1MiiKk4WLkA0KbKrXn8LRwYxzYznVYS4n9mJgx/GF Z7Ig== 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=qgIOEXH3SDeeR+od5/ERrPzYyOCmE6UgFkpmyBWgGco=; b=ghp9IsrTNUtPbU9O6DNe0+wpuuTR1MbxzWBpLGuKYScw7Y0GtQyQYI41VPT3BIipAc mVLWiVnA/zorn36V/tZ+xM9/i8tbs9BO4DjjvkSi+aK0kcOPvSKAR+9pOOXd2HWyrrbV HXwhMvBQltFKDzolF6oQv+35ilhQio4VtIzPFZMIzT4FMXtaxqH1T/baV7nxH02uiRWC 45iuLjmRJ+4wWUF5jbjP8jdRNi10k6D6fKS8xbud+OICaCriKy94ZGqtEWQfQ8w4eRnF Dzh6HdBBLUtw4SFWbMLJHmhSNnv5rpXpqE2MN2vviR+T6t3b/UCXvJkcgWhHB8hcR8af Jb7g== 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 l10si2563927edi.562.2020.06.02.14.50.08; Tue, 02 Jun 2020 14:50:31 -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 S1728376AbgFBVsN convert rfc822-to-8bit (ORCPT + 99 others); Tue, 2 Jun 2020 17:48:13 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:28198 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726130AbgFBVsL (ORCPT ); Tue, 2 Jun 2020 17:48:11 -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-106-5rEJLBUfPDi1AZxoAlMPlw-1; Tue, 02 Jun 2020 17:48:05 -0400 X-MC-Unique: 5rEJLBUfPDi1AZxoAlMPlw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 06B7C1856941; Tue, 2 Jun 2020 21:48:04 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.192.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id 494201BCBE; Tue, 2 Jun 2020 21:47:57 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Ian Rogers , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Stephane Eranian , Andi Kleen Subject: [PATCH 05/13] perf tools: Factor out parse_groups function Date: Tue, 2 Jun 2020 23:47:33 +0200 Message-Id: <20200602214741.1218986-6-jolsa@kernel.org> In-Reply-To: <20200602214741.1218986-1-jolsa@kernel.org> References: <20200602214741.1218986-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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. Acked-by: Ian Rogers 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