aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Eilers <jan.eilers@arm.com>2020-09-09 19:11:16 +0100
committerTeresaARM <teresa.charlinreyes@arm.com>2020-09-30 11:55:41 +0000
commit156113cee2b869810092b42579c31c3b1fd910c5 (patch)
treeb461c42f2678b786b846da917c456bd085aac4c9
parent3a613cc9103484249ffcd7c63a7ae57783b1ea18 (diff)
downloadarmnn-156113cee2b869810092b42579c31c3b1fd910c5.tar.gz
IVGCVSW-5295 Remove boost::format from armnn profiling
* Replace all instances of boost::format with fmt::format from armnn/src/profiling Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I4722bdde52c740bc9bdce969128074a34a3ee75e
-rw-r--r--src/profiling/ActivateTimelineReportingCommandHandler.cpp12
-rw-r--r--src/profiling/ConnectionAcknowledgedCommandHandler.cpp20
-rw-r--r--src/profiling/CounterDirectory.cpp72
-rw-r--r--src/profiling/DeactivateTimelineReportingCommandHandler.cpp12
-rw-r--r--src/profiling/PerJobCounterSelectionCommandHandler.cpp20
-rw-r--r--src/profiling/PeriodicCounterSelectionCommandHandler.cpp20
-rw-r--r--src/profiling/ProfilingService.cpp12
-rw-r--r--src/profiling/RequestCounterDirectoryCommandHandler.cpp20
-rw-r--r--src/profiling/SendCounterPacket.cpp56
-rw-r--r--src/profiling/test/ProfilingGuidTest.cpp4
10 files changed, 121 insertions, 127 deletions
diff --git a/src/profiling/ActivateTimelineReportingCommandHandler.cpp b/src/profiling/ActivateTimelineReportingCommandHandler.cpp
index 6d5f32faa4..77df76f2fe 100644
--- a/src/profiling/ActivateTimelineReportingCommandHandler.cpp
+++ b/src/profiling/ActivateTimelineReportingCommandHandler.cpp
@@ -7,7 +7,7 @@
#include "TimelineUtilityMethods.hpp"
#include <armnn/Exceptions.hpp>
-#include <boost/format.hpp>
+#include <fmt/format.h>
namespace armnn
{
@@ -30,9 +30,9 @@ void ActivateTimelineReportingCommandHandler::operator()(const arm::pipe::Packet
case ProfilingState::Uninitialised:
case ProfilingState::NotConnected:
case ProfilingState::WaitingForAck:
- throw RuntimeException(boost::str(
- boost::format("Activate Timeline Reporting Command Handler invoked while in a wrong state: %1%")
- % GetProfilingStateName(currentState)));
+ throw RuntimeException(fmt::format(
+ "Activate Timeline Reporting Command Handler invoked while in a wrong state: {}",
+ GetProfilingStateName(currentState)));
case ProfilingState::Active:
if ( !( packet.GetPacketFamily() == 0u && packet.GetPacketId() == 6u ))
{
@@ -56,8 +56,8 @@ void ActivateTimelineReportingCommandHandler::operator()(const arm::pipe::Packet
break;
default:
- throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1%")
- % static_cast<int>(currentState)));
+ throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+ static_cast<int>(currentState)));
}
}
diff --git a/src/profiling/ConnectionAcknowledgedCommandHandler.cpp b/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
index 7fa3785a43..c61c091bc4 100644
--- a/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
+++ b/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
@@ -8,7 +8,7 @@
#include <armnn/Exceptions.hpp>
-#include <boost/format.hpp>
+#include <fmt/format.h>
namespace armnn
{
@@ -23,17 +23,17 @@ void ConnectionAcknowledgedCommandHandler::operator()(const arm::pipe::Packet& p
{
case ProfilingState::Uninitialised:
case ProfilingState::NotConnected:
- throw RuntimeException(boost::str(boost::format("Connection Acknowledged Command Handler invoked while in an "
- "wrong state: %1%")
- % GetProfilingStateName(currentState)));
+ throw RuntimeException(fmt::format("Connection Acknowledged Command Handler invoked while in an "
+ "wrong state: {}",
+ GetProfilingStateName(currentState)));
case ProfilingState::WaitingForAck:
// Process the packet
if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 1u))
{
- throw armnn::InvalidArgumentException(boost::str(boost::format("Expected Packet family = 0, id = 1 but "
- "received family = %1%, id = %2%")
- % packet.GetPacketFamily()
- % packet.GetPacketId()));
+ throw armnn::InvalidArgumentException(fmt::format("Expected Packet family = 0, id = 1 but "
+ "received family = {}, id = {}",
+ packet.GetPacketFamily(),
+ packet.GetPacketId()));
}
// Once a Connection Acknowledged packet has been received, move to the Active state immediately
@@ -67,8 +67,8 @@ void ConnectionAcknowledgedCommandHandler::operator()(const arm::pipe::Packet& p
case ProfilingState::Active:
return; // NOP
default:
- throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1%")
- % static_cast<int>(currentState)));
+ throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+ static_cast<int>(currentState)));
}
}
diff --git a/src/profiling/CounterDirectory.cpp b/src/profiling/CounterDirectory.cpp
index e6356b82bd..9ef379a04e 100644
--- a/src/profiling/CounterDirectory.cpp
+++ b/src/profiling/CounterDirectory.cpp
@@ -12,7 +12,7 @@
#include <common/include/SwTrace.hpp>
-#include <boost/format.hpp>
+#include <fmt/format.h>
namespace armnn
{
@@ -32,9 +32,8 @@ const Category* CounterDirectory::RegisterCategory(const std::string& categoryNa
// Check that the given category is not already registered
if (IsCategoryRegistered(categoryName))
{
- throw InvalidArgumentException(
- boost::str(boost::format("Trying to register a category already registered (\"%1%\")")
- % categoryName));
+ throw InvalidArgumentException(fmt::format("Trying to register a category already registered (\"{}\")",
+ categoryName));
}
// Create the category
@@ -65,9 +64,8 @@ const Device* CounterDirectory::RegisterDevice(const std::string& deviceName,
// Check that a device with the given name is not already registered
if (IsDeviceRegistered(deviceName))
{
- throw InvalidArgumentException(
- boost::str(boost::format("Trying to register a device already registered (\"%1%\")")
- % deviceName));
+ throw InvalidArgumentException(fmt::format("Trying to register a device already registered (\"{}\")",
+ deviceName));
}
// Check that a category with the given (optional) parent category name is already registered
@@ -78,10 +76,10 @@ const Device* CounterDirectory::RegisterDevice(const std::string& deviceName,
if (parentCategoryNameValue.empty())
{
throw InvalidArgumentException(
- boost::str(boost::format("Trying to connect a device (name: \"%1%\") to an invalid "
- "parent category (name: \"%2%\")")
- % deviceName
- % parentCategoryNameValue));
+ fmt::format("Trying to connect a device (name: \"{}\") to an invalid "
+ "parent category (name: \"{}\")",
+ deviceName,
+ parentCategoryNameValue));
}
// Check that the given parent category is already registered
@@ -89,10 +87,10 @@ const Device* CounterDirectory::RegisterDevice(const std::string& deviceName,
if (categoryIt == m_Categories.end())
{
throw InvalidArgumentException(
- boost::str(boost::format("Trying to connect a device (name: \"%1%\") to a parent category that "
- "is not registered (name: \"%2%\")")
- % deviceName
- % parentCategoryNameValue));
+ fmt::format("Trying to connect a device (name: \"{}\") to a parent category that "
+ "is not registered (name: \"{}\")",
+ deviceName,
+ parentCategoryNameValue));
}
}
@@ -128,8 +126,8 @@ const CounterSet* CounterDirectory::RegisterCounterSet(const std::string& counte
if (IsCounterSetRegistered(counterSetName))
{
throw InvalidArgumentException(
- boost::str(boost::format("Trying to register a counter set already registered (\"%1%\")")
- % counterSetName));
+ fmt::format("Trying to register a counter set already registered (\"{}\")",
+ counterSetName));
}
// Peek the next UID, do not get an actual valid UID just now as we don't want to waste a good UID in case
@@ -144,10 +142,10 @@ const CounterSet* CounterDirectory::RegisterCounterSet(const std::string& counte
if (parentCategoryNameValue.empty())
{
throw InvalidArgumentException(
- boost::str(boost::format("Trying to connect a counter set (UID: %1%) to an invalid "
- "parent category (name: \"%2%\")")
- % counterSetUidPeek
- % parentCategoryNameValue));
+ fmt::format("Trying to connect a counter set (UID: {}) to an invalid "
+ "parent category (name: \"{}\")",
+ counterSetUidPeek,
+ parentCategoryNameValue));
}
// Check that the given parent category is already registered
@@ -155,10 +153,10 @@ const CounterSet* CounterDirectory::RegisterCounterSet(const std::string& counte
if (it == m_Categories.end())
{
throw InvalidArgumentException(
- boost::str(boost::format("Trying to connect a counter set (UID: %1%) to a parent category "
- "that is not registered (name: \"%2%\")")
- % counterSetUidPeek
- % parentCategoryNameValue));
+ fmt::format("Trying to connect a counter set (UID: {}) to a parent category "
+ "that is not registered (name: \"{}\")",
+ counterSetUidPeek,
+ parentCategoryNameValue));
}
}
@@ -246,9 +244,8 @@ const Counter* CounterDirectory::RegisterCounter(const BackendId& backendId,
if (categoryIt == m_Categories.end())
{
throw InvalidArgumentException(
- boost::str(boost::format("Trying to connect a counter to a category "
- "that is not registered (name: \"%1%\")")
- % parentCategoryName));
+ fmt::format("Trying to connect a counter to a category that is not registered (name: \"{}\")",
+ parentCategoryName));
}
// Get the parent category
@@ -265,10 +262,10 @@ const Counter* CounterDirectory::RegisterCounter(const BackendId& backendId,
if (parentCategoryCounter->m_Name == name)
{
throw InvalidArgumentException(
- boost::str(boost::format("Trying to register a counter to category \"%1%\" with a name that "
- "is already used within that category (name: \"%2%\")")
- % parentCategoryName
- % name));
+ fmt::format("Trying to register a counter to category \"{}\" with a name that "
+ "is already used within that category (name: \"{}\")",
+ parentCategoryName,
+ name));
}
}
@@ -280,9 +277,9 @@ const Counter* CounterDirectory::RegisterCounter(const BackendId& backendId,
if (!IsCounterSetRegistered(counterSetUidValue))
{
throw InvalidArgumentException(
- boost::str(boost::format("Trying to connect a counter to a counter set that is "
- "not registered (counter set UID: %1%)")
- % counterSetUidValue));
+ fmt::format("Trying to connect a counter to a counter set that is "
+ "not registered (counter set UID: {})",
+ counterSetUidValue));
}
}
@@ -531,9 +528,8 @@ uint16_t CounterDirectory::GetNumberOfCores(const Optional<uint16_t>& numberOfCo
if (deviceIt == m_Devices.end())
{
throw InvalidArgumentException(
- boost::str(boost::format("Trying to connect a counter to a device that is "
- "not registered (device UID %1%)")
- % deviceUid));
+ fmt::format("Trying to connect a counter to a device that is not registered (device UID {})",
+ deviceUid));
}
// Get the associated device
diff --git a/src/profiling/DeactivateTimelineReportingCommandHandler.cpp b/src/profiling/DeactivateTimelineReportingCommandHandler.cpp
index bdee83b1c0..37d46c05dc 100644
--- a/src/profiling/DeactivateTimelineReportingCommandHandler.cpp
+++ b/src/profiling/DeactivateTimelineReportingCommandHandler.cpp
@@ -6,7 +6,7 @@
#include "DeactivateTimelineReportingCommandHandler.hpp"
#include <armnn/Exceptions.hpp>
-#include <boost/format.hpp>
+#include <fmt/format.h>
namespace armnn
@@ -24,9 +24,9 @@ void DeactivateTimelineReportingCommandHandler::operator()(const arm::pipe::Pack
case ProfilingState::Uninitialised:
case ProfilingState::NotConnected:
case ProfilingState::WaitingForAck:
- throw RuntimeException(boost::str(
- boost::format("Deactivate Timeline Reporting Command Handler invoked while in a wrong state: %1%")
- % GetProfilingStateName(currentState)));
+ throw RuntimeException(fmt::format(
+ "Deactivate Timeline Reporting Command Handler invoked while in a wrong state: {}",
+ GetProfilingStateName(currentState)));
case ProfilingState::Active:
if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 7u))
{
@@ -42,8 +42,8 @@ void DeactivateTimelineReportingCommandHandler::operator()(const arm::pipe::Pack
break;
default:
- throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1%")
- % static_cast<int>(currentState)));
+ throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+ static_cast<int>(currentState)));
}
}
diff --git a/src/profiling/PerJobCounterSelectionCommandHandler.cpp b/src/profiling/PerJobCounterSelectionCommandHandler.cpp
index fea8ee3e5b..9e2f0626d3 100644
--- a/src/profiling/PerJobCounterSelectionCommandHandler.cpp
+++ b/src/profiling/PerJobCounterSelectionCommandHandler.cpp
@@ -6,7 +6,7 @@
#include "PerJobCounterSelectionCommandHandler.hpp"
#include <armnn/Exceptions.hpp>
-#include <boost/format.hpp>
+#include <fmt/format.h>
namespace armnn
{
@@ -22,25 +22,25 @@ void PerJobCounterSelectionCommandHandler::operator()(const arm::pipe::Packet& p
case ProfilingState::Uninitialised:
case ProfilingState::NotConnected:
case ProfilingState::WaitingForAck:
- throw armnn::RuntimeException(boost::str(boost::format(
- "Per-Job Counter Selection Command Handler invoked while in an incorrect state: %1%")
- % GetProfilingStateName(currentState)));
+ throw armnn::RuntimeException(fmt::format(
+ "Per-Job Counter Selection Command Handler invoked while in an incorrect state: {}",
+ GetProfilingStateName(currentState)));
case ProfilingState::Active:
// Process the packet
if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 5u))
{
- throw armnn::InvalidArgumentException(boost::str(boost::format("Expected Packet family = 0, id = 5 but "
- "received family = %1%, id = %2%")
- % packet.GetPacketFamily()
- % packet.GetPacketId()));
+ throw armnn::InvalidArgumentException(fmt::format("Expected Packet family = 0, id = 5 but "
+ "received family = {}, id = {}",
+ packet.GetPacketFamily(),
+ packet.GetPacketId()));
}
// Silently drop the packet
break;
default:
- throw armnn::RuntimeException(boost::str(boost::format("Unknown profiling service state: %1%")
- % static_cast<int>(currentState)));
+ throw armnn::RuntimeException(fmt::format("Unknown profiling service state: {}",
+ static_cast<int>(currentState)));
}
}
diff --git a/src/profiling/PeriodicCounterSelectionCommandHandler.cpp b/src/profiling/PeriodicCounterSelectionCommandHandler.cpp
index e622123296..cb14ec0a1a 100644
--- a/src/profiling/PeriodicCounterSelectionCommandHandler.cpp
+++ b/src/profiling/PeriodicCounterSelectionCommandHandler.cpp
@@ -9,7 +9,7 @@
#include <armnn/Types.hpp>
#include <armnn/utility/NumericCast.hpp>
-#include <boost/format.hpp>
+#include <fmt/format.h>
#include <vector>
@@ -65,18 +65,18 @@ void PeriodicCounterSelectionCommandHandler::operator()(const arm::pipe::Packet&
case ProfilingState::Uninitialised:
case ProfilingState::NotConnected:
case ProfilingState::WaitingForAck:
- throw RuntimeException(boost::str(boost::format("Periodic Counter Selection Command Handler invoked while in "
- "an wrong state: %1%")
- % GetProfilingStateName(currentState)));
+ throw RuntimeException(fmt::format("Periodic Counter Selection Command Handler invoked while in "
+ "an wrong state: {}",
+ GetProfilingStateName(currentState)));
case ProfilingState::Active:
{
// Process the packet
if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 4u))
{
- throw armnn::InvalidArgumentException(boost::str(boost::format("Expected Packet family = 0, id = 4 but "
- "received family = %1%, id = %2%")
- % packet.GetPacketFamily()
- % packet.GetPacketId()));
+ throw armnn::InvalidArgumentException(fmt::format("Expected Packet family = 0, id = 4 but "
+ "received family = {}, id = {}",
+ packet.GetPacketFamily(),
+ packet.GetPacketId()));
}
// Parse the packet to get the capture period and counter UIDs
@@ -161,8 +161,8 @@ void PeriodicCounterSelectionCommandHandler::operator()(const arm::pipe::Packet&
break;
}
default:
- throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1%")
- % static_cast<int>(currentState)));
+ throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+ static_cast<int>(currentState)));
}
}
diff --git a/src/profiling/ProfilingService.cpp b/src/profiling/ProfilingService.cpp
index 3521fc0884..6fe52f845e 100644
--- a/src/profiling/ProfilingService.cpp
+++ b/src/profiling/ProfilingService.cpp
@@ -11,7 +11,7 @@
#include <common/include/SocketConnectionException.hpp>
-#include <boost/format.hpp>
+#include <fmt/format.h>
namespace armnn
{
@@ -183,8 +183,8 @@ void ProfilingService::Update()
break;
default:
- throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1")
- % static_cast<int>(currentState)));
+ throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+ static_cast<int>(currentState)));
}
}
@@ -203,8 +203,8 @@ void ProfilingService::Disconnect()
break;
default:
- throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1")
- % static_cast<int>(currentState)));
+ throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+ static_cast<int>(currentState)));
}
}
@@ -486,7 +486,7 @@ inline void ProfilingService::CheckCounterUid(uint16_t counterUid) const
{
if (!IsCounterRegistered(counterUid))
{
- throw InvalidArgumentException(boost::str(boost::format("Counter UID %1% is not registered") % counterUid));
+ throw InvalidArgumentException(fmt::format("Counter UID {} is not registered", counterUid));
}
}
diff --git a/src/profiling/RequestCounterDirectoryCommandHandler.cpp b/src/profiling/RequestCounterDirectoryCommandHandler.cpp
index 8f78ae63f0..f86470b77d 100644
--- a/src/profiling/RequestCounterDirectoryCommandHandler.cpp
+++ b/src/profiling/RequestCounterDirectoryCommandHandler.cpp
@@ -5,7 +5,7 @@
#include "RequestCounterDirectoryCommandHandler.hpp"
-#include <boost/format.hpp>
+#include <fmt/format.h>
namespace armnn
{
@@ -21,17 +21,17 @@ void RequestCounterDirectoryCommandHandler::operator()(const arm::pipe::Packet&
case ProfilingState::Uninitialised:
case ProfilingState::NotConnected:
case ProfilingState::WaitingForAck:
- throw RuntimeException(boost::str(boost::format("Request Counter Directory Comand Handler invoked while in an "
- "wrong state: %1%")
- % GetProfilingStateName(currentState)));
+ throw RuntimeException(fmt::format("Request Counter Directory Comand Handler invoked while in an "
+ "wrong state: {}",
+ GetProfilingStateName(currentState)));
case ProfilingState::Active:
// Process the packet
if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 3u))
{
- throw armnn::InvalidArgumentException(boost::str(boost::format("Expected Packet family = 0, id = 3 but "
- "received family = %1%, id = %2%")
- % packet.GetPacketFamily()
- % packet.GetPacketId()));
+ throw armnn::InvalidArgumentException(fmt::format("Expected Packet family = 0, id = 3 but "
+ "received family = {}, id = {}",
+ packet.GetPacketFamily(),
+ packet.GetPacketId()));
}
// Send all the packet required for the handshake with the external profiling service
@@ -40,8 +40,8 @@ void RequestCounterDirectoryCommandHandler::operator()(const arm::pipe::Packet&
break;
default:
- throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1%")
- % static_cast<int>(currentState)));
+ throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+ static_cast<int>(currentState)));
}
}
diff --git a/src/profiling/SendCounterPacket.cpp b/src/profiling/SendCounterPacket.cpp
index 121ced9241..b0bfeb5677 100644
--- a/src/profiling/SendCounterPacket.cpp
+++ b/src/profiling/SendCounterPacket.cpp
@@ -14,7 +14,7 @@
#include <common/include/Constants.hpp>
#include <common/include/SwTrace.hpp>
-#include <boost/format.hpp>
+#include <fmt/format.h>
#include <cstring>
@@ -90,7 +90,7 @@ void SendCounterPacket::SendStreamMetaDataPacket()
{
CancelOperationAndThrow<BufferExhaustion>(
writeBuffer,
- boost::str(boost::format("No space left in buffer. Unable to reserve (%1%) bytes.") % totalSize));
+ fmt::format("No space left in buffer. Unable to reserve ({}) bytes.", totalSize));
}
try
@@ -188,8 +188,9 @@ bool SendCounterPacket::CreateCategoryRecord(const CategoryPtr& category,
auto it = counters.find(counterUid);
if (it == counters.end())
{
- errorMessage = boost::str(boost::format("Counter (%1%) not found in category (%2%)")
- % counterUid % category->m_Name );
+ errorMessage = fmt::format("Counter ({}) not found in category ({})",
+ counterUid,
+ category->m_Name );
return false;
}
@@ -202,7 +203,7 @@ bool SendCounterPacket::CreateCategoryRecord(const CategoryPtr& category,
}
if (categoryCounters.empty())
{
- errorMessage = boost::str(boost::format("No valid counters found in category (%1%)")% categoryName);
+ errorMessage = fmt::format("No valid counters found in category ({})", categoryName);
return false;
}
@@ -213,8 +214,8 @@ bool SendCounterPacket::CreateCategoryRecord(const CategoryPtr& category,
std::vector<uint32_t> categoryNameBuffer;
if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceNameCharPolicy>(categoryName, categoryNameBuffer))
{
- errorMessage = boost::str(boost::format("Cannot convert the name of category (%1%) to an SWTrace namestring")
- % categoryName);
+ errorMessage = fmt::format("Cannot convert the name of category ({}) to an SWTrace namestring",
+ categoryName);
return false;
}
@@ -319,9 +320,9 @@ bool SendCounterPacket::CreateDeviceRecord(const DevicePtr& device,
std::vector<uint32_t> deviceNameBuffer;
if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceCharPolicy>(deviceName, deviceNameBuffer))
{
- errorMessage = boost::str(boost::format("Cannot convert the name of device %1% (%2%) to an SWTrace string")
- % deviceUid
- % deviceName);
+ errorMessage = fmt::format("Cannot convert the name of device {} ({}) to an SWTrace string",
+ deviceUid,
+ deviceName);
return false;
}
@@ -369,10 +370,9 @@ bool SendCounterPacket::CreateCounterSetRecord(const CounterSetPtr& counterSet,
std::vector<uint32_t> counterSetNameBuffer;
if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceNameCharPolicy>(counterSet->m_Name, counterSetNameBuffer))
{
- errorMessage = boost::str(boost::format("Cannot convert the name of counter set %1% (%2%) to "
- "an SWTrace namestring")
- % counterSetUid
- % counterSetName);
+ errorMessage = fmt::format("Cannot convert the name of counter set {} ({}) to an SWTrace namestring",
+ counterSetUid,
+ counterSetName);
return false;
}
@@ -464,10 +464,9 @@ bool SendCounterPacket::CreateEventRecord(const CounterPtr& counter,
std::vector<uint32_t> counterNameBuffer;
if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceCharPolicy>(counterName, counterNameBuffer))
{
- errorMessage = boost::str(boost::format("Cannot convert the name of counter %1% (name: %2%) "
- "to an SWTrace string")
- % counterUid
- % counterName);
+ errorMessage = fmt::format("Cannot convert the name of counter {} (name: {}) to an SWTrace string",
+ counterUid,
+ counterName);
return false;
}
@@ -481,10 +480,10 @@ bool SendCounterPacket::CreateEventRecord(const CounterPtr& counter,
std::vector<uint32_t> counterDescriptionBuffer;
if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceCharPolicy>(counterDescription, counterDescriptionBuffer))
{
- errorMessage = boost::str(boost::format("Cannot convert the description of counter %1% (description: %2%) "
- "to an SWTrace string")
- % counterUid
- % counterName);
+ errorMessage = fmt::format("Cannot convert the description of counter {} (description: {}) "
+ "to an SWTrace string",
+ counterUid,
+ counterName);
return false;
}
@@ -506,10 +505,9 @@ bool SendCounterPacket::CreateEventRecord(const CounterPtr& counter,
// Convert the counter units into a SWTrace namestring
if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceNameCharPolicy>(counterUnits, counterUnitsBuffer))
{
- errorMessage = boost::str(boost::format("Cannot convert the units of counter %1% (units: %2%) "
- "to an SWTrace string")
- % counterUid
- % counterName);
+ errorMessage = fmt::format("Cannot convert the units of counter {} (units: {}) to an SWTrace string",
+ counterUid,
+ counterName);
return false;
}
}
@@ -811,7 +809,7 @@ void SendCounterPacket::SendCounterDirectoryPacket(const ICounterDirectory& coun
{
CancelOperationAndThrow<BufferExhaustion>(
writeBuffer,
- boost::str(boost::format("No space left in buffer. Unable to reserve (%1%) bytes.") % totalSize));
+ fmt::format("No space left in buffer. Unable to reserve ({}) bytes.", totalSize));
}
// Offset for writing to the buffer
@@ -848,7 +846,7 @@ void SendCounterPacket::SendPeriodicCounterCapturePacket(uint64_t timestamp, con
{
CancelOperationAndThrow<BufferExhaustion>(
writeBuffer,
- boost::str(boost::format("No space left in buffer. Unable to reserve (%1%) bytes.") % totalSize));
+ fmt::format("No space left in buffer. Unable to reserve ({}) bytes.", totalSize));
}
// Create header.
@@ -897,7 +895,7 @@ void SendCounterPacket::SendPeriodicCounterSelectionPacket(uint32_t capturePerio
{
CancelOperationAndThrow<BufferExhaustion>(
writeBuffer,
- boost::str(boost::format("No space left in buffer. Unable to reserve (%1%) bytes.") % totalSize));
+ fmt::format("No space left in buffer. Unable to reserve ({}) bytes.", totalSize));
}
// Create header.
diff --git a/src/profiling/test/ProfilingGuidTest.cpp b/src/profiling/test/ProfilingGuidTest.cpp
index 392833a364..f89699cb99 100644
--- a/src/profiling/test/ProfilingGuidTest.cpp
+++ b/src/profiling/test/ProfilingGuidTest.cpp
@@ -11,7 +11,7 @@
#include <set>
#include <boost/test/unit_test.hpp>
-#include <boost/format.hpp>
+#include <fmt/format.h>
#include <thread>
using namespace armnn::profiling;
@@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE(StaticGuidGeneratorCollisionTest)
}
else
{
- BOOST_ERROR(boost::str(boost::format("GUID collision occurred: %1% -> %2%") % str % guid));
+ BOOST_ERROR(fmt::format("GUID collision occurred: {} -> {}", str, guid));
}
break;
}