hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/tools/perf/util/metricgroup.h
....@@ -1,32 +1,64 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 #ifndef METRICGROUP_H
23 #define METRICGROUP_H 1
34
4
-#include "linux/list.h"
5
-#include "rblist.h"
6
-#include <subcmd/parse-options.h>
7
-#include "evlist.h"
8
-#include "strbuf.h"
5
+#include <linux/list.h>
6
+#include <linux/rbtree.h>
7
+#include <stdbool.h>
8
+#include "pmu-events/pmu-events.h"
9
+
10
+struct evlist;
11
+struct evsel;
12
+struct evlist;
13
+struct option;
14
+struct rblist;
15
+struct pmu_events_map;
16
+struct cgroup;
917
1018 struct metric_event {
1119 struct rb_node nd;
12
- struct perf_evsel *evsel;
20
+ struct evsel *evsel;
1321 struct list_head head; /* list of metric_expr */
22
+};
23
+
24
+struct metric_ref {
25
+ const char *metric_name;
26
+ const char *metric_expr;
1427 };
1528
1629 struct metric_expr {
1730 struct list_head nd;
1831 const char *metric_expr;
1932 const char *metric_name;
20
- struct perf_evsel **metric_events;
33
+ const char *metric_unit;
34
+ struct evsel **metric_events;
35
+ struct metric_ref *metric_refs;
36
+ int runtime;
2137 };
2238
2339 struct metric_event *metricgroup__lookup(struct rblist *metric_events,
24
- struct perf_evsel *evsel,
40
+ struct evsel *evsel,
2541 bool create);
2642 int metricgroup__parse_groups(const struct option *opt,
27
- const char *str,
28
- struct rblist *metric_events);
43
+ const char *str,
44
+ bool metric_no_group,
45
+ bool metric_no_merge,
46
+ struct rblist *metric_events);
2947
30
-void metricgroup__print(bool metrics, bool groups, char *filter, bool raw);
48
+int metricgroup__parse_groups_test(struct evlist *evlist,
49
+ struct pmu_events_map *map,
50
+ const char *str,
51
+ bool metric_no_group,
52
+ bool metric_no_merge,
53
+ struct rblist *metric_events);
54
+
55
+void metricgroup__print(bool metrics, bool groups, char *filter,
56
+ bool raw, bool details);
3157 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);
60
+
61
+int metricgroup__copy_metric_events(struct evlist *evlist, struct cgroup *cgrp,
62
+ struct rblist *new_metric_events,
63
+ struct rblist *old_metric_events);
3264 #endif