aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/PeriodicCounterSelectionCommandHandler.cpp
diff options
context:
space:
mode:
authorFinn Williams <Finn.Williams@arm.com>2019-10-14 15:55:18 +0100
committerJim Flynn Arm <jim.flynn@arm.com>2019-10-15 09:22:03 +0000
commitf4d59a678d8ef8420f52d341bb60f1a583269e24 (patch)
tree5a36aec70269d0194440aa3224b2187c86bf8c5b /src/profiling/PeriodicCounterSelectionCommandHandler.cpp
parent91e1de786ddeee7fcd702a756ef47a475ff1bd46 (diff)
downloadarmnn-f4d59a678d8ef8420f52d341bb60f1a583269e24.tar.gz
IVGCVSW-3984 Fix CheckPeriodicCounterCaptureThread
* 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
Diffstat (limited to 'src/profiling/PeriodicCounterSelectionCommandHandler.cpp')
-rw-r--r--src/profiling/PeriodicCounterSelectionCommandHandler.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/profiling/PeriodicCounterSelectionCommandHandler.cpp b/src/profiling/PeriodicCounterSelectionCommandHandler.cpp
index db09856dae..3df0f22c1c 100644
--- a/src/profiling/PeriodicCounterSelectionCommandHandler.cpp
+++ b/src/profiling/PeriodicCounterSelectionCommandHandler.cpp
@@ -109,8 +109,16 @@ void PeriodicCounterSelectionCommandHandler::operator()(const Packet& packet)
// Notify the Send Thread that new data is available in the Counter Stream Buffer
m_SendCounterPacket.SetReadyToRead();
- // Start the Period Counter Capture thread (if not running already)
- m_PeriodicCounterCapture.Start();
+ if (capturePeriod == 0 || validCounterIds.empty())
+ {
+ // No data capture stop the thread
+ m_PeriodicCounterCapture.Stop();
+ }
+ else
+ {
+ // Start the Period Counter Capture thread (if not running already)
+ m_PeriodicCounterCapture.Start();
+ }
break;
}