aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test/SendCounterPacketTests.cpp
diff options
context:
space:
mode:
authorKeith Davis <keith.davis@arm.com>2020-03-30 10:43:41 +0100
committerFinn Williams <Finn.Williams@arm.com>2020-04-02 16:56:24 +0100
commit33ed221e2e8e3a77b5f543061e0cce07b259fc64 (patch)
tree8467f2e4ce019bfa2837ae1030c321509414780c /src/profiling/test/SendCounterPacketTests.cpp
parent0fe279bbf22fd2116b283b9df61076d526f115e4 (diff)
downloadarmnn-33ed221e2e8e3a77b5f543061e0cce07b259fc64.tar.gz
IVGCVSW-4455 Add an Activate and Deactivate control packet to the protocol
* Add Activate/Deactivate command handlers * Add IReportStructure, INotifyBackends single function interfaces * Add overrided mechanism to report structure in Runtime.cpp * Add overrided mechanism to notify backends in ProfilingService.cpp * Add optional IReportStructure argument to ProfilingService constructor for use in ActivateTimelineReportingCommandHandler * Refactoring and tidying up indentation * Removal of unused code in ProfilingUtils.cpp and ProfilingService.cpp * Added GatordMock end to end test * Fixed an issue with SendCounterPacket sending duplicate packets * Fixed an issue with DirectoryCaptureCommandHandler handling of Optional Signed-off-by: Keith Davis <keith.davis@arm.com> Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I5ef1b74171459bfc649861dedf99921d22c9e63f
Diffstat (limited to 'src/profiling/test/SendCounterPacketTests.cpp')
-rw-r--r--src/profiling/test/SendCounterPacketTests.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/profiling/test/SendCounterPacketTests.cpp b/src/profiling/test/SendCounterPacketTests.cpp
index d7dc7e2d9e..51f049ddc6 100644
--- a/src/profiling/test/SendCounterPacketTests.cpp
+++ b/src/profiling/test/SendCounterPacketTests.cpp
@@ -1172,7 +1172,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2)
BOOST_CHECK(counterDirectory.GetCategoryCount() == 2);
BOOST_CHECK(category2);
- uint16_t numberOfCores = 3;
+ uint16_t numberOfCores = 4;
// Register a counter associated to "category1"
const Counter* counter1 = nullptr;
@@ -1186,7 +1186,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2)
"counter1description",
std::string("counter1units"),
numberOfCores));
- BOOST_CHECK(counterDirectory.GetCounterCount() == 3);
+ BOOST_CHECK(counterDirectory.GetCounterCount() == 4);
BOOST_CHECK(counter1);
// Register a counter associated to "category1"
@@ -1203,7 +1203,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2)
armnn::EmptyOptional(),
device2->m_Uid,
0));
- BOOST_CHECK(counterDirectory.GetCounterCount() == 4);
+ BOOST_CHECK(counterDirectory.GetCounterCount() == 5);
BOOST_CHECK(counter2);
// Register a counter associated to "category2"
@@ -1217,7 +1217,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2)
"counter3",
"counter3description",
armnn::EmptyOptional(),
- 5,
+ numberOfCores,
device2->m_Uid,
counterSet1->m_Uid));
BOOST_CHECK(counterDirectory.GetCounterCount() == 9);
@@ -1236,7 +1236,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2)
uint32_t packetHeaderWord1 = ReadUint32(readBuffer, 4);
BOOST_TEST(((packetHeaderWord0 >> 26) & 0x3F) == 0); // packet_family
BOOST_TEST(((packetHeaderWord0 >> 16) & 0x3FF) == 2); // packet_id
- BOOST_TEST(packetHeaderWord1 == 928); // data_length
+ BOOST_TEST(packetHeaderWord1 == 432); // data_length
// Check the body header
uint32_t bodyHeaderWord0 = ReadUint32(readBuffer, 8);
@@ -1269,7 +1269,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2)
uint32_t categoryRecordOffset0 = ReadUint32(readBuffer, 44);
uint32_t categoryRecordOffset1 = ReadUint32(readBuffer, 48);
BOOST_TEST(categoryRecordOffset0 == 64); // Category record offset for "category1"
- BOOST_TEST(categoryRecordOffset1 == 472); // Category record offset for "category2"
+ BOOST_TEST(categoryRecordOffset1 == 168); // Category record offset for "category2"
// Get the device record pool offset
uint32_t uint32_t_size = sizeof(uint32_t);
@@ -1584,7 +1584,8 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2)
const Category* category = counterDirectory.GetCategory(categoryRecord.name);
BOOST_CHECK(category);
BOOST_CHECK(category->m_Name == categoryRecord.name);
- BOOST_CHECK(category->m_Counters.size() == categoryRecord.event_count);
+ BOOST_CHECK(category->m_Counters.size() == categoryRecord.event_count + static_cast<size_t>(numberOfCores) -1);
+ BOOST_CHECK(category->m_Counters.size() == categoryRecord.event_count + static_cast<size_t>(numberOfCores) -1);
// Check that the event records are correct
for (const EventRecord& eventRecord : categoryRecord.event_records)