0001 #ifndef PERF_UTIL_OFF_CPU_H
0002 #define PERF_UTIL_OFF_CPU_H
0003
0004 #include <linux/perf_event.h>
0005
0006 struct evlist;
0007 struct target;
0008 struct perf_session;
0009 struct record_opts;
0010
0011 #define OFFCPU_EVENT "offcpu-time"
0012
0013 #define OFFCPU_SAMPLE_TYPES (PERF_SAMPLE_IDENTIFIER | PERF_SAMPLE_IP | \
0014 PERF_SAMPLE_TID | PERF_SAMPLE_TIME | \
0015 PERF_SAMPLE_ID | PERF_SAMPLE_CPU | \
0016 PERF_SAMPLE_PERIOD | PERF_SAMPLE_CALLCHAIN | \
0017 PERF_SAMPLE_CGROUP)
0018
0019
0020 #ifdef HAVE_BPF_SKEL
0021 int off_cpu_prepare(struct evlist *evlist, struct target *target,
0022 struct record_opts *opts);
0023 int off_cpu_write(struct perf_session *session);
0024 #else
0025 static inline int off_cpu_prepare(struct evlist *evlist __maybe_unused,
0026 struct target *target __maybe_unused,
0027 struct record_opts *opts __maybe_unused)
0028 {
0029 return -1;
0030 }
0031
0032 static inline int off_cpu_write(struct perf_session *session __maybe_unused)
0033 {
0034 return -1;
0035 }
0036 #endif
0037
0038 #endif