diff options
author | Noah Falk <noahfalk@users.noreply.github.com> | 2019-06-21 15:27:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-21 15:27:21 -0700 |
commit | 961e8d7bd1bdd058ee5f8f34937e9f3f9d80b65b (patch) | |
tree | 06c18fd142f826966f051c908252089e6e5ec55b /src/vm/eventpipeprotocolhelper.cpp | |
parent | 205e01fc5020f597ee69643c24fd56268cdf1b50 (diff) | |
download | coreclr-961e8d7bd1bdd058ee5f8f34937e9f3f9d80b65b.tar.gz coreclr-961e8d7bd1bdd058ee5f8f34937e9f3f9d80b65b.tar.bz2 coreclr-961e8d7bd1bdd058ee5f8f34937e9f3f9d80b65b.zip |
Add EventPipe Processor Number support and make NetTrace the default … (#25276)
* Add EventPipe Processor Number support and make NetTrace the default format
The EventPipe header now has a Processor Number field. On windows we query the correct value, on other OSes we currently have a -1 placeholder, but the field is written to the format regardless.
NetTrace is now the default format when using the environment variable, and the format must be explicitly configured when using the IPC channel or managed API. A parallel change in the diagnostics repo is changing dotnet-trace and dotnet-counter to specify nettrace format which means .NET devs should see nettrace almost exclusively from now on. If for whatever reason it is needed, NetPerf remains available if a scenario explicitly requests to use it.
* PR feedback + attempting to fix broken tests
Diffstat (limited to 'src/vm/eventpipeprotocolhelper.cpp')
-rw-r--r-- | src/vm/eventpipeprotocolhelper.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/vm/eventpipeprotocolhelper.cpp b/src/vm/eventpipeprotocolhelper.cpp index 00de406dd4..de5d1df105 100644 --- a/src/vm/eventpipeprotocolhelper.cpp +++ b/src/vm/eventpipeprotocolhelper.cpp @@ -32,6 +32,12 @@ static bool TryParseCircularBufferSize(uint8_t*& bufferCursor, uint32_t& bufferL return CanParse && (circularBufferSizeInMB > 0); } +static bool TryParseSerializationFormat(uint8_t*& bufferCursor, uint32_t& bufferLen, EventPipeSerializationFormat& serializationFormat) +{ + const bool CanParse = TryParse(bufferCursor, bufferLen, (uint32_t&)serializationFormat); + return CanParse && (0 <= (int)serializationFormat) && ((int)serializationFormat < (int)EventPipeSerializationFormat::Count); +} + const EventPipeCollectTracingCommandPayload* EventPipeCollectTracingCommandPayload::TryParse(BYTE* lpBuffer, uint16_t& BufferSize) { CONTRACTL @@ -54,6 +60,7 @@ const EventPipeCollectTracingCommandPayload* EventPipeCollectTracingCommandPaylo uint8_t* pBufferCursor = payload->incomingBuffer; uint32_t bufferLen = BufferSize; if (!TryParseCircularBufferSize(pBufferCursor, bufferLen, payload->circularBufferSizeInMB) || + !TryParseSerializationFormat(pBufferCursor, bufferLen, payload->serializationFormat) || !TryParseString(pBufferCursor, bufferLen, payload->outputPath) || !EventPipeProtocolHelper::TryParseProviderConfiguration(pBufferCursor, bufferLen, payload->providerConfigs)) { @@ -187,21 +194,13 @@ void EventPipeProtocolHelper::CollectTracing(DiagnosticsIpc::IpcMessage& message return; } - // IPC should produce nettrace by default or be selectable via protocol - // but this is a simple starting point for testing - EventPipeSerializationFormat format = EventPipeSerializationFormat::NetPerfV3; - if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_EventPipeNetTraceFormat) > 0) - { - format = EventPipeSerializationFormat::NetTraceV4; - } - auto sessionId = EventPipe::Enable( nullptr, // strOutputPath (ignored in this scenario) payload->circularBufferSizeInMB, // circularBufferSizeInMB payload->providerConfigs.Ptr(), // pConfigs static_cast<uint32_t>(payload->providerConfigs.Size()), // numConfigs EventPipeSessionType::IpcStream, // EventPipeSessionType - format, // EventPipeSerializationFormat + payload->serializationFormat, // EventPipeSerializationFormat pStream); // IpcStream if (sessionId == 0) |