flt.utils.muxer: remove msgTypeStr
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 8 Feb 2024 20:35:18 +0000 (15:35 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Sat, 10 Feb 2024 14:25:58 +0000 (09:25 -0500)
Make {fmt} format the message type directly.

Change-Id: Id887079214992a346d13fcafbd048aa8af9d4457
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11768
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/utils/muxer/msg-iter.cpp

index 526be00726fd42edc72ddca20b4d0ea029c45608..3a3addc79f90ef1d9b70dce24553a1f01ce86024 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "common/common.h"
 #include "cpp-common/bt2c/call.hpp"
+#include "cpp-common/bt2c/fmt.hpp"
 #include "cpp-common/bt2s/make-unique.hpp"
 #include "cpp-common/vendor/fmt/format.h"
 
@@ -239,11 +240,6 @@ void MsgIter::_seekBeginning()
 
 namespace {
 
-const char *msgTypeStr(const bt2::ConstMessage msg) noexcept
-{
-    return bt_common_message_type_string(static_cast<bt_message_type>(msg.type()));
-}
-
 std::string optLogStr(const char * const str) noexcept
 {
     return str ? fmt::format("\"{}\"", str) : "(none)";
@@ -400,7 +396,7 @@ void MsgIter::_validateMsgClkCls(const bt2::ConstMessage msg)
         return;
     }
 
-    BT_CPPLOGD("Validating the clock class of a message: msg-type={}", msgTypeStr(msg));
+    BT_CPPLOGD("Validating the clock class of a message: msg-type={}", msg.type());
 
     /* Get the clock class, if any, of `msg` */
     const auto clkCls = bt2c::call([msg]() -> bt2::OptionalBorrowedObject<bt2::ConstClockClass> {
@@ -440,8 +436,8 @@ bool MsgIter::_HeapComparator::operator()(
         BT_CPPLOGT("Comparing two messages: "
                    "port-name-a={}, msg-a-type={}, msg-a-ts={}, "
                    "port-name-b={}, msg-b-type={}, msg-b-ts={}",
-                   upstreamMsgIterA->portName(), msgTypeStr(msgA), optMsgTsStr(msgTsA),
-                   upstreamMsgIterB->portName(), msgTypeStr(msgB), optMsgTsStr(msgTsB));
+                   upstreamMsgIterA->portName(), msgA.type(), optMsgTsStr(msgTsA),
+                   upstreamMsgIterB->portName(), msgB.type(), optMsgTsStr(msgTsB));
     }
 
     /*
This page took 0.026072 seconds and 4 git commands to generate.