blob: aee6f808b512c73309f101e91712d3c0a8dfca9e [file] [log] [blame]
Arnaldo Carvalho de Melo95be9d12019-09-24 15:56:14 -03001// SPDX-License-Identifier: GPL-2.0
2#ifndef __PERF_EVSEL_CONFIG_H
3#define __PERF_EVSEL_CONFIG_H 1
4
5#include <linux/types.h>
6#include <stdbool.h>
7
8/*
Arnaldo Carvalho de Melo35ac0ca2020-05-06 13:05:08 -03009 * The 'struct evsel_config_term' is used to pass event
Arnaldo Carvalho de Melo6ec17b42020-04-29 15:57:01 -030010 * specific configuration data to evsel__config routine.
Arnaldo Carvalho de Melo95be9d12019-09-24 15:56:14 -030011 * It is allocated within event parsing and attached to
Arnaldo Carvalho de Melo35ac0ca2020-05-06 13:05:08 -030012 * evsel::config_terms list head.
Arnaldo Carvalho de Melo95be9d12019-09-24 15:56:14 -030013*/
14enum evsel_term_type {
Arnaldo Carvalho de Melo35ac0ca2020-05-06 13:05:08 -030015 EVSEL__CONFIG_TERM_PERIOD,
16 EVSEL__CONFIG_TERM_FREQ,
17 EVSEL__CONFIG_TERM_TIME,
18 EVSEL__CONFIG_TERM_CALLGRAPH,
19 EVSEL__CONFIG_TERM_STACK_USER,
20 EVSEL__CONFIG_TERM_INHERIT,
21 EVSEL__CONFIG_TERM_MAX_STACK,
22 EVSEL__CONFIG_TERM_MAX_EVENTS,
23 EVSEL__CONFIG_TERM_OVERWRITE,
24 EVSEL__CONFIG_TERM_DRV_CFG,
25 EVSEL__CONFIG_TERM_BRANCH,
26 EVSEL__CONFIG_TERM_PERCORE,
27 EVSEL__CONFIG_TERM_AUX_OUTPUT,
28 EVSEL__CONFIG_TERM_AUX_SAMPLE_SIZE,
29 EVSEL__CONFIG_TERM_CFG_CHG,
Arnaldo Carvalho de Melo95be9d12019-09-24 15:56:14 -030030};
31
Arnaldo Carvalho de Melo35ac0ca2020-05-06 13:05:08 -030032struct evsel_config_term {
Arnaldo Carvalho de Melo95be9d12019-09-24 15:56:14 -030033 struct list_head list;
34 enum evsel_term_type type;
Leo Yan3220fb82020-01-17 13:52:51 +080035 bool free_str;
Arnaldo Carvalho de Melo95be9d12019-09-24 15:56:14 -030036 union {
37 u64 period;
38 u64 freq;
39 bool time;
Arnaldo Carvalho de Melo95be9d12019-09-24 15:56:14 -030040 u64 stack_user;
41 int max_stack;
42 bool inherit;
43 bool overwrite;
Arnaldo Carvalho de Melo95be9d12019-09-24 15:56:14 -030044 unsigned long max_events;
45 bool percore;
46 bool aux_output;
Adrian Huntereb7a52d2019-11-15 14:42:17 +020047 u32 aux_sample_size;
Adrian Huntera1ac7de2019-11-15 14:42:22 +020048 u64 cfg_chg;
Leo Yane8846022020-01-17 13:52:50 +080049 char *str;
Arnaldo Carvalho de Melo95be9d12019-09-24 15:56:14 -030050 } val;
51 bool weak;
52};
Adrian Huntereb7a52d2019-11-15 14:42:17 +020053
54struct evsel;
55
Arnaldo Carvalho de Melo35ac0ca2020-05-06 13:05:08 -030056struct evsel_config_term *__evsel__get_config_term(struct evsel *evsel, enum evsel_term_type type);
Adrian Huntereb7a52d2019-11-15 14:42:17 +020057
Arnaldo Carvalho de Melo35ac0ca2020-05-06 13:05:08 -030058#define evsel__get_config_term(evsel, type) \
59 __evsel__get_config_term(evsel, EVSEL__CONFIG_TERM_ ## type)
Adrian Huntereb7a52d2019-11-15 14:42:17 +020060
Arnaldo Carvalho de Melo95be9d12019-09-24 15:56:14 -030061#endif // __PERF_EVSEL_CONFIG_H