[PATCH 06/13] perf tools: Add fake_pmu to parse_events function
From: Jiri Olsa
Date: Tue Jun 02 2020 - 07:51:36 EST
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 <jolsa@xxxxxxxxxx>
---
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