perf.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef _PERF_PERF_H
  2. #define _PERF_PERF_H
  3. #include <time.h>
  4. #include <stdbool.h>
  5. #include <linux/types.h>
  6. #include <linux/perf_event.h>
  7. extern bool test_attr__enabled;
  8. void test_attr__init(void);
  9. void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
  10. int fd, int group_fd, unsigned long flags);
  11. #define HAVE_ATTR_TEST
  12. #include "perf-sys.h"
  13. static inline unsigned long long rdclock(void)
  14. {
  15. struct timespec ts;
  16. clock_gettime(CLOCK_MONOTONIC, &ts);
  17. return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
  18. }
  19. #define MAX_NR_CPUS 1024
  20. extern const char *input_name;
  21. extern bool perf_host, perf_guest;
  22. extern const char perf_version_string[];
  23. void pthread__unblock_sigwinch(void);
  24. #include "util/target.h"
  25. struct record_opts {
  26. struct target target;
  27. bool group;
  28. bool inherit_stat;
  29. bool no_buffering;
  30. bool no_inherit;
  31. bool no_inherit_set;
  32. bool no_samples;
  33. bool raw_samples;
  34. bool sample_address;
  35. bool sample_weight;
  36. bool sample_time;
  37. bool sample_time_set;
  38. bool sample_cpu;
  39. bool period;
  40. bool running_time;
  41. bool full_auxtrace;
  42. bool auxtrace_snapshot_mode;
  43. bool record_switch_events;
  44. bool all_kernel;
  45. bool all_user;
  46. bool tail_synthesize;
  47. bool overwrite;
  48. unsigned int freq;
  49. unsigned int mmap_pages;
  50. unsigned int auxtrace_mmap_pages;
  51. unsigned int user_freq;
  52. u64 branch_stack;
  53. u64 sample_intr_regs;
  54. u64 default_interval;
  55. u64 user_interval;
  56. size_t auxtrace_snapshot_size;
  57. const char *auxtrace_snapshot_opts;
  58. bool sample_transaction;
  59. unsigned initial_delay;
  60. bool use_clockid;
  61. clockid_t clockid;
  62. unsigned int proc_map_timeout;
  63. };
  64. struct option;
  65. extern const char * const *record_usage;
  66. extern struct option *record_options;
  67. #endif