Observed issue
==============
The system test jobs complain that the clock regeneration is broken
since the move to the tsdl visitor approach for metadata generation.
# Test UST local with metadata regeneration
# destructive//../../src/bin/lttng/lttng create regen -o /tmp/tmp.metadata_regen_after_data_change.Vzb0vL
ok 23 - Create session regen in -o /tmp/tmp.metadata_regen_after_data_change.Vzb0vL
# destructive//../../src/bin/lttng/lttng enable-event tp:tptest -s regen -u
ok 24 - Enable ust event tp:tptest for session regen
# destructive//../../src/bin/lttng/lttng start regen
ok 25 - Start tracing for session regen
# destructive//../../src/bin/lttng/lttng stop regen
ok 26 - Stop lttng tracing for session regen
ok 27 - Validate trace at date 1970-02-02
# destructive//../../src/bin/lttng/lttng start regen
ok 28 - Start tracing for session regen
# destructive//../../src/bin/lttng/lttng regenerate metadata -s regen
ok 29 - Metadata regenerate regen
# destructive//../../src/bin/lttng/lttng stop regen
ok 30 - Stop lttng tracing for session regen
# destructive//../../src/bin/lttng/lttng destroy regen
ok 31 - Destroy session regen
not ok 32 - The trace is not at the expected date
# Failed test 'The trace is not at the expected date'
# in destructive//../utils/tap/tap.sh:fail() at line 159.
Cause
=====
Previously the clock was sampled on each call to `ust_metadata_session_statedump`
, currently the clock is only sampled on creation of the
`lttng::sessiond::ust::registry_session::registry_session` object.
Solution
========
On `lsu::registry_session::regenerate_metadata`, sample the clock and
replace the registry_session _clock object.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Change-Id: I6f671e4c01f71e1574824236cef03915a9c79b36
public:
using cycles_t = uint64_t;
using scycles_t = int64_t;
public:
using cycles_t = uint64_t;
using scycles_t = int64_t;
+ using cuptr = std::unique_ptr<const clock_class>;
const std::string name;
const std::string description;
const std::string name;
const std::string description;
_gid{egid},
_app_tracer_version{.major = major, .minor = minor},
_tracing_id{tracing_id},
_gid{egid},
_app_tracer_version{.major = major, .minor = minor},
_tracing_id{tracing_id},
+ _clock{lttng::make_unique<lsu::clock_class>()},
_metadata_generating_visitor{lttng::make_unique<ls::tsdl::trace_class_visitor>(abi,
[this](const std::string& fragment) {
_append_metadata_fragment(fragment);
_metadata_generating_visitor{lttng::make_unique<ls::tsdl::trace_class_visitor>(abi,
[this](const std::string& fragment) {
_append_metadata_fragment(fragment);
void lsu::registry_session::_accept_on_clock_classes(lst::trace_class_visitor& visitor) const
{
ASSERT_LOCKED(_lock);
void lsu::registry_session::_accept_on_clock_classes(lst::trace_class_visitor& visitor) const
{
ASSERT_LOCKED(_lock);
- _clock.accept(visitor);
+ _clock->accept(visitor);
}
void lsu::registry_session::_accept_on_stream_classes(lst::trace_class_visitor& visitor) const
}
void lsu::registry_session::_accept_on_stream_classes(lst::trace_class_visitor& visitor) const
{
lttng::pthread::lock_guard registry_lock(_lock);
{
lttng::pthread::lock_guard registry_lock(_lock);
+ /* Resample the clock */
+ _clock = lttng::make_unique<lsu::clock_class>();
+
_metadata_version++;
_reset_metadata();
_generate_metadata();
_metadata_version++;
_reset_metadata();
_generate_metadata();
/* The id of the parent session. */
const ltt_session::id_t _tracing_id;
/* The id of the parent session. */
const ltt_session::id_t _tracing_id;
- lttng::sessiond::ust::clock_class _clock;
+ lttng::sessiond::ust::clock_class::cuptr _clock;
const lttng::sessiond::trace::trace_class_visitor::cuptr _metadata_generating_visitor;
};
const lttng::sessiond::trace::trace_class_visitor::cuptr _metadata_generating_visitor;
};