mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
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 <jolsa@kernel.org> Acked-by: Ian Rogers <irogers@google.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lore.kernel.org/lkml/20200602214741.1218986-9-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
1381396b0b
commit
f78ac00a8c
2 changed files with 20 additions and 0 deletions
|
@ -756,6 +756,17 @@ int metricgroup__parse_groups(const struct option *opt,
|
|||
metric_no_merge, NULL, metric_events, map);
|
||||
}
|
||||
|
||||
int metricgroup__parse_groups_test(struct evlist *evlist,
|
||||
struct pmu_events_map *map,
|
||||
const char *str,
|
||||
bool metric_no_group,
|
||||
bool metric_no_merge,
|
||||
struct rblist *metric_events)
|
||||
{
|
||||
return parse_groups(evlist, str, metric_no_group,
|
||||
metric_no_merge, &perf_pmu__fake, metric_events, map);
|
||||
}
|
||||
|
||||
bool metricgroup__has_metric(const char *metric)
|
||||
{
|
||||
struct pmu_events_map *map = perf_pmu__find_map(NULL);
|
||||
|
|
|
@ -7,8 +7,10 @@
|
|||
#include <stdbool.h>
|
||||
|
||||
struct evsel;
|
||||
struct evlist;
|
||||
struct option;
|
||||
struct rblist;
|
||||
struct pmu_events_map;
|
||||
|
||||
struct metric_event {
|
||||
struct rb_node nd;
|
||||
|
@ -34,6 +36,13 @@ int metricgroup__parse_groups(const struct option *opt,
|
|||
bool metric_no_merge,
|
||||
struct rblist *metric_events);
|
||||
|
||||
int metricgroup__parse_groups_test(struct evlist *evlist,
|
||||
struct pmu_events_map *map,
|
||||
const char *str,
|
||||
bool metric_no_group,
|
||||
bool metric_no_merge,
|
||||
struct rblist *metric_events);
|
||||
|
||||
void metricgroup__print(bool metrics, bool groups, char *filter,
|
||||
bool raw, bool details);
|
||||
bool metricgroup__has_metric(const char *metric);
|
||||
|
|
Loading…
Reference in a new issue