coverage 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #------------------------------------------------------------------------------
  2. # $File: coverage,v 1.1 2016/06/05 00:26:32 christos Exp $
  3. # xoverage: file(1) magic for test coverage data
  4. # File formats used to store test coverage data
  5. # 2016-05-21, Georg Sauthoff <mail@georg.so>
  6. # - GCC gcno - written by GCC at compile time when compiling with
  7. # gcc -ftest-coverage
  8. # - GCC gcda - written by a program that was compiled with
  9. # gcc -fprofile-arcs
  10. # - LLVM raw profiles - generated by a program compiled with
  11. # clang -fprofile-instr-generate -fcoverage-mapping ...
  12. # - LLVM indexed profiles - generated by
  13. # llvm-profdata
  14. # - GCOV reports, i.e. the annotated source code
  15. # - LCOV trace files, i.e. aggregated GCC profiles
  16. #
  17. # GCC coverage tracefiles
  18. # .gcno file are created during compile time,
  19. # while data collected during runtime is stored in .gcda files
  20. # cf. gcov-io.h
  21. # https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gcc/Gcov-Data-Files.html
  22. # Examples:
  23. # Fedora 23/x86-64/gcc-5.3.1: 6f 6e 63 67 52 33 30 35
  24. # Debian 8 PPC64/gcc-4.9.2 : 67 63 6e 6f 34 30 39 2a
  25. 0 lelong 0x67636e6f GCC gcno coverage (-ftest-coverage),
  26. >&3 byte x version %c.
  27. >&1 byte x \b%c
  28. # big endian
  29. 0 belong 0x67636e6f GCC gcno coverage (-ftest-coverage),
  30. >&0 byte x version %c.
  31. >&2 byte x \b%c (big-endian)
  32. # Examples:
  33. # Fedora 23/x86-64/gcc-5.3.1: 61 64 63 67 52 33 30 35
  34. # Debian 8 PPC64/gcc-4.9.2 : 67 63 64 61 34 30 39 2a
  35. 0 lelong 0x67636461 GCC gcda coverage (-fprofile-arcs),
  36. >&3 byte x version %c.
  37. >&1 byte x \b%c
  38. # big endian
  39. 0 belong 0x67636461 GCC gcda coverage (-fprofile-arcs),
  40. >&0 byte x version %c.
  41. >&2 byte x \b%c (big-endian)
  42. # LCOV tracefiles
  43. # cf. http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php
  44. 0 string TN:
  45. >&0 search/64 \nSF:/ LCOV coverage tracefile
  46. # Coverage reports generated by gcov
  47. # i.e. source code annoted with coverage information
  48. 0 string \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Source:
  49. >&0 search/128 \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Graph:
  50. >>&0 search/128 \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Data: GCOV coverage report
  51. # LLVM coverage files
  52. # raw data after running a program compiled with:
  53. # `clang -fprofile-instr-generate -fcoverage-mapping ...`
  54. # default name: default.profraw
  55. # magic is: \xFF lprofr \x81
  56. # cf. http://llvm.org/docs/doxygen/html/InstrProfData_8inc_source.html
  57. 0 lequad 0xff6c70726f667281 LLVM raw profile data,
  58. >&0 byte x version %d
  59. # big endian
  60. 0 bequad 0xff6c70726f667281 LLVM raw profile data,
  61. >&7 byte x version %d (big-endian)
  62. # LLVM indexed instruction profile (as generated by llvm-profdata)
  63. # magic is: reverse(\xFF lprofi \x81)
  64. # cf. http://llvm.org/docs/CoverageMappingFormat.html
  65. # http://llvm.org/docs/doxygen/html/namespacellvm_1_1IndexedInstrProf.html
  66. # http://llvm.org/docs/CommandGuide/llvm-cov.html
  67. # http://llvm.org/docs/CommandGuide/llvm-profdata.html
  68. 0 lequad 0x8169666f72706cff LLVM indexed profile data,
  69. >&0 byte x version %d
  70. # big endian
  71. 0 bequad 0x8169666f72706cff LLVM indexed profile data,
  72. >&7 byte x version %d (big-endian)