Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ namespace System.Diagnostics
///
/// See the DiagnosticSourceEventSourceBridgeTest.cs for more explicit examples of using this bridge.
/// </summary>
[EventSource(Name = "Microsoft-Diagnostics-DiagnosticSource")]
[EventSource(Name = DiagnosticSourceEventSourceName)]
internal sealed class DiagnosticSourceEventSource : EventSource
{
private const string DiagnosticSourceEventSourceName = "Microsoft-Diagnostics-DiagnosticSource";

public static readonly DiagnosticSourceEventSource Log = new DiagnosticSourceEventSource();

public static class Keywords
Expand Down Expand Up @@ -405,7 +407,7 @@ protected override void OnEventCommand(EventCommandEventArgs command)
private DiagnosticSourceEventSource()
// This constructor uses EventSourceSettings which is only available on V4.6 and above
// Use the EventSourceSettings to turn on support for complex types, if available (v4.6 and above).
: base(EventSourceSettings.EtwSelfDescribingEventFormat)
: base(DiagnosticSourceEventSourceName, EventSourceSettings.EtwSelfDescribingEventFormat)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ namespace System.Diagnostics.Metrics
/// not counting the special zero bucket. The default value is 160.
/// o reportDeltas - If true, the histogram will report deltas instead of whole accumulated values. The default value is false.
/// </summary>
[EventSource(Name = "System.Diagnostics.Metrics")]
[EventSource(Name = MetricsEventSourceName)]
internal sealed class MetricsEventSource : EventSource
{
private const string MetricsEventSourceName = "System.Diagnostics.Metrics";

public static readonly MetricsEventSource Log = new();

// Although this API isn't public, it is invoked via reflection from System.Private.CoreLib and needs the same back-compat
Expand Down Expand Up @@ -96,7 +98,10 @@ private CommandHandler Handler
}
}

private MetricsEventSource() { }
private MetricsEventSource()
: base(MetricsEventSourceName, EventSourceSettings.EtwManifestEventFormat)
{
}

/// <summary>
/// Used to send ad-hoc diagnostics to humans.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

