plugins/common/muxing: compare clock class identities (MIP 1)
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 2 Oct 2024 05:12:41 +0000 (01:12 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 9 Oct 2024 02:56:57 +0000 (22:56 -0400)
Adjust for MIP 1, where clock classes may have identities (namespace,
name, UID), instead of UUIDs.

Change-Id: I23fe610ae7c85c7dfa2999d102c26ec9188dbeee
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/13311
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/common/muxing/muxing.cpp
src/plugins/common/muxing/muxing.hpp

index 700d86dbafc3bacc5d6b037f9e6c6fb82e7f2577..72a5718ee33115fb9ab5805cf32e700bf8ee4323 100644 (file)
@@ -200,9 +200,13 @@ int MessageComparator::_compareEventClasses(const bt2::ConstEventClass left,
 }
 
 int MessageComparator::_compareClockClasses(const bt2::ConstClockClass left,
-                                            const bt2::ConstClockClass right) noexcept
+                                            const bt2::ConstClockClass right) const noexcept
 {
-    if (const auto ret = _compareOptUuids(left.uuid(), right.uuid())) {
+    if (_mGraphMipVersion == 0) {
+        if (const auto ret = _compareOptUuids(left.uuid(), right.uuid())) {
+            return ret;
+        }
+    } else if (const auto ret = _compareIdentities(left.identity(), right.identity())) {
         return ret;
     }
 
@@ -222,7 +226,7 @@ int MessageComparator::_compareClockClasses(const bt2::ConstClockClass left,
 }
 
 int MessageComparator::_compareStreamsSameIds(const bt2::ConstStream left,
-                                              const bt2::ConstStream right) noexcept
+                                              const bt2::ConstStream right) const noexcept
 {
     BT_ASSERT_DBG(left.id() == right.id());
 
@@ -299,8 +303,11 @@ int MessageComparator::_compareStreamsSameIds(const bt2::ConstStream left,
     }
 
     /* Compare the clock classes associated to the stream classes. */
-    return _compareOptionalBorrowedObjects(leftCls.defaultClockClass(),
-                                           rightCls.defaultClockClass(), _compareClockClasses);
+    return _compareOptionalBorrowedObjects(
+        leftCls.defaultClockClass(), rightCls.defaultClockClass(),
+        [this](const bt2::ConstClockClass leftCc, const bt2::ConstClockClass rightCc) {
+            return _compareClockClasses(leftCc, rightCc);
+        });
 }
 
 int MessageComparator::_compareClockSnapshots(const bt2::ConstClockSnapshot left,
@@ -345,7 +352,7 @@ bt2::OptionalBorrowedObject<bt2::ConstStream> borrowStream(const bt2::ConstMessa
 } /* namespace */
 
 int MessageComparator::_compareMessagesSameType(const bt2::ConstMessage left,
-                                                const bt2::ConstMessage right) noexcept
+                                                const bt2::ConstMessage right) const noexcept
 {
     BT_ASSERT_DBG(left.type() == right.type());
 
index 4859a672923cf53d02101c6e6d0f2b3873d8f96f..47ce54182109e1b1bd21c7b9a38ba1e0dbf1a0a7 100644 (file)
@@ -49,14 +49,14 @@ private:
                                   const bt2::IdentityView& right) noexcept;
     static int _compareEventClasses(const bt2::ConstEventClass left,
                                     const bt2::ConstEventClass right) noexcept;
-    static int _compareClockClasses(const bt2::ConstClockClass left,
-                                    const bt2::ConstClockClass right) noexcept;
-    static int _compareStreamsSameIds(const bt2::ConstStream left,
-                                      const bt2::ConstStream right) noexcept;
+    int _compareClockClasses(const bt2::ConstClockClass left,
+                             const bt2::ConstClockClass right) const noexcept;
+    int _compareStreamsSameIds(const bt2::ConstStream left,
+                               const bt2::ConstStream right) const noexcept;
     static int _compareClockSnapshots(const bt2::ConstClockSnapshot left,
                                       const bt2::ConstClockSnapshot right) noexcept;
-    static int _compareMessagesSameType(const bt2::ConstMessage left,
-                                        const bt2::ConstMessage right) noexcept;
+    int _compareMessagesSameType(const bt2::ConstMessage left,
+                                 const bt2::ConstMessage right) const noexcept;
     static int _compareMessages(const bt2::ConstMessage left,
                                 const bt2::ConstMessage right) noexcept;
 
This page took 0.026448 seconds and 4 git commands to generate.