perf.h 2.2 KB

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