barectf.git
14 months agodocs: clarify some sentences
Erica Bugden [Wed, 1 Mar 2023 21:16:24 +0000 (16:16 -0500)] 
docs: clarify some sentences

Add information to reduce ambiguity and make it easier to search for
more details elsewhere if needed.

Change-Id: I0a54b701961dcb2e2225b843eb5d89499bd2a12d
Signed-off-by: Erica Bugden <ebugden@efficios.com>
14 months agodocs: fix broken readme links
Erica Bugden [Tue, 28 Feb 2023 23:53:31 +0000 (18:53 -0500)] 
docs: fix broken readme links

Change-Id: I5f069b84e365c61fd76c246231e0d937f8cc15c0
Signed-off-by: Erica Bugden <ebugden@efficios.com>
14 months agoFix: Pass C toolchain environments in tox.ini
Olivier Dion [Fri, 10 Mar 2023 17:30:22 +0000 (12:30 -0500)] 
Fix: Pass C toolchain environments in tox.ini

CC is important if `cc' is not in PATH.

C_INCLUDE_PATH is important for the compiler to find the good headers,
e.g. <linux/limits.h>.

LIBRARY_PATH is important for the compiler to link against good
libraries, e.g. `crt1.o'.

This is mandatory for distributions that does not install
headers/libraries in standard locations that can be deduce by the
compiler, e.g. on Guix and NIX systems.

Note that this is intended for the C toolchain and not tests them self.
See https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html.

Change-Id: I35dca0a929b6ba00ba9fe7381a5d5bddce901da1
Signed-off-by: Olivier Dion <odion@efficios.com>
16 months agofix: add tox 4 support in tox.ini
Michael Jeanson [Tue, 3 Jan 2023 21:28:49 +0000 (16:28 -0500)] 
fix: add tox 4 support in tox.ini

Tox 4 introduced configuration syntax changes to tox.ini that requires
at least tox 3.18 for compatibility.

The 'passenv' configuration was documented as space separated in tox 3
and is now comma separated in tox 4. However, newline separated works in
both tox versions [1].

The 'whitelist_externals' configuration was replaced by
'allowlist_externals', the new value was introduced in 3.18 as an
alternative.

[1] https://tox.wiki/en/latest/upgrading.html#upgrading

Change-Id: Ibe6d16f7a180d4341f1a2c0f4a6343d72210cd94
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
17 months agoFix: default value of `origin-is-unix-epoch` property is `true`
Philippe Proulx [Tue, 13 Dec 2022 17:00:21 +0000 (12:00 -0500)] 
Fix: default value of `origin-is-unix-epoch` property is `true`

This is what the YAML clock type object documentation says and this was
indeed my intention.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I35f32a04755b46e304145313fbeed598a082d924

18 months agoFix: _process_trace_node_include(): `type` property is optional here
Philippe Proulx [Mon, 21 Nov 2022 20:45:16 +0000 (15:45 -0500)] 
Fix: _process_trace_node_include(): `type` property is optional here

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ic0ce65189091fb892c6160256845701a51fa9863

18 months agoPrepare for barectf v3.2.0
Philippe Proulx [Mon, 14 Nov 2022 20:11:04 +0000 (15:11 -0500)] 
Prepare for barectf v3.2.0

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Idcb27a5c81a08915278f4d12afb7ac4bdca3a836

2 years agobarectf v3.1.0 v3.1.0
Philippe Proulx [Tue, 8 Mar 2022 12:48:27 +0000 (07:48 -0500)] 
barectf v3.1.0

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I3256dc44f7280489dc521e558828b61105691b55

2 years agopyproject.toml: require Jinja2 3.0+
Philippe Proulx [Tue, 15 Mar 2022 00:09:59 +0000 (20:09 -0400)] 
pyproject.toml: require Jinja2 3.0+

This removes Jinja2 deprecation warnings at testing time (about
MarkupSafe).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I5652c21dc624a64d9aaee5c0b0f64744150562d9

2 years agobarectf: add support for packet sequence number
Jon Lamb [Fri, 4 Mar 2022 15:19:12 +0000 (07:19 -0800)] 
barectf: add support for packet sequence number

Adds a new optional packet features object `sequence-number-field-type`,
which generates the metadata field type name `packet_seq_num` when
defined (defaults to false).

Currently this is conditionally maintained in `struct barectf_ctx` as a
`uint32_t` type like `events_discarded`.

In the future this could be improved to use the config type defined by
the stream in `struct barectf_default_ctx` so that the types are
aligned.

