Arnaldo Carvalho de Melo | 95be9d1 | 2019-09-24 15:56:14 -0300 | [diff] [blame] | 1 | // 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 Melo | 35ac0ca | 2020-05-06 13:05:08 -0300 | [diff] [blame] | 9 | * The 'struct evsel_config_term' is used to pass event |
Arnaldo Carvalho de Melo | 6ec17b4 | 2020-04-29 15:57:01 -0300 | [diff] [blame] | 10 | * specific configuration data to evsel__config routine. |
Arnaldo Carvalho de Melo | 95be9d1 | 2019-09-24 15:56:14 -0300 | [diff] [blame] | 11 | * It is allocated within event parsing and attached to |
Arnaldo Carvalho de Melo | 35ac0ca | 2020-05-06 13:05:08 -0300 | [diff] [blame] | 12 | * evsel::config_terms list head. |
Arnaldo Carvalho de Melo | 95be9d1 | 2019-09-24 15:56:14 -0300 | [diff] [blame] | 13 | */ |
| 14 | enum evsel_term_type { |
Arnaldo Carvalho de Melo | 35ac0ca | 2020-05-06 13:05:08 -0300 | [diff] [blame] | 15 | 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 Melo | 95be9d1 | 2019-09-24 15:56:14 -0300 | [diff] [blame] | 30 | }; |
| 31 | |
Arnaldo Carvalho de Melo | 35ac0ca | 2020-05-06 13:05:08 -0300 | [diff] [blame] | 32 | struct evsel_config_term { |
Arnaldo Carvalho de Melo | 95be9d1 | 2019-09-24 15:56:14 -0300 | [diff] [blame] | 33 | struct list_head list; |
| 34 | enum evsel_term_type type; |
Leo Yan | 3220fb8 | 2020-01-17 13:52:51 +0800 | [diff] [blame] | 35 | bool free_str; |
Arnaldo Carvalho de Melo | 95be9d1 | 2019-09-24 15:56:14 -0300 | [diff] [blame] | 36 | union { |
| 37 | u64 period; |
| 38 | u64 freq; |
| 39 | bool time; |
Arnaldo Carvalho de Melo | 95be9d1 | 2019-09-24 15:56:14 -0300 | [diff] [blame] | 40 | u64 stack_user; |
| 41 | int max_stack; |
| 42 | bool inherit; |
| 43 | bool overwrite; |
Arnaldo Carvalho de Melo | 95be9d1 | 2019-09-24 15:56:14 -0300 | [diff] [blame] | 44 | unsigned long max_events; |
| 45 | bool percore; |
| 46 | bool aux_output; |
Adrian Hunter | eb7a52d | 2019-11-15 14:42:17 +0200 | [diff] [blame] | 47 | u32 aux_sample_size; |
Adrian Hunter | a1ac7de | 2019-11-15 14:42:22 +0200 | [diff] [blame] | 48 | u64 cfg_chg; |
Leo Yan | e884602 | 2020-01-17 13:52:50 +0800 | [diff] [blame] | 49 | char *str; |
Arnaldo Carvalho de Melo | 95be9d1 | 2019-09-24 15:56:14 -0300 | [diff] [blame] | 50 | } val; |
| 51 | bool weak; |
| 52 | }; |
Adrian Hunter | eb7a52d | 2019-11-15 14:42:17 +0200 | [diff] [blame] | 53 | |
| 54 | struct evsel; |
| 55 | |
Arnaldo Carvalho de Melo | 35ac0ca | 2020-05-06 13:05:08 -0300 | [diff] [blame] | 56 | struct evsel_config_term *__evsel__get_config_term(struct evsel *evsel, enum evsel_term_type type); |
Adrian Hunter | eb7a52d | 2019-11-15 14:42:17 +0200 | [diff] [blame] | 57 | |
Arnaldo Carvalho de Melo | 35ac0ca | 2020-05-06 13:05:08 -0300 | [diff] [blame] | 58 | #define evsel__get_config_term(evsel, type) \ |
| 59 | __evsel__get_config_term(evsel, EVSEL__CONFIG_TERM_ ## type) |
Adrian Hunter | eb7a52d | 2019-11-15 14:42:17 +0200 | [diff] [blame] | 60 | |
Arnaldo Carvalho de Melo | 95be9d1 | 2019-09-24 15:56:14 -0300 | [diff] [blame] | 61 | #endif // __PERF_EVSEL_CONFIG_H |