Loading...
1#ifndef METRICGROUP_H
2#define METRICGROUP_H 1
3
4#include "linux/list.h"
5#include "rblist.h"
6#include <subcmd/parse-options.h>
7#include "evlist.h"
8#include "strbuf.h"
9
10struct metric_event {
11 struct rb_node nd;
12 struct perf_evsel *evsel;
13 struct list_head head; /* list of metric_expr */
14};
15
16struct metric_expr {
17 struct list_head nd;
18 const char *metric_expr;
19 const char *metric_name;
20 struct perf_evsel **metric_events;
21};
22
23struct metric_event *metricgroup__lookup(struct rblist *metric_events,
24 struct perf_evsel *evsel,
25 bool create);
26int metricgroup__parse_groups(const struct option *opt,
27 const char *str,
28 struct rblist *metric_events);
29
30void metricgroup__print(bool metrics, bool groups, char *filter, bool raw);
31#endif
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
9struct evsel;
10struct option;
11struct rblist;
12
13struct metric_event {
14 struct rb_node nd;
15 struct evsel *evsel;
16 struct list_head head; /* list of metric_expr */
17};
18
19struct 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};
26
27struct metric_event *metricgroup__lookup(struct rblist *metric_events,
28 struct evsel *evsel,
29 bool create);
30int metricgroup__parse_groups(const struct option *opt,
31 const char *str,
32 struct rblist *metric_events);
33
34void metricgroup__print(bool metrics, bool groups, char *filter,
35 bool raw, bool details);
36bool metricgroup__has_metric(const char *metric);
37#endif