Wind River Support Network

HomeDefectsLIN1022-499
Fixed

LIN1022-499 : Babeltrace cannot handle negative clock offset

Created: May 4, 2022    Updated: Nov 28, 2022
Resolved Date: Nov 28, 2022
Found In Version: 10.22.33.1
Fix Version: 10.22.33.3
Severity: Severe
Applicable for: Wind River Linux LTS 22
Component/s: Userspace

Description

This issue is the same one described by https://git.efficios.com/?p=babeltrace.git;a=commit;h=61cf588beae752e5ddfc60b6b5310f769ac9e852

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().
Live chat
Online