20.02
|
#include <ProfilingService.hpp>
Public Types | |
using | ExternalProfilingOptions = IRuntime::CreationOptions::ExternalProfilingOptions |
using | IProfilingConnectionFactoryPtr = std::unique_ptr< IProfilingConnectionFactory > |
using | IProfilingConnectionPtr = std::unique_ptr< IProfilingConnection > |
using | CounterIndices = std::vector< std::atomic< uint32_t > * > |
using | CounterValues = std::list< std::atomic< uint32_t > > |
Public Member Functions | |
void | ResetExternalProfilingOptions (const ExternalProfilingOptions &options, bool resetProfilingService=false) |
ProfilingState | ConfigureProfilingService (const ExternalProfilingOptions &options, bool resetProfilingService=false) |
void | Update () |
void | Disconnect () |
void | AddBackendProfilingContext (const BackendId backendId, std::shared_ptr< armnn::profiling::IBackendProfilingContext > profilingContext) |
const ICounterDirectory & | GetCounterDirectory () const |
ICounterRegistry & | GetCounterRegistry () |
ProfilingState | GetCurrentState () const |
bool | IsCounterRegistered (uint16_t counterUid) const override |
uint32_t | GetCounterValue (uint16_t counterUid) const override |
uint16_t | GetCounterCount () const override |
const ICounterMappings & | GetCounterMappings () const override |
IRegisterCounterMapping & | GetCounterMappingRegistry () |
bool | IsProfilingEnabled () const override |
CaptureData | GetCaptureData () override |
void | SetCaptureData (uint32_t capturePeriod, const std::vector< uint16_t > &counterIds, const std::set< BackendId > &activeBackends) |
void | SetCounterValue (uint16_t counterUid, uint32_t value) override |
uint32_t | AddCounterValue (uint16_t counterUid, uint32_t value) override |
uint32_t | SubtractCounterValue (uint16_t counterUid, uint32_t value) override |
uint32_t | IncrementCounterValue (uint16_t counterUid) override |
ProfilingDynamicGuid | NextGuid () override |
Return the next random Guid in the sequence. More... | |
ProfilingStaticGuid | GenerateStaticId (const std::string &str) override |
Create a ProfilingStaticGuid based on a hash of the string. More... | |
std::unique_ptr< ISendTimelinePacket > | GetSendTimelinePacket () const override |
ISendCounterPacket & | GetSendCounterPacket () override |
bool | IsEnabled () |
Check if the profiling is enabled. More... | |
Public Member Functions inherited from IReadWriteCounterValues | |
virtual | ~IReadWriteCounterValues () |
Public Member Functions inherited from IReadCounterValues | |
virtual | ~IReadCounterValues () |
Public Member Functions inherited from IWriteCounterValues | |
virtual | ~IWriteCounterValues () |
Public Member Functions inherited from IProfilingService | |
virtual | ~IProfilingService () |
Public Member Functions inherited from IProfilingGuidGenerator | |
virtual | ~IProfilingGuidGenerator () |
Static Public Member Functions | |
static ProfilingService & | Instance () |
Protected Member Functions | |
ProfilingService () | |
~ProfilingService () | |
void | SwapProfilingConnectionFactory (ProfilingService &instance, IProfilingConnectionFactory *other, IProfilingConnectionFactory *&backup) |
IProfilingConnection * | GetProfilingConnection (ProfilingService &instance) |
void | TransitionToState (ProfilingService &instance, ProfilingState newState) |
bool | WaitForPacketSent (ProfilingService &instance, uint32_t timeout=1000) |
BufferManager & | GetBufferManager (ProfilingService &instance) |
Definition at line 42 of file ProfilingService.hpp.
using CounterIndices = std::vector<std::atomic<uint32_t>*> |
Definition at line 48 of file ProfilingService.hpp.
using CounterValues = std::list<std::atomic<uint32_t> > |
Definition at line 49 of file ProfilingService.hpp.
Definition at line 45 of file ProfilingService.hpp.
using IProfilingConnectionFactoryPtr = std::unique_ptr<IProfilingConnectionFactory> |
Definition at line 46 of file ProfilingService.hpp.
using IProfilingConnectionPtr = std::unique_ptr<IProfilingConnection> |
Definition at line 47 of file ProfilingService.hpp.
|
inlineprotected |
Definition at line 160 of file ProfilingService.hpp.
References CommandHandlerRegistry::RegisterFunctor(), and ProfilingService::~ProfilingService().
Referenced by ProfilingService::IsEnabled().
|
protected |
Definition at line 454 of file ProfilingService.cpp.
Referenced by ProfilingService::ProfilingService().
void AddBackendProfilingContext | ( | const BackendId | backendId, |
std::shared_ptr< armnn::profiling::IBackendProfilingContext > | profilingContext | ||
) |
Definition at line 191 of file ProfilingService.cpp.
Referenced by ProfilingService::Instance(), and Runtime::Runtime().
|
overridevirtual |
Implements IWriteCounterValues.
Definition at line 262 of file ProfilingService.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and ProfilingService::Instance().
ProfilingState ConfigureProfilingService | ( | const ExternalProfilingOptions & | options, |
bool | resetProfilingService = false |
||
) |
Definition at line 39 of file ProfilingService.cpp.
References ProfilingStateMachine::GetCurrentState(), IRuntime::CreationOptions::ExternalProfilingOptions::m_EnableProfiling, armnn::profiling::NotConnected, ProfilingService::ResetExternalProfilingOptions(), armnn::profiling::Uninitialised, ProfilingService::Update(), and armnn::profiling::WaitingForAck.
Referenced by BOOST_AUTO_TEST_CASE(), ProfilingService::Instance(), Runtime::Runtime(), and VerifyPostOptimisationStructureTestImpl().
void Disconnect | ( | ) |
Definition at line 170 of file ProfilingService.cpp.
References armnn::profiling::Active, ProfilingStateMachine::GetCurrentState(), armnn::profiling::NotConnected, armnn::profiling::Uninitialised, and armnn::profiling::WaitingForAck.
Referenced by BOOST_AUTO_TEST_CASE(), and ProfilingService::Instance().
|
overridevirtual |
Create a ProfilingStaticGuid based on a hash of the string.
Implements IProfilingGuidGenerator.
Definition at line 291 of file ProfilingService.cpp.
References ProfilingGuidGenerator::GenerateStaticId().
Referenced by BOOST_AUTO_TEST_CASE(), TimelineUtilityMethods::DeclareLabel(), and ProfilingService::Instance().
|
inlineprotected |
Definition at line 249 of file ProfilingService.hpp.
|
overridevirtual |
Implements IProfilingService.
Definition at line 242 of file ProfilingService.cpp.
References Holder::GetCaptureData().
Referenced by ProfilingService::Instance().
|
overridevirtual |
Implements IReadCounterValues.
Definition at line 214 of file ProfilingService.cpp.
References CounterDirectory::GetCounterCount().
Referenced by ProfilingService::Instance().
const ICounterDirectory & GetCounterDirectory | ( | ) | const |
Definition at line 199 of file ProfilingService.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and ProfilingService::Instance().
IRegisterCounterMapping & GetCounterMappingRegistry | ( | ) |
Definition at line 237 of file ProfilingService.cpp.
Referenced by ProfilingService::Instance(), and RegisterBackendCounters::RegisterCounter().
|
overridevirtual |
Implements IProfilingService.
Definition at line 232 of file ProfilingService.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), BackendProfiling::GetActiveCounters(), and ProfilingService::Instance().
ICounterRegistry & GetCounterRegistry | ( | ) |
Definition at line 204 of file ProfilingService.cpp.
Referenced by ProfilingService::Instance().
|
overridevirtual |
Implements IReadCounterValues.
Definition at line 224 of file ProfilingService.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), ProfilingService::Instance(), and while().
ProfilingState GetCurrentState | ( | ) | const |
Definition at line 209 of file ProfilingService.cpp.
References ProfilingStateMachine::GetCurrentState().
Referenced by BOOST_AUTO_TEST_CASE(), ProfilingService::Instance(), and while().
|
inlineprotected |
Definition at line 236 of file ProfilingService.hpp.
|
inlineoverridevirtual |
Implements IProfilingService.
Definition at line 106 of file ProfilingService.hpp.
|
overridevirtual |
Implements IProfilingService.
Definition at line 296 of file ProfilingService.cpp.
References CounterDirectory::Clear(), TimelinePacketWriterFactory::GetSendTimelinePacket(), CounterDirectory::IsCategoryRegistered(), CounterDirectory::IsCounterRegistered(), ProfilingService::IsCounterRegistered(), Counter::m_Uid, armnn::profiling::NotConnected, CounterDirectory::RegisterCategory(), CounterDirectory::RegisterCounter(), BufferManager::Reset(), ProfilingStateMachine::Reset(), CounterIdMap::Reset(), SendThread::Stop(), CommandHandler::Stop(), PeriodicCounterCapture::Stop(), and ProfilingStateMachine::TransitionToState().
Referenced by BOOST_AUTO_TEST_CASE(), TimelineUtilityMethods::GetTimelineUtils(), and ProfilingService::Instance().
|
overridevirtual |
Implements IWriteCounterValues.
Definition at line 278 of file ProfilingService.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), BackendRegistry::Deregister(), LoadedNetwork::EnqueueWorkload(), ProfilingService::Instance(), Runtime::LoadNetwork(), BackendRegistry::Register(), Runtime::UnloadNetwork(), and while().
|
inlinestatic |
Definition at line 52 of file ProfilingService.hpp.
References ProfilingService::AddBackendProfilingContext(), ProfilingService::AddCounterValue(), ProfilingService::ConfigureProfilingService(), ProfilingService::Disconnect(), ProfilingService::GenerateStaticId(), ProfilingService::GetCaptureData(), ProfilingService::GetCounterCount(), ProfilingService::GetCounterDirectory(), ProfilingService::GetCounterMappingRegistry(), ProfilingService::GetCounterMappings(), ProfilingService::GetCounterRegistry(), ProfilingService::GetCounterValue(), ProfilingService::GetCurrentState(), ProfilingService::GetSendTimelinePacket(), ProfilingService::IncrementCounterValue(), ProfilingService::IsCounterRegistered(), ProfilingService::IsProfilingEnabled(), ProfilingService::NextGuid(), options, ProfilingService::ResetExternalProfilingOptions(), ProfilingService::SetCaptureData(), ProfilingService::SetCounterValue(), ProfilingService::SubtractCounterValue(), and ProfilingService::Update().
Referenced by BOOST_AUTO_TEST_CASE(), TimelineUtilityMethods::CreateConnectionRelationship(), TimelineUtilityMethods::CreateNamedTypedChildEntity(), TimelineUtilityMethods::CreateNamedTypedEntity(), TimelineUtilityMethods::CreateRelationship(), TimelineUtilityMethods::DeclareLabel(), BackendRegistry::Deregister(), LoadedNetwork::EnqueueWorkload(), SwapProfilingConnectionFactoryHelper::ForceTransitionToState(), BackendProfiling::GetActiveCounters(), SwapProfilingConnectionFactoryHelper::GetMockProfilingConnection(), ProfilingServiceRuntimeHelper::GetProfilingBufferManager(), TimelineUtilityMethods::GetTimelineUtils(), Runtime::LoadNetwork(), TimelineUtilityMethods::MarkEntityWithLabel(), TimelineUtilityMethods::MarkEntityWithType(), TimelineUtilityMethods::RecordEvent(), TimelineUtilityMethods::RecordWorkloadInferenceAndStartOfLifeEvent(), BackendRegistry::Register(), RegisterBackendCounters::RegisterCounter(), Runtime::Runtime(), SwapProfilingConnectionFactoryHelper::SwapProfilingConnectionFactoryHelper(), Runtime::UnloadNetwork(), VerifyPostOptimisationStructureTestImpl(), SwapProfilingConnectionFactoryHelper::WaitForPacketsSent(), and SwapProfilingConnectionFactoryHelper::~SwapProfilingConnectionFactoryHelper().
|
overridevirtual |
Implements IReadCounterValues.
Definition at line 219 of file ProfilingService.cpp.
Referenced by ProfilingService::GetSendTimelinePacket(), ProfilingService::Instance(), and while().
|
inline |
Check if the profiling is enabled.
Definition at line 112 of file ProfilingService.hpp.
References IRuntime::CreationOptions::ExternalProfilingOptions::m_EnableProfiling, and ProfilingService::ProfilingService().
|
overridevirtual |
Implements IProfilingService.
Definition at line 34 of file ProfilingService.cpp.
References IRuntime::CreationOptions::ExternalProfilingOptions::m_EnableProfiling.
Referenced by ProfilingService::Instance().
|
overridevirtual |
Return the next random Guid in the sequence.
Implements IProfilingGuidGenerator.
Definition at line 286 of file ProfilingService.cpp.
References ProfilingGuidGenerator::NextGuid().
Referenced by BOOST_AUTO_TEST_CASE(), TimelineUtilityMethods::CreateConnectionRelationship(), TimelineUtilityMethods::CreateNamedTypedChildEntity(), TimelineUtilityMethods::CreateNamedTypedEntity(), TimelineUtilityMethods::CreateRelationship(), LoadedNetwork::EnqueueWorkload(), ProfilingService::Instance(), TimelineUtilityMethods::MarkEntityWithLabel(), TimelineUtilityMethods::MarkEntityWithType(), TimelineUtilityMethods::RecordEvent(), and TimelineUtilityMethods::RecordWorkloadInferenceAndStartOfLifeEvent().
void ResetExternalProfilingOptions | ( | const ExternalProfilingOptions & | options, |
bool | resetProfilingService = false |
||
) |
Definition at line 20 of file ProfilingService.cpp.
References options.
Referenced by BOOST_AUTO_TEST_CASE(), ProfilingService::ConfigureProfilingService(), ProfilingService::Instance(), and while().
void SetCaptureData | ( | uint32_t | capturePeriod, |
const std::vector< uint16_t > & | counterIds, | ||
const std::set< BackendId > & | activeBackends | ||
) |
Definition at line 247 of file ProfilingService.cpp.
References Holder::SetCaptureData().
Referenced by BOOST_AUTO_TEST_CASE(), and ProfilingService::Instance().
|
overridevirtual |
Implements IWriteCounterValues.
Definition at line 254 of file ProfilingService.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and ProfilingService::Instance().
|
overridevirtual |
Implements IWriteCounterValues.
Definition at line 270 of file ProfilingService.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and ProfilingService::Instance().
|
inlineprotected |
Definition at line 226 of file ProfilingService.hpp.
|
inlineprotected |
Definition at line 240 of file ProfilingService.hpp.
References ProfilingStateMachine::TransitionToState().
void Update | ( | ) |
Definition at line 89 of file ProfilingService.cpp.
References armnn::profiling::Active, ARMNN_LOG, ProfilingStateMachine::GetCurrentState(), IRuntime::CreationOptions::ExternalProfilingOptions::m_EnableProfiling, armnn::profiling::NotConnected, SendThread::Start(), CommandHandler::Start(), SendThread::Stop(), CommandHandler::Stop(), PeriodicCounterCapture::Stop(), ProfilingStateMachine::TransitionToState(), armnn::profiling::Uninitialised, armnn::profiling::WaitingForAck, armnn::warning, and Exception::what().
Referenced by BOOST_AUTO_TEST_CASE(), ProfilingService::ConfigureProfilingService(), and ProfilingService::Instance().
|
inlineprotected |
Definition at line 244 of file ProfilingService.hpp.
References SendThread::WaitForPacketSent().
Referenced by SwapProfilingConnectionFactoryHelper::WaitForPacketsSent().