Handle negative time and offset from Epoch
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 9 Feb 2016 18:27:24 +0000 (13:27 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 13 Feb 2016 02:26:26 +0000 (21:26 -0500)
commit61cf588beae752e5ddfc60b6b5310f769ac9e852
treecf4ae5ea34f7455d12166c7e079195c062a8ca8a
parent128e68e8230a4001c4dbab6dfdcdf986c7c45113
Handle negative time and offset from Epoch

Handle cases where a trace have a negative offset from Epoch.
If Epoch is arbitrary (e.g. embedded system starting at 0, without any
network access), the "0" can be used as correlation point between
various components, and some components could start before the
correlation point. Therefore, especially in traces where the time is
meant to be shown in nanoseconds or cycles from the correlation point,
it also makes sense to have a negative time value.

It introduces API-breaking changes in the C and Python APIs, since we
need to be able to return negative time values, which were previously
used as errors (-1ULL).

The --offset and --offset-ns command line parameters can now take
negative offset (seconds and nanoseconds) values too.

The [sec.ns] format is used as fallback so we don't attempt to pass
a negative time value to POSIX time-formatting APIs.

This also fixes an inaccurate return value in an error path of
bt_ctf_event_populate_event_header().

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
23 files changed:
bindings/python/nativebt.i
converter/babeltrace.c
formats/ctf-text/ctf-text.c
formats/ctf/ctf.c
formats/ctf/events-private.h
formats/ctf/events.c
formats/ctf/ir/clock.c
formats/ctf/ir/event.c
formats/ctf/metadata/ctf-visitor-generate-io-struct.c
include/babeltrace/babeltrace-internal.h
include/babeltrace/clock-internal.h
include/babeltrace/ctf-ir/clock-internal.h
include/babeltrace/ctf-ir/clock.h
include/babeltrace/ctf-ir/metadata.h
include/babeltrace/ctf/events.h
include/babeltrace/ctf/types.h
include/babeltrace/format.h
include/babeltrace/trace-handle-internal.h
include/babeltrace/trace-handle.h
lib/context.c
lib/trace-handle.c
tests/lib/test_ctf_writer.c
tests/lib/test_seek.c
This page took 0.02656 seconds and 4 git commands to generate.