evsel_config.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // SPDX-License-Identifier: GPL-2.0
  2. #ifndef __PERF_EVSEL_CONFIG_H
  3. #define __PERF_EVSEL_CONFIG_H 1
  4. #include <linux/types.h>
  5. #include <stdbool.h>
  6. /*
  7. * The 'struct evsel_config_term' is used to pass event
  8. * specific configuration data to evsel__config routine.
  9. * It is allocated within event parsing and attached to
  10. * evsel::config_terms list head.
  11. */
  12. enum evsel_term_type {
  13. EVSEL__CONFIG_TERM_PERIOD,
  14. EVSEL__CONFIG_TERM_FREQ,
  15. EVSEL__CONFIG_TERM_TIME,
  16. EVSEL__CONFIG_TERM_CALLGRAPH,
  17. EVSEL__CONFIG_TERM_STACK_USER,
  18. EVSEL__CONFIG_TERM_INHERIT,
  19. EVSEL__CONFIG_TERM_MAX_STACK,
  20. EVSEL__CONFIG_TERM_MAX_EVENTS,
  21. EVSEL__CONFIG_TERM_OVERWRITE,
  22. EVSEL__CONFIG_TERM_DRV_CFG,
  23. EVSEL__CONFIG_TERM_BRANCH,
  24. EVSEL__CONFIG_TERM_PERCORE,
  25. EVSEL__CONFIG_TERM_AUX_OUTPUT,
  26. EVSEL__CONFIG_TERM_AUX_SAMPLE_SIZE,
  27. EVSEL__CONFIG_TERM_CFG_CHG,
  28. };
  29. struct evsel_config_term {
  30. struct list_head list;
  31. enum evsel_term_type type;
  32. bool free_str;
  33. union {
  34. u64 period;
  35. u64 freq;
  36. bool time;
  37. u64 stack_user;
  38. int max_stack;
  39. bool inherit;
  40. bool overwrite;
  41. unsigned long max_events;
  42. bool percore;
  43. bool aux_output;
  44. u32 aux_sample_size;
  45. u64 cfg_chg;
  46. char *str;
  47. } val;
  48. bool weak;
  49. };
  50. struct evsel;
  51. struct evsel_config_term *__evsel__get_config_term(struct evsel *evsel, enum evsel_term_type type);
  52. #define evsel__get_config_term(evsel, type) \
  53. __evsel__get_config_term(evsel, EVSEL__CONFIG_TERM_ ## type)
  54. #endif // __PERF_EVSEL_CONFIG_H