summaryrefslogtreecommitdiff
path: root/src/vm/eventpipeconfiguration.h
diff options
context:
space:
mode:
authorJosé Rivero <jorive@microsoft.com>2019-03-18 10:23:30 -0700
committerGitHub <noreply@github.com>2019-03-18 10:23:30 -0700
commit4497df34cbe3d8bf7a21828714a3cf764da16e98 (patch)
tree894fc03e621e498cf6b5b33a34fdbb3c63c7d10a /src/vm/eventpipeconfiguration.h
parentb88f2f635b02c130ae00b4d8aee3e766a60698d5 (diff)
downloadcoreclr-4497df34cbe3d8bf7a21828714a3cf764da16e98.tar.gz
coreclr-4497df34cbe3d8bf7a21828714a3cf764da16e98.tar.bz2
coreclr-4497df34cbe3d8bf7a21828714a3cf764da16e98.zip
[EventPipe] Adding an IPC server to handle out of process communication. (#23106)
This is the first commit to enable a "diagnostic port" using IPC (Named Pipe on Windows and Unix Domain Socket on other platforms). This change currently enable EventPipe to be enabled/disabled without the use of a file drop. - Split the DiagnosticsIpc into (DiagnosticsIpc/IpcStream) - DiagnosticsIpc (IPC listener) is meant to be used by the Diagnostic server. - IpcStream (IPC channel) is meant to be use to communicate with the connected client. - Change the FastSerializer dependency from `CFileStream` to `StreamWriter` This abstraction is meant decouple the writing of objects in order to extend its usability. The main objective is to reuse FastSerializer to stream data through the open IPC channel. - Moved the EventPipeSessionProvider* classes to their own file. - Added a more streamlined parsing achievable by defining a simpler binary protocol (by noahfalk). 1. Only one allocation is needed for the EventPipeProviderConfiguration array, no allocations or copies are needed for strings because we can refer to them directly out of the incoming command buffer 2. No change to the EventPipe API for enable is required. EventPipeProviderConfiguration retains its current behavior of not deleting the string pointers it holds. 3. No leaks happen because the command buffer owns the string memory and ensures that it stays alive for the duration of the Enable() call.
Diffstat (limited to 'src/vm/eventpipeconfiguration.h')
-rw-r--r--src/vm/eventpipeconfiguration.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/vm/eventpipeconfiguration.h b/src/vm/eventpipeconfiguration.h
index 5eec76ca80..6021305b82 100644
--- a/src/vm/eventpipeconfiguration.h
+++ b/src/vm/eventpipeconfiguration.h
@@ -13,10 +13,8 @@ class EventPipeSessionProvider;
class EventPipeEvent;
class EventPipeEventInstance;
class EventPipeProvider;
-struct EventPipeProviderConfiguration;
class EventPipeSession;
enum class EventPipeSessionType;
-class EventPipeSessionProvider;
enum class EventPipeEventLevel
{
@@ -31,7 +29,6 @@ enum class EventPipeEventLevel
class EventPipeConfiguration
{
public:
-
EventPipeConfiguration();
~EventPipeConfiguration();
@@ -39,7 +36,7 @@ public:
void Initialize();
// Create a new provider.
- EventPipeProvider* CreateProvider(const SString &providerName, EventPipeCallback pCallbackFunction, void *pCallbackData);
+ EventPipeProvider *CreateProvider(const SString &providerName, EventPipeCallback pCallbackFunction, void *pCallbackData);
// Delete a provider.
void DeleteProvider(EventPipeProvider *pProvider);
@@ -51,10 +48,15 @@ public:
bool UnregisterProvider(EventPipeProvider &provider);
// Get the provider with the specified provider ID if it exists.
- EventPipeProvider* GetProvider(const SString &providerID);
+ EventPipeProvider *GetProvider(const SString &providerID);
// Create a new session.
- EventPipeSession* CreateSession(EventPipeSessionType sessionType, unsigned int circularBufferSizeInMB, EventPipeProviderConfiguration *pProviders, unsigned int numProviders, UINT64 multiFileTraceLengthInSeconds = 0);
+ EventPipeSession *CreateSession(
+ EventPipeSessionType sessionType,
+ unsigned int circularBufferSizeInMB,
+ const EventPipeProviderConfiguration *pProviders,
+ uint32_t numProviders,
+ uint64_t multiFileTraceLengthInSeconds = 0);
// Delete a session.
void DeleteSession(EventPipeSession *pSession);
@@ -78,7 +80,7 @@ public:
void EnableRundown(EventPipeSession *pSession);
// Get the event used to write metadata to the event stream.
- EventPipeEventInstance* BuildEventMetadataEvent(EventPipeEventInstance &sourceInstance, unsigned int metdataId);
+ EventPipeEventInstance *BuildEventMetadataEvent(EventPipeEventInstance &sourceInstance, unsigned int metdataId);
// Delete deferred providers.
void DeleteDeferredProviders();
@@ -93,12 +95,11 @@ public:
}
private:
-
// Get the provider without taking the lock.
- EventPipeProvider* GetProviderNoLock(const SString &providerID);
+ EventPipeProvider *GetProviderNoLock(const SString &providerID);
// Get the enabled provider.
- EventPipeSessionProvider* GetSessionProvider(EventPipeSession *pSession, EventPipeProvider *pProvider);
+ EventPipeSessionProvider *GetSessionProvider(EventPipeSession *pSession, EventPipeProvider *pProvider);
// The one and only EventPipe session.
EventPipeSession *m_pSession;
@@ -107,7 +108,7 @@ private:
Volatile<bool> m_enabled;
// The list of event pipe providers.
- SList<SListElem<EventPipeProvider*>> *m_pProviderList;
+ SList<SListElem<EventPipeProvider *>> *m_pProviderList;
// The provider used to write configuration events to the event stream.
EventPipeProvider *m_pConfigProvider;
@@ -117,7 +118,7 @@ private:
// The provider name for the configuration event pipe provider.
// This provider is used to emit configuration events.
- const static WCHAR* s_configurationProviderName;
+ const static WCHAR *s_configurationProviderName;
// True if rundown is enabled.
Volatile<bool> m_rundownEnabled;