Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp11799ybg; Tue, 2 Jun 2020 14:53:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc7jr+Lhao64yKP8L/EErM9P02lG9ub9JPYfOfmv5sW9aRoXztrDVht9VoBvcu03BVa+VM X-Received: by 2002:a17:906:4993:: with SMTP id p19mr26394011eju.67.1591134794257; Tue, 02 Jun 2020 14:53:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591134794; cv=none; d=google.com; s=arc-20160816; b=gwud5of4lNcG/Q9gHONAyW+TJvd8EtxVrpLgAVxgZ8j6TqJGSlBMUhLkbdUxX4DPmB YmMjK8KcXLg15JHLFR2nSL5dLYQymJvZQ/hWHCSOUBWFdjZyaFTcQo1LjCa0r4EcmLah em0oFiaohHBI8DGYF2y/8j1xyxaSxVRuksuIZ8+VfoFCxXh7O1P6oYNHtyXpweQpqFzR es5OsCtNOn6PSjBaYB1Ea2MBApWXP/dZiH7Gn6ghNEVArVivKM/JNGmmAv2JKQpI3TPj f5nD4moGfKRxosmgyQT7hHH910frwZf9EDiakAdxJ51Isk8q9FyTXnGV9mPy25MvxbYC 7RJA== 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=Qr0IJTK1staMuBD3AC+q901RdSaFHFag6w3TsGq6bvw=; b=QzqazjGyw0zvb6R3vVGw4Mk2gxKZlxC9afp24Kv+tMovMRkpc8sIs7TIAtNmNZG09v fJuKDKvAi0IGSE3FLO0tX1l/PQfaUSRj2g8ESCGmI1TI4wHqaEHjeEn4VgYoHPIEgeul jbXh1nzyXa5VAYc+f+PDNdXXLmJ/J18veO6e6Xfy92ibuR7zNvCeWgE+8tYECFfciJfZ Gcx5FXTiZjupiJmqRdkzqNyhFOwo517IDF3cHJfVsIpBbgYyq5Dck6CRsmo8sUoI/aDg GrQ3DK1saInppSNBqde+oiS3Gx3fGCU35TaaZJiZMjbFMccd94PQxOcv9msYs8P1iyDK 5YWg== 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 j3si79466ejb.294.2020.06.02.14.50.47; Tue, 02 Jun 2020 14:53:14 -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 S1728410AbgFBVsR convert rfc822-to-8bit (ORCPT + 99 others); Tue, 2 Jun 2020 17:48:17 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:28150 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726130AbgFBVsQ (ORCPT ); Tue, 2 Jun 2020 17:48:16 -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-309-jXRi7SaUPNyD5VqoRqXi0g-1; Tue, 02 Jun 2020 17:48:12 -0400 X-MC-Unique: jXRi7SaUPNyD5VqoRqXi0g-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 2FDCB1083E80; Tue, 2 Jun 2020 21:48:11 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.192.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB15278EF7; Tue, 2 Jun 2020 21:48:05 +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 06/13] perf tools: Add fake_pmu to parse_events function Date: Tue, 2 Jun 2020 23:47:34 +0200 Message-Id: <20200602214741.1218986-7-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 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. Acked-by: Ian Rogers 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