aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/ProfilingConnectionFactory.cpp
diff options
context:
space:
mode:
authorKeith Davis <keith.davis@arm.com>2019-10-24 17:30:41 +0100
committerColm Donelan <colm.donelan@arm.com>2019-11-06 08:30:31 +0000
commit3201eea0565ce2bb0418d1936fec71bdeb14c084 (patch)
treef73017f6338d707165dbcfd717ddc9793b1858e0 /src/profiling/ProfilingConnectionFactory.cpp
parentfe2e2cbbbe5294072b2d58755b8a095f32a97e75 (diff)
downloadarmnn-3201eea0565ce2bb0418d1936fec71bdeb14c084.tar.gz
IVGCVSW-3444 File Only Profiling Connection
* 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
Diffstat (limited to 'src/profiling/ProfilingConnectionFactory.cpp')
-rw-r--r--src/profiling/ProfilingConnectionFactory.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/profiling/ProfilingConnectionFactory.cpp b/src/profiling/ProfilingConnectionFactory.cpp
index 759eb7a95e..4af81a024e 100644
--- a/src/profiling/ProfilingConnectionFactory.cpp
+++ b/src/profiling/ProfilingConnectionFactory.cpp
@@ -1,11 +1,13 @@
//
-// Copyright © 2017 Arm Ltd. All rights reserved.
+// Copyright © 2019 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
#include "ProfilingConnectionFactory.hpp"
-#include "SocketProfilingConnection.hpp"
+
+#include "FileOnlyProfilingConnection.hpp"
#include "ProfilingConnectionDumpToFileDecorator.hpp"
+#include "SocketProfilingConnection.hpp"
namespace armnn
{
@@ -16,19 +18,31 @@ namespace profiling
std::unique_ptr<IProfilingConnection> ProfilingConnectionFactory::GetProfilingConnection(
const Runtime::CreationOptions::ExternalProfilingOptions& options) const
{
- if ( !options.m_IncomingCaptureFile.empty() || !options.m_OutgoingCaptureFile.empty() )
+ // We can create 3 different types of IProfilingConnection.
+ // 1: If no relevant options are specified then a SocketProfilingConnection is returned.
+ // 2: If both incoming and outgoing capture files are specified then a SocketProfilingConnection decorated by a
+ // ProfilingConnectionDumpToFileDecorator is returned.
+ // 3: If both incoming and outgoing capture files are specified and "file only" then a FileOnlyProfilingConnection
+ // decorated by a ProfilingConnectionDumpToFileDecorator is returned.
+ if ((!options.m_IncomingCaptureFile.empty() || !options.m_OutgoingCaptureFile.empty()) && !options.m_FileOnly)
{
- bool ignoreFailures = false;
+ // This is type 2.
return std::make_unique<ProfilingConnectionDumpToFileDecorator>(std::make_unique<SocketProfilingConnection>(),
- options,
- ignoreFailures);
+ options);
+ }
+ else if ((!options.m_IncomingCaptureFile.empty() || !options.m_OutgoingCaptureFile.empty()) && options.m_FileOnly)
+ {
+ // This is type 3.
+ return std::make_unique<ProfilingConnectionDumpToFileDecorator>(
+ std::make_unique<FileOnlyProfilingConnection>(options), options);
}
else
{
+ // This is type 1.
return std::make_unique<SocketProfilingConnection>();
}
}
-} // namespace profiling
+} // namespace profiling
-} // namespace armnn
+} // namespace armnn