package NTraceUsage;

message TCommonEventData {
    optional fixed64 MicroSecondsTime = 1;
    optional fixed64 ThreadId = 2;
    optional fixed64 ProcessId = 3;
    optional fixed64 ContextId = 4;
}

message TFunctionScopeEvent {
    optional string Function = 1;
}

message TDummyEvent {
}

message TEventParam {
    repeated string Name = 1;

    optional string StringValue = 2;
    optional uint64 UintValue = 3;
    optional sint64 SintValue = 4;
    repeated float FloatValue = 5 [packed=true];
    repeated double DoubleValue = 6 [packed=true];
}

message TContextDeclarationEvent {
    optional fixed64 ContextId = 1;
}

message TEventReportProto {
    optional TCommonEventData CommonEventData = 1;

    repeated TFunctionScopeEvent StartFunctionScope = 2;
    repeated TFunctionScopeEvent CloseFunctionScope = 3;

    repeated TDummyEvent StartAcquiringMutex = 4;
    repeated TDummyEvent AcquiredMutex = 5;
    repeated TDummyEvent StartReleasingMutex = 6;
    repeated TDummyEvent ReleasedMutex = 7;

    repeated TDummyEvent StartWaitEvent = 8;
    repeated TDummyEvent FinishWaitEvent = 9;

    repeated TEventParam EventParams = 10;

    // if an event has this field, then its sole purpose is to report parent-child link
    // from CommonEventData::ContextId to ChildContextDeclaration::ContextId
    optional TContextDeclarationEvent ChildContextDeclaration = 11; 
}