namespace System.Net
{
[EventSource(Name = "Private.InternalDiagnostics.System.Net.Http.WinHttpHandler")]
internal sealed partial class NetEventSource { }
[EventSource(Name = NetEventSourceName)]
internal sealed partial class NetEventSource
{
private const string NetEventSourceName = "Private.InternalDiagnostics.System.Net.Http.WinHttpHandler";

public NetEventSource() : base(NetEventSourceName, EventSourceSettings.EtwManifestEventFormat) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@

namespace System.Net.Http
{
[EventSource(Name = "System.Net.Http")]
[EventSource(Name = HttpTelemetryName)]
internal sealed partial class HttpTelemetry : EventSource
{
private const string HttpTelemetryName = "System.Net.Http";

public HttpTelemetry()
: base(HttpTelemetryName, EventSourceSettings.EtwManifestEventFormat)
{
}

public static readonly HttpTelemetry Log = new HttpTelemetry();

public static class Keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@

namespace System.Net
{
[EventSource(Name = "Private.InternalDiagnostics.System.Net.Http")]
[EventSource(Name = NetEventSourceName)]
internal sealed partial class NetEventSource
{
private const string NetEventSourceName = "Private.InternalDiagnostics.System.Net.Http";

public NetEventSource() : base(NetEventSourceName, EventSourceSettings.EtwManifestEventFormat) { }

private const int UriBaseAddressId = NextAvailableEventId;
private const int ContentNullId = UriBaseAddressId + 1;
private const int HeadersInvalidValueId = ContentNullId + 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

namespace System.Net
{
[EventSource(Name = "Private.InternalDiagnostics.System.Net.HttpListener")]
internal sealed partial class NetEventSource { }
[EventSource(Name = NetEventSourceName)]
internal sealed partial class NetEventSource
{
private const string NetEventSourceName = "Private.InternalDiagnostics.System.Net.HttpListener";

public NetEventSource() : base(NetEventSourceName, EventSourceSettings.EtwManifestEventFormat) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

namespace System.Net
{
[EventSource(Name = "Private.InternalDiagnostics.System.Net.Mail")]
internal sealed partial class NetEventSource { }
[EventSource(Name = NetEventSourceName)]
internal sealed partial class NetEventSource
{
private const string NetEventSourceName = "Private.InternalDiagnostics.System.Net.Mail";

public NetEventSource() : base(NetEventSourceName, EventSourceSettings.EtwManifestEventFormat) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@

namespace System.Net
{
[EventSource(Name = "System.Net.NameResolution")]
[EventSource(Name = NameResolutionTelemetryName)]
internal sealed class NameResolutionTelemetry : EventSource
{
private const string NameResolutionTelemetryName = "System.Net.NameResolution";

public NameResolutionTelemetry()
: base(NameResolutionTelemetryName, EventSourceSettings.EtwManifestEventFormat)
{
}

public static readonly NameResolutionTelemetry Log = new NameResolutionTelemetry();

private const int ResolutionStartEventId = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

namespace System.Net
{
[EventSource(Name = "Private.InternalDiagnostics.System.Net.NameResolution")]
internal sealed partial class NetEventSource { }
[EventSource(Name = NetEventSourceName)]
internal sealed partial class NetEventSource
{
private const string NetEventSourceName = "Private.InternalDiagnostics.System.Net.NameResolution";

public NetEventSource() : base(NetEventSourceName, EventSourceSettings.EtwManifestEventFormat) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@

namespace System.Net
{
[EventSource(Name = "Private.InternalDiagnostics.System.Net.NetworkInformation")]
[EventSource(Name = NetEventSourceName)]
internal sealed class NetEventSource : EventSource
{
private const string NetEventSourceName = "Private.InternalDiagnostics.System.Net.NetworkInformation";

public NetEventSource() : base(NetEventSourceName, EventSourceSettings.EtwManifestEventFormat) { }

public static readonly NetEventSource Log = new NetEventSource();

private const int ErrorEventId = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

namespace System.Net
{
[EventSource(Name = "Private.InternalDiagnostics.System.Net.Primitives")]
internal sealed partial class NetEventSource { }
[EventSource(Name = NetEventSourceName)]
internal sealed partial class NetEventSource
{
private const string NetEventSourceName = "Private.InternalDiagnostics.System.Net.Primitives";

public NetEventSource() : base(NetEventSourceName, EventSourceSettings.EtwManifestEventFormat) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@

namespace System.Net
{
[EventSource(Name = "Private.InternalDiagnostics.System.Net.Quic")]
[EventSource(Name = NetEventSourceName)]
internal sealed partial class NetEventSource
{
private const string NetEventSourceName = "Private.InternalDiagnostics.System.Net.Quic";

public NetEventSource() : base(NetEventSourceName, EventSourceSettings.EtwManifestEventFormat) { }

static partial void AdditionalCustomizedToString(object value, ref string? result)
{
if (value is MsQuicSafeHandle safeHandle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

namespace System.Net
{
[EventSource(Name = "Private.InternalDiagnostics.System.Net.Requests")]
internal sealed partial class NetEventSource { }
[EventSource(Name = NetEventSourceName)]
internal sealed partial class NetEventSource
{
private const string NetEventSourceName = "Private.InternalDiagnostics.System.Net.Requests";

public NetEventSource() : base(NetEventSourceName, EventSourceSettings.EtwManifestEventFormat) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@

namespace System.Net
{
[EventSource(Name = "Private.InternalDiagnostics.System.Net.Security")]
[EventSource(Name = NetEventSourceName)]
internal sealed partial class NetEventSource
{
private const string NetEventSourceName = "Private.InternalDiagnostics.System.Net.Security";

public NetEventSource() : base(NetEventSourceName, EventSourceSettings.EtwManifestEventFormat) { }

#if WINDOWS
// More events are defined in NetEventSource.Security.Windows.cs
private const int LocatingPrivateKeyId = OperationReturnedSomethingId + 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@

namespace System.Net.Security
{
[EventSource(Name = "System.Net.Security")]
[EventSource(Name = NetSecurityTelemetryName)]
internal sealed class NetSecurityTelemetry : EventSource
{
private const string NetSecurityTelemetryName = "System.Net.Security";

public NetSecurityTelemetry()
: base(NetSecurityTelemetryName, EventSourceSettings.EtwManifestEventFormat)
{
}

private const string ActivitySourceName = "Experimental.System.Net.Security";
private const string ActivityName = ActivitySourceName + ".TlsHandshake";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@

namespace System.Net
{
[EventSource(Name = "Private.InternalDiagnostics.System.Net.Sockets")]
[EventSource(Name = NetEventSourceName)]
internal sealed partial class NetEventSource
{
private const string NetEventSourceName = "Private.InternalDiagnostics.System.Net.Sockets";

public NetEventSource() : base(NetEventSourceName, EventSourceSettings.EtwManifestEventFormat) { }

private const int AcceptedId = NextAvailableEventId;
private const int ConnectedId = AcceptedId + 1;
private const int ConnectedAsyncDnsId = ConnectedId + 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@

namespace System.Net.Sockets
{
[EventSource(Name = "System.Net.Sockets")]
[EventSource(Name = SocketsTelemetryName)]
internal sealed class SocketsTelemetry : EventSource
{
private const string SocketsTelemetryName = "System.Net.Sockets";

public SocketsTelemetry()
: base(SocketsTelemetryName, EventSourceSettings.EtwManifestEventFormat)
{
}

private const string ActivitySourceName = "Experimental.System.Net.Sockets";
private const string ConnectActivityName = ActivitySourceName + ".Connect";
private static readonly ActivitySource s_connectActivitySource = new ActivitySource(ActivitySourceName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@

namespace System.Net
{
[EventSource(Name = "Private.InternalDiagnostics.System.Net.WebSockets")]
[EventSource(Name = NetEventSourceName)]
internal sealed partial class NetEventSource
{
private const string NetEventSourceName = "Private.InternalDiagnostics.System.Net.WebSockets";

public NetEventSource() : base(NetEventSourceName, EventSourceSettings.EtwManifestEventFormat) { }

// NOTE
// - The 'Start' and 'Stop' suffixes on the following event names have special meaning in EventSource. They
// enable creating 'activities'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@

namespace System.Xml.Serialization
{
[EventSource(
Name = "System.Xml.Serialzation.XmlSerialization")]
[EventSource(Name = XmlSerializationEventSourceName)]
internal sealed class XmlSerializationEventSource : EventSource
{
private const string XmlSerializationEventSourceName = "System.Xml.Serialzation.XmlSerialization";

public XmlSerializationEventSource()
: base(XmlSerializationEventSourceName, EventSourceSettings.EtwManifestEventFormat)
{
}

internal static readonly XmlSerializationEventSource Log = new XmlSerializationEventSource();

[Event(EventIds.XmlSerializerExpired, Level = EventLevel.Informational)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@

namespace System.Security.Cryptography.X509Certificates
{
[EventSource(Name = "System.Security.Cryptography.X509Certificates.X509Chain.OpenSsl")]
[EventSource(Name = OpenSslX509ChainEventSourceName)]
internal sealed class OpenSslX509ChainEventSource : EventSource
{
private const string OpenSslX509ChainEventSourceName = "System.Security.Cryptography.X509Certificates.X509Chain.OpenSsl";

public OpenSslX509ChainEventSource()
: base(OpenSslX509ChainEventSourceName, EventSourceSettings.EtwManifestEventFormat)
{
}

internal static readonly OpenSslX509ChainEventSource Log = new OpenSslX509ChainEventSource();

private const int EventId_ChainStart = 1;
Expand Down
Loading