Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp613394ybs; Sun, 24 May 2020 15:45:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdgHawu/fdwlB4LYqvBPNhE1Shrw5jCbZ1k6s9Ge/XSZ+iLJ5ns7tvSXZnuQaizUjbrMir X-Received: by 2002:a17:906:e0c7:: with SMTP id gl7mr16313911ejb.306.1590360310416; Sun, 24 May 2020 15:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590360310; cv=none; d=google.com; s=arc-20160816; b=RpgDa+8GqW+ZOlGW+1nH8IBUMHBEOFKJXftdXH73ipzfqNVM9n3q+xs2V9QJRNG302 4kzPbeSkxHFWlvQL9HCxQzavk5VVhBnvB4VCG/g5zPfmG4QCUHKEyEyzOAHdJ1l0bxr5 fd/mxbRhkOoem6Qr00DmD3/gk/G2qJEeLFXKhb9C/kGHzFMV4r3Vof9P6p84d6+gEnV/ 1S2gLBPuFcVZfgLcAa+DFuCRQ25fkavHXJBnzmmTGIYWpGd/wMAowzuZDQpJPZoGCv8V KHG5oxAnPAK7zkddGNDpz904+zEO2MDJ7x4ItpdJUxplOBXdFdRlIOfzwQQ20gjnwcDw AIYQ== 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=XgyrMot1gWqLVPhhD5Fi8Nam1/vuL4fJhQQEKVhElrQ=; b=H6nOGpbhjzwY/Z0WO0RABLS4wcLZYo+ZgXuz0nUr3yJFXxVqY9D7X8DSR7D4SlC7ds FymaujSBEXToX2TC5vTqG2yQ0633pzAF39C8CCXIdTeE15vCMwqYuFXJA13ZqumGLewV RXQSOaruPE8Cm27P+NMF9cDZI3wSWy9tfhcOd+xdaZ3zgAJRHJnSdCQOABIfmHcNeGtl 6Q48SuP7Cn6TL1cQh39mz7vakzIQy4pb9eoyGsY337IWdEekVLEXBDJE5IeIfNYw6nJD wJsYDLfInk4ZpqQw+ta82fSBiQUrbDFiCPNL3LT+Ih5p6H+KUn3v7BTwyD8mwQhqhY1e DVww== 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 lc10si8588352ejb.156.2020.05.24.15.44.47; Sun, 24 May 2020 15:45:10 -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 S2388581AbgEXWmu convert rfc822-to-8bit (ORCPT + 99 others); Sun, 24 May 2020 18:42:50 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:52367 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388521AbgEXWmt (ORCPT ); Sun, 24 May 2020 18:42:49 -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-382-_sMYe6SQPlWCc_nssQ11zw-1; Sun, 24 May 2020 18:42:46 -0400 X-MC-Unique: _sMYe6SQPlWCc_nssQ11zw-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 07DB0BFC1; Sun, 24 May 2020 22:42:45 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFEE15D788; Sun, 24 May 2020 22:42:42 +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 07/14] perf tools: Factor out parse_groups function Date: Mon, 25 May 2020 00:42:12 +0200 Message-Id: <20200524224219.234847-8-jolsa@kernel.org> In-Reply-To: <20200524224219.234847-1-jolsa@kernel.org> References: <20200524224219.234847-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. 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 9e21aa767e41..d72a565ec483 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