xref: /openbmc/linux/tools/perf/util/off_cpu.h (revision 49c692b7)
1edc41a10SNamhyung Kim #ifndef PERF_UTIL_OFF_CPU_H
2edc41a10SNamhyung Kim #define PERF_UTIL_OFF_CPU_H
3edc41a10SNamhyung Kim 
4*49c692b7SNamhyung Kim #include <linux/perf_event.h>
5*49c692b7SNamhyung Kim 
6edc41a10SNamhyung Kim struct evlist;
710742d0cSNamhyung Kim struct target;
8edc41a10SNamhyung Kim struct perf_session;
9685439a7SNamhyung Kim struct record_opts;
10edc41a10SNamhyung Kim 
11edc41a10SNamhyung Kim #define OFFCPU_EVENT  "offcpu-time"
12edc41a10SNamhyung Kim 
13*49c692b7SNamhyung Kim #define OFFCPU_SAMPLE_TYPES  (PERF_SAMPLE_IDENTIFIER | PERF_SAMPLE_IP | \
14*49c692b7SNamhyung Kim 			      PERF_SAMPLE_TID | PERF_SAMPLE_TIME | \
15*49c692b7SNamhyung Kim 			      PERF_SAMPLE_ID | PERF_SAMPLE_CPU | \
16*49c692b7SNamhyung Kim 			      PERF_SAMPLE_PERIOD | PERF_SAMPLE_CALLCHAIN | \
17*49c692b7SNamhyung Kim 			      PERF_SAMPLE_CGROUP)
18*49c692b7SNamhyung Kim 
19*49c692b7SNamhyung Kim 
20edc41a10SNamhyung Kim #ifdef HAVE_BPF_SKEL
21685439a7SNamhyung Kim int off_cpu_prepare(struct evlist *evlist, struct target *target,
22685439a7SNamhyung Kim 		    struct record_opts *opts);
23edc41a10SNamhyung Kim int off_cpu_write(struct perf_session *session);
24edc41a10SNamhyung Kim #else
off_cpu_prepare(struct evlist * evlist __maybe_unused,struct target * target __maybe_unused,struct record_opts * opts __maybe_unused)2510742d0cSNamhyung Kim static inline int off_cpu_prepare(struct evlist *evlist __maybe_unused,
26685439a7SNamhyung Kim 				  struct target *target __maybe_unused,
27685439a7SNamhyung Kim 				  struct record_opts *opts __maybe_unused)
28edc41a10SNamhyung Kim {
29edc41a10SNamhyung Kim 	return -1;
30edc41a10SNamhyung Kim }
31edc41a10SNamhyung Kim 
off_cpu_write(struct perf_session * session __maybe_unused)32edc41a10SNamhyung Kim static inline int off_cpu_write(struct perf_session *session __maybe_unused)
33edc41a10SNamhyung Kim {
34edc41a10SNamhyung Kim 	return -1;
35edc41a10SNamhyung Kim }
36edc41a10SNamhyung Kim #endif
37edc41a10SNamhyung Kim 
38edc41a10SNamhyung Kim #endif  /* PERF_UTIL_OFF_CPU_H */
39