Skip to content

Commit 68173bd

Browse files
olsajiriacmel
authored andcommitted
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: Ian Rogers <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Michael Petlan <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 8b4468a commit 68173bd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/perf/util/metricgroup.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,7 @@ static void metricgroup__free_egroups(struct list_head *group_list)
712712
static int parse_groups(struct evlist *perf_evlist, const char *str,
713713
bool metric_no_group,
714714
bool metric_no_merge,
715+
struct perf_pmu *fake_pmu,
715716
struct rblist *metric_events)
716717
{
717718
struct parse_events_error parse_error;
@@ -727,7 +728,7 @@ static int parse_groups(struct evlist *perf_evlist, const char *str,
727728
return ret;
728729
pr_debug("adding %s\n", extra_events.buf);
729730
bzero(&parse_error, sizeof(parse_error));
730-
ret = parse_events(perf_evlist, extra_events.buf, &parse_error);
731+
ret = __parse_events(perf_evlist, extra_events.buf, &parse_error, fake_pmu);
731732
if (ret) {
732733
parse_events_print_error(&parse_error, extra_events.buf);
733734
goto out;
@@ -749,7 +750,7 @@ int metricgroup__parse_groups(const struct option *opt,
749750
struct evlist *perf_evlist = *(struct evlist **)opt->value;
750751

751752
return parse_groups(perf_evlist, str, metric_no_group,
752-
metric_no_merge, metric_events);
753+
metric_no_merge, NULL, metric_events);
753754
}
754755

755756
bool metricgroup__has_metric(const char *metric)

0 commit comments

Comments
 (0)