kcov.h 1.1 KB

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