xref: /linux/tools/perf/util/off_cpu.h (revision 908fc4c2)
1 #ifndef PERF_UTIL_OFF_CPU_H
2 #define PERF_UTIL_OFF_CPU_H
3 
4 #include <linux/perf_event.h>
5 
6 struct evlist;
7 struct target;
8 struct perf_session;
9 struct record_opts;
10 
11 #define OFFCPU_EVENT  "offcpu-time"
12 
13 #define OFFCPU_SAMPLE_TYPES  (PERF_SAMPLE_IDENTIFIER | PERF_SAMPLE_IP | \
14 			      PERF_SAMPLE_TID | PERF_SAMPLE_TIME | \
15 			      PERF_SAMPLE_ID | PERF_SAMPLE_CPU | \
16 			      PERF_SAMPLE_PERIOD | PERF_SAMPLE_CALLCHAIN | \
17 			      PERF_SAMPLE_CGROUP)
18 
19 
20 #ifdef HAVE_BPF_SKEL
21 int off_cpu_prepare(struct evlist *evlist, struct target *target,
22 		    struct record_opts *opts);
23 int off_cpu_write(struct perf_session *session);
24 #else
25 static inline int off_cpu_prepare(struct evlist *evlist __maybe_unused,
26 				  struct target *target __maybe_unused,
27 				  struct record_opts *opts __maybe_unused)
28 {
29 	return -1;
30 }
31 
32 static inline int off_cpu_write(struct perf_session *session __maybe_unused)
33 {
34 	return -1;
35 }
36 #endif
37 
38 #endif  /* PERF_UTIL_OFF_CPU_H */
39