IVGCVSW-3937 Make dynamic use the of the profiling connection
in the SendCounterPacket class

 * Passing the profiling connection as an argument to the
   pertinent methods of the SendCounterPacket class, as the
   connection is created dynamically by the ProfilingService
 * Updated the unit tests accordingly

Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Change-Id: Ibe72bdbad814a201c4f1505cff4badbb9b03b13e
diff --git a/src/profiling/SendCounterPacket.cpp b/src/profiling/SendCounterPacket.cpp
index 813cccf..dc5a950 100644
--- a/src/profiling/SendCounterPacket.cpp
+++ b/src/profiling/SendCounterPacket.cpp
@@ -901,7 +901,7 @@
     m_WaitCondition.notify_one();
 }
 
-void SendCounterPacket::Start()
+void SendCounterPacket::Start(IProfilingConnection& profilingConnection)
 {
     // Check if the send thread is already running
     if (m_IsRunning.load())
@@ -917,7 +917,7 @@
     m_KeepRunning.store(true);
 
     // Start the send thread
-    m_SendThread = std::thread(&SendCounterPacket::Send, this);
+    m_SendThread = std::thread(&SendCounterPacket::Send, this, std::ref(profilingConnection));
 }
 
 void SendCounterPacket::Stop()
@@ -936,7 +936,7 @@
     }
 }
 
-void SendCounterPacket::Send()
+void SendCounterPacket::Send(IProfilingConnection& profilingConnection)
 {
     // Keep the sending procedure looping until the thread is signalled to stop
     while (m_KeepRunning.load())
@@ -954,23 +954,23 @@
             else
             {
                 // Wait until the thread is notified of something to read from the buffer,
-                // or check anyway after a second
-                m_WaitCondition.wait_for(lock, std::chrono::seconds(m_Timeout));
+                // or check anyway after the specified number of milliseconds
+                m_WaitCondition.wait_for(lock, std::chrono::milliseconds(m_Timeout));
             }
         }
         // Wait condition lock scope - End
 
-        FlushBuffer();
+        FlushBuffer(profilingConnection);
     }
 
     // Ensure that all readable data got written to the profiling connection before the thread is stopped
-    FlushBuffer();
+    FlushBuffer(profilingConnection);
 
     // Mark the send thread as not running
     m_IsRunning.store(false);
 }
 
-void SendCounterPacket::FlushBuffer()
+void SendCounterPacket::FlushBuffer(IProfilingConnection& profilingConnection)
 {
     // Get the first available readable buffer
     std::unique_ptr<IPacketBuffer> packetBuffer = m_BufferManager.GetReadableBuffer();
@@ -991,10 +991,10 @@
         }
 
         // Check that the profiling connection is open, silently drop the data and continue if it's closed
-        if (m_ProfilingConnection.IsOpen())
+        if (profilingConnection.IsOpen())
         {
             // Write a packet to the profiling connection. Silently ignore any write error and continue
-            m_ProfilingConnection.WritePacket(readBuffer, boost::numeric_cast<uint32_t>(readBufferSize));
+            profilingConnection.WritePacket(readBuffer, boost::numeric_cast<uint32_t>(readBufferSize));
         }
 
         // Mark the packet buffer as read
diff --git a/src/profiling/SendCounterPacket.hpp b/src/profiling/SendCounterPacket.hpp
index 748371b..ed76937 100644
--- a/src/profiling/SendCounterPacket.hpp
+++ b/src/profiling/SendCounterPacket.hpp
@@ -33,12 +33,11 @@
 
     using IndexValuePairsVector = std::vector<std::pair<uint16_t, uint32_t>>;
 
-    SendCounterPacket(IProfilingConnection& profilingConnection, IBufferManager& buffer, int timeout =  1)
-        : m_ProfilingConnection(profilingConnection)
-        , m_BufferManager(buffer)
+    SendCounterPacket(IBufferManager& buffer, int timeout = 1000)
+        : m_BufferManager(buffer)
+        , m_Timeout(timeout)
         , m_IsRunning(false)
         , m_KeepRunning(false)
-        , m_Timeout(timeout)
     {}
     ~SendCounterPacket() { Stop(); }
 
@@ -56,12 +55,12 @@
     static const unsigned int PIPE_MAGIC = 0x45495434;
     static const unsigned int MAX_METADATA_PACKET_LENGTH = 4096;
 
