Tests: ctf: add tracers timestamp quirks workaround test cases
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 21 Jun 2019 20:46:37 +0000 (16:46 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 16 Aug 2019 15:35:50 +0000 (11:35 -0400)
commit8e03dac57df3ee78b8c7c78bfdec4dec5669741c
treeb93da47448bdc15a13235ea0362344d8bc4fe1e5
parent1eb289076eed1e36fa2c7256f504fb22f40f9f7c
Tests: ctf: add tracers timestamp quirks workaround test cases

This commit adds test traces and test cases to cover the `src.ctf.fs`
workarounds used to support timestamp corner cases or bugs in the
tracers.

Note: I manually modified the test traces to contain problematic
timestamp values using an hex editor as if there would be created by an
affected tracer.

Test traces
===========
* `event-after-packet` lttng test trace
  This trace `event-after-packet` was modified manually to simulate the
  hard to reproduce `event-after-packet` LTTng tracers bug.

  When the bug occurs, the timestamp of the last event of a packet is larger than
  the `timestamp_end` of it's own packet. It makes it look like the event
  happened after the packet was closed which is non compliant with the CTF
  specification.

  To create a trace exhibiting this bug, the `timestamp_end` field of
  the last 2 packets was made one clock cycle smaller than the timestamp
  of the last event of the said packet.

  This bug was fixed in the follow versions of the LTTng tracers:
  - lttng-ust 2.11.0
  - lttng-module 2.11.0
  - lttng-module 2.10.10
  - lttng-module 2.9.13

* `lttng-crash` test trace
  This trace was modified manually to simulate a trace resulting from the
  lttng-crash utility.

  When extracting a trace using the lttng-crash utility the `timestamp_end` of
  some packets may be left uninitialized with the default value of 0.

  To create a trace exhibiting this behavior, the `timestamp_end` of the last
  three packets were set to 0.

  This is _not_ a bug and all LTTng tracers can produce such trace.

* `event-before-packet` barectf test trace
  This trace `event-before-packet` exhibits a barectf bug where the first
  event of the second packet has a timestamp smaller than the
  `timestamp_begin` field of its own packet.

  This bug was fixed in barectf tracer version 2.3.1.

Test cases
==========

* `trace-info` query
  - Add test case for `event-after-packet` LTTng quirk,
  - Add test case for `lttng-crash` workaround.

  Both of this test traces used in these test cases are based on the same
  trace and the end result on the `trace-info` query is the same. We use
  the same code for both test cases.

* Trace decoding
  -Add `test_succeed` cases for all three of the above test traces.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: Icfdb8052aa2a88038e22ad6a58f391b6d8dbd3df
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1542
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
tests/data/ctf-traces/succeed/barectf-event-before-packet/metadata [new file with mode: 0644]
tests/data/ctf-traces/succeed/barectf-event-before-packet/stream [new file with mode: 0644]
tests/data/ctf-traces/succeed/lttng-crash/chan_0 [new file with mode: 0644]
tests/data/ctf-traces/succeed/lttng-crash/metadata [new file with mode: 0644]
tests/data/ctf-traces/succeed/lttng-event-after-packet/chan_0 [new file with mode: 0644]
tests/data/ctf-traces/succeed/lttng-event-after-packet/metadata [new file with mode: 0644]
tests/data/plugins/src.ctf.fs/succeed/trace-barectf-event-before-packet.expect [new file with mode: 0644]
tests/data/plugins/src.ctf.fs/succeed/trace-lttng-crash.expect [new file with mode: 0644]
tests/data/plugins/src.ctf.fs/succeed/trace-lttng-event-after-packet.expect [new file with mode: 0644]
tests/plugins/src.ctf.fs/query/test_query_trace_info.py
tests/plugins/src.ctf.fs/succeed/test_succeed
This page took 0.026382 seconds and 4 git commands to generate.