crosvm/metrics/protos/event_details.proto

98 lines
3.8 KiB
Protocol Buffer
Raw Normal View History

// Provides data structures for additional details for metrics events.
syntax = "proto2";
message RecordDetails {
reserved 1 to 11, 14 to 16;
// Additional details about an unexpected exit of a child process within
// the emulator.
optional EmulatorChildProcessExitDetails emulator_child_process_exit_details =
12;
// Additional details about wave formats from the Window's host system.
optional WaveFormatDetails wave_format_details = 13;
}
message WaveFormatDetails {
// Format requested by WASAPI `GetMixFormat` system call.
optional WaveFormat requested = 1;
// Originally the requested wave format that's modified by the emulator. Only
// populated if the emulator decides the requested wave format should not be
// used.
optional WaveFormat modified = 2;
// Format that is valid and closest matching to the modified format, if the
// modified was rejected. Should only be populated if modified is also
// non-null and was rejected by WASAPI `IsFormatSupported` system call.
optional WaveFormat closest_matched = 3;
}
// Defines the format of waveformat audio data. This information is used by
// WASAPI to determine how to process the audio playback data coming from the
// emulator.
//
// The fields in the structure come from WAVEFORMATEXTENSIBLE of win32 api.
// https://docs.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatextensible
message WaveFormat {
// Ex. 65534 (Maps to WAVE_FORMAT_EXTENSIBLE)
optional int32 format_tag = 1;
// Number of channels.
optional int32 channels = 2;
// Sample rate in Hz. Ex: 48000
optional int32 samples_per_sec = 3;
// Required average data-transfer rate for the format tag. Usually this will
// be samples_per_sec * block_align, since the format tag is usually
// WAVE_FORMAT_IEEE_FLOAT or it's extensible and SubFormat is
// KSDATAFORMAT_SUBTYPE_IEEE_FLOAT.
optional int32 avg_bytes_per_sec = 4;
// Minimum atomic unit of data based on the format_tag. Usually this will
// just be bits_per_samples * channels.
optional int32 block_align = 5;
// Bits used per sample. Must be a multiple of 8.
optional int32 bits_per_sample = 6;
// Size in bytes of extra information appended to WAVEFORMATEX struct.
optional int32 size_bytes = 7;
// The next fields are part of the WAVEFORMATEXTENSIBLE struct. They will only
// be non-null if format_tag is WAVE_FORMAT_EXTENSIBLE.
// Bit depth. Can be any value. Ex. bits_per_sample is 24,
// but samples is 20. Note: This value is a union, so it could mean something
// slightly different, but most likely won't. Refer to doc for more info.
optional int32 samples = 8;
// Bitmask mapping channels in stream to speaker positions.
// Ex. 3 ( SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT )
optional int64 channel_mask = 9;
// Similar to format_tag, but for WAVEFORMATEXTENSIBLE structs.
optional WaveFormatSubFormat sub_format = 10;
// Subformat GUID mapping:
// https://github.com/retep998/winapi-rs/blob/2f76bdea3a79817ccfab496fbd1786d5a697387b/src/shared/ksmedia.rs
enum WaveFormatSubFormat {
KSDATAFORMAT_SUBTYPE_INVALID = 0;
KSDATAFORMAT_SUBTYPE_ANALOG = 1;
KSDATAFORMAT_SUBTYPE_PCM = 2;
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = 3;
KSDATAFORMAT_SUBTYPE_DRM = 4;
KSDATAFORMAT_SUBTYPE_ALAW = 5;
KSDATAFORMAT_SUBTYPE_MULAW = 6;
KSDATAFORMAT_SUBTYPE_ADPCM = 7;
KSDATAFORMAT_SUBTYPE_MPEG = 8;
}
}
enum EmulatorProcessType {
PROCESS_TYPE_UNKNOWN = 0;
PROCESS_TYPE_MAIN = 1;
PROCESS_TYPE_BLOCK = 2;
PROCESS_TYPE_METRICS = 3;
PROCESS_TYPE_NET = 4;
PROCESS_TYPE_SLIRP = 5;
PROCESS_TYPE_GPU = 6;
PROCESS_TYPE_SOUND = 7;
}
message EmulatorChildProcessExitDetails {
// The Windows exit code of the child process
optional uint32 exit_code = 1;
// The process identifier, as defined by the ProcessType enum in the
// emulator code.
optional EmulatorProcessType process_type = 2;
}