-    void Start();
+    void Start(IProfilingConnection& profilingConnection);
     void Stop();
     bool IsRunning() { return m_IsRunning.load(); }
 
 private:
-    void Send();
+    void Send(IProfilingConnection& profilingConnection);
 
     template <typename ExceptionType>
     void CancelOperationAndThrow(const std::string& errorMessage)
@@ -87,16 +86,15 @@
         throw ExceptionType(errorMessage);
     }
 
-    void FlushBuffer();
+    void FlushBuffer(IProfilingConnection& profilingConnection);
 
-    IProfilingConnection& m_ProfilingConnection;
     IBufferManager& m_BufferManager;
+    int m_Timeout;
     std::mutex m_WaitMutex;
     std::condition_variable m_WaitCondition;
     std::thread m_SendThread;
     std::atomic<bool> m_IsRunning;
     std::atomic<bool> m_KeepRunning;
-    int m_Timeout;
 
 protected:
     // Helper methods, protected for testing
diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp
index 71d9dcf..ba1e6cf 100644
--- a/src/profiling/test/ProfilingTests.cpp
+++ b/src/profiling/test/ProfilingTests.cpp
@@ -1778,9 +1778,8 @@
     uint32_t version = 1;
     Holder holder;
     TestCaptureThread captureThread;
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(512);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockBuffer);
+    SendCounterPacket sendCounterPacket(mockBuffer);
 
     uint32_t sizeOfUint32 = numeric_cast<uint32_t>(sizeof(uint32_t));
     uint32_t sizeOfUint16 = numeric_cast<uint32_t>(sizeof(uint16_t));
@@ -2140,9 +2139,8 @@
     std::vector<uint16_t> captureIds1 = { 0, 1 };
     std::vector<uint16_t> captureIds2;
 
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(512);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockBuffer);
+    SendCounterPacket sendCounterPacket(mockBuffer);
 
     std::vector<uint16_t> counterIds;
     CaptureReader captureReader;
@@ -2210,9 +2208,8 @@
 
     Packet packetA(packetId, 0, packetData);
 
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(1024);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockBuffer);
+    SendCounterPacket sendCounterPacket(mockBuffer);
 
     CounterDirectory counterDirectory;
 
@@ -2244,9 +2241,8 @@
 
     Packet packetA(packetId, 0, packetData);
 
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(1024);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockBuffer);
+    SendCounterPacket sendCounterPacket(mockBuffer);
 
     CounterDirectory counterDirectory;
     const Device* device = counterDirectory.RegisterDevice("deviceA", 1);
