blob: 33b826b9946ed3a1b7acd8e7d86632222a6c9358 [file] [log] [blame]
Dmitry Vyukov5c9a8752016-03-22 14:27:30 -07001#ifndef _LINUX_KCOV_IOCTLS_H
2#define _LINUX_KCOV_IOCTLS_H
3
4#include <linux/types.h>
5
6#define KCOV_INIT_TRACE _IOR('c', 1, unsigned long)
7#define KCOV_ENABLE _IO('c', 100)
8#define KCOV_DISABLE _IO('c', 101)
9
Victor Chibotaru94126092017-11-17 15:30:46 -080010enum {
11 /*
12 * Tracing coverage collection mode.
13 * Covered PCs are collected in a per-task buffer.
14 * In new KCOV version the mode is chosen by calling
15 * ioctl(fd, KCOV_ENABLE, mode). In older versions the mode argument
16 * was supposed to be 0 in such a call. So, for reasons of backward
17 * compatibility, we have chosen the value KCOV_TRACE_PC to be 0.
18 */
19 KCOV_TRACE_PC = 0,
20 /* Collecting comparison operands mode. */
21 KCOV_TRACE_CMP = 1,
22};
23
24/*
25 * The format for the types of collected comparisons.
26 *
27 * Bit 0 shows whether one of the arguments is a compile-time constant.
28 * Bits 1 & 2 contain log2 of the argument size, up to 8 bytes.
29 */
30#define KCOV_CMP_CONST (1 << 0)
31#define KCOV_CMP_SIZE(n) ((n) << 1)
32#define KCOV_CMP_MASK KCOV_CMP_SIZE(3)
33
Dmitry Vyukov5c9a8752016-03-22 14:27:30 -070034#endif /* _LINUX_KCOV_IOCTLS_H */