Commit 68173bda authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf tools: Add fake_pmu to parse_group() function

Allow to pass fake_pmu in parse_groups function so it can be used in
parse_events call.

It's will be passed by the upcoming metricgroup__parse_groups_test
function.

Committer notes:

Made it a 'struct perf_pmu' pointer, in line with the changes at the
start of this patchkit to avoid statics deep down in library code.
Acked-by: default avatarIan Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20200602214741.1218986-6-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 8b4468a2
...@@ -712,6 +712,7 @@ static void metricgroup__free_egroups(struct list_head *group_list) ...@@ -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, static int parse_groups(struct evlist *perf_evlist, const char *str,
bool metric_no_group, bool metric_no_group,
bool metric_no_merge, bool metric_no_merge,
struct perf_pmu *fake_pmu,
struct rblist *metric_events) struct rblist *metric_events)
{ {
struct parse_events_error parse_error; struct parse_events_error parse_error;
...@@ -727,7 +728,7 @@ static int parse_groups(struct evlist *perf_evlist, const char *str, ...@@ -727,7 +728,7 @@ static int parse_groups(struct evlist *perf_evlist, const char *str,
return ret; return ret;
pr_debug("adding %s\n", extra_events.buf); pr_debug("adding %s\n", extra_events.buf);
bzero(&parse_error, sizeof(parse_error)); bzero(&parse_error, sizeof(parse_error));
ret = parse_events(perf_evlist, extra_events.buf, &parse_error); ret = __parse_events(perf_evlist, extra_events.buf, &parse_error, fake_pmu);
if (ret) { if (ret) {
parse_events_print_error(&parse_error, extra_events.buf); parse_events_print_error(&parse_error, extra_events.buf);
goto out; goto out;
...@@ -749,7 +750,7 @@ int metricgroup__parse_groups(const struct option *opt, ...@@ -749,7 +750,7 @@ int metricgroup__parse_groups(const struct option *opt,
struct evlist *perf_evlist = *(struct evlist **)opt->value; struct evlist *perf_evlist = *(struct evlist **)opt->value;
return parse_groups(perf_evlist, str, metric_no_group, return parse_groups(perf_evlist, str, metric_no_group,
metric_no_merge, metric_events); metric_no_merge, NULL, metric_events);
} }
bool metricgroup__has_metric(const char *metric) bool metricgroup__has_metric(const char *metric)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment