journalfile_v2.ksy.in 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. meta:
  2. id: journalfile_v2`'ifdef(`VIRT_MEMBERS',`_virtmemb')
  3. endian: le
  4. application: netdata
  5. file-extension: njfv2
  6. license: GPL-3.0-or-later
  7. seq:
  8. - id: journal_v2_header
  9. type: journal_v2_header
  10. size: 4096
  11. - id: extent_list
  12. type: journal_v2_extent_list
  13. repeat: expr
  14. repeat-expr: journal_v2_header.extent_count
  15. - id: extent_trailer
  16. type: journal_v2_block_trailer
  17. - id: metric_list
  18. type: journal_v2_metric_list
  19. repeat: expr
  20. repeat-expr: journal_v2_header.metric_count
  21. - id: metric_trailer
  22. type: journal_v2_block_trailer
  23. - id: page_blocs
  24. type: journal_v2_page_block
  25. repeat: expr
  26. repeat-expr: _root.journal_v2_header.metric_count
  27. - id: padding
  28. size: _root._io.size - _root._io.pos - 4
  29. - id: journal_file_trailer
  30. type: journal_v2_block_trailer
  31. types:
  32. journal_v2_metric_list:
  33. seq:
  34. - id: uuid
  35. size: 16
  36. - id: entries
  37. type: u4
  38. - id: page_offset
  39. type: u4
  40. - id: delta_start_s
  41. type: u4
  42. - id: delta_end_s
  43. type: u4
  44. ifdef(`VIRT_MEMBERS',
  45. ` instances:
  46. page_block:
  47. type: journal_v2_page_block
  48. io: _root._io
  49. pos: page_offset
  50. ')dnl
  51. journal_v2_page_hdr:
  52. seq:
  53. - id: crc
  54. type: u4
  55. - id: uuid_offset
  56. type: u4
  57. - id: entries
  58. type: u4
  59. - id: uuid
  60. size: 16
  61. journal_v2_page_list:
  62. seq:
  63. - id: delta_start_s
  64. type: u4
  65. - id: delta_end_s
  66. type: u4
  67. - id: extent_idx
  68. type: u4
  69. - id: update_every_s
  70. type: u4
  71. - id: page_len
  72. type: u2
  73. - id: type
  74. type: u1
  75. - id: reserved
  76. type: u1
  77. ifdef(`VIRT_MEMBERS',
  78. ` instances:
  79. extent:
  80. io: _root._io
  81. type: journal_v2_extent_list
  82. pos: _root.journal_v2_header.extent_offset + (extent_idx * 16)
  83. ')dnl
  84. journal_v2_header:
  85. seq:
  86. - id: magic
  87. contents: [ 0x19, 0x10, 0x22, 0x01 ] #0x01221019
  88. - id: reserved
  89. type: u4
  90. - id: start_time_ut
  91. type: u8
  92. - id: end_time_ut
  93. type: u8
  94. - id: extent_count
  95. type: u4
  96. - id: extent_offset
  97. type: u4
  98. - id: metric_count
  99. type: u4
  100. - id: metric_offset
  101. type: u4
  102. - id: page_count
  103. type: u4
  104. - id: page_offset
  105. type: u4
  106. - id: extent_trailer_offset
  107. type: u4
  108. - id: metric_trailer_offset
  109. type: u4
  110. - id: original_file_size
  111. type: u4
  112. - id: total_file_size
  113. type: u4
  114. - id: data
  115. type: u8
  116. ifdef(`VIRT_MEMBERS',
  117. ` instances:
  118. trailer:
  119. io: _root._io
  120. type: journal_v2_block_trailer
  121. pos: _root._io.size - 4
  122. ')dnl
  123. journal_v2_block_trailer:
  124. seq:
  125. - id: checksum
  126. type: u4
  127. journal_v2_extent_list:
  128. seq:
  129. - id: datafile_offset
  130. type: u8
  131. - id: datafile_size
  132. type: u4
  133. - id: file_idx
  134. type: u2
  135. - id: page_cnt
  136. type: u1
  137. - id: padding
  138. type: u1
  139. journal_v2_page_block:
  140. seq:
  141. - id: hdr
  142. type: journal_v2_page_hdr
  143. - id: page_list
  144. type: journal_v2_page_list
  145. repeat: expr
  146. repeat-expr: hdr.entries
  147. - id: block_trailer
  148. type: journal_v2_block_trailer