perf.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. #define MAX_NR_CPUS 1024
  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_phys_addr;
  38. bool sample_weight;
  39. bool sample_time;
  40. bool sample_time_set;
  41. bool sample_cpu;
  42. bool period;
  43. bool period_set;
  44. bool running_time;
  45. bool full_auxtrace;
  46. bool auxtrace_snapshot_mode;
  47. bool record_namespaces;
  48. bool record_switch_events;
  49. bool all_kernel;
  50. bool all_user;
  51. bool tail_synthesize;
  52. bool overwrite;
  53. bool ignore_missing_thread;
  54. bool strict_freq;
  55. bool sample_id;
  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 sample_user_regs;
  63. u64 default_interval;
  64. u64 user_interval;
  65. size_t auxtrace_snapshot_size;
  66. const char *auxtrace_snapshot_opts;
  67. bool sample_transaction;
  68. unsigned initial_delay;
  69. bool use_clockid;
  70. clockid_t clockid;
  71. unsigned int proc_map_timeout;
  72. };
  73. struct option;
  74. extern const char * const *record_usage;
  75. extern struct option *record_options;
  76. extern int version_verbose;
  77. int record__parse_freq(const struct option *opt, const char *str, int unset);
  78. #endif