perf.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. int call_graph;
  34. bool call_graph_enabled;
  35. bool group;
  36. bool inherit_stat;
  37. bool no_buffering;
  38. bool no_inherit;
  39. bool no_inherit_set;
  40. bool no_samples;
  41. bool raw_samples;
  42. bool sample_address;
  43. bool sample_weight;
  44. bool sample_time;
  45. bool period;
  46. unsigned int freq;
  47. unsigned int mmap_pages;
  48. unsigned int user_freq;
  49. u64 branch_stack;
  50. u64 default_interval;
  51. u64 user_interval;
  52. u16 stack_dump_size;
  53. bool sample_transaction;
  54. unsigned initial_delay;
  55. };
  56. #endif