src.ctf.fs: trace-info: omit stream `range-ns` field when no TS
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 6 Jun 2019 04:05:53 +0000 (00:05 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 7 Jun 2019 22:49:03 +0000 (18:49 -0400)
commit1d4ac4b6541dcbbe1f676e198ab868fe5254ba49
treed3be47c36f7598c6ab436c06380c3533e1293e1f
parenta8be4294fc84cc1b81b1690412c22c9e06cdb8e3
src.ctf.fs: trace-info: omit stream `range-ns` field when no TS

Don't print -1 timestamps when packet contexts don't have
`timestamp_begin` and `timestamp_end` fields. Simply omit this part of
the query reply.

Remove FIXME comment as the only user of the index now handles absent
timestamps.

Tests
=====
Adapt `test_ctf_plugin` stream sorting function to fall back on using
the `paths` field if `range-ns` field is absent and rename it to
abstract implementation details.

Add test case to test that `range-ns` fields are absent on traces
without `timestamp_begin` and `timestamp_end` fields in their packet
context.

Example
=======
Here is an example of the output of the `trace-info` query on a trace
without packet contexts before this commit:
  -
    streams:
      -
       range-ns:
          begin: -1
          end: -1
       paths:
          - /home/frdeso/projets/babeltrace/tests/ctf-traces/succeed/no-packet-context/stream
       class-id: 0
       port-name: /home/frdeso/projets/babeltrace/tests/ctf-traces/succeed/no-packet-context | 0 | /home/frdeso/projets/babeltrace/tests/ctf-traces/succeed/no-packet-context/stream
    range-ns:
      begin: -1
      end: 0
    name: no-packet-context
    path: /home/frdeso/projets/babeltrace/tests/ctf-traces/succeed/no-packet-context

Here is an example of the output of the `trace-info` query on a trace
without packet contexts after this commit:
  -
    streams:
      -
       class-id: 0
       port-name: /home/frdeso/projets/babeltrace/tests/ctf-traces/succeed/no-packet-context | 0 | /home/frdeso/projets/babeltrace/tests/ctf-traces/succeed/no-packet-context/stream
       paths:
          - /home/frdeso/projets/babeltrace/tests/ctf-traces/succeed/no-packet-context/stream
    name: no-packet-context
    path: /home/frdeso/projets/babeltrace/tests/ctf-traces/succeed/no-packet-context

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I419f57960a52d8ed2823fdb06982e5c20710b6da
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1387
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
plugins/ctf/fs-src/fs.h
plugins/ctf/fs-src/query.c
tests/plugins/ctf/test_query_trace_info.py
This page took 0.027336 seconds and 4 git commands to generate.