1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <uapi/linux/kcov.h>
12 /* Coverage collection is not enabled yet. */
13 KCOV_MODE_DISABLED = 0,
14 /* KCOV was initialized, but tracing mode hasn't been chosen yet. */
17 * Tracing coverage collection mode.
18 * Covered PCs are collected in a per-task buffer.
20 KCOV_MODE_TRACE_PC = 2,
21 /* Collecting comparison operands mode. */
22 KCOV_MODE_TRACE_CMP = 3,
25 #define KCOV_IN_CTXSW (1 << 30)
27 void kcov_task_init(struct task_struct *t);
28 void kcov_task_exit(struct task_struct *t);
30 #define kcov_prepare_switch(t) \
32 (t)->kcov_mode |= KCOV_IN_CTXSW; \
35 #define kcov_finish_switch(t) \
37 (t)->kcov_mode &= ~KCOV_IN_CTXSW; \
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) {}
47 #endif /* CONFIG_KCOV */
48 #endif /* _LINUX_KCOV_H */