Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1232250ybg; Tue, 2 Jun 2020 04:54:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9hOTWIioAJObhv9DGMQHxf6fX/vodKkpeYaqZNZXsE3TlWzFnEtRo4vKep6gl6xpRJPmV X-Received: by 2002:a17:906:5a99:: with SMTP id l25mr24123713ejq.235.1591098856548; Tue, 02 Jun 2020 04:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591098856; cv=none; d=google.com; s=arc-20160816; b=LWVVobMEUkow6WshRnyu3R4dcgNVwIpJvp7xI01q9nqVBBdbuncoVEECLrreP7dDce 6PEyNoGlaDszf+CeMFcgmEjJPupcmsHyKt8nBfcU9k9czrQ+ztNTFg79/5MdEx3h2tmF BYckAct0rbtSpkeEUhrGMpq8Z2h9r0Rf1Teko+x3+TZKWEW76IEgaa+Jla+r+x8v4S9k VT8EoE2chZJATpD7E4ZT0RXHN5nk5KPXzgsBzKASFsrPvkk393eYQ0i87XbXeHbKEbi9 zCeygcT6vZShV54qIwXhCk3kGRbKQYwrZS7pssB3Xn3OFo4BjvB4OIOblzU8gm0hOUUk /jng== 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=TJQwG0fsprZ6FmfjeZw5JSRgsjPnDzAfOFY0bLLufK0=; b=bNtI2l2UdnOXWoin8UkVzAD9rkAL2QPJCX5XiNRb/y/0czAwHxcXZ0JEnLBnCbEimC l0/FIsrOcoKGkknlhJOY2xPnpFoOqgNasLqIV5GBf/nUlT5ALrWiBBg8r015SH/MrQTL 8UTjDn8Mj48LgCU9MNymSkXZDm/PaK92knKDcbv2CMf/D2Vj0qyZwbeOnQNQsNHCIVNs EhvSpwNUKgtOpFYaaBHJaAS5xEBlK3oKC0RrYWbSmqOVeA+js++D6B+AMAnhhK3mhGrN 02Z1FhUWQpHl6Ek5YHconBrL2g0PvCUaoUqvQ0Oo5LCGHNF4r96twaoTxvCtC+n9Jw3p FmFw== 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 ch25si1319809ejb.62.2020.06.02.04.53.52; Tue, 02 Jun 2020 04:54:16 -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 S1728214AbgFBLve convert rfc822-to-8bit (ORCPT + 99 others); Tue, 2 Jun 2020 07:51:34 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:47383 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728145AbgFBLvb (ORCPT ); Tue, 2 Jun 2020 07:51:31 -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-180-XDo09HvkMKKZu6St_qx7XA-1; Tue, 02 Jun 2020 07:51:25 -0400 X-MC-Unique: XDo09HvkMKKZu6St_qx7XA-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 5A3791030981; Tue, 2 Jun 2020 11:51:15 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.195.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 161EF10013D7; Tue, 2 Jun 2020 11:51:12 +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 06/13] perf tools: Add fake_pmu to parse_events function Date: Tue, 2 Jun 2020 13:50:48 +0200 Message-Id: <20200602115055.1168446-7-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 Allow to pass fake_pmu in parse_groups function so it can be used in parse_events call. It's set true by metricgroup__parse_groups_test function. Signed-off-by: Jiri Olsa --- tools/perf/util/metricgroup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index 47afe5867f9b..f3e761e14e66 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -712,6 +712,7 @@ static void metricgroup__free_egroups(struct list_head *group_list) static int parse_groups(struct evlist *perf_evlist, const char *str, bool metric_no_group, bool metric_no_merge, + bool fake_pmu, struct rblist *metric_events) { struct parse_events_error parse_error; @@ -727,7 +728,7 @@ static int parse_groups(struct evlist *perf_evlist, const char *str, return ret; pr_debug("adding %s\n", extra_events.buf); bzero(&parse_error, sizeof(parse_error)); - ret = parse_events(perf_evlist, extra_events.buf, &parse_error, false); + ret = parse_events(perf_evlist, extra_events.buf, &parse_error, fake_pmu); if (ret) { parse_events_print_error(&parse_error, extra_events.buf); goto out; @@ -749,7 +750,7 @@ int metricgroup__parse_groups(const struct option *opt, struct evlist *perf_evlist = *(struct evlist **)opt->value; return parse_groups(perf_evlist, str, metric_no_group, - metric_no_merge, metric_events); + metric_no_merge, false, metric_events); } bool metricgroup__has_metric(const char *metric) -- 2.25.4