record.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _PERF_RECORD_H
  3. #define _PERF_RECORD_H
  4. #include <time.h>
  5. #include <stdbool.h>
  6. #include <linux/types.h>
  7. #include <linux/stddef.h>
  8. #include <linux/perf_event.h>
  9. #include "util/target.h"
  10. struct option;
  11. struct record_opts {
  12. struct target target;
  13. bool group;
  14. bool inherit_stat;
  15. bool no_buffering;
  16. bool no_inherit;
  17. bool no_inherit_set;
  18. bool no_samples;
  19. bool raw_samples;
  20. bool sample_address;
  21. bool sample_phys_addr;
  22. bool sample_weight;
  23. bool sample_time;
  24. bool sample_time_set;
  25. bool sample_cpu;
  26. bool period;
  27. bool period_set;
  28. bool running_time;
  29. bool full_auxtrace;
  30. bool auxtrace_snapshot_mode;
  31. bool auxtrace_snapshot_on_exit;
  32. bool auxtrace_sample_mode;
  33. bool record_namespaces;
  34. bool record_cgroup;
  35. bool record_switch_events;
  36. bool record_switch_events_set;
  37. bool all_kernel;
  38. bool all_user;
  39. bool kernel_callchains;
  40. bool user_callchains;
  41. bool tail_synthesize;
  42. bool overwrite;
  43. bool ignore_missing_thread;
  44. bool strict_freq;
  45. bool sample_id;
  46. bool no_bpf_event;
  47. bool kcore;
  48. bool text_poke;
  49. unsigned int freq;
  50. unsigned int mmap_pages;
  51. unsigned int auxtrace_mmap_pages;
  52. unsigned int user_freq;
  53. u64 branch_stack;
  54. u64 sample_intr_regs;
  55. u64 sample_user_regs;
  56. u64 default_interval;
  57. u64 user_interval;
  58. size_t auxtrace_snapshot_size;
  59. const char *auxtrace_snapshot_opts;
  60. const char *auxtrace_sample_opts;
  61. bool sample_transaction;
  62. int initial_delay;
  63. bool use_clockid;
  64. clockid_t clockid;
  65. u64 clockid_res_ns;
  66. int nr_cblocks;
  67. int affinity;
  68. int mmap_flush;
  69. unsigned int comp_level;
  70. unsigned int nr_threads_synthesize;
  71. int ctl_fd;
  72. int ctl_fd_ack;
  73. bool ctl_fd_close;
  74. };
  75. extern const char * const *record_usage;
  76. extern struct option *record_options;
  77. int record__parse_freq(const struct option *opt, const char *str, int unset);
  78. static inline bool record_opts__no_switch_events(const struct record_opts *opts)
  79. {
  80. return opts->record_switch_events_set && !opts->record_switch_events;
  81. }
  82. #endif // _PERF_RECORD_H