20.02
|
#include "ProfilingMocks.hpp"
#include "SendCounterPacketTests.hpp"
#include <BufferManager.hpp>
#include <CounterDirectory.hpp>
#include <EncodeVersion.hpp>
#include <ProfilingUtils.hpp>
#include <SendCounterPacket.hpp>
#include <Processes.hpp>
#include <armnn/Exceptions.hpp>
#include <armnn/Conversion.hpp>
#include <armnn/Utils.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <chrono>
Go to the source code of this file.
Typedefs | |
using | PacketType = MockProfilingConnection::PacketType |
Functions | |
BOOST_AUTO_TEST_CASE (MockSendCounterPacketTest) | |
BOOST_AUTO_TEST_CASE (SendPeriodicCounterSelectionPacketTest) | |
BOOST_AUTO_TEST_CASE (SendPeriodicCounterCapturePacketTest) | |
BOOST_AUTO_TEST_CASE (SendStreamMetaDataPacketTest) | |
BOOST_AUTO_TEST_CASE (CreateDeviceRecordTest) | |
BOOST_AUTO_TEST_CASE (CreateInvalidDeviceRecordTest) | |
BOOST_AUTO_TEST_CASE (CreateCounterSetRecordTest) | |
BOOST_AUTO_TEST_CASE (CreateInvalidCounterSetRecordTest) | |
BOOST_AUTO_TEST_CASE (CreateEventRecordTest) | |
BOOST_AUTO_TEST_CASE (CreateEventRecordNoUnitsTest) | |
BOOST_AUTO_TEST_CASE (CreateInvalidEventRecordTest1) | |
BOOST_AUTO_TEST_CASE (CreateInvalidEventRecordTest2) | |
BOOST_AUTO_TEST_CASE (CreateInvalidEventRecordTest3) | |
BOOST_AUTO_TEST_CASE (CreateCategoryRecordTest) | |
BOOST_AUTO_TEST_CASE (CreateInvalidCategoryRecordTest1) | |
BOOST_AUTO_TEST_CASE (CreateInvalidCategoryRecordTest2) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest1) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest2) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest3) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest4) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest5) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest6) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest7) | |
BOOST_AUTO_TEST_CASE (SendThreadTest0) | |
BOOST_AUTO_TEST_CASE (SendThreadTest1) | |
BOOST_AUTO_TEST_CASE (SendThreadTest2) | |
BOOST_AUTO_TEST_CASE (SendThreadTest3) | |
BOOST_AUTO_TEST_CASE (SendCounterPacketTestWithSendThread) | |
BOOST_AUTO_TEST_CASE (SendThreadBufferTest) | |
BOOST_AUTO_TEST_CASE (SendThreadSendStreamMetadataPacket1) | |
BOOST_AUTO_TEST_CASE (SendThreadSendStreamMetadataPacket2) | |
BOOST_AUTO_TEST_CASE (SendThreadSendStreamMetadataPacket3) | |
BOOST_AUTO_TEST_CASE (SendThreadSendStreamMetadataPacket4) | |
Definition at line 98 of file SendCounterPacketTests.cpp.
BOOST_AUTO_TEST_CASE | ( | MockSendCounterPacketTest | ) |
Definition at line 100 of file SendCounterPacketTests.cpp.
References MockBufferManager::GetReadableBuffer(), MockBufferManager::MarkRead(), MockSendCounterPacket::SendCounterDirectoryPacket(), MockSendCounterPacket::SendPeriodicCounterCapturePacket(), MockSendCounterPacket::SendPeriodicCounterSelectionPacket(), and MockSendCounterPacket::SendStreamMetaDataPacket().
BOOST_AUTO_TEST_CASE | ( | SendPeriodicCounterSelectionPacketTest | ) |
Definition at line 148 of file SendCounterPacketTests.cpp.
References MockBufferManager::GetReadableBuffer(), armnn::profiling::ReadUint16(), armnn::profiling::ReadUint32(), and SendCounterPacket::SendPeriodicCounterSelectionPacket().
BOOST_AUTO_TEST_CASE | ( | SendPeriodicCounterCapturePacketTest | ) |
Definition at line 209 of file SendCounterPacketTests.cpp.
References MockBufferManager::GetReadableBuffer(), armnn::profiling::ReadUint16(), armnn::profiling::ReadUint32(), armnn::profiling::ReadUint64(), and SendCounterPacket::SendPeriodicCounterCapturePacket().
BOOST_AUTO_TEST_CASE | ( | SendStreamMetaDataPacketTest | ) |
Definition at line 286 of file SendCounterPacketTests.cpp.
References armnn::profiling::EncodeVersion(), armnnUtils::Processes::GetCurrentId(), armnn::profiling::GetHardwareVersion(), armnn::profiling::GetProcessName(), MockBufferManager::GetReadableBuffer(), armnn::profiling::GetSoftwareInfo(), armnn::profiling::GetSoftwareVersion(), MAX_METADATA_PACKET_LENGTH, armnn::numeric_cast(), SendCounterPacket::PIPE_MAGIC, armnn::profiling::ReadUint32(), and SendCounterPacket::SendStreamMetaDataPacket().
BOOST_AUTO_TEST_CASE | ( | CreateDeviceRecordTest | ) |
Definition at line 406 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), and SendCounterPacketTest::CreateDeviceRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidDeviceRecordTest | ) |
Definition at line 438 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), and SendCounterPacketTest::CreateDeviceRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateCounterSetRecordTest | ) |
Definition at line 459 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), and SendCounterPacketTest::CreateCounterSetRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidCounterSetRecordTest | ) |
Definition at line 491 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), and SendCounterPacketTest::CreateCounterSetRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateEventRecordTest | ) |
Definition at line 512 of file SendCounterPacketTests.cpp.
References ARMNN_NO_CONVERSION_WARN_BEGIN, ARMNN_NO_CONVERSION_WARN_END, BOOST_CHECK(), SendCounterPacketTest::CreateEventRecordTest(), and armnn::profiling::uint32_t_size.
BOOST_AUTO_TEST_CASE | ( | CreateEventRecordNoUnitsTest | ) |
Definition at line 633 of file SendCounterPacketTests.cpp.
References ARMNN_NO_CONVERSION_WARN_BEGIN, ARMNN_NO_CONVERSION_WARN_END, BOOST_CHECK(), SendCounterPacketTest::CreateEventRecordTest(), and armnn::profiling::uint32_t_size.
BOOST_AUTO_TEST_CASE | ( | CreateInvalidEventRecordTest1 | ) |
Definition at line 737 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), and SendCounterPacketTest::CreateEventRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidEventRecordTest2 | ) |
Definition at line 776 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), and SendCounterPacketTest::CreateEventRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidEventRecordTest3 | ) |
Definition at line 815 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), and SendCounterPacketTest::CreateEventRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateCategoryRecordTest | ) |
Definition at line 854 of file SendCounterPacketTests.cpp.
References ARMNN_NO_CONVERSION_WARN_BEGIN, ARMNN_NO_CONVERSION_WARN_END, BOOST_CHECK(), SendCounterPacketTest::CreateCategoryRecordTest(), Counter::m_MaxCounterUid, Counter::m_Name, Counter::m_Uid, armnn::numeric_cast(), and armnn::profiling::uint32_t_size.
BOOST_AUTO_TEST_CASE | ( | CreateInvalidCategoryRecordTest1 | ) |
Definition at line 1049 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), and SendCounterPacketTest::CreateCategoryRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidCategoryRecordTest2 | ) |
Definition at line 1070 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), and SendCounterPacketTest::CreateCategoryRecordTest().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest1 | ) |
Definition at line 1109 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), CounterDirectory::GetDeviceCount(), CounterDirectory::RegisterDevice(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest2 | ) |
Definition at line 1135 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), CounterDirectory::GetCategory(), CounterDirectory::GetCategoryCount(), CounterDirectory::GetCounter(), CounterDirectory::GetCounterCount(), CounterDirectory::GetCounterSet(), CounterDirectory::GetCounterSetCount(), CounterDirectory::GetDevice(), CounterDirectory::GetDeviceCount(), MockBufferManager::GetReadableBuffer(), Counter::m_Class, Device::m_Cores, CounterSet::m_Count, Category::m_Counters, Counter::m_CounterSetUid, Counter::m_Description, Counter::m_DeviceUid, Counter::m_Interpolation, Counter::m_MaxCounterUid, Counter::m_Multiplier, Category::m_Name, Device::m_Name, CounterSet::m_Name, Counter::m_Name, Device::m_Uid, CounterSet::m_Uid, Counter::m_Units, armnn::profiling::ReadUint32(), armnn::profiling::ReadUint64(), armnn::profiling::ReadUint8(), CounterDirectory::RegisterCategory(), CounterDirectory::RegisterCounter(), CounterDirectory::RegisterCounterSet(), CounterDirectory::RegisterDevice(), SendCounterPacket::SendCounterDirectoryPacket(), and armnn::profiling::uint32_t_size.
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest3 | ) |
Definition at line 1607 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), MockCounterDirectory::GetDeviceCount(), MockCounterDirectory::RegisterDevice(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest4 | ) |
Definition at line 1625 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), MockCounterDirectory::GetCounterSetCount(), MockCounterDirectory::RegisterCounterSet(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest5 | ) |
Definition at line 1643 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), MockCounterDirectory::GetCategoryCount(), MockCounterDirectory::RegisterCategory(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest6 | ) |
Definition at line 1661 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), MockCounterDirectory::GetCategoryCount(), MockCounterDirectory::GetCounterSetCount(), MockCounterDirectory::GetDeviceCount(), MockCounterDirectory::RegisterCategory(), MockCounterDirectory::RegisterCounterSet(), MockCounterDirectory::RegisterDevice(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest7 | ) |
Definition at line 1693 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), MockCounterDirectory::GetCategoryCount(), MockCounterDirectory::GetCounterCount(), MockCounterDirectory::GetCounterSetCount(), MockCounterDirectory::GetDeviceCount(), Device::m_Uid, CounterSet::m_Uid, MockCounterDirectory::RegisterCategory(), MockCounterDirectory::RegisterCounter(), MockCounterDirectory::RegisterCounterSet(), MockCounterDirectory::RegisterDevice(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendThreadTest0 | ) |
Definition at line 1742 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), SendThread::IsRunning(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadTest1 | ) |
Definition at line 1766 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), MockStreamCounterBuffer::GetCommittedSize(), armnn::profiling::GetProcessName(), MockStreamCounterBuffer::GetReadableSize(), MockStreamCounterBuffer::GetReadSize(), armnn::numeric_cast(), SendCounterPacket::SendCounterDirectoryPacket(), SendCounterPacket::SendPeriodicCounterCapturePacket(), SendCounterPacket::SendPeriodicCounterSelectionPacket(), SendCounterPacket::SendStreamMetaDataPacket(), SendThread::SetReadyToRead(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadTest2 | ) |
Definition at line 1878 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), MockStreamCounterBuffer::GetCommittedSize(), armnn::profiling::GetProcessName(), MockStreamCounterBuffer::GetReadableSize(), MockStreamCounterBuffer::GetReadSize(), armnn::numeric_cast(), SendCounterPacket::SendCounterDirectoryPacket(), SendCounterPacket::SendPeriodicCounterCapturePacket(), SendCounterPacket::SendPeriodicCounterSelectionPacket(), SendCounterPacket::SendStreamMetaDataPacket(), SendThread::SetReadyToRead(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadTest3 | ) |
Definition at line 2000 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), MockStreamCounterBuffer::GetCommittedSize(), armnn::profiling::GetProcessName(), MockStreamCounterBuffer::GetReadableSize(), MockStreamCounterBuffer::GetReadSize(), armnn::numeric_cast(), SendCounterPacket::SendCounterDirectoryPacket(), SendCounterPacket::SendPeriodicCounterCapturePacket(), SendCounterPacket::SendPeriodicCounterSelectionPacket(), SendCounterPacket::SendStreamMetaDataPacket(), SendThread::SetReadyToRead(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendCounterPacketTestWithSendThread | ) |
Definition at line 2107 of file SendCounterPacketTests.cpp.
References BOOST_CHECK(), MockProfilingConnection::CheckForPacket(), armnn::profiling::GetProcessName(), armnn::numeric_cast(), SendCounterPacket::SendCounterDirectoryPacket(), SendCounterPacket::SendPeriodicCounterCapturePacket(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadBufferTest | ) |
Definition at line 2156 of file SendCounterPacketTests.cpp.
References MockProfilingConnection::CheckForPacket(), BufferManager::Commit(), armnn::profiling::GetProcessName(), BufferManager::GetReadableBuffer(), MockProfilingConnection::GetWrittenDataSize(), armnn::numeric_cast(), BufferManager::Reserve(), SendCounterPacket::SendCounterDirectoryPacket(), SendCounterPacket::SendPeriodicCounterCapturePacket(), SendCounterPacket::SendStreamMetaDataPacket(), SendThread::Start(), SendThread::Stop(), and armnn::profiling::StreamMetaData.
BOOST_AUTO_TEST_CASE | ( | SendThreadSendStreamMetadataPacket1 | ) |
Definition at line 2217 of file SendCounterPacketTests.cpp.
References SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadSendStreamMetadataPacket2 | ) |
Definition at line 2231 of file SendCounterPacketTests.cpp.
References SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadSendStreamMetadataPacket3 | ) |
Definition at line 2246 of file SendCounterPacketTests.cpp.
References MockProfilingConnection::CheckForPacket(), armnn::profiling::GetProcessName(), MockProfilingConnection::GetWrittenDataSize(), armnn::numeric_cast(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadSendStreamMetadataPacket4 | ) |
Definition at line 2274 of file SendCounterPacketTests.cpp.
References BOOST_AUTO_TEST_SUITE_END(), MockProfilingConnection::CheckForPacket(), MockProfilingConnection::Clear(), ProfilingStateMachine::GetCurrentState(), armnn::profiling::GetProcessName(), MockProfilingConnection::GetWrittenDataSize(), armnn::numeric_cast(), SendThread::SetReadyToRead(), SendThread::Start(), SendThread::Stop(), and armnn::profiling::WaitingForAck.