aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2020-07-09 07:28:37 +0100
committerJim Flynn <jim.flynn@arm.com>2020-07-09 13:48:46 +0100
commit1fdeb99ca83bac83e0cacb332880e2e62dd22198 (patch)
tree76aa91baf9d3b7306b2fa15e1a50dc0bbfe3af26 /src/profiling/test
parent86953ed331027bd557a80d782d5ee99298de35c4 (diff)
downloadarmnn-1fdeb99ca83bac83e0cacb332880e2e62dd22198.tar.gz
IVGCVSW-5095 Make timeline report the Linux Thread ID not the pthread ID
Change-Id: Id69519fd9ef57716de4e389ed4156710a904c701 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src/profiling/test')
-rw-r--r--src/profiling/test/ProfilingTestUtils.cpp5
-rw-r--r--src/profiling/test/ProfilingTestUtils.hpp2
-rw-r--r--src/profiling/test/SendTimelinePacketTests.cpp3
-rw-r--r--src/profiling/test/TimelinePacketTests.cpp9
4 files changed, 11 insertions, 8 deletions
diff --git a/src/profiling/test/ProfilingTestUtils.cpp b/src/profiling/test/ProfilingTestUtils.cpp
index 9f6bc43be8..526f3f95fd 100644
--- a/src/profiling/test/ProfilingTestUtils.cpp
+++ b/src/profiling/test/ProfilingTestUtils.cpp
@@ -8,6 +8,7 @@
#include <armnn/Descriptors.hpp>
#include <LabelsAndEventClasses.hpp>
+#include <Threads.hpp>
#include <ProfilingService.hpp>
#include <test/TestUtils.hpp>
@@ -295,7 +296,7 @@ ProfilingGuid VerifyTimelineEntityBinaryPacketData(Optional<ProfilingGuid> guid,
}
ProfilingGuid VerifyTimelineEventBinaryPacket(Optional<uint64_t> timestamp,
- Optional<std::thread::id> threadId,
+ Optional<int> threadId,
Optional<ProfilingGuid> eventGuid,
const unsigned char* readableData,
unsigned int& offset)
@@ -333,7 +334,7 @@ ProfilingGuid VerifyTimelineEventBinaryPacket(Optional<uint64_t> timestamp,
}
else
{
- BOOST_CHECK(readThreadId == std::this_thread::get_id());
+ BOOST_CHECK(readThreadId == armnnUtils::Threads::GetCurrentThreadId());
}
// Check the event GUID
diff --git a/src/profiling/test/ProfilingTestUtils.hpp b/src/profiling/test/ProfilingTestUtils.hpp
index 8f138bb315..4daf9d5f4a 100644
--- a/src/profiling/test/ProfilingTestUtils.hpp
+++ b/src/profiling/test/ProfilingTestUtils.hpp
@@ -53,7 +53,7 @@ ProfilingGuid VerifyTimelineEntityBinaryPacketData(Optional<ProfilingGuid> guid,
unsigned int& offset);
ProfilingGuid VerifyTimelineEventBinaryPacket(Optional<uint64_t> timestamp,
- Optional<std::thread::id> threadId,
+ Optional<int> threadId,
Optional<ProfilingGuid> eventGuid,
const unsigned char* readableData,
unsigned int& offset);
diff --git a/src/profiling/test/SendTimelinePacketTests.cpp b/src/profiling/test/SendTimelinePacketTests.cpp
index 4b45cfef76..da30cef90c 100644
--- a/src/profiling/test/SendTimelinePacketTests.cpp
+++ b/src/profiling/test/SendTimelinePacketTests.cpp
@@ -6,6 +6,7 @@
#include "ProfilingMocks.hpp"
#include <BufferManager.hpp>
+#include <Threads.hpp>
#include <ProfilingService.hpp>
#include <ProfilingUtils.hpp>
#include <SendTimelinePacket.hpp>
@@ -322,7 +323,7 @@ BOOST_AUTO_TEST_CASE(SendEventClassAfterTimelineEntityPacketTest)
// Send TimelineEventBinaryPacket
const uint64_t timestamp = 456789u;
- const std::thread::id threadId = std::this_thread::get_id();
+ const int threadId = armnnUtils::Threads::GetCurrentThreadId();
const uint64_t eventProfilingGuid = 123456u;
sendTimelinePacket->SendTimelineEventBinaryPacket(timestamp, threadId, eventProfilingGuid);
diff --git a/src/profiling/test/TimelinePacketTests.cpp b/src/profiling/test/TimelinePacketTests.cpp
index 96e9bf2400..71c6915a8c 100644
--- a/src/profiling/test/TimelinePacketTests.cpp
+++ b/src/profiling/test/TimelinePacketTests.cpp
@@ -3,6 +3,7 @@
// SPDX-License-Identifier: MIT
//
+#include <Threads.hpp>
#include <ProfilingUtils.hpp>
#include <boost/test/unit_test.hpp>
@@ -724,7 +725,7 @@ BOOST_AUTO_TEST_CASE(TimelineEventClassTestFullConstructionOfData)
BOOST_AUTO_TEST_CASE(TimelineEventPacketTestNoBuffer)
{
const uint64_t timestamp = 456789u;
- const std::thread::id threadId = std::this_thread::get_id();
+ const int threadId = armnnUtils::Threads::GetCurrentThreadId();
const uint64_t profilingGuid = 123456u;
unsigned int numberOfBytesWritten = 789u;
TimelinePacketStatus result = WriteTimelineEventBinary(timestamp,
@@ -742,7 +743,7 @@ BOOST_AUTO_TEST_CASE(TimelineEventPacketTestBufferExhaustionZeroValue)
std::vector<unsigned char> buffer(512, 0);
const uint64_t timestamp = 456789u;
- const std::thread::id threadId = std::this_thread::get_id();
+ const int threadId = armnnUtils::Threads::GetCurrentThreadId();
const uint64_t profilingGuid = 123456u;
unsigned int numberOfBytesWritten = 789u;
TimelinePacketStatus result = WriteTimelineEventBinary(timestamp,
@@ -760,7 +761,7 @@ BOOST_AUTO_TEST_CASE(TimelineEventPacketTestBufferExhaustionFixedValue)
std::vector<unsigned char> buffer(10, 0);
const uint64_t timestamp = 456789u;
- const std::thread::id threadId = std::this_thread::get_id();
+ const int threadId = armnnUtils::Threads::GetCurrentThreadId();
const uint64_t profilingGuid = 123456u;
unsigned int numberOfBytesWritten = 789u;
TimelinePacketStatus result = WriteTimelineEventBinary(timestamp,
@@ -778,7 +779,7 @@ BOOST_AUTO_TEST_CASE(TimelineEventPacketTestFullConstructionOfData)
std::vector<unsigned char> buffer(512, 0);
const uint64_t timestamp = 456789u;
- const std::thread::id threadId = std::this_thread::get_id();
+ const int threadId = armnnUtils::Threads::GetCurrentThreadId();
const uint64_t profilingGuid = 123456u;
unsigned int numberOfBytesWritten = 789u;
TimelinePacketStatus result = WriteTimelineEventBinary(timestamp,