diff --git a/src/profiling/test/SendCounterPacketTests.cpp b/src/profiling/test/SendCounterPacketTests.cpp
index 0d21ec0..16302bc 100644
--- a/src/profiling/test/SendCounterPacketTests.cpp
+++ b/src/profiling/test/SendCounterPacketTests.cpp
@@ -74,9 +74,8 @@
 BOOST_AUTO_TEST_CASE(SendPeriodicCounterSelectionPacketTest)
 {
     // Error no space left in buffer
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer1(10);
-    SendCounterPacket sendPacket1(mockProfilingConnection, mockBuffer1);
+    SendCounterPacket sendPacket1(mockBuffer1);
 
     uint32_t capturePeriod = 1000;
     std::vector<uint16_t> selectedCounterIds;
@@ -85,7 +84,7 @@
 
     // Packet without any counters
     MockBufferManager mockBuffer2(512);
-    SendCounterPacket sendPacket2(mockProfilingConnection, mockBuffer2);
+    SendCounterPacket sendPacket2(mockBuffer2);
 
     sendPacket2.SendPeriodicCounterSelectionPacket(capturePeriod, selectedCounterIds);
     auto readBuffer2 = mockBuffer2.GetReadableBuffer();
@@ -101,7 +100,7 @@
 
     // Full packet message
     MockBufferManager mockBuffer3(512);
-    SendCounterPacket sendPacket3(mockProfilingConnection, mockBuffer3);
+    SendCounterPacket sendPacket3(mockBuffer3);
 
     selectedCounterIds.reserve(5);
     selectedCounterIds.emplace_back(100);
@@ -136,9 +135,8 @@
 BOOST_AUTO_TEST_CASE(SendPeriodicCounterCapturePacketTest)
 {
     // Error no space left in buffer
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer1(10);
-    SendCounterPacket sendPacket1(mockProfilingConnection, mockBuffer1);
+    SendCounterPacket sendPacket1(mockBuffer1);
 
     auto captureTimestamp = std::chrono::steady_clock::now();
     uint64_t time =  static_cast<uint64_t >(captureTimestamp.time_since_epoch().count());
@@ -149,7 +147,7 @@
 
     // Packet without any counters
     MockBufferManager mockBuffer2(512);
-    SendCounterPacket sendPacket2(mockProfilingConnection, mockBuffer2);
+    SendCounterPacket sendPacket2(mockBuffer2);
 
     sendPacket2.SendPeriodicCounterCapturePacket(time, indexValuePairs);
     auto readBuffer2 = mockBuffer2.GetReadableBuffer();
@@ -166,7 +164,7 @@
 
     // Full packet message
     MockBufferManager mockBuffer3(512);
-    SendCounterPacket sendPacket3(mockProfilingConnection, mockBuffer3);
+    SendCounterPacket sendPacket3(mockBuffer3);
 
     indexValuePairs.reserve(5);
     indexValuePairs.emplace_back(std::make_pair<uint16_t, uint32_t >(0, 100));
@@ -216,9 +214,8 @@
     uint32_t sizeUint32 = numeric_cast<uint32_t>(sizeof(uint32_t));
 
     // Error no space left in buffer
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer1(10);
-    SendCounterPacket sendPacket1(mockProfilingConnection, mockBuffer1);
+    SendCounterPacket sendPacket1(mockBuffer1);
     BOOST_CHECK_THROW(sendPacket1.SendStreamMetaDataPacket(), armnn::profiling::BufferExhaustion);
 
     // Full metadata packet
@@ -237,7 +234,7 @@
     uint32_t packetEntries = 6;
 
     MockBufferManager mockBuffer2(512);
-    SendCounterPacket sendPacket2(mockProfilingConnection, mockBuffer2);
+    SendCounterPacket sendPacket2(mockBuffer2);
     sendPacket2.SendStreamMetaDataPacket();
     auto readBuffer2 = mockBuffer2.GetReadableBuffer();
 
@@ -331,9 +328,8 @@
 
 BOOST_AUTO_TEST_CASE(CreateDeviceRecordTest)
 {
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(0);
-    SendCounterPacketTest sendCounterPacketTest(mockProfilingConnection, mockBuffer);
+    SendCounterPacketTest sendCounterPacketTest(mockBuffer);
 
     // Create a device for testing
     uint16_t deviceUid = 27;
@@ -364,9 +360,8 @@
 
 BOOST_AUTO_TEST_CASE(CreateInvalidDeviceRecordTest)
 {
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(0);
-    SendCounterPacketTest sendCounterPacketTest(mockProfilingConnection, mockBuffer);
+    SendCounterPacketTest sendCounterPacketTest(mockBuffer);
 
     // Create a device for testing
     uint16_t deviceUid = 27;
@@ -386,9 +381,8 @@
 
 BOOST_AUTO_TEST_CASE(CreateCounterSetRecordTest)
 {
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(0);
-    SendCounterPacketTest sendCounterPacketTest(mockProfilingConnection, mockBuffer);
+    SendCounterPacketTest sendCounterPacketTest(mockBuffer);
 
     // Create a counter set for testing
     uint16_t counterSetUid = 27;
@@ -419,9 +413,8 @@
 
 BOOST_AUTO_TEST_CASE(CreateInvalidCounterSetRecordTest)
 {
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(0);
-    SendCounterPacketTest sendCounterPacketTest(mockProfilingConnection, mockBuffer);
+    SendCounterPacketTest sendCounterPacketTest(mockBuffer);
 
     // Create a counter set for testing
     uint16_t counterSetUid = 27;
@@ -441,9 +434,8 @@
 
 BOOST_AUTO_TEST_CASE(CreateEventRecordTest)
 {
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(0);
-    SendCounterPacketTest sendCounterPacketTest(mockProfilingConnection, mockBuffer);
+    SendCounterPacketTest sendCounterPacketTest(mockBuffer);
 
     // Create a counter for testing
     uint16_t counterUid = 7256;
@@ -562,9 +554,8 @@
 
 BOOST_AUTO_TEST_CASE(CreateEventRecordNoUnitsTest)
 {
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(0);
-    SendCounterPacketTest sendCounterPacketTest(mockProfilingConnection, mockBuffer);
+    SendCounterPacketTest sendCounterPacketTest(mockBuffer);
 
     // Create a counter for testing
     uint16_t counterUid = 44312;
@@ -666,9 +657,8 @@
 
 BOOST_AUTO_TEST_CASE(CreateInvalidEventRecordTest1)
 {
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(0);
-    SendCounterPacketTest sendCounterPacketTest(mockProfilingConnection, mockBuffer);
+    SendCounterPacketTest sendCounterPacketTest(mockBuffer);
 
     // Create a counter for testing
     uint16_t counterUid = 7256;
@@ -705,9 +695,8 @@
 
 BOOST_AUTO_TEST_CASE(CreateInvalidEventRecordTest2)
 {
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(0);
-    SendCounterPacketTest sendCounterPacketTest(mockProfilingConnection, mockBuffer);
+    SendCounterPacketTest sendCounterPacketTest(mockBuffer);
 
     // Create a counter for testing
     uint16_t counterUid = 7256;
@@ -744,9 +733,8 @@
 
 BOOST_AUTO_TEST_CASE(CreateInvalidEventRecordTest3)
 {
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(0);
-    SendCounterPacketTest sendCounterPacketTest(mockProfilingConnection, mockBuffer);
+    SendCounterPacketTest sendCounterPacketTest(mockBuffer);
 
     // Create a counter for testing
     uint16_t counterUid = 7256;
@@ -783,9 +771,8 @@
 
 BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest)
 {
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(0);
-    SendCounterPacketTest sendCounterPacketTest(mockProfilingConnection, mockBuffer);
+    SendCounterPacketTest sendCounterPacketTest(mockBuffer);
 
     // Create a category for testing
     const std::string categoryName = "some_category";
@@ -985,9 +972,8 @@
 
 BOOST_AUTO_TEST_CASE(CreateInvalidCategoryRecordTest1)
 {
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(0);
-    SendCounterPacketTest sendCounterPacketTest(mockProfilingConnection, mockBuffer);
+    SendCounterPacketTest sendCounterPacketTest(mockBuffer);
 
     // Create a category for testing
     const std::string categoryName = "some invalid category";
@@ -1009,9 +995,8 @@
 
 BOOST_AUTO_TEST_CASE(CreateInvalidCategoryRecordTest2)
 {
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(0);
-    SendCounterPacketTest sendCounterPacketTest(mockProfilingConnection, mockBuffer);
+    SendCounterPacketTest sendCounterPacketTest(mockBuffer);
 
     // Create a category for testing
     const std::string categoryName = "some_category";
@@ -1068,9 +1053,8 @@
     BOOST_CHECK(device2);
 
     // Buffer with not enough space
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(10);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockBuffer);
+    SendCounterPacket sendCounterPacket(mockBuffer);
     BOOST_CHECK_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory),
                       armnn::profiling::BufferExhaustion);
 }
@@ -1161,9 +1145,8 @@
     BOOST_CHECK(counter3);
 
     // Buffer with enough space
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(1024);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockBuffer);
+    SendCounterPacket sendCounterPacket(mockBuffer);
     BOOST_CHECK_NO_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory));
 
     // Get the readable buffer
@@ -1563,9 +1546,8 @@
     BOOST_CHECK(device);
 
     // Buffer with enough space
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(1024);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockBuffer);
+    SendCounterPacket sendCounterPacket(mockBuffer);
     BOOST_CHECK_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException);
 }
 
@@ -1582,9 +1564,8 @@
     BOOST_CHECK(counterSet);
 
     // Buffer with enough space
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(1024);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockBuffer);
+    SendCounterPacket sendCounterPacket(mockBuffer);
     BOOST_CHECK_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException);
 }
 
