metricgroup.h 979 字节
Newer Older
1
// SPDX-License-Identifier: GPL-2.0-only
2 3 4
#ifndef METRICGROUP_H
#define METRICGROUP_H 1

5 6 7 8 9 10 11
#include <linux/list.h>
#include <linux/rbtree.h>
#include <stdbool.h>

struct evsel;
struct option;
struct rblist;
12 13 14

struct metric_event {
	struct rb_node nd;
15
	struct evsel *evsel;
16 17 18 19 20 21 22
	struct list_head head; /* list of metric_expr */
};

struct metric_expr {
	struct list_head nd;
	const char *metric_expr;
	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 31
					 bool create);
int metricgroup__parse_groups(const struct option *opt,
32 33 34 35
			      const char *str,
			      bool metric_no_group,
			      bool metric_no_merge,
			      struct rblist *metric_events);
36

37 38
void metricgroup__print(bool metrics, bool groups, char *filter,
			bool raw, bool details);
39
bool metricgroup__has_metric(const char *metric);
40
int arch_get_runtimeparam(void);
41
#endif