EventSource.WriteEventWithRelatedActivityIdCore 메서드

정의

중요

이 API는 CLS 규격이 아닙니다.

현재 작업이 다른 작업과 연관되어 있음을 나타내는 이벤트를 기록합니다.

protected:
 void WriteEventWithRelatedActivityIdCore(int eventId, Guid* relatedActivityId, int eventDataCount, System::Diagnostics::Tracing::EventSource::EventData* data);
protected:
 void WriteEventWithRelatedActivityIdCore(int eventId, Guid* childActivityID, int eventDataCount, System::Diagnostics::Tracing::EventSource::EventData* data);
[System.CLSCompliant(false)]
[System.Security.SecurityCritical]
protected void WriteEventWithRelatedActivityIdCore (int eventId, Guid* relatedActivityId, int eventDataCount, System.Diagnostics.Tracing.EventSource.EventData* data);
[System.CLSCompliant(false)]
protected void WriteEventWithRelatedActivityIdCore (int eventId, Guid* relatedActivityId, int eventDataCount, System.Diagnostics.Tracing.EventSource.EventData* data);
[System.CLSCompliant(false)]
[System.Security.SecurityCritical]
protected void WriteEventWithRelatedActivityIdCore (int eventId, Guid* childActivityID, int eventDataCount, System.Diagnostics.Tracing.EventSource.EventData* data);
[<System.CLSCompliant(false)>]
[<System.Security.SecurityCritical>]
member this.WriteEventWithRelatedActivityIdCore : int * nativeptr<Guid> * int * nativeptr<System.Diagnostics.Tracing.EventSource.EventData> -> unit
[<System.CLSCompliant(false)>]
member this.WriteEventWithRelatedActivityIdCore : int * nativeptr<Guid> * int * nativeptr<System.Diagnostics.Tracing.EventSource.EventData> -> unit

매개 변수

eventId
Int32

EventSource 내에서 이 이벤트를 고유하게 식별하는 식별자입니다.

relatedActivityIdchildActivityID
Guid*

관련 작업 ID의 GUID에 대한 포인터입니다.

eventDataCount
Int32

data 필드의 항목 수입니다.

data
EventSource.EventData

이벤트 데이터 필드에서 첫 번째 항목에 대한 포인터입니다.

특성

예제

다음 C# 코드 예제에서는 호출 WriteEventWithRelatedActivityIdCore하는 메서드 오버로드를 정의하는 방법을 보여줍니다.

[EventSource(Name = "Litware-ProductName-ComponentName")]
public sealed class LitwareComponentNameEventSource : EventSource
{
    [Event(1, Task = Tasks.Request, Opcode = EventOpcode.Send)]
    public void RequestStart(Guid relatedActivityId, int reqId, string url)
    {
        WriteEventWithRelatedActivityIdCore(1, relatedActivityId, reqId, url);
    }
}
<EventSource(Name:="Litware-ProductName-ComponentName")> _
Public NotInheritable Class LitwareComponentNameEventSource
    Inherits EventSource
    <[Event](1, Task:=Tasks.Request, Opcode:=EventOpcode.Send)> _
    Public Sub RequestStart(relatedActivityId As Guid, reqId As Integer, url As String)
        WriteEventWithRelatedActivityIdCore(1, relatedActivityId, reqId, url)
    End Sub

End Class
#region Keywords / Task / Opcodes
public static class Tasks
{
    public const EventTask Request = (EventTask)0x1;
}
#endregion
#Region "Keywords / Task / Opcodes"
    Public NotInheritable Class Tasks
        Private Sub New()
        End Sub
        Public Const Request As EventTask = DirectCast(&H1, EventTask)
    End Class
#End Region

설명

WriteEventWithRelatedActivityIdCore는 메서드와 WriteEventWithRelatedActivityId data 유사하지만 인수의 받은 편지함을 childActivityID 해제할 필요가 없으므로 더 나은 성능을 제공합니다.

이 함수를 호출하는 ETW 이벤트 메서드는 다음 지침을 따라야 합니다.

  1. 첫 번째 매개 변수를 명명relatedActivityId된 매개 변수로 Guid 지정합니다.

  2. 속성 중 하나 Send 또는 Receive 속성으로 지정합니다 EventAttribute.Opcode .

  3. 이벤트 ID를 전달한 다음 관련 ID GUID를 전달한 다음 이벤트 메서드가 전달되는 모든 매개 변수를 동일한 순서로 전달 WriteEventWithRelatedActivityIdCore 합니다.

이 메서드는 매개 변수와 동일한 규칙을 WriteEventCore args 사용합니다. 자세한 내용은 WriteEventCore 설명서를 참조하세요.

적용 대상