--- /dev/null
+# The MIT License (MIT)
+#
+# Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+--- !<tag:barectf.org,2020/3/config>
+target-byte-order: le
+trace:
+ type:
+ $include:
+ - stdint.yaml
+ stream-types:
+ default:
+ $is-default: yes
+ event-types:
+ ev:
+ payload-field-type:
+ class: struct
+ members:
+ - array:
+ field-type:
+ class: static-array
+ length: 2
+ element-field-type:
+ class: static-array
+ length: 2
+ element-field-type:
+ class: static-array
+ length: 2
+ element-field-type:
+ class: static-array
+ length: 2
+ element-field-type:
+ class: static-array
+ length: 2
+ element-field-type: uint8
+...
--- /dev/null
+# The MIT License (MIT)
+#
+# Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+--- !<tag:barectf.org,2020/3/config>
+target-byte-order: le
+trace:
+ type:
+ $include:
+ - stdreal.yaml
+ stream-types:
+ default:
+ $is-default: yes
+ event-types:
+ ev:
+ payload-field-type:
+ class: struct
+ members:
+ - array:
+ field-type:
+ class: static-array
+ length: 4
+ element-field-type: double
+...
--- /dev/null
+# The MIT License (MIT)
+#
+# Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+--- !<tag:barectf.org,2020/3/config>
+target-byte-order: le
+trace:
+ type:
+ $include:
+ - stdreal.yaml
+ stream-types:
+ default:
+ $is-default: yes
+ event-types:
+ ev:
+ payload-field-type:
+ class: struct
+ members:
+ - array:
+ field-type:
+ class: static-array
+ length: 2
+ element-field-type:
+ class: static-array
+ length: 3
+ element-field-type: double
+...
--- /dev/null
+# The MIT License (MIT)
+#
+# Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+--- !<tag:barectf.org,2020/3/config>
+target-byte-order: le
+trace:
+ type:
+ $include:
+ - stdmisc.yaml
+ stream-types:
+ default:
+ $is-default: yes
+ event-types:
+ ev:
+ payload-field-type:
+ class: struct
+ members:
+ - array:
+ field-type:
+ class: static-array
+ length: 2
+ element-field-type:
+ class: static-array
+ length: 3
+ element-field-type: str
+...
--- /dev/null
+# The MIT License (MIT)
+#
+# Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+--- !<tag:barectf.org,2020/3/config>
+target-byte-order: le
+trace:
+ type:
+ $include:
+ - stdint.yaml
+ stream-types:
+ default:
+ $is-default: yes
+ event-types:
+ ev:
+ payload-field-type:
+ class: struct
+ members:
+ - array:
+ field-type:
+ class: static-array
+ length: 2
+ element-field-type:
+ class: static-array
+ length: 3
+ element-field-type: uint8
+...
--- /dev/null
+# The MIT License (MIT)
+#
+# Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+--- !<tag:barectf.org,2020/3/config>
+target-byte-order: le
+trace:
+ type:
+ $include:
+ - stdmisc.yaml
+ stream-types:
+ default:
+ $is-default: yes
+ event-types:
+ ev:
+ payload-field-type:
+ class: struct
+ members:
+ - array:
+ field-type:
+ class: static-array
+ length: 3
+ element-field-type: str
+...
--- /dev/null
+# The MIT License (MIT)
+#
+# Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+--- !<tag:barectf.org,2020/3/config>
+target-byte-order: le
+trace:
+ type:
+ $include:
+ - stdint.yaml
+ - stdmisc.yaml
+ stream-types:
+ default:
+ $is-default: yes
+ event-types:
+ ev:
+ payload-field-type:
+ class: struct
+ members:
+ - before: uint32
+ - array:
+ field-type:
+ class: static-array
+ length: 5
+ element-field-type:
+ class: uint
+ size: 3
+ - after: str
+...
--- /dev/null
+# The MIT License (MIT)
+#
+# Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+--- !<tag:barectf.org,2020/3/config>
+target-byte-order: le
+trace:
+ type:
+ $include:
+ - stdint.yaml
+ stream-types:
+ default:
+ $is-default: yes
+ event-types:
+ ev:
+ payload-field-type:
+ class: struct
+ members:
+ - array:
+ field-type:
+ class: static-array
+ length: 5
+ element-field-type:
+ class: uint
+ size: 3
+...
--- /dev/null
+# The MIT License (MIT)
+#
+# Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+--- !<tag:barectf.org,2020/3/config>
+target-byte-order: le
+trace:
+ type:
+ $include:
+ - stdint.yaml
+ stream-types:
+ default:
+ $is-default: yes
+ event-types:
+ ev:
+ payload-field-type:
+ class: struct
+ members:
+ - array:
+ field-type:
+ class: static-array
+ length: 7
+ element-field-type: uint8
+...
--- /dev/null
+# The MIT License (MIT)
+#
+# Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+--- !<tag:barectf.org,2020/3/config>
+target-byte-order: le
+trace:
+ type:
+ $include:
+ - stdint.yaml
+ stream-types:
+ default:
+ $is-default: yes
+ event-types:
+ ev:
+ payload-field-type:
+ class: struct
+ members:
+ - before: uint8
+ - array:
+ field-type:
+ class: static-array
+ length: 0
+ element-field-type:
+ class: uint
+ size: 8
+ alignment: 64
+ - after: uint8
+...
--- /dev/null
+# The MIT License (MIT)
+#
+# Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+import pytest
+import os
+import os.path
+import barectf
+import shutil
+import subprocess
+
+
+@pytest.fixture
+def tracing_succeed_test(yaml_cfg_path, request, tmpdir):
+ def func():
+ test_dir = os.path.dirname(request.fspath)
+
+ # Use the test's module and function names to automatically find
+ # the test-specific expectation files.
+ #
+ # For:
+ #
+ # Test module name:
+ # `test_succeed_hello_there.py`
+ #
+ # Test function name:
+ # `test_how_are_you`
+ #
+ # The corresponding base expectation file path is
+ # `expect/succeed/hello-there/how-are-you'.
+ elems = [test_dir, 'expect']
+ mod = request.module.__name__
+ mod = mod.replace('test_', '')
+ mod = mod.replace('_', '-')
+ parts = mod.split('-')
+ elems.append(parts[0])
+ elems.append('-'.join(parts[1:]))
+ func = request.function.__name__
+ func = func.replace('test_', '')
+ func = func.replace('_', '-')
+ elems.append(func)
+ expect_base_path = os.path.join(*elems)
+
+ # Use the test's module and function names to automatically find
+ # the test-specific C source file.
+ #
+ # For:
+ #
+ # Test module name:
+ # `test_succeed_hello_there.py`
+ #
+ # Test function name:
+ # `test_how_are_you`
+ #
+ # The corresponding expectation file path is
+ # `src/succeed/hello-there/how-are-you.c'.
+ elems = [test_dir, 'src']
+ mod = request.module.__name__
+ mod = mod.replace('test_', '')
+ mod = mod.replace('_', '-')
+ parts = mod.split('-')
+ elems.append(parts[0])
+ elems.append('-'.join(parts[1:]))
+ func = request.function.__name__
+ func = func.replace('test_', '')
+ func = func.replace('_', '-')
+ elems.append(f'{func}.c')
+ src_path = os.path.join(*elems)
+
+ # create barectf configuration
+ with open(yaml_cfg_path) as f:
+ cfg = barectf.configuration_from_file(f)
+
+ # generate and write C code files
+ cg = barectf.CodeGenerator(cfg)
+ files = cg.generate_c_headers()
+ files += cg.generate_c_sources()
+
+ for file in files:
+ with open(os.path.join(tmpdir, file.name), 'w') as f:
+ f.write(file.contents)
+
+ # generate metadata stream, stripping the version and date
+ file = cg.generate_metadata_stream()
+ lines = file.contents.split('\n')
+ new_lines = []
+ discard_patterns = [
+ 'Copyright (c)',
+ 'The following code was generated',
+ '* on ',
+ 'barectf_gen_date =',
+ 'tracer_major =',
+ 'tracer_minor =',
+ 'tracer_patch =',
+ ]
+
+ for line in lines:
+ skip = False
+
+ for pattern in discard_patterns:
+ if pattern in line:
+ skip = True
+
+ if skip:
+ continue
+
+ new_lines.append(line)
+
+ actual_metadata = '\n'.join(new_lines)
+
+ # copy Makefile to build directory
+ support_dir = os.path.join(test_dir, 'support')
+ shutil.copy(os.path.join(support_dir, 'Makefile'), tmpdir)
+
+ # copy platform files to build directory
+ shutil.copy(os.path.join(support_dir, 'test-platform.c'), tmpdir)
+ shutil.copy(os.path.join(support_dir, 'test-platform.h'), tmpdir)
+
+ # copy specific source code file to build directory
+ shutil.copy(src_path, os.path.join(tmpdir, 'test.c'))
+
+ # build the test
+ subprocess.check_output(['make'], cwd=tmpdir)
+
+ # run the test (produce the data stream)
+ subprocess.check_output(['./test'], cwd=tmpdir)
+
+ # read actual stream
+ with open(os.path.join(tmpdir, 'stream'), 'rb') as f:
+ actual_stream = f.read()
+
+ # read data stream expectation file
+ with open(f'{expect_base_path}.data.expect', 'rb') as f:
+ expected_stream = f.read()
+
+ # read metadata stream expectation file
+ with open(f'{expect_base_path}.metadata.expect', 'r') as f:
+ expected_metadata = f.read()
+
+ # validate streams
+ assert actual_metadata == expected_metadata
+ assert actual_stream == expected_stream
+
+ return func
--- /dev/null
+/* CTF 1.8 */
+
+/*
+ * The MIT License (MIT)
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ *
+ *
+ * For more details, see <https://barectf.org/>.
+ */
+
+trace {
+ major = 1;
+ minor = 8;
+ byte_order = le;
+ packet.header := struct {
+ integer {
+ signed = false;
+ size = 32;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } magic;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } stream_id;
+ } align(8);
+};
+
+env {
+ domain = "bare";
+ tracer_name = "barectf";
+};
+
+/* Stream type `default` */
+stream {
+ id = 0;
+ packet.context := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } packet_size;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } content_size;
+ } align(8);
+ event.header := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } id;
+ } align(8);
+};
+
+event {
+ stream_id = 0;
+ id = 0;
+ name = "ev";
+ fields := struct {
+ integer {
+ signed = false;
+ size = 8;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } array[2][2][2][2][2];
+ } align(1);
+};
--- /dev/null
+/* CTF 1.8 */
+
+/*
+ * The MIT License (MIT)
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ *
+ *
+ * For more details, see <https://barectf.org/>.
+ */
+
+trace {
+ major = 1;
+ minor = 8;
+ byte_order = le;
+ packet.header := struct {
+ integer {
+ signed = false;
+ size = 32;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } magic;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } stream_id;
+ } align(8);
+};
+
+env {
+ domain = "bare";
+ tracer_name = "barectf";
+};
+
+/* Stream type `default` */
+stream {
+ id = 0;
+ packet.context := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } packet_size;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } content_size;
+ } align(8);
+ event.header := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } id;
+ } align(8);
+};
+
+event {
+ stream_id = 0;
+ id = 0;
+ name = "ev";
+ fields := struct {
+ floating_point {
+ mant_dig = 53;
+ exp_dig = 11;
+ align = 64;
+ byte_order = native;
+ } array[4];
+ } align(1);
+};
--- /dev/null
+/* CTF 1.8 */
+
+/*
+ * The MIT License (MIT)
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ *
+ *
+ * For more details, see <https://barectf.org/>.
+ */
+
+trace {
+ major = 1;
+ minor = 8;
+ byte_order = le;
+ packet.header := struct {
+ integer {
+ signed = false;
+ size = 32;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } magic;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } stream_id;
+ } align(8);
+};
+
+env {
+ domain = "bare";
+ tracer_name = "barectf";
+};
+
+/* Stream type `default` */
+stream {
+ id = 0;
+ packet.context := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } packet_size;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } content_size;
+ } align(8);
+ event.header := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } id;
+ } align(8);
+};
+
+event {
+ stream_id = 0;
+ id = 0;
+ name = "ev";
+ fields := struct {
+ floating_point {
+ mant_dig = 53;
+ exp_dig = 11;
+ align = 64;
+ byte_order = native;
+ } array[2][3];
+ } align(1);
+};
--- /dev/null
+/* CTF 1.8 */
+
+/*
+ * The MIT License (MIT)
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ *
+ *
+ * For more details, see <https://barectf.org/>.
+ */
+
+trace {
+ major = 1;
+ minor = 8;
+ byte_order = le;
+ packet.header := struct {
+ integer {
+ signed = false;
+ size = 32;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } magic;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } stream_id;
+ } align(8);
+};
+
+env {
+ domain = "bare";
+ tracer_name = "barectf";
+};
+
+/* Stream type `default` */
+stream {
+ id = 0;
+ packet.context := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } packet_size;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } content_size;
+ } align(8);
+ event.header := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } id;
+ } align(8);
+};
+
+event {
+ stream_id = 0;
+ id = 0;
+ name = "ev";
+ fields := struct {
+ string {
+ encoding = UTF8;
+ } array[2][3];
+ } align(1);
+};
--- /dev/null
+/* CTF 1.8 */
+
+/*
+ * The MIT License (MIT)
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ *
+ *
+ * For more details, see <https://barectf.org/>.
+ */
+
+trace {
+ major = 1;
+ minor = 8;
+ byte_order = le;
+ packet.header := struct {
+ integer {
+ signed = false;
+ size = 32;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } magic;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } stream_id;
+ } align(8);
+};
+
+env {
+ domain = "bare";
+ tracer_name = "barectf";
+};
+
+/* Stream type `default` */
+stream {
+ id = 0;
+ packet.context := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } packet_size;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } content_size;
+ } align(8);
+ event.header := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } id;
+ } align(8);
+};
+
+event {
+ stream_id = 0;
+ id = 0;
+ name = "ev";
+ fields := struct {
+ integer {
+ signed = false;
+ size = 8;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } array[2][3];
+ } align(1);
+};
--- /dev/null
+/* CTF 1.8 */
+
+/*
+ * The MIT License (MIT)
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ *
+ *
+ * For more details, see <https://barectf.org/>.
+ */
+
+trace {
+ major = 1;
+ minor = 8;
+ byte_order = le;
+ packet.header := struct {
+ integer {
+ signed = false;
+ size = 32;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } magic;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } stream_id;
+ } align(8);
+};
+
+env {
+ domain = "bare";
+ tracer_name = "barectf";
+};
+
+/* Stream type `default` */
+stream {
+ id = 0;
+ packet.context := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } packet_size;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } content_size;
+ } align(8);
+ event.header := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } id;
+ } align(8);
+};
+
+event {
+ stream_id = 0;
+ id = 0;
+ name = "ev";
+ fields := struct {
+ string {
+ encoding = UTF8;
+ } array[3];
+ } align(1);
+};
--- /dev/null
+/* CTF 1.8 */
+
+/*
+ * The MIT License (MIT)
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ *
+ *
+ * For more details, see <https://barectf.org/>.
+ */
+
+trace {
+ major = 1;
+ minor = 8;
+ byte_order = le;
+ packet.header := struct {
+ integer {
+ signed = false;
+ size = 32;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } magic;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } stream_id;
+ } align(8);
+};
+
+env {
+ domain = "bare";
+ tracer_name = "barectf";
+};
+
+/* Stream type `default` */
+stream {
+ id = 0;
+ packet.context := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } packet_size;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } content_size;
+ } align(8);
+ event.header := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } id;
+ } align(8);
+};
+
+event {
+ stream_id = 0;
+ id = 0;
+ name = "ev";
+ fields := struct {
+ integer {
+ signed = false;
+ size = 32;
+ align = 32;
+ byte_order = native;
+ base = 10;
+ } before;
+ integer {
+ signed = false;
+ size = 3;
+ align = 1;
+ byte_order = native;
+ base = 10;
+ } array[5];
+ string {
+ encoding = UTF8;
+ } after;
+ } align(1);
+};
--- /dev/null
+/* CTF 1.8 */
+
+/*
+ * The MIT License (MIT)
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ *
+ *
+ * For more details, see <https://barectf.org/>.
+ */
+
+trace {
+ major = 1;
+ minor = 8;
+ byte_order = le;
+ packet.header := struct {
+ integer {
+ signed = false;
+ size = 32;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } magic;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } stream_id;
+ } align(8);
+};
+
+env {
+ domain = "bare";
+ tracer_name = "barectf";
+};
+
+/* Stream type `default` */
+stream {
+ id = 0;
+ packet.context := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } packet_size;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } content_size;
+ } align(8);
+ event.header := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } id;
+ } align(8);
+};
+
+event {
+ stream_id = 0;
+ id = 0;
+ name = "ev";
+ fields := struct {
+ integer {
+ signed = false;
+ size = 3;
+ align = 1;
+ byte_order = native;
+ base = 10;
+ } array[5];
+ } align(1);
+};
--- /dev/null
+/* CTF 1.8 */
+
+/*
+ * The MIT License (MIT)
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ *
+ *
+ * For more details, see <https://barectf.org/>.
+ */
+
+trace {
+ major = 1;
+ minor = 8;
+ byte_order = le;
+ packet.header := struct {
+ integer {
+ signed = false;
+ size = 32;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } magic;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } stream_id;
+ } align(8);
+};
+
+env {
+ domain = "bare";
+ tracer_name = "barectf";
+};
+
+/* Stream type `default` */
+stream {
+ id = 0;
+ packet.context := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } packet_size;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } content_size;
+ } align(8);
+ event.header := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } id;
+ } align(8);
+};
+
+event {
+ stream_id = 0;
+ id = 0;
+ name = "ev";
+ fields := struct {
+ integer {
+ signed = false;
+ size = 8;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } array[7];
+ } align(1);
+};
--- /dev/null
+/* CTF 1.8 */
+
+/*
+ * The MIT License (MIT)
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ *
+ *
+ * For more details, see <https://barectf.org/>.
+ */
+
+trace {
+ major = 1;
+ minor = 8;
+ byte_order = le;
+ packet.header := struct {
+ integer {
+ signed = false;
+ size = 32;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } magic;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } stream_id;
+ } align(8);
+};
+
+env {
+ domain = "bare";
+ tracer_name = "barectf";
+};
+
+/* Stream type `default` */
+stream {
+ id = 0;
+ packet.context := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } packet_size;
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } content_size;
+ } align(8);
+ event.header := struct {
+ integer {
+ signed = false;
+ size = 64;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } id;
+ } align(8);
+};
+
+event {
+ stream_id = 0;
+ id = 0;
+ name = "ev";
+ fields := struct {
+ integer {
+ signed = false;
+ size = 8;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } before;
+ integer {
+ signed = false;
+ size = 8;
+ align = 64;
+ byte_order = native;
+ base = 10;
+ } array[0];
+ integer {
+ signed = false;
+ size = 8;
+ align = 8;
+ byte_order = native;
+ base = 10;
+ } after;
+ } align(1);
+};
--- /dev/null
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include <stdint.h>
+
+#include "test-platform.h"
+#include "barectf.h"
+
+int main()
+{
+ struct test_platform_ctx *platform_ctx;
+ const uint8_t subsubsubsubarray1[] = {1, 2};
+ const uint8_t subsubsubsubarray2[] = {3, 4};
+ const uint8_t subsubsubsubarray3[] = {5, 6};
+ const uint8_t subsubsubsubarray4[] = {7, 8};
+ const uint8_t subsubsubsubarray5[] = {9, 10};
+ const uint8_t subsubsubsubarray6[] = {11, 12};
+ const uint8_t subsubsubsubarray7[] = {13, 14};
+ const uint8_t subsubsubsubarray8[] = {15, 16};
+ const uint8_t subsubsubsubarray9[] = {17, 18};
+ const uint8_t subsubsubsubarray10[] = {19, 20};
+ const uint8_t subsubsubsubarray11[] = {21, 22};
+ const uint8_t subsubsubsubarray12[] = {23, 24};
+ const uint8_t subsubsubsubarray13[] = {25, 26};
+ const uint8_t subsubsubsubarray14[] = {27, 28};
+ const uint8_t subsubsubsubarray15[] = {29, 30};
+ const uint8_t subsubsubsubarray16[] = {31, 32};
+ const uint8_t *subsubsubarray1[] = {subsubsubsubarray1, subsubsubsubarray2};
+ const uint8_t *subsubsubarray2[] = {subsubsubsubarray3, subsubsubsubarray4};
+ const uint8_t *subsubsubarray3[] = {subsubsubsubarray5, subsubsubsubarray6};
+ const uint8_t *subsubsubarray4[] = {subsubsubsubarray7, subsubsubsubarray8};
+ const uint8_t *subsubsubarray5[] = {subsubsubsubarray9, subsubsubsubarray10};
+ const uint8_t *subsubsubarray6[] = {subsubsubsubarray11, subsubsubsubarray12};
+ const uint8_t *subsubsubarray7[] = {subsubsubsubarray13, subsubsubsubarray14};
+ const uint8_t *subsubsubarray8[] = {subsubsubsubarray15, subsubsubsubarray16};
+ const uint8_t * const *subsubarray1[] = {subsubsubarray1, subsubsubarray2};
+ const uint8_t * const *subsubarray2[] = {subsubsubarray3, subsubsubarray4};
+ const uint8_t * const *subsubarray3[] = {subsubsubarray5, subsubsubarray6};
+ const uint8_t * const *subsubarray4[] = {subsubsubarray7, subsubsubarray8};
+ const uint8_t * const * const *subarray1[] = {subsubarray1, subsubarray2};
+ const uint8_t * const * const *subarray2[] = {subsubarray3, subsubarray4};
+ const uint8_t * const * const * const *array[] = {subarray1, subarray2};
+
+ platform_ctx = test_platform_init(512);
+ assert(platform_ctx);
+ barectf_trace_ev(test_platform_barectf_ctx(platform_ctx), array);
+ test_platform_fini(platform_ctx);
+ return 0;
+}
--- /dev/null
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <assert.h>
+
+#include "test-platform.h"
+#include "barectf.h"
+
+int main()
+{
+ struct test_platform_ctx *platform_ctx;
+ const double array[] = {3.14, 6.62, 299792458., 0.2229};
+
+ platform_ctx = test_platform_init(512);
+ assert(platform_ctx);
+ barectf_trace_ev(test_platform_barectf_ctx(platform_ctx), array);
+ test_platform_fini(platform_ctx);
+ return 0;
+}
--- /dev/null
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <assert.h>
+
+#include "test-platform.h"
+#include "barectf.h"
+
+int main()
+{
+ struct test_platform_ctx *platform_ctx;
+ const double subarray1[] = {-17.5, 15.48, 1001.};
+ const double subarray2[] = {.1534, 555.555, 1e9};
+ const double *array[] = {subarray1, subarray2};
+
+ platform_ctx = test_platform_init(512);
+ assert(platform_ctx);
+ barectf_trace_ev(test_platform_barectf_ctx(platform_ctx), array);
+ test_platform_fini(platform_ctx);
+ return 0;
+}
--- /dev/null
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <assert.h>
+
+#include "test-platform.h"
+#include "barectf.h"
+
+int main()
+{
+ struct test_platform_ctx *platform_ctx;
+ const char *str1[] = {"Officia", "sit", "labore"};
+ const char *str2[] = {"Excepteur", "labore", "non"};
+ const char * const *array[] = {str1, str2};
+
+ platform_ctx = test_platform_init(512);
+ assert(platform_ctx);
+ barectf_trace_ev(test_platform_barectf_ctx(platform_ctx), array);
+ test_platform_fini(platform_ctx);
+ return 0;
+}
--- /dev/null
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include <stdint.h>
+
+#include "test-platform.h"
+#include "barectf.h"
+
+int main()
+{
+ struct test_platform_ctx *platform_ctx;
+ const uint8_t subarray1[] = {1, 2, 3};
+ const uint8_t subarray2[] = {4, 5, 6};
+ const uint8_t *array[] = {subarray1, subarray2};
+
+ platform_ctx = test_platform_init(512);
+ assert(platform_ctx);
+ barectf_trace_ev(test_platform_barectf_ctx(platform_ctx), array);
+ test_platform_fini(platform_ctx);
+ return 0;
+}
--- /dev/null
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <assert.h>
+
+#include "test-platform.h"
+#include "barectf.h"
+
+int main()
+{
+ struct test_platform_ctx *platform_ctx;
+ const char *array[] = {"Lorem", "ipsum", "quis"};
+
+ platform_ctx = test_platform_init(512);
+ assert(platform_ctx);
+ barectf_trace_ev(test_platform_barectf_ctx(platform_ctx), array);
+ test_platform_fini(platform_ctx);
+ return 0;
+}
--- /dev/null
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include <stdint.h>
+
+#include "test-platform.h"
+#include "barectf.h"
+
+int main()
+{
+ struct test_platform_ctx *platform_ctx;
+ const uint8_t array[] = {7, 5, 3, 2, 1};
+
+ platform_ctx = test_platform_init(512);
+ assert(platform_ctx);
+ barectf_trace_ev(test_platform_barectf_ctx(platform_ctx), 123456,
+ array, "hello!");
+ test_platform_fini(platform_ctx);
+ return 0;
+}
--- /dev/null
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include <stdint.h>
+
+#include "test-platform.h"
+#include "barectf.h"
+
+int main()
+{
+ struct test_platform_ctx *platform_ctx;
+ const uint8_t array[] = {7, 5, 3, 2, 1};
+
+ platform_ctx = test_platform_init(512);
+ assert(platform_ctx);
+ barectf_trace_ev(test_platform_barectf_ctx(platform_ctx), array);
+ test_platform_fini(platform_ctx);
+ return 0;
+}
--- /dev/null
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include <stdint.h>
+
+#include "test-platform.h"
+#include "barectf.h"
+
+int main()
+{
+ struct test_platform_ctx *platform_ctx;
+ const uint8_t array[] = {1, 1, 2, 3, 5, 8, 13};
+
+ platform_ctx = test_platform_init(512);
+ assert(platform_ctx);
+ barectf_trace_ev(test_platform_barectf_ctx(platform_ctx), array);
+ test_platform_fini(platform_ctx);
+ return 0;
+}
--- /dev/null
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include <stdlib.h>
+
+#include "test-platform.h"
+#include "barectf.h"
+
+int main()
+{
+ struct test_platform_ctx *platform_ctx;
+
+ platform_ctx = test_platform_init(512);
+ assert(platform_ctx);
+ barectf_trace_ev(test_platform_barectf_ctx(platform_ctx), 23, NULL, 177);
+ test_platform_fini(platform_ctx);
+ return 0;
+}
--- /dev/null
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2020 Philippe Proulx <pproulx@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+CFLAGS += -O0 -g -Wall -pedantic -Wno-unused-function
+TARGET = test
+OBJS = $(TARGET).o barectf.o test-platform.o
+
+$(TARGET): $(OBJS)
+ $(CC) -o $@ $(LDFLAGS) $^
+
+barectf.o: barectf.c
+ $(CC) $(CFLAGS) -ansi -c $<
--- /dev/null
+/*
+ * Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <assert.h>
+
+#include "barectf.h"
+#include "test-platform.h"
+
+struct test_platform_ctx {
+ struct barectf_default_ctx ctx;
+ FILE *fh;
+};
+
+static void write_packet(struct test_platform_ctx * const platform_ctx)
+{
+ size_t nmemb = fwrite(barectf_packet_buf(&platform_ctx->ctx),
+ barectf_packet_buf_size(&platform_ctx->ctx), 1,
+ platform_ctx->fh);
+ assert(nmemb == 1);
+}
+
+static int is_backend_full(void * const data)
+{
+ return 0;
+}
+
+static void open_packet(void * const data)
+{
+ struct test_platform_ctx * const platform_ctx = (void *) data;
+
+ barectf_default_open_packet(&platform_ctx->ctx);
+}
+
+static void close_packet(void * const data)
+{
+ struct test_platform_ctx * const platform_ctx = (void *) data;
+
+ barectf_default_close_packet(&platform_ctx->ctx);
+ write_packet(platform_ctx);
+}
+
+struct test_platform_ctx *test_platform_init(const size_t buf_size)
+{
+ uint8_t *buf;
+ struct test_platform_ctx *platform_ctx;
+ struct barectf_platform_callbacks cbs;
+
+ cbs.is_backend_full = is_backend_full;
+ cbs.open_packet = open_packet;
+ cbs.close_packet = close_packet;
+ platform_ctx = malloc(sizeof(*platform_ctx));
+ assert(platform_ctx);
+ buf = malloc(buf_size);
+ assert(buf);
+ memset(buf, 0, buf_size);
+ platform_ctx->fh = fopen("stream", "wb");
+ assert(platform_ctx->fh);
+ barectf_init(&platform_ctx->ctx, buf, buf_size, cbs, platform_ctx);
+ open_packet(platform_ctx);
+ return platform_ctx;
+}
+
+void test_platform_fini(struct test_platform_ctx * const platform_ctx)
+{
+ if (barectf_packet_is_open(&platform_ctx->ctx) &&
+ !barectf_packet_is_empty(&platform_ctx->ctx)) {
+ close_packet(platform_ctx);
+ }
+
+ fclose(platform_ctx->fh);
+ free(barectf_packet_buf(&platform_ctx->ctx));
+ free(platform_ctx);
+}
+
+struct barectf_default_ctx *test_platform_barectf_ctx(
+ struct test_platform_ctx * const platform_ctx)
+{
+ return &platform_ctx->ctx;
+}
--- /dev/null
+#ifndef _BARECTF_TEST_PLATFORM_H
+#define _BARECTF_TEST_PLATFORM_H
+
+/*
+ * Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdlib.h>
+
+#include "barectf.h"
+
+struct test_platform_ctx;
+
+struct test_platform_ctx *test_platform_init(size_t buf_size);
+void test_platform_fini(struct test_platform_ctx *ctx);
+struct barectf_default_ctx *test_platform_barectf_ctx(
+ struct test_platform_ctx *ctx);
+
+#endif /* _BARECTF_TEST_PLATFORM_H */
--- /dev/null
+# The MIT License (MIT)
+#
+# Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+def test_nested_5_uint8(tracing_succeed_test):
+ tracing_succeed_test()
+
+
+def test_of_double(tracing_succeed_test):
+ tracing_succeed_test()
+
+
+def test_of_static_array_of_double(tracing_succeed_test):
+ tracing_succeed_test()
+
+
+def test_of_static_array_of_str(tracing_succeed_test):
+ tracing_succeed_test()
+
+
+def test_of_static_array_of_uint8(tracing_succeed_test):
+ tracing_succeed_test()
+
+
+def test_of_str(tracing_succeed_test):
+ tracing_succeed_test()
+
+
+def test_of_uint3(tracing_succeed_test):
+ tracing_succeed_test()
+
+
+def test_of_uint3_middle(tracing_succeed_test):
+ tracing_succeed_test()
+
+
+def test_of_uint8(tracing_succeed_test):
+ tracing_succeed_test()
+
+
+def test_zero_len(tracing_succeed_test):
+ tracing_succeed_test()