generates dual ksy for njfv2 + fix for padding after page blocks (#14383)
* add ability to generate different ksys * fix dist * fix page_block by metric count instead of till EOF
This commit is contained in:
parent
d8d467d87f
commit
2ec714523a
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1,2 +1,3 @@
|
|||||||
*.c diff=cpp
|
*.c diff=cpp
|
||||||
*.h diff=cpp
|
*.h diff=cpp
|
||||||
|
*.ksy.in linguist-language=ksy
|
||||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -231,3 +231,7 @@ Session.*.vim
|
|||||||
# Judy stuff
|
# Judy stuff
|
||||||
JudyLTables.c
|
JudyLTables.c
|
||||||
judyltablesgen
|
judyltablesgen
|
||||||
|
|
||||||
|
# m4 generated ksys
|
||||||
|
database/engine/journalfile_v2.ksy
|
||||||
|
database/engine/journalfile_v2_virtmemb.ksy
|
||||||
|
15
Makefile.am
15
Makefile.am
@ -78,6 +78,7 @@ dist_noinst_DATA = \
|
|||||||
packaging/protobuf.checksums \
|
packaging/protobuf.checksums \
|
||||||
packaging/protobuf.version \
|
packaging/protobuf.version \
|
||||||
packaging/version \
|
packaging/version \
|
||||||
|
database/engine/journalfile_v2.ksy.in \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
# until integrated within build
|
# until integrated within build
|
||||||
@ -555,6 +556,20 @@ if ENABLE_DBENGINE
|
|||||||
database/engine/pdc.c \
|
database/engine/pdc.c \
|
||||||
database/engine/pdc.h \
|
database/engine/pdc.h \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
RRD_PLUGIN_KSY_BUILTFILES = \
|
||||||
|
database/engine/journalfile_v2.ksy \
|
||||||
|
database/engine/journalfile_v2_virtmemb.ksy \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
BUILT_SOURCES += $(RRD_PLUGIN_KSY_BUILTFILES)
|
||||||
|
CLEANFILES += $(RRD_PLUGIN_KSY_BUILTFILES)
|
||||||
|
|
||||||
|
database/engine/journalfile_v2.ksy: $(abs_top_srcdir)/database/engine/journalfile_v2.ksy.in
|
||||||
|
m4 $(abs_top_srcdir)/database/engine/journalfile_v2.ksy.in > $@
|
||||||
|
|
||||||
|
database/engine/journalfile_v2_virtmemb.ksy: $(abs_top_srcdir)/database/engine/journalfile_v2.ksy.in
|
||||||
|
m4 -DVIRT_MEMBERS $(abs_top_srcdir)/database/engine/journalfile_v2.ksy.in > $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
API_PLUGIN_FILES = \
|
API_PLUGIN_FILES = \
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
meta:
|
meta:
|
||||||
id: netdata_journalfile_v2
|
id: journalfile_v2`'ifdef(`VIRT_MEMBERS',`_virtmemb')
|
||||||
endian: le
|
endian: le
|
||||||
|
application: netdata
|
||||||
|
file-extension: njfv2
|
||||||
|
license: GPL-3.0-or-later
|
||||||
|
|
||||||
seq:
|
seq:
|
||||||
- id: journal_v2_header
|
- id: journal_v2_header
|
||||||
@ -19,12 +22,14 @@ seq:
|
|||||||
- id: metric_trailer
|
- id: metric_trailer
|
||||||
type: journal_v2_block_trailer
|
type: journal_v2_block_trailer
|
||||||
- id: page_blocs
|
- id: page_blocs
|
||||||
type: jounral_v2_page_blocs
|
type: journal_v2_page_block
|
||||||
|
repeat: expr
|
||||||
|
repeat-expr: _root.journal_v2_header.metric_count
|
||||||
|
- id: padding
|
||||||
size: _root._io.size - _root._io.pos - 4
|
size: _root._io.size - _root._io.pos - 4
|
||||||
- id: journal_file_trailer
|
- id: journal_file_trailer
|
||||||
type: journal_v2_block_trailer
|
type: journal_v2_block_trailer
|
||||||
|
|
||||||
|
|
||||||
types:
|
types:
|
||||||
journal_v2_metric_list:
|
journal_v2_metric_list:
|
||||||
seq:
|
seq:
|
||||||
@ -38,11 +43,13 @@ types:
|
|||||||
type: u4
|
type: u4
|
||||||
- id: delta_end_s
|
- id: delta_end_s
|
||||||
type: u4
|
type: u4
|
||||||
instances:
|
ifdef(`VIRT_MEMBERS',
|
||||||
|
` instances:
|
||||||
page_block:
|
page_block:
|
||||||
type: journal_v2_page_block
|
type: journal_v2_page_block
|
||||||
io: _root._io
|
io: _root._io
|
||||||
pos: page_offset
|
pos: page_offset
|
||||||
|
')dnl
|
||||||
journal_v2_page_hdr:
|
journal_v2_page_hdr:
|
||||||
seq:
|
seq:
|
||||||
- id: crc
|
- id: crc
|
||||||
@ -69,11 +76,13 @@ types:
|
|||||||
type: u1
|
type: u1
|
||||||
- id: reserved
|
- id: reserved
|
||||||
type: u1
|
type: u1
|
||||||
instances:
|
ifdef(`VIRT_MEMBERS',
|
||||||
|
` instances:
|
||||||
extent:
|
extent:
|
||||||
io: _root._io
|
io: _root._io
|
||||||
type: journal_v2_extent_list
|
type: journal_v2_extent_list
|
||||||
pos: _root.journal_v2_header.extent_offset + (extent_idx * 16)
|
pos: _root.journal_v2_header.extent_offset + (extent_idx * 16)
|
||||||
|
')dnl
|
||||||
journal_v2_header:
|
journal_v2_header:
|
||||||
seq:
|
seq:
|
||||||
- id: magic
|
- id: magic
|
||||||
@ -106,11 +115,13 @@ types:
|
|||||||
type: u4
|
type: u4
|
||||||
- id: data
|
- id: data
|
||||||
type: u8
|
type: u8
|
||||||
instances:
|
ifdef(`VIRT_MEMBERS',
|
||||||
|
` instances:
|
||||||
trailer:
|
trailer:
|
||||||
io: _root._io
|
io: _root._io
|
||||||
type: journal_v2_block_trailer
|
type: journal_v2_block_trailer
|
||||||
pos: _root._io.size - 4
|
pos: _root._io.size - 4
|
||||||
|
')dnl
|
||||||
journal_v2_block_trailer:
|
journal_v2_block_trailer:
|
||||||
seq:
|
seq:
|
||||||
- id: checksum
|
- id: checksum
|
||||||
@ -137,8 +148,3 @@ types:
|
|||||||
repeat-expr: hdr.entries
|
repeat-expr: hdr.entries
|
||||||
- id: block_trailer
|
- id: block_trailer
|
||||||
type: journal_v2_block_trailer
|
type: journal_v2_block_trailer
|
||||||
jounral_v2_page_blocs:
|
|
||||||
seq:
|
|
||||||
- id: blocs
|
|
||||||
type: journal_v2_page_block
|
|
||||||
repeat: eos
|
|
Loading…
Reference in New Issue
Block a user