This source file includes following definitions.
- kcov_task_init
- kcov_task_exit
- kcov_prepare_switch
- kcov_finish_switch
1
2 #ifndef _LINUX_KCOV_H
3 #define _LINUX_KCOV_H
4
5 #include <uapi/linux/kcov.h>
6
7 struct task_struct;
8
9 #ifdef CONFIG_KCOV
10
11 enum kcov_mode {
12
13 KCOV_MODE_DISABLED = 0,
14
15 KCOV_MODE_INIT = 1,
16
17
18
19
20 KCOV_MODE_TRACE_PC = 2,
21
22 KCOV_MODE_TRACE_CMP = 3,
23 };
24
25 #define KCOV_IN_CTXSW (1 << 30)
26
27 void kcov_task_init(struct task_struct *t);
28 void kcov_task_exit(struct task_struct *t);
29
30 #define kcov_prepare_switch(t) \
31 do { \
32 (t)->kcov_mode |= KCOV_IN_CTXSW; \
33 } while (0)
34
35 #define kcov_finish_switch(t) \
36 do { \
37 (t)->kcov_mode &= ~KCOV_IN_CTXSW; \
38 } while (0)
39
40 #else
41
42 static inline void kcov_task_init(struct task_struct *t) {}
43 static inline void kcov_task_exit(struct task_struct *t) {}
44 static inline void kcov_prepare_switch(struct task_struct *t) {}
45 static inline void kcov_finish_switch(struct task_struct *t) {}
46
47 #endif
48 #endif