@@ -1601,9 +1582,8 @@
     BOOST_CHECK(category);
 
     // Buffer with enough space
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(1024);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockBuffer);
+    SendCounterPacket sendCounterPacket(mockBuffer);
     BOOST_CHECK_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException);
 }
 
@@ -1636,9 +1616,8 @@
     BOOST_CHECK(category);
 
     // Buffer with enough space
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(1024);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockBuffer);
+    SendCounterPacket sendCounterPacket(mockBuffer);
     BOOST_CHECK_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException);
 }
 
@@ -1686,9 +1665,8 @@
     BOOST_CHECK(counter);
 
     // Buffer with enough space
-    MockProfilingConnection mockProfilingConnection;
     MockBufferManager mockBuffer(1024);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockBuffer);
+    SendCounterPacket sendCounterPacket(mockBuffer);
     BOOST_CHECK_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException);
 }
 
@@ -1696,16 +1674,16 @@
 {
     MockProfilingConnection mockProfilingConnection;
     MockStreamCounterBuffer mockStreamCounterBuffer(0);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockStreamCounterBuffer);
+    SendCounterPacket sendCounterPacket(mockStreamCounterBuffer);
 
     // Try to start the send thread many times, it must only start once
 
-    sendCounterPacket.Start();
+    sendCounterPacket.Start(mockProfilingConnection);
     BOOST_CHECK(sendCounterPacket.IsRunning());
