Skip to content

Commit f78ac00

Browse files
olsajiriacmel
authored andcommitted
perf tools: Add metricgroup__parse_groups_test function
Add the metricgroup__parse_groups_test function. It will be used as test's interface to metric parsing in following changes. Signed-off-by: Jiri Olsa <[email protected]> Acked-by: Ian Rogers <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Andi Kleen <[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 1381396 commit f78ac00

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tools/perf/util/metricgroup.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,17 @@ int metricgroup__parse_groups(const struct option *opt,
756756
metric_no_merge, NULL, metric_events, map);
757757
}
758758

759+
int metricgroup__parse_groups_test(struct evlist *evlist,
760+
struct pmu_events_map *map,
761+
const char *str,
762+
bool metric_no_group,
763+
bool metric_no_merge,
764+
struct rblist *metric_events)
765+
{
766+
return parse_groups(evlist, str, metric_no_group,
767+
metric_no_merge, &perf_pmu__fake, metric_events, map);
768+
}
769+
759770
bool metricgroup__has_metric(const char *metric)
760771
{
761772
struct pmu_events_map *map = perf_pmu__find_map(NULL);

tools/perf/util/metricgroup.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
#include <stdbool.h>
88

99
struct evsel;
10+
struct evlist;
1011
struct option;
1112
struct rblist;
13+
struct pmu_events_map;
1214

1315
struct metric_event {
1416
struct rb_node nd;
@@ -34,6 +36,13 @@ int metricgroup__parse_groups(const struct option *opt,
3436
bool metric_no_merge,
3537
struct rblist *metric_events);
3638

39+
int metricgroup__parse_groups_test(struct evlist *evlist,
40+
struct pmu_events_map *map,
41+
const char *str,
42+
bool metric_no_group,
43+
bool metric_no_merge,
44+
struct rblist *metric_events);
45+
3746
void metricgroup__print(bool metrics, bool groups, char *filter,
3847
bool raw, bool details);
3948
bool metricgroup__has_metric(const char *metric);

0 commit comments

Comments
 (0)