Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Collections / Concurrent / CDSCollectionETWBCLProvider.cs / 1305376 / CDSCollectionETWBCLProvider.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
//
// CDSETWProvider.cs
//
// [....]
//
// A helper class for firing ETW events related to the Coordination Data Structure Collections.
//
// This provider is used by CDS collection primitives in both mscorlib.dll and system.dll. The purpose of sharing
// the provider class is to be able to enable ETW tracing on all CDS collection types with a single ETW provider GUID.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
using System;
using System.Collections.Generic;
using System.Text;
namespace System.Collections.Concurrent
{
#if !FEATURE_PAL // PAL doesn't support eventing
using System.Diagnostics.Eventing;
[System.Runtime.CompilerServices.FriendAccessAllowed]
sealed internal class CDSCollectionETWBCLProvider : EventProviderBase
{
//
// Defines the singleton instance for the CDS ETW provider
//
// The CDS collection Event provider GUID is {35167F8E-49B2-4b96-AB86-435B59336B5E}
//
public static CDSCollectionETWBCLProvider Log = new CDSCollectionETWBCLProvider();
private CDSCollectionETWBCLProvider() : base(new Guid(0x35167f8e, 0x49b2, 0x4b96, 0xab, 0x86, 0x43, 0x5b, 0x59, 0x33, 0x6b, 0x5e)) { }
/////////////////////////////////////////////////////////////////////////////////////
//
// ConcurrentStack Events
//
[Event(1, Level = EventLevel.LogAlways)]
public void ConcurrentStack_FastPushFailed(int spinCount)
{
if (IsEnabled()) WriteEvent(1,spinCount);
}
[Event(2, Level = EventLevel.LogAlways)]
public void ConcurrentStack_FastPopFailed(int spinCount)
{
if (IsEnabled()) WriteEvent(2,spinCount);
}
/////////////////////////////////////////////////////////////////////////////////////
//
// ConcurrentDictionary Events
//
[Event(3, Level = EventLevel.LogAlways)]
public void ConcurrentDictionary_AcquiringAllLocks(int numOfBuckets)
{
if (IsEnabled()) WriteEvent(3, numOfBuckets);
}
//
// Events below this point are used by the CDS types in System.DLL
//
/////////////////////////////////////////////////////////////////////////////////////
//
// ConcurrentBag Events
//
[Event(4, Level = EventLevel.Verbose)]
public void ConcurrentBag_TryTakeSteals()
{
if (IsEnabled(EventLevel.Verbose, ((EventKeywords)(-1)) )) WriteEvent(4);
}
[Event(5, Level = EventLevel.Verbose)]
public void ConcurrentBag_TryPeekSteals()
{
if (IsEnabled(EventLevel.Verbose, ((EventKeywords)(-1)) )) WriteEvent(5);
}
}
#endif // !FEATURE_PAL
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
//
// CDSETWProvider.cs
//
// [....]
//
// A helper class for firing ETW events related to the Coordination Data Structure Collections.
//
// This provider is used by CDS collection primitives in both mscorlib.dll and system.dll. The purpose of sharing
// the provider class is to be able to enable ETW tracing on all CDS collection types with a single ETW provider GUID.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
using System;
using System.Collections.Generic;
using System.Text;
namespace System.Collections.Concurrent
{
#if !FEATURE_PAL // PAL doesn't support eventing
using System.Diagnostics.Eventing;
[System.Runtime.CompilerServices.FriendAccessAllowed]
sealed internal class CDSCollectionETWBCLProvider : EventProviderBase
{
//
// Defines the singleton instance for the CDS ETW provider
//
// The CDS collection Event provider GUID is {35167F8E-49B2-4b96-AB86-435B59336B5E}
//
public static CDSCollectionETWBCLProvider Log = new CDSCollectionETWBCLProvider();
private CDSCollectionETWBCLProvider() : base(new Guid(0x35167f8e, 0x49b2, 0x4b96, 0xab, 0x86, 0x43, 0x5b, 0x59, 0x33, 0x6b, 0x5e)) { }
/////////////////////////////////////////////////////////////////////////////////////
//
// ConcurrentStack Events
//
[Event(1, Level = EventLevel.LogAlways)]
public void ConcurrentStack_FastPushFailed(int spinCount)
{
if (IsEnabled()) WriteEvent(1,spinCount);
}
[Event(2, Level = EventLevel.LogAlways)]
public void ConcurrentStack_FastPopFailed(int spinCount)
{
if (IsEnabled()) WriteEvent(2,spinCount);
}
/////////////////////////////////////////////////////////////////////////////////////
//
// ConcurrentDictionary Events
//
[Event(3, Level = EventLevel.LogAlways)]
public void ConcurrentDictionary_AcquiringAllLocks(int numOfBuckets)
{
if (IsEnabled()) WriteEvent(3, numOfBuckets);
}
//
// Events below this point are used by the CDS types in System.DLL
//
/////////////////////////////////////////////////////////////////////////////////////
//
// ConcurrentBag Events
//
[Event(4, Level = EventLevel.Verbose)]
public void ConcurrentBag_TryTakeSteals()
{
if (IsEnabled(EventLevel.Verbose, ((EventKeywords)(-1)) )) WriteEvent(4);
}
[Event(5, Level = EventLevel.Verbose)]
public void ConcurrentBag_TryPeekSteals()
{
if (IsEnabled(EventLevel.Verbose, ((EventKeywords)(-1)) )) WriteEvent(5);
}
}
#endif // !FEATURE_PAL
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ApplicationFileParser.cs
- ScaleTransform.cs
- StreamReader.cs
- XmlHelper.cs
- ServiceMemoryGates.cs
- RtfNavigator.cs
- TableLayoutPanelCellPosition.cs
- AxImporter.cs
- SqlComparer.cs
- ResourcePart.cs
- GridViewDesigner.cs
- FormatterConverter.cs
- AssertFilter.cs
- MessageSmuggler.cs
- X509CertificateChain.cs
- PrintDocument.cs
- SystemIPInterfaceStatistics.cs
- Function.cs
- SamlAuthorityBinding.cs
- HttpCachePolicyBase.cs
- MimeMapping.cs
- PointLightBase.cs
- TypeConverterHelper.cs
- SessionParameter.cs
- FreezableOperations.cs
- EntityContainerEntitySet.cs
- DbDataAdapter.cs
- CommandValueSerializer.cs
- FontEmbeddingManager.cs
- ControlCachePolicy.cs
- Calendar.cs
- SynchronizationLockException.cs
- DataExpression.cs
- wgx_sdk_version.cs
- KeySplineConverter.cs
- KerberosReceiverSecurityToken.cs
- WebPartActionVerb.cs
- ModelUIElement3D.cs
- SingleAnimationUsingKeyFrames.cs
- XPathAxisIterator.cs
- DelegatingStream.cs
- DesignerCalendarAdapter.cs
- ZipIOCentralDirectoryFileHeader.cs
- MonitorWrapper.cs
- DefinitionBase.cs
- UIInitializationException.cs
- LogEntrySerializer.cs
- SqlInfoMessageEvent.cs
- TextRunCacheImp.cs
- WpfMemberInvoker.cs
- InternalRelationshipCollection.cs
- _IPv6Address.cs
- RuntimeArgument.cs
- RadioButtonBaseAdapter.cs
- WebPartVerb.cs
- PackageStore.cs
- DelegateBodyWriter.cs
- XmlJsonReader.cs
- NameValueSectionHandler.cs
- XmlUtilWriter.cs
- ComponentManagerBroker.cs
- FixedSchema.cs
- ValueType.cs
- FixedHyperLink.cs
- UserControl.cs
- MtomMessageEncodingElement.cs
- XmlSerializationReader.cs
- ConstructorArgumentAttribute.cs
- OdbcParameter.cs
- ExtensionWindowHeader.cs
- QilGenerator.cs
- DataGridViewLayoutData.cs
- CodeDomConfigurationHandler.cs
- ResourceCodeDomSerializer.cs
- XmlValidatingReaderImpl.cs
- MetadataCache.cs
- RegexGroup.cs
- SQLInt64.cs
- MultipartContentParser.cs
- SubMenuStyleCollection.cs
- PlatformNotSupportedException.cs
- ScrollChrome.cs
- LoadRetryStrategyFactory.cs
- Visitors.cs
- EntityContainer.cs
- CreateUserErrorEventArgs.cs
- InvokePattern.cs
- ErrorFormatter.cs
- FragmentQueryProcessor.cs
- ObjectNavigationPropertyMapping.cs
- ColumnResult.cs
- log.cs
- ComponentGuaranteesAttribute.cs
- SystemEvents.cs
- DuplexChannel.cs
- recordstate.cs
- PointConverter.cs
- HtmlDocument.cs
- CompilationRelaxations.cs
- RawStylusInputReport.cs