aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test/SendCounterPacketTests.cpp
AgeCommit message (Collapse)Author
2022-03-23IVGCVSW-6706 Create the libpipeClient libraryJim Flynn
Change-Id: I2368aade38ad3808fab55d8a86cd659d4e95d91e Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-03-16IVGCVSW-6851 Move DirectoryCaptureCommandHandler to the profiling server libraryJim Flynn
Change-Id: Ib14fdcca15f40fedc0f992b0fd882458dc58c9ba Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-03-16IVGCVSW-6852 Break the remaining dependencies on Arm NN in the profiling codeJim Flynn
Change-Id: I18b8ca22896567904768170350ee5eb22edd4a22 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-03-14IVGCVSW-6847 replace armnn:Optional with arm::pipe::Optional in profiling codeJim Flynn
Change-Id: I048c538d4f8c21770aec2b2751c934d9fa15a4dc Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-03-13IVGCVSW-6848 Move Process.[ch]pp from armnnUtils to profiling/commonJim Flynn
Change-Id: I13353f50293eae565a75ccfda37209350512bbc6 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-03-13IVGCVSW-6849 Change ARMNN_NO_CONVERSION_WARN_BEGIN/END to ↵Jim Flynn
ARM_PIPE_NO_CONVERSION_WARN_BEGIN/END in the profiling code Change-Id: Id5571f9847289692f968ad30ceab064e96693cac Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-03-12IVGCVSW-6842 Replace ARMNN_ASSERT with ARM_PIPE_ASSERT in profiling codeJim Flynn
Change-Id: Ie982ae603b7fb2793baf921232d32ce43f46d444 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-03-10IVGCVSW-6841 Replace armnn::numeric_cast with arm::pipe::numeric_cast in ↵Jim Flynn
profiling code Change-Id: Ib3115694608dee59ced8dc31077e16fe19d0dfea Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-03-09IVGCVSW-6821 Remove dependency on armnn::Exception classes from the ↵Jim Flynn
Profiling code Change-Id: Id46a9a0576091df21b2af5b472f1ca5c6335e8a3 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-03-01IVGCVSW-6704 Change the namespace from armnn::profiling to arm::pipeCathal Corbett
* Updated ABI version to 29 due to being the first ABI break in 22.05 !android-nn-driver:7226 Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: I9c50007dcd5b5e792757e7bd1213606df5ffec36
2021-06-11IVGCVSW-5963 'Move unit tests to new framework'Sadik Armagan
* Used doctest in ArmNN unit tests Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: Ia9cf5fc72775878885c5f864abf2c56b3a935f1a
2020-09-29IVGCVSW-5301 Remove all boost::numeric_cast from armnn/src/profilingMatthew Sloyan
* Replaced with armnn/utility/NumericCast.hpp Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: I14e89c00cd1dd607315113d5b8ca56c2e9f6c363
2020-07-29IVGCVSW-5166 Pull out the common and server side code into standalone librariesJim Flynn
Change-Id: I180f84c493a9b2be4b93b25d312ebdd9e71b1735 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2020-07-13IVGCVSW-5076 Correct Profiling Stream Metadata packet revision tableJim Flynn
Change-Id: Ic3f8637642d3f3a5925f5b82e3729b3b654a7f3e Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2020-06-02Fix a few build warnings:Rob Hughes
* Remove redundant asserts for unsigned ints being positive * Remove unneeded include of lightweight_test.hpp header * Remove unused exception variable names * Replace hardcoded 0.0f with T() for some template functions * Add a few static_casts Change-Id: I290b0433cf995f6d0199422eaa10f816e5fd8eb9 Signed-off-by: Robert Hughes <robert.hughes@arm.com>
2020-05-15IVGCVSW-4835 Change CounterSet and Device name offsets sizes to bytesFinn Williams
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I5dee006d5532cc85b86997a4cd0877afbf043122
2020-05-07IVGCVSW-4730 Remove the duplication of PIPE_MAGIC in the code baseFinn Williams
Change-Id: I41c6e917b29eee33360758b6c5afe5dadba89093 Signed-off-by: Finn Williams <Finn.Williams@arm.com>
2020-05-01Update the CounterDirectory Packet offsets to be relative to the start of ↵Finn Williams
the table containing that offset * IVGCVSW-4763 Update the event pointer table offsets * IVGCVSW-4764 Update the event record block offsets * IVGCVSW-4765 Update the device name offset * IVGCVSW-4766 Update the counter set name offset * IVGCVSW-4767 Update device pointer table offsets * IVGCVSW-4768 Update the counter set pointer table offsets * IVGCVSW-4769 Update the category pointer table offsets Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I6e815ae5b16478fc5ec760caf704451fe5f84a29
2020-04-30IVGCVSW-4760 Change the offsets in the counter directory body_header to be ↵Finn Williams
from the start of the packet body Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: Ie5ef5e410f3b06f1c80c7c5ea2057f5008cf09ed
2020-04-22IVGCVSW-4719 Remove possible zeros from SendStreamMetaDataPacket offsetsFinn Williams
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I8d7ee408c4c73be9b42bb739254b95c476e0e38c
2020-04-06IVGCVSW-4485 Remove Boost assertNarumol Prangnawarat
* Change boost assert to armnn assert * Change include file to armnn assert * Fix ARMNN_ASSERT_MSG issue with multiple conditions * Change BOOST_ASSERT to BOOST_TEST where appropriate * Remove unused include statements Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I5d0fa3a37b7c1c921216de68f0073aa34702c9ff
2020-04-02IVGCVSW-4455 Add an Activate and Deactivate control packet to the protocolKeith Davis
* Add Activate/Deactivate command handlers * Add IReportStructure, INotifyBackends single function interfaces * Add overrided mechanism to report structure in Runtime.cpp * Add overrided mechanism to notify backends in ProfilingService.cpp * Add optional IReportStructure argument to ProfilingService constructor for use in ActivateTimelineReportingCommandHandler * Refactoring and tidying up indentation * Removal of unused code in ProfilingUtils.cpp and ProfilingService.cpp * Added GatordMock end to end test * Fixed an issue with SendCounterPacket sending duplicate packets * Fixed an issue with DirectoryCaptureCommandHandler handling of Optional Signed-off-by: Keith Davis <keith.davis@arm.com> Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I5ef1b74171459bfc649861dedf99921d22c9e63f
2020-02-28IVGCVSW-4454 Remove the CounterSet and Device fields from CategorySadik Armagan
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I721f59cd1f6d068e02dabd62c42871a43be9d934
2020-02-16IVGCVSW-4320 Implement ReportCounters in BackendProfilingJim Flynn
Change-Id: Idd545079f6331bb4241709fa1534635f3fdf610b Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2020-02-14IVGCVSW-4338 Implement the Activation of Counters in backendsFinn Williams
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I4a2465f06e046f78242ff0a246c651638b205498
2020-02-10IVGCVSW-4328 BufferManager running out of buffers crashes applicationSadik Armagan
* Refactored SendCounterPacket classes, separated SendCounterPacket from Send thread * Created ISendThread.hpp, IConsumer, SendThread.hpp and SendThread.cpp * Injected IConsumer to BufferManager to notify SendThread when packet is ready to read Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I80f0bb8b8401c6bfd1611f7760217c6fe35d7ad8
2020-01-21Add thin abstraction layer for processes and filesystemRob Hughes
This is used instead of some hardcoded Unix calls and means this code now works on Windows (This is a rework of a previous patch which used boost, now that I have been informed that we are trying to move towards removing boost). Change-Id: Ib0d11055279bbd7b710f086e9890369e3ecbfe9a Signed-off-by: Robert Hughes <robert.hughes@arm.com>
2020-01-14IVGCVSW-4229 Fix Intermittent failures in ExternalProfilingFinn Williams
* Added a BufferManager.Reset() method to prevent packets being retained after a test * Fixed a bug causing the send thread to wait needlessly before moving to active state * Refactored SendCoundPacketTests and ProfilingTests test helper classes * Fixed issue where WaitForPacketSent could miss a notification and timeout Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I353a652260c2f7dd465baa9e979e22f50f3ca6a7
2020-01-09Fix build error on gcc 7+ for implicit switch statement fallthroughsRob Hughes
Change-Id: I48632a42892d8e9a616255fe106e40161b0ee55f Signed-off-by: Robert Hughes <robert.hughes@arm.com>
2019-12-13IVGCVSW-4178 Add code to increment the 3 ArmNN countersKeith Davis
* Increment at Runtime.cpp | BackendRegistry.cpp | LoadedNetwork.cpp * Update unit tests * UID generation is now handled by backends Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: Ifa53763409078c14839675206d8b260cdc36a8df
2019-12-09IVGCVSW-4228 Fix SendThreadSendStreamMetadataPacketFinn Williams
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: Ib095718bee36434cc9a60e8e472040b12f1b9f20
2019-12-04IVGCVSW-4223 Change PeriodicCounterCapture Packet Family to 3Jim Flynn
Change-Id: Ibc166c25d8d5fd09f407c0c697217a57b84d8cdc Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2019-12-04IVGCVSW-4118 Change the SendCounterPacket send thread to use do whileFinn Williams
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I702fdc941e29ddcb31f54513e0a7dc642f0f4685
2019-11-29IVGCVSW-4118 Fix long unit test executionColm Donelan
* Reduced sleep_for timings * Removed duplicate SendStreamMetaDataPacket. * Modified SendCounterPacket::WaitForPacketSent to use wait_for * Modified SendCounterPacket::Send WaitingForAck to use wait_for * Added destructor to StreamRedirector. * Added method SendCounterPacketTests::HasWrittenData * Restructured many tests in ProfilingTests. Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: I55c59cac6674ac40a1056a5302a997d5da9e9d91 Signed-off-by: Colm Donelan <Colm.Donelan@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-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