Linux Audio

Check our new training course

Loading...
v4.17
 
 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
v5.14.15
 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#include "pmu-events/pmu-events.h"
 9
10struct evlist;
11struct evsel;
12struct option;
13struct rblist;
14struct pmu_events_map;
15struct cgroup;
16
17struct metric_event {
18	struct rb_node nd;
19	struct evsel *evsel;
20	struct list_head head; /* list of metric_expr */
21};
22
23struct metric_ref {
24	const char *metric_name;
25	const char *metric_expr;
26};
27
28struct metric_expr {
29	struct list_head nd;
30	const char *metric_expr;
31	const char *metric_name;
32	const char *metric_unit;
33	struct evsel **metric_events;
34	struct metric_ref *metric_refs;
35	int runtime;
36};
37
38struct metric_event *metricgroup__lookup(struct rblist *metric_events,
39					 struct evsel *evsel,
40					 bool create);
41int metricgroup__parse_groups(const struct option *opt,
42			      const char *str,
43			      bool metric_no_group,
44			      bool metric_no_merge,
45			      struct rblist *metric_events);
46struct pmu_event *metricgroup__find_metric(const char *metric,
47					   struct pmu_events_map *map);
48int 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
55void metricgroup__print(bool metrics, bool groups, char *filter,
56			bool raw, bool details);
57bool metricgroup__has_metric(const char *metric);
58int arch_get_runtimeparam(struct pmu_event *pe __maybe_unused);
59void metricgroup__rblist_exit(struct rblist *metric_events);
60
61int metricgroup__copy_metric_events(struct evlist *evlist, struct cgroup *cgrp,
62				    struct rblist *new_metric_events,
63				    struct rblist *old_metric_events);
64#endif