-    sendCounterPacket.Start();
-    sendCounterPacket.Start();
-    sendCounterPacket.Start();
-    sendCounterPacket.Start();
+    sendCounterPacket.Start(mockProfilingConnection);
+    sendCounterPacket.Start(mockProfilingConnection);
+    sendCounterPacket.Start(mockProfilingConnection);
+    sendCounterPacket.Start(mockProfilingConnection);
     BOOST_CHECK(sendCounterPacket.IsRunning());
 
     std::this_thread::sleep_for(std::chrono::seconds(1));
@@ -1720,8 +1698,8 @@
 
     MockProfilingConnection mockProfilingConnection;
     MockStreamCounterBuffer mockStreamCounterBuffer(1024);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockStreamCounterBuffer);
-    sendCounterPacket.Start();
+    SendCounterPacket sendCounterPacket(mockStreamCounterBuffer);
+    sendCounterPacket.Start(mockProfilingConnection);
 
     // Interleaving writes and reads to/from the buffer with pauses to test that the send thread actually waits for
     // something to become available for reading
@@ -1828,8 +1806,8 @@
 
     MockProfilingConnection mockProfilingConnection;
     MockStreamCounterBuffer mockStreamCounterBuffer(1024);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockStreamCounterBuffer);
-    sendCounterPacket.Start();
+    SendCounterPacket sendCounterPacket(mockStreamCounterBuffer);
+    sendCounterPacket.Start(mockProfilingConnection);
 
     // Adding many spurious "ready to read" signals throughout the test to check that the send thread is
     // capable of handling unnecessary read requests
@@ -1948,8 +1926,8 @@
 
     MockProfilingConnection mockProfilingConnection;
     MockStreamCounterBuffer mockStreamCounterBuffer(1024);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, mockStreamCounterBuffer);
-    sendCounterPacket.Start();
+    SendCounterPacket sendCounterPacket(mockStreamCounterBuffer);
+    sendCounterPacket.Start(mockProfilingConnection);
 
     // Not using pauses or "grace periods" to stress test the send thread
 
@@ -2049,8 +2027,8 @@
 {
     MockProfilingConnection mockProfilingConnection;
     BufferManager bufferManager(1, 1024);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, bufferManager, -1);
-    sendCounterPacket.Start();
+    SendCounterPacket sendCounterPacket(bufferManager, -1);
+    sendCounterPacket.Start(mockProfilingConnection);
 
     // Interleaving writes and reads to/from the buffer with pauses to test that the send thread actually waits for
     // something to become available for reading
@@ -2176,8 +2154,8 @@
 {
     MockWriteProfilingConnection mockProfilingConnection;
     BufferManager bufferManager(3, 1024);
-    SendCounterPacket sendCounterPacket(mockProfilingConnection, bufferManager, -1);
-    sendCounterPacket.Start();
+    SendCounterPacket sendCounterPacket(bufferManager, -1);
+    sendCounterPacket.Start(mockProfilingConnection);
 
     // SendStreamMetaDataPacket
     sendCounterPacket.SendStreamMetaDataPacket();
diff --git a/src/profiling/test/SendCounterPacketTests.hpp b/src/profiling/test/SendCounterPacketTests.hpp
index 584df5e..0323f62 100644
--- a/src/profiling/test/SendCounterPacketTests.hpp
+++ b/src/profiling/test/SendCounterPacketTests.hpp
@@ -497,8 +497,8 @@
 class SendCounterPacketTest : public SendCounterPacket
 {
 public:
-    SendCounterPacketTest(IProfilingConnection& profilingconnection, IBufferManager& buffer)
-        : SendCounterPacket(profilingconnection, buffer)
+    SendCounterPacketTest(IBufferManager& buffer)
+        : SendCounterPacket(buffer)
     {}
 
     bool CreateDeviceRecordTest(const DevicePtr& device,