0001
0002 #ifndef METRICGROUP_H
0003 #define METRICGROUP_H 1
0004
0005 #include <linux/list.h>
0006 #include <linux/rbtree.h>
0007 #include <stdbool.h>
0008 #include "pmu-events/pmu-events.h"
0009
0010 struct evlist;
0011 struct evsel;
0012 struct option;
0013 struct rblist;
0014 struct cgroup;
0015
0016
0017
0018
0019
0020
0021 struct metric_event {
0022 struct rb_node nd;
0023 struct evsel *evsel;
0024 struct list_head head;
0025 };
0026
0027
0028
0029
0030
0031
0032
0033
0034 struct metric_ref {
0035 const char *metric_name;
0036 const char *metric_expr;
0037 };
0038
0039
0040
0041
0042
0043 struct metric_expr {
0044 struct list_head nd;
0045
0046 const char *metric_expr;
0047
0048 const char *metric_name;
0049
0050
0051
0052
0053
0054
0055 const char *metric_unit;
0056
0057 struct evsel **metric_events;
0058
0059 struct metric_ref *metric_refs;
0060
0061 int runtime;
0062 };
0063
0064 struct metric_event *metricgroup__lookup(struct rblist *metric_events,
0065 struct evsel *evsel,
0066 bool create);
0067 int metricgroup__parse_groups(const struct option *opt,
0068 const char *str,
0069 bool metric_no_group,
0070 bool metric_no_merge,
0071 struct rblist *metric_events);
0072 int metricgroup__parse_groups_test(struct evlist *evlist,
0073 const struct pmu_events_table *table,
0074 const char *str,
0075 bool metric_no_group,
0076 bool metric_no_merge,
0077 struct rblist *metric_events);
0078
0079 void metricgroup__print(bool metrics, bool groups, char *filter,
0080 bool raw, bool details, const char *pmu_name);
0081 bool metricgroup__has_metric(const char *metric);
0082 int arch_get_runtimeparam(const struct pmu_event *pe __maybe_unused);
0083 void metricgroup__rblist_exit(struct rblist *metric_events);
0084
0085 int metricgroup__copy_metric_events(struct evlist *evlist, struct cgroup *cgrp,
0086 struct rblist *new_metric_events,
0087 struct rblist *old_metric_events);
0088 #endif