Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1#ifndef PERF_UTIL_OFF_CPU_H
2#define PERF_UTIL_OFF_CPU_H
3
4#include <linux/perf_event.h>
5
6struct evlist;
7struct target;
8struct perf_session;
9struct 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_RAW | \
17 PERF_SAMPLE_CGROUP)
18
19#define OFFCPU_THRESH 500000000ULL
20
21#ifdef HAVE_BPF_SKEL
22int off_cpu_prepare(struct evlist *evlist, struct target *target,
23 struct record_opts *opts);
24int off_cpu_write(struct perf_session *session);
25#else
26static inline int off_cpu_prepare(struct evlist *evlist __maybe_unused,
27 struct target *target __maybe_unused,
28 struct record_opts *opts __maybe_unused)
29{
30 return -1;
31}
32
33static inline int off_cpu_write(struct perf_session *session __maybe_unused)
34{
35 return -1;
36}
37#endif
38
39#endif /* PERF_UTIL_OFF_CPU_H */