         
syntax = "proto2";
package NV.Profiler;
import "Profiler/ProfilerCommon.proto";
import "Profiler/ProfilerCategories.proto";
import "Profiler/ProfilerStringTable.proto";
// enable arenas for better allocation performance
option cc_enable_arenas = true;
enum ProfilerResultsMethod
{
    // Every feature counts Method 0 as invalid. The array of categories.size() is always > 1.
    InvalidResultsMethod = 0;
    // Notification of new profile source
    MethodSourceMessage = 1;
    // Notification of new profile results
    MethodResultMessage = 2;
    MethodClearCachedProfilerSourceMessage = 3;
    // Notification of requested profile device info
    MethodDeviceInfoMessage = 4;
    // ONLY ADD AT THE END OF THIS LIST. DO NOT RE-ORDER.
}
// Union of metric values.
message MetricValueMessage
{
    optional string StringValue = 1;
    optional float FloatValue = 2;
    optional double DoubleValue = 3;
    optional uint32 Uint32Value = 4;
    optional uint64 Uint64Value = 5;
}
message MetricListElementMessage
{
    optional MetricValueMessage CorrelationId = 1;
    required MetricValueMessage ElementValue = 2;
}
message MetricResultMessage
{
    required uint32 MetricNameId = 1;
    optional MetricValueMessage MetricValue = 2;
    repeated MetricListElementMessage MetricValueList = 3;
}
message ProfilerSourceMessage
{
    message TypeInfo
    {
        optional ProfilerCategory Category = 1 [default = CategoryResults];
        optional ProfilerResultsMethod Method = 2 [default = MethodSourceMessage];
    }
    required SourceData Source = 1;
}
// Send to the profiler on target to tell it that the source should be resent on next profile.
// Without this, it will not re-send the source.
message ClearCachedProfilerSourceMessage
{
    message TypeInfo
    {
        optional ProfilerCategory Category = 1 [default = CategoryResults];
        optional ProfilerResultsMethod Method = 2 [default = MethodClearCachedProfilerSourceMessage];
    }
}
message ProfilerVersionInfoMessage
{
    required string Provider = 1;
    required string Version = 2;
}
message ProfileSeriesInfoMessage
{
    required uint32 SeriesID = 1;
    // Is set iff the current result is not the result for the default settings
    optional string CombinationStr = 2;
}
message ProfilerClockStatusMessage
{
    required bool RequestedLock = 1;
    required bool ExecutedLocked = 2;
}
message ProfilerResultMessage
{
    message TypeInfo
    {
        optional ProfilerCategory Category = 1 [default = CategoryResults];
        optional ProfilerResultsMethod Method = 2 [default = MethodResultMessage];
    }
    // This is the index of this profile, not the APICallID.
    required uint32 ID = 1;
    required LaunchData Launch = 2;
    repeated MetricResultMessage MetricResults = 3;
    required SourceData Source = 4;
    required Messages.ProfilerStringTable StringTable = 5;
    optional bool UnsupportedDevice = 6;
    repeated ProfilerVersionInfoMessage VersionInfo = 7;
    optional ProfileSeriesInfoMessage SeriesInfo = 8;
    optional ProfilerClockStatusMessage ClockStatus = 9;
    optional bytes CounterDataImageCtx = 10;
    optional bytes CounterDataImageDev = 11;
    optional uint32 DeviceId = 12;
    optional AppReplayConfig AppReplayConfig = 13;
}
message ProfilerDeviceInfoMessage
{
    message TypeInfo
    {
        optional ProfilerCategory Category = 1 [default = CategoryResults];
        optional ProfilerResultsMethod Method = 2 [default = MethodDeviceInfoMessage];
    }
    required uint32 ThreadId = 1;
    optional string NvmlDriverVersion = 2;
    optional bytes CounterAvailabilityImageCtx = 3;
    optional bytes CounterAvailabilityImageDev = 4;
}
