aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test/SendCounterPacketTests.cpp
AgeCommit message (Collapse)Author
2019-10-24IVGCVSW-3950 Create SendTimelinePacket interface and classSadik Armagan
* Implemented ISendTimelinePacket interface and its implementation SendTimelinePacket * Implemented TimelinePacketWriterFactory * Implemented unit tests for SendTimelinePacket functions Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I0a47586437f99510394d4d94589dccfb397d38e5
2019-10-15IVGCVSW-3939 Code refactoring and minor fixesMatteo Martincigh
* Fixed value masking in SendPeriodicCounterCapturePacket and updated the pertinent unit tests * Code refactoring and cleanup * Added extra comments to the ProfilingService stop/reset procedure Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: Ibaf2fede76e06d5b8ce7258a4820a60e5993559f
2019-10-09IVGCVSW-3937 Improve the Connection Acknowledged HandlerMatteo Martincigh
* The Connection Acknowledged Handler should report an error is it's called while in a wrong state * Stopping the threads in the ProfilingService before having to start them again * Updated the unit tests to check the changes * Removed unnecessary Packet.cpp file * Fixed memory leak Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I8c4d33b4d97994df86fe6c9f8c659f880ec64c16
2019-10-08IVGCVSW-3937 Update the Send thread to send out the Metadata packetMatteo Martincigh
* The Send thread now automatically sends out Stream Metadata packets when the Profiling Service is in WaitingForAck state * Added a reference to the profiling state in the SendCounterPacket class * Moving the RuntimeException thrown in the Send thread to the main thread for rethrowing * The Stop method now rethrows the exception occurred in the send thread * The Stop method does not rethrow when destructing the object * Added unit tests Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: Ice7080bff63199eac84fc4fa1d37fb1a6fcdff89
2019-10-07IVGCVSW-3937 Make dynamic use the of the profiling connectionMatteo Martincigh
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
2019-10-04IVGCVSW-3904 Add more unit tests for send thread with BufferManagerNarumol Prangnawarat
* Add timeout parameter to wait for readable data * Write all readable data to the profiling connection when ready to read * Set ready to read when buffer exhaust * Ensure that readable data get written to profiling connection before the send thread is stopped * Add MockWriteProfilingConnection to be able to test WritePacket * Refactor BufferManager and the unit tests Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I80ae01bd8d0119a3a3a957069ae8ac521c005a12
2019-10-03IVGCVSW-3440 Fix intermittently failing send thread testMatteo Martincigh
* Simplified the implementation of the MockStreamCounterBuffer * Minor refactoring Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I3aed97daee0ac32d384e1f830e8cc57aae84950b
2019-09-26IVGCVSW-3902 Create IReadOnlyPacketBuffer, IPacketBuffer and IBufferManager ↵Narumol Prangnawarat
interfaces * Create IReadOnlyPacketBuffer, IPacketBuffer and IBufferManager interfaces * Add Read and Write util functions that use IPacketBuffer * Add MockBufferManager using IBufferManager for testing * Modify SendCounterPacket to use IBufferManager * Modify MockStreamCounterBuffer to use IBufferManager * Remove IBufferWrapper and MockBuffer * Add MockPacketBuffer for testing * Modify unit tests to use the new interfaces Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: Ib86768187e032f07169aa39367a418b7665c9f03
2019-09-25IVGCVSW-3905 Create a first implementation of the send threadMatteo Martincigh
* Added the send thread directly to the SendCounterPacket class * Updated the SendCounterPacket class constructor to also take a reference of a IProfilingConnection object, used to send packets out * Added Start and Stop methods to SendCounterPacket to start and stop the send thread * Added mutex and wait condition to make the send thread waiting for something to send * This implementation used the old IBufferWrapper interface * Added defult (empty) constructor for the Packet class * Refactoring of IPeriodicCounterCapture and SocketProfilingConnection * Modified WritePacket to make it match IBufferWrapper::GetReadBuffer * Added unit test for regular and stress testing of the send thread Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I8175619ff4e65c0d5be99bcd8bd9d8dd87f717c6
2019-09-24IVGCVSW-3691 Fix the Counter Directory Packet data lengthMatteo Martincigh
* The data_length field in the header represents only the size of the data included in the packet after the header, so the header size is not included * Removed a number of conversion macros in SendCounterPacket by using numeric casts where possible * Updated the unit tests accordingly Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: Ifb23c341c442ff3d33b234d4213b739a77ceb658
2019-09-18IVGCVSW-3691 Implement SendCounterPacket.SendCounterDirectoryPacket() functionMatteo Martincigh
* Changed the signature of SendCounterDirectoryPacket to accept any ICounterDirectory object * Added helper methods to the SendCounterPacket class for creating the records * Created mock classes for testing * Added unit tests for both SendCounterDirectoryPacket and the helper methods * Added unit tests for the SWTrace utility functions * Added ReadUint8 utility function for getting single byte out of a buffer * Disabled extra sign-conversion warning in the conversion macro Change-Id: Ie2dddcd6824ed07b623f0cd78d9b7d05c5b70c39 Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
2019-09-17IVGCVSW-3691 Rework the CounterDirectory class to take into considerationMatteo Martincigh
the connections between components * Added constructors and connections to the profiling classes * Used hash table to keep track of the profiling objects by UID * Added register methods * Added find/check helper methods * Updated the makefile to include the profiling directory * Added unit tests for the CounterDirectory class * Added ICounterDirectory interface class for read-only use * Added custom macro to locally disable conversion warnings Change-Id: I3f53a68663ee77b8d03ac0ef7dc01e90c6893511 Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
2019-09-13IVGCVSW-3872 Add Missing packet to SendMetaDataPacketFerran Balaguer
Signed-off-by: Ferran Balaguer <ferran.balaguer@arm.com> Change-Id: I98d8b22bdc447c2ff3f4d74d58ef9c0eae75db76
2019-09-13IVGCVSW-3436 Create the Periodic Counter Selection Command HandlerFerran Balaguer
Change-Id: Ia6fe19db5aebe82bb00dcbab17e16633befda0a5 Signed-off-by: Ferran Balaguer <ferran.balaguer@arm.com>
2019-09-09IVGCVSW-3691 Basic refactoring in view of upcoming work in the profilerMatteo Martincigh
Change-Id: Iea4550b864fc2adb04a3a2411a7ead06b1f60ab9 Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
2019-09-09IVGCVSW-3690 Implement SendCounterPacket.SendStreamMetaDataPacket() functionFerran Balaguer
Signed-off-by: Ferran Balaguer <ferran.balaguer@arm.com> Change-Id: I9e034b0caaff5371fadfdba20fdbe3171d4cd2e6
2019-09-05IVGCVSW-3692 Implement SendPeriodicCounterCapturePacket() functionFrancis Murtagh
Change-Id: Ic976fc36955bec5e7721d1e34e89e7be79e23053 Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
2019-09-03IVGCVSW-3693 Implement ↵Ferran Balaguer
SendCounterPacket.SendPeriodicCounterSelectionPacket() function Signed-off-by: Ferran Balaguer <ferran.balaguer@arm.com> Change-Id: Ib034a4f5ca589759d925e3dd0ca50e5a3dfa74c5
2019-09-02IVGCVSW-3434 Create the SendCounterPacket interfaceFerran Balaguer
Signed-off-by: Ferran Balaguer <ferran.balaguer@arm.com> Change-Id: I0d9b0ab12f17cb86544163ce3f0dc4945151e9e1