aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFerran Balaguer <ferran.balaguer@arm.com>2019-09-13 13:31:40 +0100
committerFerran Balaguer Arm <ferran.balaguer@arm.com>2019-09-13 16:08:33 +0000
commit5bf1d321e480b9c0030368edd5138fec949975c1 (patch)
tree8ce33ef32a80d0f13122983986cf671df8134961 /src
parent3b2eb6fcf909c12f01aa937a985553d9c2dce2c4 (diff)
downloadarmnn-5bf1d321e480b9c0030368edd5138fec949975c1.tar.gz
IVGCVSW-3872 Add Missing packet to SendMetaDataPacket
Signed-off-by: Ferran Balaguer <ferran.balaguer@arm.com> Change-Id: I98d8b22bdc447c2ff3f4d74d58ef9c0eae75db76
Diffstat (limited to 'src')
-rw-r--r--src/profiling/SendCounterPacket.cpp13
-rw-r--r--src/profiling/test/SendCounterPacketTests.cpp10
2 files changed, 19 insertions, 4 deletions
diff --git a/src/profiling/SendCounterPacket.cpp b/src/profiling/SendCounterPacket.cpp
index 94a5db223e..f2172b3b7d 100644
--- a/src/profiling/SendCounterPacket.cpp
+++ b/src/profiling/SendCounterPacket.cpp
@@ -53,7 +53,8 @@ void SendCounterPacket::SendStreamMetaDataPacket()
// Counter Directory packet (packet family=0; packet id=2)
// Request Counter Directory packet (packet family=0, packet id=3)
// Periodic Counter Selection packet (packet family=0, packet id=4)
- uint32_t packetVersionEntries = 5;
+ // Periodic Counter Capture packet (packet family=1, packet class=0, type=0)
+ uint32_t packetVersionEntries = 6;
uint32_t payloadSize = numeric_cast<uint32_t>(infoSize + hardwareVersionSize + softwareVersionSize +
processNameSize + packetVersionCountSize +
@@ -150,12 +151,20 @@ void SendCounterPacket::SendStreamMetaDataPacket()
uint32_t packetId = 0;
offset += sizeUint32;
- for (uint32_t i = 0; i < packetVersionEntries; ++i) {
+ for (uint32_t i = 0; i < packetVersionEntries - 1; ++i)
+ {
WriteUint32(writeBuffer, offset, ((packetFamily & 0x3F) << 26) | ((packetId++ & 0x3FF) << 16));
offset += sizeUint32;
WriteUint32(writeBuffer, offset, EncodeVersion(1, 0, 0));
offset += sizeUint32;
}
+
+ packetFamily = 1;
+ packetId = 0;
+
+ WriteUint32(writeBuffer, offset, ((packetFamily & 0x3F) << 26) | ((packetId & 0x3FF) << 16));
+ offset += sizeUint32;
+ WriteUint32(writeBuffer, offset, EncodeVersion(1, 0, 0));
}
}
catch(...)
diff --git a/src/profiling/test/SendCounterPacketTests.cpp b/src/profiling/test/SendCounterPacketTests.cpp
index 4c4620ffca..4435ab67a3 100644
--- a/src/profiling/test/SendCounterPacketTests.cpp
+++ b/src/profiling/test/SendCounterPacketTests.cpp
@@ -214,7 +214,7 @@ BOOST_AUTO_TEST_CASE(SendStreamMetaDataPacketTest)
uint32_t processNameSize = numeric_cast<uint32_t>(processName.size()) > 0 ?
numeric_cast<uint32_t>(processName.size()) + 1 : 0;
- uint32_t packetEntries = 5;
+ uint32_t packetEntries = 6;
MockBuffer mockBuffer2(512);
SendCounterPacket sendPacket2(mockBuffer2);
@@ -289,7 +289,7 @@ BOOST_AUTO_TEST_CASE(SendStreamMetaDataPacketTest)
{
BOOST_TEST((ReadUint32(readBuffer2, offset) >> 16) == packetEntries);
offset += sizeUint32;
- for (uint32_t i = 0; i < packetEntries; ++i)
+ for (uint32_t i = 0; i < packetEntries - 1; ++i)
{
BOOST_TEST(((ReadUint32(readBuffer2, offset) >> 26) & 0x3F) == 0);
BOOST_TEST(((ReadUint32(readBuffer2, offset) >> 16) & 0x3FF) == i);
@@ -297,6 +297,12 @@ BOOST_AUTO_TEST_CASE(SendStreamMetaDataPacketTest)
BOOST_TEST(ReadUint32(readBuffer2, offset) == EncodeVersion(1, 0, 0));
offset += sizeUint32;
}
+
+ BOOST_TEST(((ReadUint32(readBuffer2, offset) >> 26) & 0x3F) == 1);
+ BOOST_TEST(((ReadUint32(readBuffer2, offset) >> 16) & 0x3FF) == 0);
+ offset += sizeUint32;
+ BOOST_TEST(ReadUint32(readBuffer2, offset) == EncodeVersion(1, 0, 0));
+ offset += sizeUint32;
}
BOOST_TEST(offset == totalLength);