aboutsummaryrefslogtreecommitdiff
path: root/src/profiling
AgeCommit message (Collapse)Author
2019-11-07IVGCVSW-4107 Fix bug in ProfilingConnectionDumpToFileDecoratorTestsAron Virginas-Tar
* Replace predefined file name with randomly generated file name to avoid reading back old dumps Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> Change-Id: Ia48a9cda4527c585453383a5d758e1831c38604a
2019-11-07IVGCVSW-4102 Move ProfilingGuid to public interfacejaneil01
* Moved ProfilingGuid to Types.hpp * Refactoring to enable ProfilingGuid Signed-off-by: janeil01 <jan.eilers@arm.com> Change-Id: Ibf77002d74e484f8a63ffd96aa14303c1f0d38ae
2019-11-07IVGCVSW-3951 Create the timeline decoderFinn Williams
* Added ITimelineDecoder.h C interface * Added an example implementation of ITimelineDecoder.h * Added command handlers for the timeline directory and objects * Added tests for the decoder implementation * Changed ReadSwTraceMessage to take a const unsigned char* so it can be used by the directory command handler * Fixed some bugs in ProfilingUtils.cpp and related tests Change-Id: If06faf1fe0274a8f022f194a6d3527f5ce5374c6 Signed-off-by: Finn Williams <Finn.Williams@arm.com>
2019-11-06IVGCVSW-4065 Add a RecordEvent functionMatteo Martincigh
* Added RecordEvent utility function to the TimelineUtilityMethods class * Added new utility function to get a timestamp * Added unit tests Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: Ia3f8fe7397915fa6c903ce0c0abab3047cea628c
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-11-05IVGCVSW-4065 Use platform-specific thread id size in Timeline packetsMatteo Martincigh
* Using std::thread::id as a general data type for thread id * Added new profiling util functions for reading/writing a thread id to/from a buffer * Fixed code and unit tests accordingly Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I1aaa3bdb740c8a97010f655b1e9f7581b52e7aff
2019-11-05IVGCVSW-4065 Refactor the IPacketBuffer smart pointersMatteo Martincigh
* Added convenience "using" statement for the unique pointers to IPacketBuffer * Replaced all the occurrencies in the code Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: Iffec3a425ffbc1ecb23012971563a48139eb32eb
2019-10-31IVGCVSW-4049 Fix potential threading issue with the SendCounterPacket threadFinn Williams
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I311270dac0ba90b04e3488572e6b045546114a12
2019-10-30IVGCVSW-4037 Add a CreateNamedTypedChildEntity methodNarumol Prangnawarat
* Added new method to the TimelineUtilityMethods class * Added unit tests * Code refactoring * Skipped the 0 when generating a dynamic GUID for testing purposes Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: Ic2c8033ad010e07b0f8b7971ce653263e21c6f97
2019-10-30IVGCVSW-4036 Add CreateNamedTypedEntity functionNarumol Prangnawarat
* Add CreateNamedTypedEntity function * Add NameEntity function * Add TypeEntity function * Unit tests Change-Id: I3cc27157a0b41c8709b0a468f93b58b63a1ad8d1 Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com>
2019-10-30IVGCVSW-4035 Add a CreateTypedLabel functionMatteo Martincigh
* Create new utility function in the TimelineUtilityMethods class * Added unit tests Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I63704b94d5cc6861e4e160de2aae4ae497699dd2
2019-10-28IVGCVSW-4033 Provide a utility method to send the 'well known'Matteo Martincigh
labels and event classes * Added utility method SendWellKnownLabelsAndEventClasses * Added unit tests Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: Id8ec0d0eb6861feb8b61731e656d1571effc904a
2019-10-28IVGCVSW-4031 Provide well known profiling GUIDsJim Flynn
Change-Id: Ibf99b025f51503e8937012b655aad74698f32e38 Signed-off-by: Jim Flynn <jim.flynn@arm.com> Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
2019-10-25IVGCVSW-4022 Create a DeclareLabel utility functionMatteo Martincigh
* Created new TimelineUtilityMethods class * Created the DeclareLabel utility methods inside the new class * Added unit tests Change-Id: Ife0f7853a556d48206b76baeb3934344a990bee9 Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
2019-10-25IVGCVSW-4028 Add TimelinePacketWriterFactory to ProfilingServiceJim Flynn
Change-Id: I1baf6ff49fc591577efab8190352f2ae5a7dc5e5 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2019-10-25IVGCVSW-4027 Add the IProfilingGuidGenerator interfaceJim Flynn
Change-Id: Idfb80d73171aa2b57d4dcf01dc137817cf19d2bd Signed-off-by: Jim Flynn <jim.flynn@arm.com>
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-22IVGCVSW-3980 Add ProfilingGuid and ProfilingGuidGenerator APINarumol Prangnawarat
* ProfilingGuid * ProfilingDynamicGuid * ProfilingStaticGuid * ProfilingGuidGenerator API * Unit tests Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: If950415f059d07d34cf64e13a9b4663dd032ec34
2019-10-22Fix for bug where ProfilingConnectionDumpToFactory is not used in profiling ↵Keith Davis
service Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: I962093766a79fefc8fb91b9bc3d5bd8f28c35114
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-17IVGCVSW-3409 Create the ProfilingService classColm Donelan
* Improve the error handling in SocketProfilingConnection to close the socket when an error has been detected. * Update the CommandHandler thread to handle a closed socket. Signed-off-by: Colm Donelan <Colm.Donelan@arm.com> Change-Id: I1577c8d7d57a7af9bde98c2dec12cb19a3afb21d
2019-10-16IVGCVSW-3930 Create the Timeline Relationship Binary PacketNarumol Prangnawarat
Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: Ia3f93a25cd26c6d9116c2112d1e8d07be438bf39
2019-10-16IVGCVSW-3931 Create the Timeline Event Binary PacketMatteo Martincigh
* Added WriteTimelineEventBinaryPacket function * Added unit tests * Code refactoring Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I36b6a8b26bb46eb5ea97bb711ef7e153ea6d851f
2019-10-16Refactor ProfilingUtilsJan Eilers
* Added decl_id to all swtrace stream messages * Adjusted unit tests to include decl_id * Refactored code to reduce code duplication Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I7a607765d9e65b1c08e4f914acbeda392400f6a4
2019-10-16IVGCVSW-3929 Create the Timeline Event Class Binary PacketJan Eilers
* Added some utility functions * Added WriteTimelineEventClassBinaryPacket * Added related unit tests Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: Ib1fca3f8642bf5bbddb5ce51f2d90581a86359b1
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-11IVGCVSW-3721 Add support for startup sequence (Mock Gatord service).Colm Donelan
* Receive and process the stream metadata from the client. * Send the connection ack packet. * Wait in a receiving thread and print the packets. * GatordMockTest and Impl for PeriodicCounterCapture CommandHandler * CaptureData class to retain packet data * MockUtils * Update SocketProfilingConnection to fix non blocking receipt of packets. * Restructure directory layout following review comments. * Extract the mock service into a static library in the cmake files. Signed-off-by: Colm Donelan <Colm.Donelan@arm.com> Signed-off-by: Keith Davis <keith.davis@arm.com> Signed-off-by: Mike Kelly <mike.kelly@arm.com> Signed-off-by: Finn Williams <Finn.Williams@arm.com> Signed-off-by: Kevin May <kevin.may@arm.com> Change-Id: I33c1c9f93976708c9315f71290d42cff53b8c075
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-3926 Create the Timeline Message Directory PackageSadik Armagan
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I8be40f2e6f1f916b2566ca4d9e87b38d27eb7730
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-3948 Add Profiling config to Runtime constructorJim Flynn
Change-Id: Ib5cb85e620ed2cd76a85d423b2674b5d80981be9 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
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-3928 Add the Timeline Entity Binary PacketDavid Monahan
Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: If3dda4c5ba5c79e4bade58e14fc4df677cb2f5a1
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-10-04IVGCVSW-3949 Fix signed/unsigned comparison bugJim Flynn
Change-Id: I6a7a809e2d30f137f8221a7d30091d3d6821c213 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
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-3927 Create the Timeline Label Binary PacketMatteo Martincigh
* Added a new utility function to create a Timeline Label Binary Packet and write it to a given buffer * Added new enumeration to be reused for subsequent utility functions * Added unit tests Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: Icbabefb9050f3f3b1a30082eabf875593378001f