diff options
author | Jim Flynn <jim.flynn@arm.com> | 2022-03-10 23:13:01 +0000 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2022-03-12 15:14:48 +0000 |
commit | 6c9f17dc5fe58e23db0ba591302168766b38ab2a (patch) | |
tree | 50b302f1bdfcce997a2b8330a8142d6858c672d5 /src/backends/backendsCommon | |
parent | 6730fe9cbc195f054d697b25daba8516d70658e0 (diff) | |
download | armnn-6c9f17dc5fe58e23db0ba591302168766b38ab2a.tar.gz |
IVGCVSW-6843 replace armnn::Logging with arm::pipe::Logging in profiling code
Change-Id: I9c3af46ca02c5685e06657b8af0e4658d71891d4
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src/backends/backendsCommon')
-rw-r--r-- | src/backends/backendsCommon/test/BackendProfilingTests.cpp | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/src/backends/backendsCommon/test/BackendProfilingTests.cpp b/src/backends/backendsCommon/test/BackendProfilingTests.cpp index f1ec46baa7..253ff4a8fc 100644 --- a/src/backends/backendsCommon/test/BackendProfilingTests.cpp +++ b/src/backends/backendsCommon/test/BackendProfilingTests.cpp @@ -31,6 +31,32 @@ #include <limits> #include <backends/BackendProfiling.hpp> + +namespace arm +{ + +namespace pipe +{ + +struct LogLevelSwapper +{ +public: + LogLevelSwapper(arm::pipe::LogSeverity severity) + { + // Set the new log level + arm::pipe::ConfigureLogging(true, true, severity); + } + ~LogLevelSwapper() + { + // The default log level for unit tests is "Fatal" + arm::pipe::ConfigureLogging(true, true, arm::pipe::LogSeverity::Fatal); + } +}; + +} // namespace pipe + +} // namespace arm + using namespace arm::pipe; class ReadCounterVals : public IReadCounterValues @@ -123,6 +149,8 @@ TEST_SUITE("BackendProfilingTestSuite") { TEST_CASE("BackendProfilingCounterRegisterMockBackendTest") { + arm::pipe::LogLevelSwapper logLevelSwapper(arm::pipe::LogSeverity::Fatal); + // Reset the profiling service to the uninitialized state armnn::IRuntime::CreationOptions options; options.m_ProfilingOptions.m_EnableProfiling = true; @@ -154,6 +182,8 @@ TEST_CASE("BackendProfilingCounterRegisterMockBackendTest") TEST_CASE("TestBackendCounters") { + arm::pipe::LogLevelSwapper logLevelSwapper(arm::pipe::LogSeverity::Fatal); + Holder holder; arm::pipe::PacketVersionResolver packetVersionResolver; ProfilingStateMachine stateMachine; @@ -457,17 +487,19 @@ TEST_CASE("TestBackendCounterLogging") uint32_t period = 15939u; - armnn::SetAllLoggingSinks(true, false, false); - SetLogFilter(armnn::LogSeverity::Warning); + arm::pipe::SetAllLoggingSinks(true, false, false); + arm::pipe::SetLogFilter(arm::pipe::LogSeverity::Warning); periodicCounterSelectionCommandHandler(PacketWriter(period, {5})); periodicCounterCapture.Stop(); - SetLogFilter(armnn::LogSeverity::Fatal); + arm::pipe::SetLogFilter(arm::pipe::LogSeverity::Fatal); CHECK(ss.str().find("ActivateCounters example test error") != std::string::npos); } TEST_CASE("BackendProfilingContextGetSendTimelinePacket") { + arm::pipe::LogLevelSwapper logLevelSwapper(arm::pipe::LogSeverity::Fatal); + // Reset the profiling service to the uninitialized state armnn::IRuntime::CreationOptions options; options.m_ProfilingOptions.m_EnableProfiling = true; @@ -507,6 +539,8 @@ TEST_CASE("BackendProfilingContextGetSendTimelinePacket") TEST_CASE("GetProfilingGuidGenerator") { + arm::pipe::LogLevelSwapper logLevelSwapper(arm::pipe::LogSeverity::Fatal); + // Reset the profiling service to the uninitialized state armnn::IRuntime::CreationOptions options; options.m_ProfilingOptions.m_EnableProfiling = true; |