diff options
author | Victor "Nate" Graf <nategraf1@gmail.com> | 2017-12-20 18:07:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-20 18:07:52 -0800 |
commit | 7524d72d4f0f634fe5407280b83c25181dc8c556 (patch) | |
tree | 119c7edbbd7b3a0aec47d55334d52d1471e3a3da /src/mscorlib/src | |
parent | 9891c8ba8f84ff646455b4493447295c591665f4 (diff) | |
download | coreclr-7524d72d4f0f634fe5407280b83c25181dc8c556.tar.gz coreclr-7524d72d4f0f634fe5407280b83c25181dc8c556.tar.bz2 coreclr-7524d72d4f0f634fe5407280b83c25181dc8c556.zip |
Enable EventPipe across Unix and Windows (#14772)
* [squashed] most work complete to enable EventPipe on Windows
* Eventpipe now builds on Windows
* Ensure evevntpipe is intialized on Windows
* Resolve the location of python from build.cmd
* Ensure eventing files are generated when needed
* moving linkage declaration to cmake
* create new event from constructor
* enable FEATURE_EVENT_TRACE and FEATURE_PERF_TRACE everywhere
* [WIP] checkpoint in fixing contarct errors
* add another possible python location
* Fix double delete bug in EventPipeConfiguration destructor
* Fix typo in function name
* Revert changes to .gitgnore
* bump to netstandard1.6 in preperation for new version of TraceEvent
* Revert changes to groovy files
* revert changes to perf-prep scripts
* add common.h and use nothrow
* Fix issue which was causing double delete of configprovider
* Add new test utilizing TraceEvent
* Remove accidentally added local directory reference
* Add comment to explain the addition of misc/tracepointprovider.cpp
* Add back sys.exit(0) and refactor
* Change conditional to be more direct
* Better handle NULL config
* Initialize m_deleteDefered
* Eliminate obsolete field
* Fix spelling error
* Fix nits
* Make smaple progiler timing functions easier to read
* Move projects back to netstandard1.4
* Incomplete improvements to EventPipeTrace test
* Add event integrity checks to test
* Clean up some left over code
* Add EventSource based test
* Remove unused PAL tests on Windows
* Fix Linux build breaks
* Minor changes to CMake files
* Remove //HACK for hack that was previously removed
* Fix formatting and negate a #ifdef
* Add conditional to ensure PERFTRACING is not enabled without EVENT_TRACE
* Take lock on EventPipeProvider and EventPipeConfiguration destruction
* Load winmm.dll at runtime
* Change function name and compile conditions
* Move typedef into #ifndef
* Use the correct config in setup
* Change lifecycle managment of EventPipeConfiguration's configuration provider
* Enable EventPipe tests pri0 and disable broken tests
* Replace python3 only error with python2 compatable one
* Make common.csproj build pri0
* Change TraceEvent version to 2.0.2 to match published verison
* Address cross build failure
* Remove use of undefined variable
* Add crossgen fix to .cmd
* Use more specific types to avoid marshalling errors
* Use Assert-style statements and remove one check
* Fix cross arch build
* Fix flipped branch
* Bring build.cmd changes to build.sh
* Fix cmake writing
* Revert "Bring build.cmd changes to build.sh"
This reverts commit 893c6492548d8bc9859ebba5b1b810aa630fac63.
* remove stdlib.h
* Fix out of order null check
Diffstat (limited to 'src/mscorlib/src')
-rw-r--r-- | src/mscorlib/src/System/Diagnostics/Eventing/EventPipe.cs | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/EventPipe.cs b/src/mscorlib/src/System/Diagnostics/Eventing/EventPipe.cs index 539c60b55f..ac15202f93 100644 --- a/src/mscorlib/src/System/Diagnostics/Eventing/EventPipe.cs +++ b/src/mscorlib/src/System/Diagnostics/Eventing/EventPipe.cs @@ -15,12 +15,12 @@ namespace System.Diagnostics.Tracing [MarshalAs(UnmanagedType.LPWStr)] private string m_providerName; private UInt64 m_keywords; - private uint m_loggingLevel; + private UInt32 m_loggingLevel; internal EventPipeProviderConfiguration( string providerName, UInt64 keywords, - uint loggingLevel) + UInt32 loggingLevel) { if(string.IsNullOrEmpty(providerName)) { @@ -45,7 +45,7 @@ namespace System.Diagnostics.Tracing get { return m_keywords; } } - internal uint LoggingLevel + internal UInt32 LoggingLevel { get { return m_loggingLevel; } } @@ -54,13 +54,13 @@ namespace System.Diagnostics.Tracing internal sealed class EventPipeConfiguration { private string m_outputFile; - private uint m_circularBufferSizeInMB; + private UInt32 m_circularBufferSizeInMB; private List<EventPipeProviderConfiguration> m_providers; private TimeSpan m_minTimeBetweenSamples = TimeSpan.FromMilliseconds(1); internal EventPipeConfiguration( string outputFile, - uint circularBufferSizeInMB) + UInt32 circularBufferSizeInMB) { if(string.IsNullOrEmpty(outputFile)) { @@ -80,7 +80,7 @@ namespace System.Diagnostics.Tracing get { return m_outputFile; } } - internal uint CircularBufferSizeInMB + internal UInt32 CircularBufferSizeInMB { get { return m_circularBufferSizeInMB; } } @@ -90,13 +90,13 @@ namespace System.Diagnostics.Tracing get { return m_providers.ToArray(); } } - internal long ProfilerSamplingRateInNanoseconds + internal Int64 ProfilerSamplingRateInNanoseconds { // 100 nanoseconds == 1 tick. get { return m_minTimeBetweenSamples.Ticks * 100; } } - internal void EnableProvider(string providerName, UInt64 keywords, uint loggingLevel) + internal void EnableProvider(string providerName, UInt64 keywords, UInt32 loggingLevel) { m_providers.Add(new EventPipeProviderConfiguration( providerName, @@ -124,6 +124,11 @@ namespace System.Diagnostics.Tracing throw new ArgumentNullException(nameof(configuration)); } + if(configuration.Providers == null) + { + throw new ArgumentNullException(nameof(configuration.Providers)); + } + EventPipeProviderConfiguration[] providers = configuration.Providers; EventPipeInternal.Enable( @@ -146,7 +151,7 @@ namespace System.Diagnostics.Tracing // These PInvokes are used by the configuration APIs to interact with EventPipe. // [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - internal static extern void Enable(string outputFile, uint circularBufferSizeInMB, long profilerSamplingRateInNanoseconds, EventPipeProviderConfiguration[] providers, int numProviders); + internal static extern void Enable(string outputFile, UInt32 circularBufferSizeInMB, Int64 profilerSamplingRateInNanoseconds, EventPipeProviderConfiguration[] providers, Int32 numProviders); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] internal static extern void Disable(); @@ -158,15 +163,15 @@ namespace System.Diagnostics.Tracing internal static extern IntPtr CreateProvider(string providerName, UnsafeNativeMethods.ManifestEtw.EtwEnableCallback callbackFunc); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - internal static extern unsafe IntPtr DefineEvent(IntPtr provHandle, uint eventID, Int64 keywords, uint eventVersion, uint level, void *pMetadata, uint metadataLength); + internal static extern unsafe IntPtr DefineEvent(IntPtr provHandle, UInt32 eventID, Int64 keywords, UInt32 eventVersion, UInt32 level, void *pMetadata, UInt32 metadataLength); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] internal static extern void DeleteProvider(IntPtr provHandle); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - internal static extern unsafe void WriteEvent(IntPtr eventHandle, uint eventID, void* pData, uint length, Guid* activityId, Guid* relatedActivityId); + internal static extern unsafe void WriteEvent(IntPtr eventHandle, UInt32 eventID, void* pData, UInt32 length, Guid* activityId, Guid* relatedActivityId); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - internal static extern unsafe void WriteEventData(IntPtr eventHandle, uint eventID, EventProvider.EventData** pEventData, uint dataCount, Guid* activityId, Guid* relatedActivityId); + internal static extern unsafe void WriteEventData(IntPtr eventHandle, UInt32 eventID, EventProvider.EventData** pEventData, UInt32 dataCount, Guid* activityId, Guid* relatedActivityId); } } |