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 | /* |
| 9 | * The 'struct perf_evsel_config_term' is used to pass event |
| 10 | * specific configuration data to perf_evsel__config routine. |
| 11 | * It is allocated within event parsing and attached to |
| 12 | * perf_evsel::config_terms list head. |
| 13 | */ |
| 14 | enum evsel_term_type { |
| 15 | PERF_EVSEL__CONFIG_TERM_PERIOD, |
| 16 | PERF_EVSEL__CONFIG_TERM_FREQ, |
| 17 | PERF_EVSEL__CONFIG_TERM_TIME, |
| 18 | PERF_EVSEL__CONFIG_TERM_CALLGRAPH, |
| 19 | PERF_EVSEL__CONFIG_TERM_STACK_USER, |
| 20 | PERF_EVSEL__CONFIG_TERM_INHERIT, |
| 21 | PERF_EVSEL__CONFIG_TERM_MAX_STACK, |
| 22 | PERF_EVSEL__CONFIG_TERM_MAX_EVENTS, |
| 23 | PERF_EVSEL__CONFIG_TERM_OVERWRITE, |
| 24 | PERF_EVSEL__CONFIG_TERM_DRV_CFG, |
| 25 | PERF_EVSEL__CONFIG_TERM_BRANCH, |
| 26 | PERF_EVSEL__CONFIG_TERM_PERCORE, |
| 27 | PERF_EVSEL__CONFIG_TERM_AUX_OUTPUT, |
Adrian Hunter | eb7a52d | 2019-11-15 14:42:17 +0200 | [diff] [blame^] | 28 | PERF_EVSEL__CONFIG_TERM_AUX_SAMPLE_SIZE, |
Arnaldo Carvalho de Melo | 95be9d1 | 2019-09-24 15:56:14 -0300 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | struct perf_evsel_config_term { |
| 32 | struct list_head list; |
| 33 | enum evsel_term_type type; |
| 34 | union { |
| 35 | u64 period; |
| 36 | u64 freq; |
| 37 | bool time; |
| 38 | char *callgraph; |
| 39 | char *drv_cfg; |
| 40 | u64 stack_user; |
| 41 | int max_stack; |
| 42 | bool inherit; |
| 43 | bool overwrite; |
| 44 | char *branch; |
| 45 | unsigned long max_events; |
| 46 | bool percore; |
| 47 | bool aux_output; |
Adrian Hunter | eb7a52d | 2019-11-15 14:42:17 +0200 | [diff] [blame^] | 48 | u32 aux_sample_size; |
Arnaldo Carvalho de Melo | 95be9d1 | 2019-09-24 15:56:14 -0300 | [diff] [blame] | 49 | } val; |
| 50 | bool weak; |
| 51 | }; |
Adrian Hunter | eb7a52d | 2019-11-15 14:42:17 +0200 | [diff] [blame^] | 52 | |
| 53 | struct evsel; |
| 54 | |
| 55 | struct perf_evsel_config_term *__perf_evsel__get_config_term(struct evsel *evsel, |
| 56 | enum evsel_term_type type); |
| 57 | |
| 58 | #define perf_evsel__get_config_term(evsel, type) \ |
| 59 | __perf_evsel__get_config_term(evsel, PERF_EVSEL__CONFIG_TERM_ ## type) |
| 60 | |
Arnaldo Carvalho de Melo | 95be9d1 | 2019-09-24 15:56:14 -0300 | [diff] [blame] | 61 | #endif // __PERF_EVSEL_CONFIG_H |