Dmitry Vyukov | 5c9a875 | 2016-03-22 14:27:30 -0700 | [diff] [blame] | 1 | #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 Chibotaru | 9412609 | 2017-11-17 15:30:46 -0800 | [diff] [blame] | 10 | enum { |
| 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 Vyukov | 5c9a875 | 2016-03-22 14:27:30 -0700 | [diff] [blame] | 34 | #endif /* _LINUX_KCOV_IOCTLS_H */ |