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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 13 Jun 2019 21:24:22 +0000 (17:24 -0400)
commit58117c6d95fd827c2cb02f1fc5f25111ea5d7f87
treef31d77c7a90a6d72428568beb013ed163d8aa2d7
parentc1f82f3b94e856988cd73ac452a0e5655726eefb
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.025495 seconds and 4 git commands to generate.