diff options
author | Brian Robbins <brianrob@microsoft.com> | 2017-05-12 10:51:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-12 10:51:31 -0700 |
commit | fca97d0ca72524b3bdd61817f7a172dd47d53287 (patch) | |
tree | 2cd8ca575969c94f487e7e9d175099b31fcf6ff6 /src/vm/eventpipeconfiguration.h | |
parent | f70698458849e3541dc96fac8d6c0d6b52ccf048 (diff) | |
download | coreclr-fca97d0ca72524b3bdd61817f7a172dd47d53287.tar.gz coreclr-fca97d0ca72524b3bdd61817f7a172dd47d53287.tar.bz2 coreclr-fca97d0ca72524b3bdd61817f7a172dd47d53287.zip |
EventPipe Circular Buffer Support and Ability to Start/Stop Tracing (#11507)
Diffstat (limited to 'src/vm/eventpipeconfiguration.h')
-rw-r--r-- | src/vm/eventpipeconfiguration.h | 92 |
1 files changed, 90 insertions, 2 deletions
diff --git a/src/vm/eventpipeconfiguration.h b/src/vm/eventpipeconfiguration.h index a2377757d4..baa9b3bd23 100644 --- a/src/vm/eventpipeconfiguration.h +++ b/src/vm/eventpipeconfiguration.h @@ -8,9 +8,22 @@ #include "slist.h" +class EventPipeEnabledProvider; +class EventPipeEnabledProviderList; class EventPipeEvent; class EventPipeEventInstance; class EventPipeProvider; +struct EventPipeProviderConfiguration; + +enum class EventPipeEventLevel +{ + LogAlways, + Critical, + Error, + Warning, + Informational, + Verbose +}; class EventPipeConfiguration { @@ -31,20 +44,42 @@ public: // Get the provider with the specified provider ID if it exists. EventPipeProvider* GetProvider(const GUID &providerID); + // Get the configured size of the circular buffer. + size_t GetCircularBufferSize() const; + + // Set the configured size of the circular buffer. + void SetCircularBufferSize(size_t circularBufferSize); + // Enable the event pipe. - void Enable(); + void Enable( + uint circularBufferSizeInMB, + EventPipeProviderConfiguration *pProviders, + int numProviders); // Disable the event pipe. void Disable(); + // Get the status of the event pipe. + bool Enabled() const; + // Get the event used to write metadata to the event stream. - EventPipeEventInstance* BuildEventMetadataEvent(EventPipeEvent &sourceEvent, BYTE *pPayloadData = NULL, unsigned int payloadLength = 0); + EventPipeEventInstance* BuildEventMetadataEvent(EventPipeEventInstance &sourceInstance, BYTE *pPayloadData = NULL, unsigned int payloadLength = 0); private: // Get the provider without taking the lock. EventPipeProvider* GetProviderNoLock(const GUID &providerID); + // Determines whether or not the event pipe is enabled. + Volatile<bool> m_enabled; + + // The configured size of the circular buffer. + size_t m_circularBufferSizeInBytes; + + // EventPipeConfiguration only supports a single session. + // This is the set of configurations for each enabled provider. + EventPipeEnabledProviderList *m_pEnabledProviderList; + // The list of event pipe providers. SList<SListElem<EventPipeProvider*>> *m_pProviderList; @@ -59,6 +94,59 @@ private: static const GUID s_configurationProviderID; }; +class EventPipeEnabledProviderList +{ + +private: + + // The number of providers in the list. + unsigned int m_numProviders; + + // The list of providers. + EventPipeEnabledProvider *m_pProviders; + + // A catch-all provider used when tracing is enabled at start-up + // under (COMPlus_PerformanceTracing & 1) == 1. + EventPipeEnabledProvider *m_pCatchAllProvider; + +public: + + // Create a new list based on the input. + EventPipeEnabledProviderList(EventPipeProviderConfiguration *pConfigs, unsigned int numConfigs); + ~EventPipeEnabledProviderList(); + + // Get the enabled provider for the specified provider. + // Return NULL if one doesn't exist. + EventPipeEnabledProvider* GetEnabledProvider(EventPipeProvider *pProvider); +}; + +class EventPipeEnabledProvider +{ +private: + + // The provider name. + WCHAR *m_pProviderName; + + // The enabled keywords. + UINT64 m_keywords; + + // The loging level. + EventPipeEventLevel m_loggingLevel; + +public: + + EventPipeEnabledProvider(); + ~EventPipeEnabledProvider(); + + void Set(LPCWSTR providerName, UINT64 keywords, EventPipeEventLevel loggingLevel); + + LPCWSTR GetProviderName() const; + + UINT64 GetKeywords() const; + + EventPipeEventLevel GetLevel() const; +}; + #endif // FEATURE_PERFTRACING #endif // __EVENTPIPE_CONFIGURATION_H__ |