aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test/ProfilingTests.cpp
AgeCommit message (Collapse)Author
2019-11-15IVGCVSW-4074 Send Timeline message in RequestCounterDirectoryCommandHandlerMatteo Martincigh
* Added call to SendTimelineMessageDirectoryPackage in the handler * Updated the unit tests accordingly * Refactored SendTimelinePacket to remove macro Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I7bb6f8575945b99a0e77ef30ecfe4dee3058669e
2019-11-15IVGCVSW-4073 Send stream info in the ConnectionAcknowledgedCommandHandlerMatteo Martincigh
* Added call to ISendTimelinePacket::SendStreamMetaDataPacket * Added call to ISendTimelinePacket::SendTimelineMessageDirectoryPackage * Added new StreamMetadataCommandHandler class to the mock Gatord service * Updated code and unit tests * Added include paths to the gatord mock target Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: Ic6d200b513175884607b7c0563cbfa4942ff2fc6
2019-11-06IVGCVSW-3444 File Only Profiling ConnectionKeith Davis
* Add FileOnlyProfilingConnection Decorator * Fix bug where Conn Ack not automatically sent back * Modify GatordMock to use the Counter Directory class. * Promote DirectoryCaptureCommandHandler from GatordMock into ArmNN. * Remove MockUtils as it's contents were moved or deleted. * Rewrite GatordMockTests to use Counter Directory class. * Flush streams in ProfilingConnectionDumpToFileDecorator::Close. Signed-off-by: Keith Davis <keith.davis@arm.com> Signed-off-by: Colm Donelan <Colm.Donelan@arm.com> Change-Id: I77b2aedece24150dd31691b577f3b5d81b2e226f
2019-10-18IVGCVSW-4005 Add PacketFamilyId to version resolverJim Flynn
Change-Id: Ief9373871438df4e1d353bbc545a3ee4f25c1fb0 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2019-10-18IVGCVSW-4002 Add FamilyId to CommandHandlerKeyJim Flynn
Change-Id: I0bb0bf77da2bcd7f4746078c4ccee9acc98638a7 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
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-15IVGCVSW-3948 Add Startup method to ProfilingJim Flynn
Change-Id: I591e84048775278bfc728e1b0c189ff4cf2d350b Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2019-10-15IVGCVSW-3984 Fix CheckPeriodicCounterCaptureThreadFinn Williams
* PerodicCounterCapture now sleeps instead of terminating when reading empty counter data * m_IsRunning is now set to false after the thread is joined and is no longer atomic * removed usages of find() (not thread safe) Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: Ie65d5a9a7e42a31653ec8eed064849355661ef56
2019-10-14IVGCVSW-3971 Implement the Per-Job Counter Selection command handlerMatteo Martincigh
* Added new PerJobCounterSelectionCommandHandler class * The new handler drops the incoming packet without altering the state of the profiling service * Added unit test Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I2b1bb803318a9e6c438391a0985893eb412e7787
2019-10-14IVGCVSW-3972 Implement the Disconnect functionalityJim Flynn
* Added Disconnect method to the ProfilingService class * Added unit test Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Signed-off-by: Jim Flynn <jim.flynn@arm.com> Change-Id: I5cc57abd3e1239cdf8afe21ee4883c1f73cd0e80
2019-10-11IVGCVSW-3964 Implement the Periodic Counter Selection command handlerMatteo Martincigh
* Improved the PeriodicCounterPacket class to handle errors properly * Improved the PeriodicCounterSelectionCommandHandler to handle invalid counter UIDs in the selection packet * Added the Periodic Counter Selection command handler to the ProfilingService class * Code refactoring and added comments * Added WaitForPacketSent method to the SendCounterPacket class to allow waiting for the packets to be sent (useful in the unit tests) * Added unit tests and updated the old ones accordingly * Fixed threading issues with a number of unit tests Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I271b7b0bfa801d88fe1725b934d24e30cd839ed7
2019-10-10IVGCVSW-3964 Change the type held by the Packet class to unsigned charMatteo Martincigh
* Updated the Packet class * Updated the pertinent code accordingly Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I73eab5b1ead67a610cd17fd33f8a74f764ad8cc4
2019-10-10IVGCVSW-3963 Implement the Request Counter Directory HandlerMatteo Martincigh
* Integrated the RequestCounterDirectoryCommandHandler in the ProfilingService class * Code refactoring * Added/Updated unit tests Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I60d9f8acf166e29b3dabc921dbdb8149461bd85f
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 Add the necessary components to the ProfilingService class toMatteo Martincigh
process a connection to an external profiling service (e.g. gatord) * Added the required components (CommandHandlerRegistry, CommandHandler, SendCounterPacket, ...) to the ProfilingService class * Reworked the ProfilingService::Run procedure and renamed it to Update * Handling all states but Active in the Run method (future work) * Updated the unit and tests accordingly * Added component tests to check that the Connection Acknowledged packet is handled correctly * Added test util classes, made the default constructor/destructor protected to superclass a ProfilingService object * Added IProfilingConnectionFactory interface Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I010d94b18980c9e6394253f4b2bbe4fe5bb3fe4f
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-08IVGCVSW-3937 Refactor and improve the CommandHandleRegistry classMatteo Martincigh
* Added simplified RegisterFunctor method * Code refactoring * Updated the unit tests accordingly Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: Iee941d898facd9c1ab5366e87c611c99a0468830
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-07IVGCVSW-3937 Refactor and improve the PeriodicCounterCapture classMatteo Martincigh
* Conformed the PeriodicCounterCapture class to the other thread-based classes * Code refactoring * Renamed CounterValues file to ICounterValues * Removed no longer used file * Updated unit tests accordingly Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I8c42aa17e17a90cda5cf86eb8ac2d13501ecdadc
2019-10-07IVGCVSW-3937 Rename CommandThread to CommandHandlerMatteo Martincigh
* Renamed files, class name and methods accordingly * Updated unit tests accordingly Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: Ifb88aa61edb93b852a07b1bd59bd259213677b44
2019-10-07IVGCVSW-3937 Refactor the command threadMatteo Martincigh
* Integrated the Join method into Stop * Updated the unit tests accordingly * General code refactoring Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: If8537e77b3d3ff2b780f58a07df01191a91d83d2
2019-10-07IVGCVSW-3937 Initial ServiceProfiling refactoringMatteo Martincigh
* Made the ServiceProfiling class a singleton * Registered basic category and counters * Code refactoring * Updated unit tests accordingly Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I648a6202eead2a3016aac14d905511bd945a90cb
2019-09-27IVGCVSW-3557 Return IProfilingConnection from ProfilingConnectionFactorySadik Armagan
* Remove WaitingForAck test, test std::cerr instead Signed-off-by: Kevin May <kevin.may@arm.com> Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I968c53dc005ff078ed08faf8818c83cb2a41528a
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-25IVGCVSW-3411 Add the Counter Values array and accessor methodsFinnWilliamsArm
Signed-off-by: FinnWilliamsArm <Finn.Williams@arm.com> Change-Id: I4fa2428a83b93cbe58b821344206e2f7ce9e37e7
2019-09-24IVGCVSW-3439 Create the Command ThreadFinnWilliamsArm
Signed-off-by: FinnWilliamsArm <Finn.Williams@arm.com> Change-Id: I9548c5937967f4c25841bb851273168379687bcd
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-23IVGCVSW-3413 Add the Counters MetadataFinnWilliamsArm
Signed-off-by: FinnWilliamsArm <Finn.Williams@arm.com> Change-Id: I1313320a28b2d17d1adbc80248882ef458c34a14
2019-09-23IVGCVSW-3437 Add Request Counter Directory Command HandlerNarumol Prangnawarat
Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I56ef68d6fe993d271a0fc43467f2a63cdcaee496
2019-09-20IVGCVSW-3433 Create the Periodic Counter Capture ThreadFrancis Murtagh
* Add Periodic counter thread object * Add Unit test for thread * Move MockBuffer to header file to allow reuse Change-Id: Id2a8ea636723ab35e8a50efc200c8c76059bba02 Signed-off-by: Ferran Balaguer <ferran.balaguer@arm.com> Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
2019-09-19IVGCVSW-3430 Connection Acknowledged Command Handler ImplementationSadik Armagan
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I0ba97a93edb283b37bd1c089c668135a4bf9550c
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-18IVGCVSW-3432 Fix a multithread store conflictJim Flynn
* Unit test was using the same CaptureData object across 50 threads Change-Id: I0249b5a8e0bb05e3d3efdd855f5b34b1d5ef3dc9 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2019-09-18IVGCVSW-3691 Add extra unit tests to complete coverage forMatteo Martincigh
the CounterDirectory class Change-Id: I37c6d2b43d3994878c8daeeb0ff226bf411c0aae 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-16IVGCVSW-3826: Implement IProfiling functionsFinnWilliamsArm
!armnn:1814 Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Signed-off-by: FinnWilliamsArm <Finn.Williams@arm.com> Change-Id: I82c7453d7969880e321572637adc0fb9c0e5fd7b
2019-09-16Split out basic CaptureData unit tests from Holder testsMatthew Bentham
Change-Id: I68f62c2941c4af77a48829bbc71d5836d9477b5d Signed-off-by: Matthew Bentham <Matthew.Bentham@arm.com>
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-12IVGCVSW-3580: Extend the IProfilingConnection to connect to a SocketTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Signed-off-by: Aron Virginas-Tar <aron.virginas-tar@arm.com> Change-Id: I72e099ee00052f7a0907c055c7bff02c7d8fde86
2019-09-09IVGCVSW-3691 Add utility function to generate valid UIDs for profiling objectsMatteo Martincigh
Change-Id: I59ad320bfd52c881671c5e4710fb70c5d0293aad Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
2019-09-09IVGCVSW-3432 Create CaptureData HolderFrancis Murtagh
* Improve tests with greater number of threads Change-Id: I6855cdee463809045b10fff85ed9193dd3d3207a Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
2019-09-05IVGCVSW-3674 Create basic ProfileService classKeith Davis
Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: I5bed5196c256883fb704fe14b60bb8f7a77cc9df
2019-09-05IVGCVSW-3432 Create CaptureData HolderFrancis Murtagh
* Fix race condition where result was read before execution of write Change-Id: I8961c4ce5a9000cb4d465106fe56e615beecf4dc Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
2019-09-04IVGCVSW-3432 Create CaptureData HolderFrancis Murtagh
* Create CaptureData and Holder classes * Add unit test Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com> Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: I9f2766a8a6081ae4f9988904af2ca24cd434ebca
2019-09-03IVGCVSW-3431 Create Profiling Service State MachineNikhil Raj
Change-Id: I30ae52d38181a91ce642e24919ad788902e42eb4 Signed-off-by: Nikhil Raj <nikhil.raj@arm.com>
2019-08-23IVGCVSW-3427 Create PacketVersionResolver classAron Virginas-Tar
* Create first version of PacketVersionResolver class * Add basic unit test * Move existing classes inside the armnn::profiling namespace * Add utility methods for Version Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> Change-Id: If0ea0e1b9dea7fbfcd8b808e97b1e2aa91964dfa
2019-08-19IVGCVSW-3429 Add a utility Version classNikhil Raj
Change-Id: Id429f7d9176c775953c1261c5a3e9f1d565927c1 Signed-off-by: Nikhil Raj <nikhil.raj@arm.com>
2019-08-16IVGCVSW-3550 Create Command Handler RegistryFrancis Murtagh
Change-Id: I51e34068d79ba660ae2f16b22ad2bb8191d473fa Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
2019-08-16IVGCVSW-3425 Create the Command Handler Functor base classFrancis Murtagh
Change-Id: I59ac9b32ac594161bdc5e1de2cdee02d79fc1992 Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>