1 // SPDX-License-Identifier: GPL-2.0-only
3 #define METRICGROUP_H 1
5 #include <linux/list.h>
6 #include <linux/rbtree.h>
8 #include "pmu-events/pmu-events.h"
14 struct pmu_events_map;
20 struct list_head head; /* list of metric_expr */
24 const char *metric_name;
25 const char *metric_expr;
30 const char *metric_expr;
31 const char *metric_name;
32 const char *metric_unit;
33 struct evsel **metric_events;
34 struct metric_ref *metric_refs;
38 struct metric_event *metricgroup__lookup(struct rblist *metric_events,
41 int metricgroup__parse_groups(const struct option *opt,
45 struct rblist *metric_events);
46 struct pmu_event *metricgroup__find_metric(const char *metric,
47 struct pmu_events_map *map);
48 int metricgroup__parse_groups_test(struct evlist *evlist,
49 struct pmu_events_map *map,
53 struct rblist *metric_events);
55 void metricgroup__print(bool metrics, bool groups, char *filter,
56 bool raw, bool details);
57 bool metricgroup__has_metric(const char *metric);
58 int arch_get_runtimeparam(struct pmu_event *pe __maybe_unused);
59 void metricgroup__rblist_exit(struct rblist *metric_events);
61 int metricgroup__copy_metric_events(struct evlist *evlist, struct cgroup *cgrp,
62 struct rblist *new_metric_events,
63 struct rblist *old_metric_events);