perf.h 2.0 KB

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