diff options
author | Brian Robbins <brianrob@microsoft.com> | 2018-01-25 20:29:23 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-25 20:29:23 -0800 |
commit | a118b0571d8ae8bd34c275d02294fa19251345b6 (patch) | |
tree | 505de85259c0263f556d7813fd388abf39eaf2c0 /src/vm/eventpipeconfiguration.h | |
parent | 5c5695fb05c62f42b969cc33119399e6c8fcf04e (diff) | |
download | coreclr-a118b0571d8ae8bd34c275d02294fa19251345b6.tar.gz coreclr-a118b0571d8ae8bd34c275d02294fa19251345b6.tar.bz2 coreclr-a118b0571d8ae8bd34c275d02294fa19251345b6.zip |
Create the concept of EventPipeSession and refactor EventPipe to use it. Also expose COMPlus configuration variables to support session configuration and output file path. (#16018)
Diffstat (limited to 'src/vm/eventpipeconfiguration.h')
-rw-r--r-- | src/vm/eventpipeconfiguration.h | 95 |
1 files changed, 21 insertions, 74 deletions
diff --git a/src/vm/eventpipeconfiguration.h b/src/vm/eventpipeconfiguration.h index baca06920a..d1a8a90c46 100644 --- a/src/vm/eventpipeconfiguration.h +++ b/src/vm/eventpipeconfiguration.h @@ -8,12 +8,13 @@ #include "slist.h" -class EventPipeEnabledProvider; -class EventPipeEnabledProviderList; +class EventPipeSessionProvider; class EventPipeEvent; class EventPipeEventInstance; class EventPipeProvider; struct EventPipeProviderConfiguration; +class EventPipeSession; +class EventPipeSessionProvider; enum class EventPipeEventLevel { @@ -50,20 +51,20 @@ public: // Get the provider with the specified provider ID if it exists. EventPipeProvider* GetProvider(const SString &providerID); + // Create a new session. + EventPipeSession* CreateSession(unsigned int circularBufferSizeInMB, EventPipeProviderConfiguration *pProviders, unsigned int numProviders); + + // Delete a session. + void DeleteSession(EventPipeSession *pSession); + // 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( - unsigned int circularBufferSizeInMB, - EventPipeProviderConfiguration *pProviders, - int numProviders); + // Enable a session in the event pipe. + void Enable(EventPipeSession *pSession); - // Disable the event pipe. - void Disable(); + // Disable a session in the event pipe. + void Disable(EventPipeSession *pSession); // Get the status of the event pipe. bool Enabled() const; @@ -71,8 +72,8 @@ public: // Determine if rundown is enabled. bool RundownEnabled() const; - // Enable the well-defined symbolic rundown configuration. - void EnableRundown(); + // Enable rundown using the specified configuration. + void EnableRundown(EventPipeSession *pSession); // Get the event used to write metadata to the event stream. EventPipeEventInstance* BuildEventMetadataEvent(EventPipeEventInstance &sourceInstance); @@ -85,15 +86,14 @@ private: // Get the provider without taking the lock. EventPipeProvider* GetProviderNoLock(const SString &providerID); - // Determines whether or not the event pipe is enabled. - Volatile<bool> m_enabled; + // Get the enabled provider. + EventPipeSessionProvider* GetSessionProvider(EventPipeSession *pSession, EventPipeProvider *pProvider); - // The configured size of the circular buffer. - size_t m_circularBufferSizeInBytes; + // The one and only EventPipe session. + EventPipeSession *m_pSession; - // EventPipeConfiguration only supports a single session. - // This is the set of configurations for each enabled provider. - EventPipeEnabledProviderList *m_pEnabledProviderList; + // Determines whether or not the event pipe is enabled. + Volatile<bool> m_enabled; // The list of event pipe providers. SList<SListElem<EventPipeProvider*>> *m_pProviderList; @@ -112,59 +112,6 @@ private: Volatile<bool> m_rundownEnabled; }; -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__ |