perf.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #ifndef MAX_NR_CPUS
  20. #define MAX_NR_CPUS 2048
  21. #endif
  22. extern const char *input_name;
  23. extern bool perf_host, perf_guest;
  24. extern const char perf_version_string[];
  25. void pthread__unblock_sigwinch(void);
  26. #include "util/target.h"
  27. struct record_opts {
  28. struct target target;
  29. bool group;
  30. bool inherit_stat;
  31. bool no_buffering;
  32. bool no_inherit;
  33. bool no_inherit_set;
  34. bool no_samples;
  35. bool raw_samples;
  36. bool sample_address;
  37. bool sample_weight;
  38. bool sample_time;
  39. bool sample_time_set;
  40. bool sample_cpu;
  41. bool period;
  42. bool running_time;
  43. bool full_auxtrace;
  44. bool auxtrace_snapshot_mode;
  45. bool record_switch_events;
  46. bool all_kernel;
  47. bool all_user;
  48. bool tail_synthesize;
  49. bool overwrite;
  50. unsigned int freq;
  51. unsigned int mmap_pages;
  52. unsigned int auxtrace_mmap_pages;
  53. unsigned int user_freq;
  54. u64 branch_stack;
  55. u64 sample_intr_regs;
  56. u64 default_interval;
  57. u64 user_interval;
  58. size_t auxtrace_snapshot_size;
  59. const char *auxtrace_snapshot_opts;
  60. bool sample_transaction;
  61. unsigned initial_delay;
  62. bool use_clockid;
  63. clockid_t clockid;
  64. unsigned int proc_map_timeout;
  65. };
  66. struct option;
  67. extern const char * const *record_usage;
  68. extern struct option *record_options;
  69. #endif