Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1232122ybg; Tue, 2 Jun 2020 04:54:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZ2zt0iH7zULOcJ6sVrqD2Ld+KckrseBxhEzoRT6FnNKCkpjH8RzihoWE+a/nt0siaNsvK X-Received: by 2002:a50:8307:: with SMTP id 7mr26321768edh.283.1591098840829; Tue, 02 Jun 2020 04:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591098840; cv=none; d=google.com; s=arc-20160816; b=AbSvBHoT5QtJ34h6rzGP6rsuTgqrl+rO580YabO/I5YL4kBQqDXirU6NceEjTiv3mB Tq4YxT/iiYvpfADbXkUcCx9wh1Jr+6ACPJi/y6JSjv3Cmcawt/irp6qMlMgcD5AxepsZ AywQKhZHMZxIiI2S5td1vWatPAG8NCqgqx7UY4e9YxV+0PLpUi3NHAeC5NPnbMhsuVZl pc4LztdSl5rEIq/BGucpVaLRzU13LnFsWOB5VypirCyM8Hc5JYyhLzC9MclghFrP+dgT raDRCNRjseKBlBERkJXLfN5lpq+7Wi0+1LWRZJqOCUhKQoIFn2K3G9fOBzEUszZAzjlX ALsg== 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=Gj3kRWpdpE4DAliWfsvNZVj6a2ulYSuSdRuzcI4Chcc=; b=JJJHCVqc+DwcyAP3oeGdoSj75W2bI93S3PKaQNxqYf5bioY+XwIJllTTJAbMw4zEFi 8ffDTLbFcoImeljopXit5DhkgLM8N3Pra9ZITNXWfmAWcDjlwuybEeuqmyY1MoLBk/kI p4fIjpid1uZXrkozjLAdZNNcZcdR3yMJEIVwjxWryboMLsWwPro07uit7aXqzMPntGni DdGua9WA/GF6R+d/hAGN/jiZPon5mRaj2lrNQAPUBgxZtci5dqlV7veiPu0sG0OAqMwb wUAWMlGDvMPHa4vwXEpiDi6nqrYHNvqFv617Wl9xWgABx73i5XxNkHdy7n7ZTVlaIDtQ OX6w== 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 n18si1452779edq.195.2020.06.02.04.53.38; Tue, 02 Jun 2020 04:54: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 S1726267AbgFBLvd convert rfc822-to-8bit (ORCPT + 99 others); Tue, 2 Jun 2020 07:51:33 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:25129 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727863AbgFBLv1 (ORCPT ); Tue, 2 Jun 2020 07:51:27 -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-337-LhOn6Yk3P8ujbXGnvQj51w-1; Tue, 02 Jun 2020 07:51:22 -0400 X-MC-Unique: LhOn6Yk3P8ujbXGnvQj51w-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 98C031030983; Tue, 2 Jun 2020 11:51:20 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.195.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4EC061001281; Tue, 2 Jun 2020 11:51:18 +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 08/13] perf tools: Add metricgroup__parse_groups_test function Date: Tue, 2 Jun 2020 13:50:50 +0200 Message-Id: <20200602115055.1168446-9-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 Adding metricgroup__parse_groups_test function. It will be used as test's interface to metric parsing in following changes. 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