off_cpu.h 971 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef PERF_UTIL_OFF_CPU_H
  2. #define PERF_UTIL_OFF_CPU_H
  3. #include <linux/perf_event.h>
  4. struct evlist;
  5. struct target;
  6. struct perf_session;
  7. struct record_opts;
  8. #define OFFCPU_EVENT "offcpu-time"
  9. #define OFFCPU_SAMPLE_TYPES (PERF_SAMPLE_IDENTIFIER | PERF_SAMPLE_IP | \
  10. PERF_SAMPLE_TID | PERF_SAMPLE_TIME | \
  11. PERF_SAMPLE_ID | PERF_SAMPLE_CPU | \
  12. PERF_SAMPLE_PERIOD | PERF_SAMPLE_RAW | \
  13. PERF_SAMPLE_CGROUP)
  14. #define OFFCPU_THRESH 500000000ULL
  15. #ifdef HAVE_BPF_SKEL
  16. int off_cpu_prepare(struct evlist *evlist, struct target *target,
  17. struct record_opts *opts);
  18. int off_cpu_write(struct perf_session *session);
  19. #else
  20. static inline int off_cpu_prepare(struct evlist *evlist __maybe_unused,
  21. struct target *target __maybe_unused,
  22. struct record_opts *opts __maybe_unused)
  23. {
  24. return -1;
  25. }
  26. static inline int off_cpu_write(struct perf_session *session __maybe_unused)
  27. {
  28. return -1;
  29. }
  30. #endif
  31. #endif /* PERF_UTIL_OFF_CPU_H */