Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp10894ybg; Tue, 2 Jun 2020 14:51:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3A8nksUxtFKijl7gyJnhUKkReBteTlzgydm+MrxZecH1M1fGPj07oya8Rvh/+biGFHore X-Received: by 2002:a17:906:a288:: with SMTP id i8mr11680869ejz.324.1591134660776; Tue, 02 Jun 2020 14:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591134660; cv=none; d=google.com; s=arc-20160816; b=xsup2uMi1mDy5cuBOdOjSjbr0jhwqIGBwA7zRt8YtjHtq/QyRndml1IPDWUXthOkZN EOH82l6nZ16YVV/xq3KQqj3T1BmjLUt2LNf8WdRfV4aekB1De1JqdFSvRxtabMm/Oj2R d5rYF3DzsgCvGZbN4RbAy5WgJQ6hpqfM+l46cI8VzYjV4iEmcQXi50xSHDKtJ5AdhjiI v2Z+lwFgLgmJCNfJ/qW2lpxTUBmXBsk6J9oFVOVDDjQEemFPW2jrbVVDOt65/qVM6c0O +QH6cpFlkHZQ3CCs6XibUpIe3rTniiy1kIerdRM5Mdc6/MpV0OkM1iBGtVxg+b34vS26 exow== 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=CRC8EQahkwG+QQ8eSX0K1CnaiJCGYgGk7hCv4OtM3ic=; b=XXtPe74XIdMY0X8hcEJNCRxgeTaiNF1o6OiIY3NBDdKaJs9bepiaA5MAVDVYxDDp7p BmyT+dKtDPbKwxtHtl96vnOCEkgIqDBA+WT1kOrmPO7aT1DX0ks+0TP9s+pCemTjXtkH nN1+Rq6xRfkpG/dxHRGPd5+GjPxWx8RRHp8xjI/PgRkdatGzRYFl7azlboBDZLSEg6vP 0iimH3TQtprv3cG+rzUbVS4uheK1oZG4L1Q3Q6ZIsp+sT2FuSDH07avjlKcpmmtI+3fI Az6wvWfP0OPOF1vvKTXEjuIJ2xgYTDuXDMHz0yHDreFF76DNao5KZ9p/l9Hfl/YqqsKm Lz5A== 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 lv27si74859ejb.651.2020.06.02.14.50.37; Tue, 02 Jun 2020 14:51:00 -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 S1728456AbgFBVs3 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 2 Jun 2020 17:48:29 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:51489 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728440AbgFBVsY (ORCPT ); Tue, 2 Jun 2020 17:48: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-163-K3i03b6KMge28wdFYTeeJw-1; Tue, 02 Jun 2020 17:48:19 -0400 X-MC-Unique: K3i03b6KMge28wdFYTeeJw-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 6E426835B40; Tue, 2 Jun 2020 21:48:17 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.192.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC2EB1BCBE; Tue, 2 Jun 2020 21:48:14 +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 08/13] perf tools: Add metricgroup__parse_groups_test function Date: Tue, 2 Jun 2020 23:47:36 +0200 Message-Id: <20200602214741.1218986-9-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 Adding metricgroup__parse_groups_test function. It will be used as test's interface to metric parsing in following changes. Acked-by: Ian Rogers Signed-off-by: Jiri Olsa --- tools/perf/util/metricgroup.c | 11 +++++++++++ tools/perf/util/metricgroup.h | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index 72999aacfa37..fe33fee7f6ad 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -756,6 +756,17 @@ int metricgroup__parse_groups(const struct option *opt, metric_no_merge, false, metric_events, map); } +int metricgroup__parse_groups_test(struct evlist *evlist, + struct pmu_events_map *map, + const char *str, + bool metric_no_group, + bool metric_no_merge, + struct rblist *metric_events) +{ + return parse_groups(evlist, str, metric_no_group, + metric_no_merge, true, metric_events, map); +} + bool metricgroup__has_metric(const char *metric) { struct pmu_events_map *map = perf_pmu__find_map(NULL); diff --git a/tools/perf/util/metricgroup.h b/tools/perf/util/metricgroup.h index 287850bcdeca..426c824e20bf 100644 --- a/tools/perf/util/metricgroup.h +++ b/tools/perf/util/metricgroup.h @@ -7,8 +7,10 @@ #include struct evsel; +struct evlist; struct option; struct rblist; +struct pmu_events_map; struct metric_event { struct rb_node nd; @@ -34,6 +36,13 @@ int metricgroup__parse_groups(const struct option *opt, bool metric_no_merge, struct rblist *metric_events); +int metricgroup__parse_groups_test(struct evlist *evlist, + struct pmu_events_map *map, + const char *str, + bool metric_no_group, + bool metric_no_merge, + struct rblist *metric_events); + void metricgroup__print(bool metrics, bool groups, char *filter, bool raw, bool details); bool metricgroup__has_metric(const char *metric); -- 2.25.4