perf.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #ifndef NSEC_PER_SEC
  14. # define NSEC_PER_SEC 1000000000ULL
  15. #endif
  16. #ifndef NSEC_PER_USEC
  17. # define NSEC_PER_USEC 1000ULL
  18. #endif
  19. static inline unsigned long long rdclock(void)
  20. {
  21. struct timespec ts;
  22. clock_gettime(CLOCK_MONOTONIC, &ts);
  23. return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
  24. }
  25. #define MAX_NR_CPUS 256
  26. extern const char *input_name;
  27. extern bool perf_host, perf_guest;
  28. extern const char perf_version_string[];
  29. void pthread__unblock_sigwinch(void);
  30. #include "util/target.h"
  31. struct record_opts {
  32. struct target target;
  33. bool group;
  34. bool inherit_stat;
  35. bool no_buffering;
  36. bool no_inherit;
  37. bool no_inherit_set;
  38. bool no_samples;
  39. bool raw_samples;
  40. bool sample_address;
  41. bool sample_weight;
  42. bool sample_time;
  43. bool period;
  44. bool sample_intr_regs;
  45. unsigned int freq;
  46. unsigned int mmap_pages;
  47. unsigned int user_freq;
  48. u64 branch_stack;
  49. u64 default_interval;
  50. u64 user_interval;
  51. bool sample_transaction;
  52. unsigned initial_delay;
  53. };
  54. struct option;
  55. extern const char * const *record_usage;
  56. extern struct option *record_options;
  57. #endif