[Philippe Proulx: add documentation to Jon's patch.]

Refs: https://github.com/efficios/barectf/pull/24
Closes: https://github.com/efficios/barectf/issues/23
Signed-off-by: Jon Lamb <jon@auxon.io>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ibfa9e4ab73a7c338e41377aae01d498dee62086b

2 years agopoetry.lock: update
Philippe Proulx [Tue, 8 Mar 2022 04:22:56 +0000 (23:22 -0500)] 
poetry.lock: update

This is needed to support Mypy on Python 3.10 as it uses
`typing_extensions` instead of `typed_ast` for Python ≥ 3.9 (`typed_ast`
seems broken on Python 3.10.2).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
2 years agoUse poetry-core build system
Michael Jeanson [Fri, 1 Oct 2021 15:49:23 +0000 (11:49 -0400)] 
Use poetry-core build system

This allows building the project on a system without installing the full
poetry tooling and all its dependencies but only the minimal poetry-core
package while maintaining the current workflow for developers.

Introduced in poetry '1.1.0'.

Change-Id: I5be7e8d962f385cabb583666aeda8543f592ba66
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
3 years agodocs: yaml: dyn-array-ft-obj.adoc: fix wrong static array FT copy
Philippe Proulx [Fri, 22 Jan 2021 17:03:20 +0000 (12:03 -0500)] 
docs: yaml: dyn-array-ft-obj.adoc: fix wrong static array FT copy

Reported-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoFix: barectf_packet_set_buf(): keep full packet state
Philippe Proulx [Tue, 6 Oct 2020 18:20:12 +0000 (14:20 -0400)] 
Fix: barectf_packet_set_buf(): keep full packet state

The condition of barectf_packet_is_full() is:

    ctx->at == ctx->packet_size

So we're reusing `ctx->at` to know whether or not a packet is full.

A full packet is always (already) closed.

The problem is that barectf_packet_set_buf() changes `ctx->packet_size`
without touching `ctx->at`. Therefore if the value of `ctx->packet_size`
changes, and if the packet was considered to be full, it's not the case
anymore, but it must be.

In barectf_packet_set_buf(), set `ctx->at` to `ctx->packet_size` if it
was already the case to keep any full packet state.

Adding a test with a custom platform calling barectf_packet_set_buf()
with a `NULL` buffer after closing a completely full packet. Without
this patch (in `barectf.c.j2`), this test leads to a segmentation fault.

Fixes: https://github.com/efficios/barectf/issues/18
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agodocs: {dst,trace-type}-obj.adoc: specify "default FT", not just "true"
Philippe Proulx [Tue, 29 Sep 2020 01:38:55 +0000 (21:38 -0400)] 
docs: {dst,trace-type}-obj.adoc: specify "default FT", not just "true"

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agodocs: build: index.adoc: add custom `stdint.h` example
Philippe Proulx [Tue, 29 Sep 2020 01:11:28 +0000 (21:11 -0400)] 
docs: build: index.adoc: add custom `stdint.h` example

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agodocs: platform: api.adoc: fix mistake
Philippe Proulx [Tue, 29 Sep 2020 01:10:49 +0000 (21:10 -0400)] 
docs: platform: api.adoc: fix mistake

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoPrepare for barectf v3.1.0
Philippe Proulx [Fri, 25 Sep 2020 19:29:18 +0000 (15:29 -0400)] 
Prepare for barectf v3.1.0

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf v3.0.0 v3.0.0
Philippe Proulx [Thu, 24 Sep 2020 14:36:26 +0000 (10:36 -0400)] 
barectf v3.0.0

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agodocs: how-barectf-works: update CTF trace structure images
Philippe Proulx [Fri, 25 Sep 2020 18:48:31 +0000 (14:48 -0400)] 
docs: how-barectf-works: update CTF trace structure images

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotest_pass_everything.py: check two new symbols
Philippe Proulx [Fri, 25 Sep 2020 14:15:57 +0000 (10:15 -0400)] 
test_pass_everything.py: check two new symbols

ed4a69c ("barectf.h.j2: add barectf_discarded_event_records_count()")
and 3bf37cb ("barectf.h.j2: add barectf_packet_buf_addr()") introduced
new API symbols to check here.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotest_pass_everything.py: use `cc` by default (like Make), not `gcc`
Philippe Proulx [Fri, 25 Sep 2020 14:15:39 +0000 (10:15 -0400)] 
test_pass_everything.py: use `cc` by default (like Make), not `gcc`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotest_pass_everything.py: reformat
Philippe Proulx [Fri, 25 Sep 2020 14:15:25 +0000 (10:15 -0400)] 
test_pass_everything.py: reformat

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agodocs: whats-new.adoc: use headings for main topics
Philippe Proulx [Fri, 25 Sep 2020 14:03:52 +0000 (10:03 -0400)] 
docs: whats-new.adoc: use headings for main topics

This is more readable than a single long list.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agodocs: cli: usage.adoc: improve page
Philippe Proulx [Fri, 25 Sep 2020 14:02:02 +0000 (10:02 -0400)] 
docs: cli: usage.adoc: improve page

Changes:

* Add link to <https://git-scm.com/>.

* Use the third person for the command descriptions in the
  General description section.

* Add and fix many internal links.

* Specify that `PREFIX` must be a valid C identifier.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing/conftest.py: add valid `basic-extra-pc-ft-members` cat.
Philippe Proulx [Fri, 25 Sep 2020 02:02:45 +0000 (22:02 -0400)] 
tests/tracing/conftest.py: add valid `basic-extra-pc-ft-members` cat.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing: add DST extra packet context FT members test
Philippe Proulx [Fri, 25 Sep 2020 00:12:17 +0000 (20:12 -0400)] 
tests/tracing: add DST extra packet context FT members test

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing: add event record type tests
Philippe Proulx [Fri, 25 Sep 2020 00:00:25 +0000 (20:00 -0400)] 
tests/tracing: add event record type tests

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing: add data stream type tests
Philippe Proulx [Thu, 24 Sep 2020 23:54:07 +0000 (19:54 -0400)] 
tests/tracing: add data stream type tests

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing/support/basic/test-platform.h: `ctx` -> `platform_ctx`
Philippe Proulx [Thu, 24 Sep 2020 23:36:22 +0000 (19:36 -0400)] 
tests/tracing/support/basic/test-platform.h: `ctx` -> `platform_ctx`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing: add data stream type event record feature tests
Philippe Proulx [Thu, 24 Sep 2020 23:35:55 +0000 (19:35 -0400)] 
tests/tracing: add data stream type event record feature tests

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing: add data stream type packet feature tests
Philippe Proulx [Thu, 24 Sep 2020 23:31:42 +0000 (19:31 -0400)] 
tests/tracing: add data stream type packet feature tests

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing: `int main()` -> `int main(void)`
Philippe Proulx [Thu, 24 Sep 2020 23:28:43 +0000 (19:28 -0400)] 
tests/tracing: `int main()` -> `int main(void)`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing: add trace type feature tests
Philippe Proulx [Thu, 24 Sep 2020 23:15:59 +0000 (19:15 -0400)] 
tests/tracing: add trace type feature tests

This patch adds a new tracing test category named `counter-clock`.

This is because the `counter-clock` platform (in
`tests/tracing/support/counter-clock`) has a data stream clock which is
a simpler counter starting at 0.

The platform's base YAML trace type object,
`tests/tracing/support/counter-clock/base.yaml`, specifies a single
event record type `dummy` so that test-specific configurations which do
not need event record types are lighter.

The C files in `tests/tracing/src/counter-clock/trace-type-features`
do not call any tracing function: they only initialize and finalize
the test platform, which effectively opens and closes a single packet.

In the new `test-platform.c` file, test_platform_fini() closes the
current packet whether or not it's empty.

`tests/tracing/support/counter-clock/base-no-features.yaml` is a YAML
trace type object file which disables all the trace type and data stream
type features except the data stream type ID and event record type ID
features.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests: reflow licence headers for 72 columns
Philippe Proulx [Thu, 24 Sep 2020 23:13:43 +0000 (19:13 -0400)] 
tests: reflow licence headers for 72 columns

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoFix: schemas/config/3/config.yaml: allow `uuid-field-type` to be `true`
Philippe Proulx [Thu, 24 Sep 2020 21:45:21 +0000 (17:45 -0400)] 
Fix: schemas/config/3/config.yaml: allow `uuid-field-type` to be `true`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf/schemas/config/3/config.yaml: `True` -> `true`
Philippe Proulx [Thu, 24 Sep 2020 21:44:41 +0000 (17:44 -0400)] 
barectf/schemas/config/3/config.yaml: `True` -> `true`

It works, but this is not Python.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf.c.j2: only declare `ts` variable when needed
Philippe Proulx [Thu, 24 Sep 2020 21:28:15 +0000 (17:28 -0400)] 
barectf.c.j2: only declare `ts` variable when needed

This patch changes the `barectf.c.j2` template so that, for the
packet opening, packet closing, and event record header serialization
functions, the `ts` variable is only declared when it's used.

Without this patch, the C compiler can report such a warning:

    warning: unused variable ‘ts’ [-Wunused-variable]

In `barectf.c-macros.j2`, the open_close_func_preamble() macro is
changed to accept the timestamp packet feature in order to check either
the packet beginning or end timestamp field type feature.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing: use test categories
Philippe Proulx [Thu, 24 Sep 2020 20:35:48 +0000 (16:35 -0400)] 
tests/tracing: use test categories

This patch renames all `succeed` directories under `tests/tracing`
to `basic`. All tracing tests must succeed anyway.

In `basic/dynamic-array/of-double.yaml`:

* `basic` is the category.
* `dynamic-array` is the subcategory.
* `of-double.yaml` is the test file.

Support files are now per category: `tests/tracing/support` is moved
to `tests/tracing/support/basic`.

This makes it possible to add tracing test categories which have their
own platform and base YAML trace type object.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf: add pre-release version information (`barectf.__pre_version__`)
Philippe Proulx [Thu, 24 Sep 2020 20:01:25 +0000 (16:01 -0400)] 
barectf: add pre-release version information (`barectf.__pre_version__`)

This makes it possible to make a `-dev` or `-pre` version for example.

`barectf.__version__` contains the pre-release information.

The generated metadata stream gets a new `tracer_pre` environment entry
set to this value (empty string as of this patch).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing: add basic structure data field tests
Philippe Proulx [Thu, 24 Sep 2020 18:13:08 +0000 (14:13 -0400)] 
tests/tracing: add basic structure data field tests

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing: add data stream test (two packets)
Philippe Proulx [Thu, 24 Sep 2020 17:55:58 +0000 (13:55 -0400)] 
tests/tracing: add data stream test (two packets)

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing: add basic int., enum., real, and string data field tests
Philippe Proulx [Thu, 24 Sep 2020 17:47:51 +0000 (13:47 -0400)] 
tests/tracing: add basic int., enum., real, and string data field tests

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoconfigs/succeed/**/*.yaml: remove useless YAML document end
Philippe Proulx [Thu, 24 Sep 2020 17:46:47 +0000 (13:46 -0400)] 
configs/succeed/**/*.yaml: remove useless YAML document end

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agodocs: yaml: put static/dynamic array FT obj. C types example in partial
Philippe Proulx [Thu, 24 Sep 2020 17:33:51 +0000 (13:33 -0400)] 
docs: yaml: put static/dynamic array FT obj. C types example in partial

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agodocs: {static,dyn}-array-ft-obj.adoc: use example block
Philippe Proulx [Thu, 24 Sep 2020 17:31:33 +0000 (13:31 -0400)] 
docs: {static,dyn}-array-ft-obj.adoc: use example block

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoFix: YAML: force enumeration FT objects to have at least one mapping
Philippe Proulx [Thu, 24 Sep 2020 17:23:34 +0000 (13:23 -0400)] 
Fix: YAML: force enumeration FT objects to have at least one mapping

As per CTF 1.8.3:

> Enumerations need to contain at least one entry.

Before this patch, ythose were legal:

    class: uenum
    size: 8

    class: uenum
    size: 8
    mappings: {}

    class: uenum
    size: 8
    mappings:
      A: []

CTF consumers would not like the resulting metadata stream. For
example, Babeltrace 2.1.0-rc1 [v1.2.0-3520-g73f74ae1f]:

    09-24 13:26:41.740 80492 80492 E PLUGIN/CTF/META/PARSER yyerror@parser.y:925 At line 109 in metadata stream: syntax error, unexpected CTF_RBRAC: token="}"
    09-24 13:26:41.740 80492 80492 E PLUGIN/CTF/META/DECODER ctf_metadata_decoder_append_content@decoder.c:280 [N/A] Cannot create the metadata AST out of the metadata text: mdec-addr=0x559dd9546a10
    09-24 13:26:41.740 80492 80492 W PLUGIN/SRC.CTF.FS/QUERY support_info_query@query.c:459 cannot append metadata content: metadata-decoder-status=-2
    09-24 13:26:41.741 80492 80492 W LIB/QUERY-EXECUTOR bt_query_executor_query@query-executor.c:231 Component class's "query" method failed: query-exec-addr=0x559dd9548070, cc-addr=0x559dd95233e0, cc-type=SOURCE, cc-name="fs", cc-partial-descr="Read CTF traces from the file sy", cc-is-frozen=0, cc-so-handle-addr=0x559dd9522770, cc-so-handle-path="lib/babeltrace2/plugins/babeltrace-plugin-ctf.so", object="babeltrace.support-info", params-addr=0x559dd9545f10, params-type=MAP, params-element-count=2, log-level=WARNING
    09-24 13:26:41.741 80492 80492 E CLI-CFG-SRC-AUTO-DISC support_info_query_all_sources@autodisc.c:493 babeltrace.support-info query failed.
    09-24 13:26:41.741 80492 80492 E CLI main@babeltrace2.c:2644 Command-line error: retcode=1

    ERROR:    [Babeltrace CLI] (babeltrace2.c:2644)
      Command-line error: retcode=1
    CAUSED BY [Source auto-discovery] (autodisc.c:493)
      babeltrace.support-info query failed.
    CAUSED BY [libbabeltrace2] (query-executor.c:231)
      Component class's "query" method failed: query-exec-addr=0x559dd9548070, cc-addr=0x559dd95233e0, cc-type=SOURCE, cc-name="fs", cc-partial-descr="Read CTF traces from
      the file sy", cc-is-frozen=0, cc-so-handle-addr=0x559dd9522770, cc-so-handle-path="babeltrace2/plugins/babeltrace-plugin-ctf.so",
      object="babeltrace.support-info", params-addr=0x559dd9545f10, params-type=MAP, params-element-count=2, log-level=WARNING

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf/templates: use `loop.last` instead of hack in `barectf/cgen.py`
Philippe Proulx [Thu, 24 Sep 2020 16:11:08 +0000 (12:11 -0400)] 
barectf/templates: use `loop.last` instead of hack in `barectf/cgen.py`

This patch removes the raw text replacement at the end of
_CodeGen.gen_src() (`barectf/cgen.py`).

Instead, to avoid empty lines before `}`, Jinja 2 templates only
output an empty line it's not the loop's last iteration:

    {% if not loop.last %}{{ '\n' }}{% endif %}

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotest-platform.h: do not include `barectf.h`: forward-declare context
Philippe Proulx [Thu, 24 Sep 2020 16:09:28 +0000 (12:09 -0400)] 
test-platform.h: do not include `barectf.h`: forward-declare context

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoYAML files: remove empty line after `%YAML 1.2` directive
Philippe Proulx [Thu, 24 Sep 2020 15:41:40 +0000 (11:41 -0400)] 
YAML files: remove empty line after `%YAML 1.2` directive

It's more common not to have one. At least the specification's
examples [1] do not have any.

[1]: https://yaml.org/spec/1.2/spec.html

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing: use a base trace type YAML file
Philippe Proulx [Thu, 24 Sep 2020 15:33:07 +0000 (11:33 -0400)] 
tests/tracing: use a base trace type YAML file

This patch adds `tests/tracing/support/base.yaml` as a base YAML trace
type object for test configuration files to include.

`tests/tracing/conftest.py` is changed to add `tests/tracing/support` to
the barectf inclusion search directories and to only consider YAML files
in `tests/tracing/configs/succeed` (`tests/tracing/support/base.yaml` is
not a test).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agodocs: example.adoc: use file names as heading titles
Philippe Proulx [Thu, 24 Sep 2020 14:14:35 +0000 (10:14 -0400)] 
docs: example.adoc: use file names as heading titles

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agomodules/platform/pages/example.adoc: add a list of other examples
Philippe Proulx [Thu, 24 Sep 2020 13:59:23 +0000 (09:59 -0400)] 
modules/platform/pages/example.adoc: add a list of other examples

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agodocs: add missing `build` module
Philippe Proulx [Thu, 24 Sep 2020 14:02:20 +0000 (10:02 -0400)] 
docs: add missing `build` module

This was not added because the root `.gitignore` file contained `build/`
(fixed by 4dd70d0 (".gitignore: simplify")).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years ago.gitignore: simplify
Philippe Proulx [Thu, 24 Sep 2020 14:08:37 +0000 (10:08 -0400)] 
.gitignore: simplify

This patch removes lines from the root `.gitignore` file which were
useless for the barectf project.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotest-platform.c: write_packet(): use `const size_t`
Philippe Proulx [Thu, 24 Sep 2020 11:32:13 +0000 (07:32 -0400)] 
test-platform.c: write_packet(): use `const size_t`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agodocs/modules/ROOT/pages/index.adoc: add internal links
Philippe Proulx [Thu, 24 Sep 2020 11:19:04 +0000 (07:19 -0400)] 
docs/modules/ROOT/pages/index.adoc: add internal links

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoDocument barectf 3
Philippe Proulx [Thu, 24 Sep 2020 00:01:30 +0000 (20:01 -0400)] 
Document barectf 3

This patch adds the complete documentation of barectf 3 (upcoming major
release of the project).

The new `docs` directory is an Antora [1] documentation component
version. You can include it in an Antora site.

All the pages are written in AsciiDoc (Asciidoctor version).

Some contents were copied (and adapted) from the barectf wiki [2], but
most of the pages feature brand new text. The logo and diagrams are also
refreshed.

I'm removing the `barectf` CLI tool's manual page (`doc/man`) as it's
now documented in `docs/modules/cli/pages/usage.adoc`. Having the CLI
documented within the whole project's documentation makes it possible to
have critical links to and from other parts of it. This is to the
advantage of the reader.

[1]: https://antora.org/
[2]: https://github.com/efficios/barectf/wiki

3 years agobarectf_platform_linux_fs_init(): accept DS file path, not trace dir.
Philippe Proulx [Thu, 24 Sep 2020 02:45:24 +0000 (22:45 -0400)] 
barectf_platform_linux_fs_init(): accept DS file path, not trace dir.

This patch changes the Linux FS platform's
barectf_platform_linux_fs_init() function so that it accepts the data
stream file path instead of its trace directory.

This makes it possible to initialize many Linux FS platform contexts for
the same trace, each one targeting a distinct data stream file.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf-platform-linux-fs.c: write_packet(): use `const size_t`
Philippe Proulx [Thu, 24 Sep 2020 02:37:13 +0000 (22:37 -0400)] 
barectf-platform-linux-fs.c: write_packet(): use `const size_t`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf-platform-linux-fs.c: rename missing `ctx` -> `platform_ctx`
Philippe Proulx [Thu, 24 Sep 2020 02:36:38 +0000 (22:36 -0400)] 
barectf-platform-linux-fs.c: rename missing `ctx` -> `platform_ctx`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agopoetry.lock: update
Philippe Proulx [Thu, 24 Sep 2020 02:25:23 +0000 (22:25 -0400)] 
poetry.lock: update

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agopyproject.toml: update description
Philippe Proulx [Thu, 24 Sep 2020 02:24:21 +0000 (22:24 -0400)] 
pyproject.toml: update description

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf/templates/c: name `void *` context parameters `vctx`
Philippe Proulx [Wed, 23 Sep 2020 23:59:49 +0000 (19:59 -0400)] 
barectf/templates/c: name `void *` context parameters `vctx`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf.h.j2: add barectf_packet_buf_addr()
Philippe Proulx [Wed, 23 Sep 2020 22:20:07 +0000 (18:20 -0400)] 
barectf.h.j2: add barectf_packet_buf_addr()

barectf_packet_buf_addr() is an alias of barectf_packet_buf().

This is more in line with the barectf_packet_set_buf() function which
sets both the buffer's address and size.

This change helps document the platform API.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf.h.j2: add barectf_discarded_event_records_count()
Philippe Proulx [Wed, 23 Sep 2020 22:18:08 +0000 (18:18 -0400)] 
barectf.h.j2: add barectf_discarded_event_records_count()

barectf_discarded_event_records_count() is an alias of
barectf_packet_events_discarded().

The count of discarded event records is not related to the current
packet; it's a data stream variable.

This change helps document the platform API.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf.h.j2: rename "clock callbacks" -> "clock source callbacks"
Philippe Proulx [Wed, 23 Sep 2020 22:17:28 +0000 (18:17 -0400)] 
barectf.h.j2: rename "clock callbacks" -> "clock source callbacks"

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf/templates/c: rename "back-end" -> "back end"
Philippe Proulx [Wed, 23 Sep 2020 22:17:07 +0000 (18:17 -0400)] 
barectf/templates/c: rename "back-end" -> "back end"

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoStandardize root field type prefixes
Philippe Proulx [Wed, 23 Sep 2020 14:51:05 +0000 (10:51 -0400)] 
Standardize root field type prefixes

This patch changes `cgen.py` and what depends on it so that:

* `_RootFtPrefixes` attribute names always begin with `P` (packet) or
  `ER` (event record).

* `_RootFtPrefixes` attribute values for event record prefixes do not
  begin with `er`.

  The C source context where this is used indicates that it's an event
  record field, so `er` is redundant.

  This also makes the documentation easier to understand.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoAdd missing `serialize-write-timestamp-statements.j2` file
Philippe Proulx [Mon, 21 Sep 2020 23:29:14 +0000 (19:29 -0400)] 
Add missing `serialize-write-timestamp-statements.j2` file

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoEnable discarded event records snapshot FT DST feature by default
Philippe Proulx [Mon, 21 Sep 2020 23:26:49 +0000 (19:26 -0400)] 
Enable discarded event records snapshot FT DST feature by default

This patch changes `config.py` (API) and the v3 YAML parser to make
the discarded event records snapshot field type (data stream type)
feature enabled by default.

This feature is nice to have, only adds an integer field to each packet,
and doesn't require anything from the user.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoRename "time" -> "timestamp" (terminology)
Philippe Proulx [Mon, 21 Sep 2020 21:04:36 +0000 (17:04 -0400)] 
Rename "time" -> "timestamp" (terminology)

This patch renames the "time" concept to "timestamp" throughout.

The term "timestamp" is better to describe what used to be named "time",
for example a packet's beginning and end timestamps, and an event
record's timestamp.

"Time" has many definitions, one of which is duration, whereas the
only definition of "timestamp" in Antidote 10 is:

> a printed or stamped mark indicating a time or date of an event

which is pretty accurate.

Which is also why the timestamp members are named `timestamp_begin`,
`timestamp_end`, and `timestamp` in CTF 1.8.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoRename "target byte order" -> "native byte order"
Philippe Proulx [Fri, 18 Sep 2020 19:32:20 +0000 (15:32 -0400)] 
Rename "target byte order" -> "native byte order"

Going back to the CTF terminology.

From the trace type's perspective, I believe this term is better. I
think it's also easier to understand when reading the documentation.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoconfig.py: move target byte order property from config. to trace type
Philippe Proulx [Fri, 18 Sep 2020 19:27:12 +0000 (15:27 -0400)] 
config.py: move target byte order property from config. to trace type

This property is part of the trace type, as it's related to the byte
order of bit array field types which are all part of the trace type.

Also it's a CTF concept, not a barectf concept.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agopoetry.lock: update
Philippe Proulx [Fri, 18 Sep 2020 17:01:11 +0000 (13:01 -0400)] 
poetry.lock: update

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years ago.gitignore: ignore generated HTML READMEs
Philippe Proulx [Fri, 18 Sep 2020 17:00:44 +0000 (13:00 -0400)] 
.gitignore: ignore generated HTML READMEs

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoUse YAML 1.2 throughout
Philippe Proulx [Fri, 18 Sep 2020 16:56:41 +0000 (12:56 -0400)] 
Use YAML 1.2 throughout

The `yes` and `no` boolean values do not exist in YAML 1.2 [1].

Change all of them for `true` and `false`.

Also, in `tests/tracing/configs` and in
`examples/linux-fs-simple/config.yaml`, add the explicit `%YAML 1.2`
directive to indicate that it's a YAML 1.2 document.

[1]: https://yaml.org/spec/1.2/spec.html#id2805071

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoRemove `CHANGELOG.md`
Philippe Proulx [Thu, 17 Sep 2020 14:42:10 +0000 (10:42 -0400)] 
Remove `CHANGELOG.md`

This is the change log of barectf 2.

For barectf 3, the change log will be part of the documentation.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf-tracepoint.h: improve quality
Philippe Proulx [Thu, 17 Sep 2020 13:13:18 +0000 (09:13 -0400)] 
barectf-tracepoint.h: improve quality

Changes:

* Reflow header comment to fit 72 columns.

* Capitalize comments.

* Use updated `barectf.h` definition names (`_BARECTF_IDENTIFIER_PREFIX`
  and `_BARECTF_DEFAULT_DATA_STREAM_TYPE_NAME`).

* Check for `BARECTF_TRACEPOINT_DATA_STREAM_TYPE_NAME` as an alternative
  to `BARECTF_TRACEPOINT_STREAM` (for consistency).

* Rework error messages.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf.h.j2: use more accurate definition names
Philippe Proulx [Thu, 17 Sep 2020 13:12:06 +0000 (09:12 -0400)] 
barectf.h.j2: use more accurate definition names

Leaving the old definitions to avoid breaking anything.

The updated names are:

`_BARECTF_PREFIX`:
    `_BARECTF_IDENTIFIER_PREFIX`

`_BARECTF_DEFAULT_STREAM`:
    `_BARECTF_DEFAULT_DATA_STREAM_TYPE_NAME`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoexamples/linux-fs-simple: use `trace` as trace directory, not `ctf`
Philippe Proulx [Thu, 17 Sep 2020 04:09:02 +0000 (00:09 -0400)] 
examples/linux-fs-simple: use `trace` as trace directory, not `ctf`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoexamples/linux-fs-simple: convert README to Asciidoctor and improve it
Philippe Proulx [Thu, 17 Sep 2020 04:05:44 +0000 (00:05 -0400)] 
examples/linux-fs-simple: convert README to Asciidoctor and improve it

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agolinux-fs-simple/config.yaml: convert to v3 format
Philippe Proulx [Thu, 17 Sep 2020 03:59:58 +0000 (23:59 -0400)] 
linux-fs-simple/config.yaml: convert to v3 format

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agolinux-fs-simple.c: improve quality
Philippe Proulx [Thu, 17 Sep 2020 03:58:27 +0000 (23:58 -0400)] 
linux-fs-simple.c: improve quality

Changes:

* Remove unneeded included headers.
* Remove unneeded TO_VOID_PTR() macro.
* Use `const` where possible.
* Use single return points.
* Capitalize comments.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agolinux-fs-simple/Makefile: remove nonexistent `view` from `.PHONY`
Philippe Proulx [Thu, 17 Sep 2020 03:57:22 +0000 (23:57 -0400)] 
linux-fs-simple/Makefile: remove nonexistent `view` from `.PHONY`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf-platform-linux-fs.c: improve quality
Philippe Proulx [Thu, 17 Sep 2020 01:19:39 +0000 (21:19 -0400)] 
barectf-platform-linux-fs.c: improve quality

Changes:

* Remove unneeded included headers.
* Remove unneeded TO_VOID_PTR() macro.
* Use `const` where possible.
* Use single return points.
* Rename platform context variables to `platform_ctx`.
* Capitalize comments.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf-platform-linux-fs.*: remove header titles
Philippe Proulx [Thu, 17 Sep 2020 01:08:36 +0000 (21:08 -0400)] 
barectf-platform-linux-fs.*: remove header titles

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoexamples/linux-fs-simple, platforms/linux-fs: use double quotes to include
Philippe Proulx [Thu, 17 Sep 2020 01:05:32 +0000 (21:05 -0400)] 
examples/linux-fs-simple, platforms/linux-fs: use double quotes to include

    #include "barectf.h"

is more permissive than

    #include <barectf.h>

You don't need to add `-I.` to search the same directory.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf-platform-linux-fs.*: update copyright years
Philippe Proulx [Thu, 17 Sep 2020 01:00:44 +0000 (21:00 -0400)] 
barectf-platform-linux-fs.*: update copyright years

Also reflow the license headers to fit 72 columns.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf-platform-linux-fs.h: remove function documentation
Philippe Proulx [Thu, 17 Sep 2020 01:00:12 +0000 (21:00 -0400)] 
barectf-platform-linux-fs.h: remove function documentation

This is now in the local `README.adoc` file.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agobarectf-platform-linux-fs.c: use `CLOCK_REALTIME`
Philippe Proulx [Thu, 17 Sep 2020 00:57:52 +0000 (20:57 -0400)] 
barectf-platform-linux-fs.c: use `CLOCK_REALTIME`

Although this clock source can go back, the result is more friendly than
using `CLOCK_MONOTONIC` and having to set the clock type's offset
manually or getting invalid event record times.

I believe this is acceptable considering the demonstration purpose of
this platform.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoplatforms/linux-fs: remove `README.md`, write a better `README.adoc`
Philippe Proulx [Thu, 17 Sep 2020 00:57:16 +0000 (20:57 -0400)] 
platforms/linux-fs: remove `README.md`, write a better `README.adoc`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoMove `doc/examples` to `examples`
Philippe Proulx [Thu, 17 Sep 2020 00:09:49 +0000 (20:09 -0400)] 
Move `doc/examples` to `examples`

I'm planning to remove the `doc` directory, writing the documentation
within the `docs` directory.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoRemove Parallella platform and examples
Philippe Proulx [Thu, 17 Sep 2020 00:05:49 +0000 (20:05 -0400)] 
Remove Parallella platform and examples

It's very hard to test and to integrate in a CI.

Also, the Epiphany repositories are not updated since 3-4 years [1].

[1]: https://github.com/adapteva

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoRename "event type" -> "event record type", "stream type" -> "data stream type"
Philippe Proulx [Wed, 16 Sep 2020 23:36:59 +0000 (19:36 -0400)] 
Rename "event type" -> "event record type", "stream type" -> "data stream type"

This matches an eventual CTF 2 terminology and makes writing the barectf
documentation easier, as a data stream type describes data streams and
an event record type describes event records. An event record is what
the tracer records for an occurring event.

Throughout the code, for names, variables, and file names:

* `dst` means "data stream type".
* `ds` means "data stream".
* `ert` means "event record type".
* `er` means "event record".

The v3 YAML schemas are modified accordingly.

This patch also renames "discarded events counter" to "discarded event
records counter snapshot", as this field is a snapshot of the per-data
stream counter.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoAdd dynamic array tracing tests
Philippe Proulx [Thu, 10 Sep 2020 21:32:50 +0000 (17:32 -0400)] 
Add dynamic array tracing tests

The new tests are modified copies of static array tracing tests as a
dynamic array field can contain the same fields as a static array field.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agoRemoved unused `tests/conftest.py`
Philippe Proulx [Thu, 10 Sep 2020 20:54:58 +0000 (16:54 -0400)] 
Removed unused `tests/conftest.py`

Used to contain the yaml_cfg_path() fixture; not needed anymore since
b1c5cbc ("tests/config/yaml: use pytest_collect_file() hook for YAML
files") and 816fefd ("tests/tracing: use pytest_collect_file() hook for
YAML files").

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotests/tracing/support/test-platform.c: clear buffer at every packet opening
Philippe Proulx [Thu, 10 Sep 2020 19:01:56 +0000 (15:01 -0400)] 
tests/tracing/support/test-platform.c: clear buffer at every packet opening

This ensures that there's no garbage data left in the buffer between
packets.

It's not triggering any failure currently because all the tests in
`tests/tracing` produce a single packet.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agotracing/src/succeed/static-array: update copyright notice's year
Philippe Proulx [Thu, 10 Sep 2020 19:01:36 +0000 (15:01 -0400)] 
tracing/src/succeed/static-array: update copyright notice's year

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
3 years agosrc/succeed/static-array: add missing `const` qualifiers
Philippe Proulx [Thu, 10 Sep 2020 18:58:14 +0000 (14:58 -0400)] 
src/succeed/static-array: add missing `const` qualifiers

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.040931 seconds and 4 git commands to generate.