iterator.c, muxer: tweak clock compatibility validation error messages
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 10 Sep 2024 19:45:40 +0000 (15:45 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 9 Oct 2024 02:56:57 +0000 (22:56 -0400)
commitf9b485aec70c4f55a202cf3d1e4bfd416a091835
tree1f2614262c2eab3dcfb077d60526108d05f3d749
parent237e5f2c48cf6933200ec6efdbd371271f3ce3ed
iterator.c, muxer: tweak clock compatibility validation error messages

In general, make the prose part of the messages be a bit more in line
with the enumerator names, which usually ends up a bit more specific
than the current messages.

In muxer's msg-iter.cpp:

 - Split the ExpectingOriginUnixGotNone,
   ExpectingOriginUnknownWithUuidGotNone and
   ExpectingOriginUnknownWithoutUuidGotNone, to provide slightly more
   precise error messages about what kind of clock class is expected.

 - Always include the stream class information, whenever there is a
   stream class (message iterator inactivity messages don't have an
   associated stream class).  Factor this out in a `formatStreamCls`
   lambda.

 - Factor out the formatting of the clock class info, and print an
   additional `clock-class-origin-is-unix-epoch` and `clock-class-uuid`
   fields.  This factorisation will be helpful when adding support for
   MIP 1, since the fields to format will change.  We will need to
   update fewer places.

In iterator.c:

 - Print the actual clock class info in a few more places.

 - Change phrases like "has non Unix epoch origin" for "has unknown
   origin", both in human-readable messages and conditions IDs.

 - Tweak the "Expecting a clock class, got none." messages to be a bit
   more specific, differentiating the three cases.

 - Print the expected UUID whenever we expect a clock class with a
   specific UUID.

Instead of cherry-picking the information we print for each case, we
could also print the entire reference clock class information (making it
clear that we don't necessarily expect this particular clock class
instance, perhaps with a `reference-` prefix).  It would probably make
the implementation simpler, but it would print a bit more unnecessary
information.  The user would have to infer from the error message what
is the relevant information in there.  I don't have a strong preference
for either approach.

Change-Id: I0ce2ab5b146a79baa5aa0afbd9d5de4f79f283a1
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12784
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/lib/graph/iterator.c
src/plugins/utils/muxer/msg-iter.cpp
tests/lib/conds/clk-cls-compat-postconds-triggers.cpp
tests/plugins/flt.utils.muxer/test-clock-compatibility.cpp
This page took 0.029598 seconds and 4 git commands to generate.