6b09eb30b4ecf8bf0434e3520a4904f14f8da5f7
[linux-2.6-microblaze.git] / tools / perf / util / metricgroup.h
1 // SPDX-License-Identifier: GPL-2.0-only
2 #ifndef METRICGROUP_H
3 #define METRICGROUP_H 1
4
5 #include <linux/list.h>
6 #include <linux/rbtree.h>
7 #include <stdbool.h>
8
9 struct evsel;
10 struct option;
11 struct rblist;
12
13 struct metric_event {
14         struct rb_node nd;
15         struct evsel *evsel;
16         struct list_head head; /* list of metric_expr */
17 };
18
19 struct metric_expr {
20         struct list_head nd;
21         const char *metric_expr;
22         const char *metric_name;
23         const char *metric_unit;
24         struct evsel **metric_events;
25         int runtime;
26 };
27
28 struct metric_event *metricgroup__lookup(struct rblist *metric_events,
29                                          struct evsel *evsel,
30                                          bool create);
31 int metricgroup__parse_groups(const struct option *opt,
32                         const char *str,
33                         struct rblist *metric_events);
34
35 void metricgroup__print(bool metrics, bool groups, char *filter,
36                         bool raw, bool details);
37 bool metricgroup__has_metric(const char *metric);
38 int arch_get_runtimeparam(void);
39 #endif