Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -0,0 +1,160 @@
//------------------------------------------------------------------------------
// <copyright file="etwprovider.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <OWNER>[....]</OWNER>
//------------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
using System.Diagnostics.Contracts;
namespace System.Diagnostics.Tracing
{
[StructLayout(LayoutKind.Explicit, Size = 16)]
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
internal struct EventDescriptor
{
# region private
[FieldOffset(0)]
private ushort m_id;
[FieldOffset(2)]
private byte m_version;
[FieldOffset(3)]
private byte m_channel;
[FieldOffset(4)]
private byte m_level;
[FieldOffset(5)]
private byte m_opcode;
[FieldOffset(6)]
private ushort m_task;
[FieldOffset(8)]
private long m_keywords;
#endregion
public EventDescriptor(
int id,
byte version,
byte channel,
byte level,
byte opcode,
int task,
long keywords
)
{
if (id < 0)
{
throw new ArgumentOutOfRangeException("id", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
}
if (id > ushort.MaxValue)
{
throw new ArgumentOutOfRangeException("id", Environment.GetResourceString("ArgumentOutOfRange_NeedValidId", 1, ushort.MaxValue));
}
m_id = (ushort)id;
m_version = version;
m_channel = channel;
m_level = level;
m_opcode = opcode;
m_keywords = keywords;
if (id < 0)
{
throw new ArgumentOutOfRangeException("task", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
}
if (id > ushort.MaxValue)
{
throw new ArgumentOutOfRangeException("task", Environment.GetResourceString("ArgumentOutOfRange_NeedValidId", 1, ushort.MaxValue));
}
m_task = (ushort)task;
}
public int EventId {
get {
return m_id;
}
}
public byte Version
{
get
{
return m_version;
}
}
public byte Channel
{
get
{
return m_channel;
}
}
public byte Level
{
get
{
return m_level;
}
}
public byte Opcode
{
get
{
return m_opcode;
}
}
public int Task
{
get
{
return m_task;
}
}
public long Keywords
{
get
{
return m_keywords;
}
}
public override bool Equals(object obj)
{
if (!(obj is EventDescriptor))
return false;
return Equals((EventDescriptor) obj);
}
public override int GetHashCode()
{
return m_id ^ m_version ^ m_channel ^ m_level ^ m_opcode ^ m_task ^ (int)m_keywords;
}
public bool Equals(EventDescriptor other)
{
if ((m_id != other.m_id) ||
(m_version != other.m_version) ||
(m_channel != other.m_channel) ||
(m_level != other.m_level) ||
(m_opcode != other.m_opcode) ||
(m_task != other.m_task) ||
(m_keywords != other.m_keywords))
{
return false;
}
return true;
}
public static bool operator ==(EventDescriptor event1, EventDescriptor event2)
{
return event1.Equals(event2);
}
public static bool operator !=(EventDescriptor event1, EventDescriptor event2)
{
return !event1.Equals(event2);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
b1b7786df7e252f1c86a96303144059702326bfa

View File

@@ -0,0 +1,27 @@
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
// <OWNER>[....]</OWNER>
/*============================================================
**
** File: EventSourceException.cs
**
============================================================*/
using System;
using System.Runtime.Serialization;
namespace System.Diagnostics.Tracing
{
[Serializable]
public class EventSourceException : Exception
{
public EventSourceException() : base(Environment.GetResourceString("EventSource_ListenerWriteFailure")) { }
public EventSourceException(string message) : base(message) { }
public EventSourceException(string message, Exception innerException) : base(message, innerException) { }
protected EventSourceException(SerializationInfo info, StreamingContext context) : base(info, context) { }
internal EventSourceException(Exception innerException) : base(Environment.GetResourceString("EventSource_ListenerWriteFailure"), innerException) { }
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,155 @@
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
// <OWNER>[....]</OWNER>
/*============================================================
**
** File: winmeta.cs
**
** Purpose:
** Contains eventing constants defined by the Windows
** environment.
**
============================================================*/
namespace System.Diagnostics.Tracing {
/// <summary>
/// WindowsEventLevel
/// </summary>
public enum EventLevel {
/// <summary>
/// Log always
/// </summary>
LogAlways = 0,
/// <summary>
/// Only critical errors
/// </summary>
Critical,
/// <summary>
/// All errors, including previous levels
/// </summary>
Error,
/// <summary>
/// All warnings, including previous levels
/// </summary>
Warning,
/// <summary>
/// All informational events, including previous levels
/// </summary>
Informational,
/// <summary>
/// All events, including previous levels
/// </summary>
Verbose
}
/// <summary>
/// WindowsEventTask
/// </summary>
[System.Runtime.CompilerServices.FriendAccessAllowed]
public enum EventTask {
/// <summary>
/// Undefined task
/// </summary>
None = 0
}
/// <summary>
/// EventOpcode
/// </summary>
[System.Runtime.CompilerServices.FriendAccessAllowed]
public enum EventOpcode {
/// <summary>
/// An informational event
/// </summary>
Info = 0,
/// <summary>
/// An activity start event
/// </summary>
Start,
/// <summary>
/// An activity end event
/// </summary>
Stop,
/// <summary>
/// A trace collection start event
/// </summary>
DataCollectionStart,
/// <summary>
/// A trace collection end event
/// </summary>
DataCollectionStop,
/// <summary>
/// An extensional event
/// </summary>
Extension,
/// <summary>
/// A reply event
/// </summary>
Reply,
/// <summary>
/// An event representing the activity resuming from the suspension
/// </summary>
Resume,
/// <summary>
/// An event representing the activity is suspended, pending another activity's completion
/// </summary>
Suspend,
/// <summary>
/// An event representing the activity is transferred to another component, and can continue to work
/// </summary>
Send,
/// <summary>
/// An event representing receiving an activity transfer from another component
/// </summary>
Receive = 240
}
#if FEARURE_MANAGED_ETW_CHANNELS
// Added for CLR V4
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32", Justification="Backwards compatibility")]
[System.Runtime.CompilerServices.FriendAccessAllowed]
public enum EventChannel : byte
{
Default = 0,
};
#endif
/// <summary>
/// EventOpcode
/// </summary>
[Flags]
public enum EventKeywords : long {
/// <summary>
/// Wild card value
/// </summary>
None = 0x0,
/// <summary>
/// WDI context events
/// </summary>
WdiContext = 0x02000000000000,
/// <summary>
/// WDI diagnostic events
/// </summary>
WdiDiagnostic = 0x04000000000000,
/// <summary>
/// SQM events
/// </summary>
Sqm = 0x08000000000000,
/// <summary>
/// FAiled security audits
/// </summary>
AuditFailure = 0x10000000000000,
/// <summary>
/// Successful security audits
/// </summary>
AuditSuccess = 0x20000000000000,
/// <summary>
/// Transfer events where the related Activity ID is a computed value and not a GUID
/// </summary>
CorrelationHint = 0x10000000000000,
/// <summary>
/// Events raised using classic eventlog API
/// </summary>
EventLogClassic = 0x80000000000000
}
}