mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-15 23:14:31 +08:00
f78ac00a8c
Add the metricgroup__parse_groups_test function. It will be used as test's interface to metric parsing in following changes. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: Ian Rogers <irogers@google.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lore.kernel.org/lkml/20200602214741.1218986-9-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
51 lines
1.2 KiB
C
51 lines
1.2 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
#ifndef METRICGROUP_H
|
|
#define METRICGROUP_H 1
|
|
|
|
#include <linux/list.h>
|
|
#include <linux/rbtree.h>
|
|
#include <stdbool.h>
|
|
|
|
struct evsel;
|
|
struct evlist;
|
|
struct option;
|
|
struct rblist;
|
|
struct pmu_events_map;
|
|
|
|
struct metric_event {
|
|
struct rb_node nd;
|
|
struct evsel *evsel;
|
|
struct list_head head; /* list of metric_expr */
|
|
};
|
|
|
|
struct metric_expr {
|
|
struct list_head nd;
|
|
const char *metric_expr;
|
|
const char *metric_name;
|
|
const char *metric_unit;
|
|
struct evsel **metric_events;
|
|
int runtime;
|
|
};
|
|
|
|
struct metric_event *metricgroup__lookup(struct rblist *metric_events,
|
|
struct evsel *evsel,
|
|
bool create);
|
|
int metricgroup__parse_groups(const struct option *opt,
|
|
const char *str,
|
|
bool metric_no_group,
|
|
bool metric_no_merge,
|
|
struct rblist *metric_events);
|
|
|
|
int metricgroup__parse_groups_test(struct evlist *evlist,
|
|
struct pmu_events_map *map,
|
|
const char *str,
|
|
bool metric_no_group,
|
|
bool metric_no_merge,
|
|
struct rblist *metric_events);
|
|
|
|
void metricgroup__print(bool metrics, bool groups, char *filter,
|
|
bool raw, bool details);
|
|
bool metricgroup__has_metric(const char *metric);
|
|
int arch_get_runtimeparam(void);
|
|
#endif
|