Skip to content

Commit 8b4468a

Browse files
olsajiriacmel
authored andcommitted
perf parse: Factor out parse_groups() function
Factor out the parse_groups function, it will be used for new test interface coming 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 e1c92a7 commit 8b4468a

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

tools/perf/util/metricgroup.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -709,14 +709,12 @@ static void metricgroup__free_egroups(struct list_head *group_list)
709709
}
710710
}
711711

712-
int metricgroup__parse_groups(const struct option *opt,
713-
const char *str,
714-
bool metric_no_group,
715-
bool metric_no_merge,
716-
struct rblist *metric_events)
712+
static int parse_groups(struct evlist *perf_evlist, const char *str,
713+
bool metric_no_group,
714+
bool metric_no_merge,
715+
struct rblist *metric_events)
717716
{
718717
struct parse_events_error parse_error;
719-
struct evlist *perf_evlist = *(struct evlist **)opt->value;
720718
struct strbuf extra_events;
721719
LIST_HEAD(group_list);
722720
int ret;
@@ -742,6 +740,18 @@ int metricgroup__parse_groups(const struct option *opt,
742740
return ret;
743741
}
744742

743+
int metricgroup__parse_groups(const struct option *opt,
744+
const char *str,
745+
bool metric_no_group,
746+
bool metric_no_merge,
747+
struct rblist *metric_events)
748+
{
749+
struct evlist *perf_evlist = *(struct evlist **)opt->value;
750+
751+
return parse_groups(perf_evlist, str, metric_no_group,
752+
metric_no_merge, metric_events);
753+
}
754+
745755
bool metricgroup__has_metric(const char *metric)
746756
{
747757
struct pmu_events_map *map = perf_pmu__find_map(NULL);

0 commit comments

Comments
 (0)