diff options
author | Colm Donelan <Colm.Donelan@arm.com> | 2019-11-14 14:19:07 +0000 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-11-15 17:11:01 +0000 |
commit | 0270524f96c4e21a755d1c71e46c4e8665918237 (patch) | |
tree | 1ce1fc3fd51f568e15e84e0281410b6b53de2fe5 /src/profiling/PeriodicCounterSelectionCommandHandler.cpp | |
parent | 9723d0243463e3a32ed11ae1c38298343b4e8818 (diff) | |
download | armnn-0270524f96c4e21a755d1c71e46c4e8665918237.tar.gz |
IVGCVSW-4129 Fix thread starvation due to low capture periods
* Set default capture period to 10mSec.
* Validate capture period in PeriodicCounterSelectionCommandHandler
pull it up to 10mSec if it is lower.
* Fix segmentation fault in GatordMock when receive thread closes.
Signed-off-by: Colm Donelan <Colm.Donelan@arm.com>
Change-Id: I9f7ddc70bd99c102c5baef872d28329976a4dc07
Diffstat (limited to 'src/profiling/PeriodicCounterSelectionCommandHandler.cpp')
-rw-r--r-- | src/profiling/PeriodicCounterSelectionCommandHandler.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/profiling/PeriodicCounterSelectionCommandHandler.cpp b/src/profiling/PeriodicCounterSelectionCommandHandler.cpp index 3df0f22c1c..a6b6a050ad 100644 --- a/src/profiling/PeriodicCounterSelectionCommandHandler.cpp +++ b/src/profiling/PeriodicCounterSelectionCommandHandler.cpp @@ -6,6 +6,7 @@ #include "PeriodicCounterSelectionCommandHandler.hpp" #include "ProfilingUtils.hpp" +#include <armnn/Types.hpp> #include <boost/numeric/conversion/cast.hpp> #include <boost/format.hpp> @@ -82,7 +83,12 @@ void PeriodicCounterSelectionCommandHandler::operator()(const Packet& packet) ParseData(packet, captureData); // Get the capture data - const uint32_t capturePeriod = captureData.GetCapturePeriod(); + uint32_t capturePeriod = captureData.GetCapturePeriod(); + // Validate that the capture period is within the acceptable range. + if (capturePeriod > 0 && capturePeriod < LOWEST_CAPTURE_PERIOD) + { + capturePeriod = LOWEST_CAPTURE_PERIOD; + } const std::vector<uint16_t>& counterIds = captureData.GetCounterIds(); // Check whether the selected counter UIDs are valid |