Merge tag 'block-5.9-2020-08-14' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / tools / perf / util / metricgroup.h
blob62623a39cbecd46763662463c831a2032b09787b
1 // SPDX-License-Identifier: GPL-2.0-only
2 #ifndef METRICGROUP_H
3 #define METRICGROUP_H 1
5 #include <linux/list.h>
6 #include <linux/rbtree.h>
7 #include <stdbool.h>
9 struct evsel;
10 struct evlist;
11 struct option;
12 struct rblist;
13 struct pmu_events_map;
15 struct metric_event {
16 struct rb_node nd;
17 struct evsel *evsel;
18 struct list_head head; /* list of metric_expr */
21 struct metric_ref {
22 const char *metric_name;
23 const char *metric_expr;
26 struct metric_expr {
27 struct list_head nd;
28 const char *metric_expr;
29 const char *metric_name;
30 const char *metric_unit;
31 struct evsel **metric_events;
32 struct metric_ref *metric_refs;
33 int runtime;
36 struct metric_event *metricgroup__lookup(struct rblist *metric_events,
37 struct evsel *evsel,
38 bool create);
39 int metricgroup__parse_groups(const struct option *opt,
40 const char *str,
41 bool metric_no_group,
42 bool metric_no_merge,
43 struct rblist *metric_events);
45 int metricgroup__parse_groups_test(struct evlist *evlist,
46 struct pmu_events_map *map,
47 const char *str,
48 bool metric_no_group,
49 bool metric_no_merge,
50 struct rblist *metric_events);
52 void metricgroup__print(bool metrics, bool groups, char *filter,
53 bool raw, bool details);
54 bool metricgroup__has_metric(const char *metric);
55 int arch_get_runtimeparam(void);
56 void metricgroup__rblist_exit(struct rblist *metric_events);
57 #endif