//
// Copyright (C) 2023 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// @generated by protoc-gen-es v2.2.2 with parameter "target=ts"
// @generated from file protos/perfetto/trace/etw/etw.proto (package perfetto.protos, syntax proto2)
/* eslint-disable */

import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file protos/perfetto/trace/etw/etw.proto.
 */
export const file_protos_perfetto_trace_etw_etw: GenFile = /*@__PURE__*/
  fileDesc("CiNwcm90b3MvcGVyZmV0dG8vdHJhY2UvZXR3L2V0dy5wcm90bxIPcGVyZmV0dG8ucHJvdG9zIvgKCg9DU3dpdGNoRXR3RXZlbnQSFQoNbmV3X3RocmVhZF9pZBgBIAEoDRIVCg1vbGRfdGhyZWFkX2lkGAIgASgNEhsKE25ld190aHJlYWRfcHJpb3JpdHkYAyABKBESGwoTb2xkX3RocmVhZF9wcmlvcml0eRgEIAEoERIYChBwcmV2aW91c19jX3N0YXRlGAUgASgNElQKFm9sZF90aHJlYWRfd2FpdF9yZWFzb24YBiABKA4yNC5wZXJmZXR0by5wcm90b3MuQ1N3aXRjaEV0d0V2ZW50Lk9sZFRocmVhZFdhaXRSZWFzb24SUAoUb2xkX3RocmVhZF93YWl0X21vZGUYByABKA4yMi5wZXJmZXR0by5wcm90b3MuQ1N3aXRjaEV0d0V2ZW50Lk9sZFRocmVhZFdhaXRNb2RlEkkKEG9sZF90aHJlYWRfc3RhdGUYCCABKA4yLy5wZXJmZXR0by5wcm90b3MuQ1N3aXRjaEV0d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QIxIOCgpXUl9SVU5ET1dOECQSFwoTTUFYSU1VTV9XQUlUX1JFQVNPThAlIjMKEU9sZFRocmVhZFdhaXRNb2RlEg8KC0tFUk5FTF9NT0RFEAASDQoJVVNFUl9NT0RFEAEihwEKDk9sZFRocmVhZFN0YXRlEg8KC0lOSVRJQUxJWkVEEAASCQoFUkVBRFkQARILCgdSVU5OSU5HEAISCwoHU1RBTkRCWRADEg4KClRFUk1JTkFURUQQBBILCgdXQUlUSU5HEAUSDgoKVFJBTlNJVElPThAGEhIKDkRFRkVSUkVEX1JFQURZEAciogMKE1JlYWR5VGhyZWFkRXR3RXZlbnQSEwoLdF90aHJlYWRfaWQYASABKA0SSAoNYWRqdXN0X3JlYXNvbhgCIAEoDjIxLnBlcmZldHRvLnByb3Rvcy5SZWFkeVRocmVhZEV0d0V2ZW50LkFkanVzdFJlYXNvbhIYChBhZGp1c3RfaW5jcmVtZW50GAMgASgREjwKBGZsYWcYBCABKA4yLi5wZXJmZXR0by5wcm90b3MuUmVhZHlUaHJlYWRFdHdFdmVudC5UcmFjZUZsYWciWAoMQWRqdXN0UmVhc29uEhgKFElHTk9SRV9USEVfSU5DUkVNRU5UEAASEwoPQVBQTFlfSU5DUkVNRU5UEAESGQoVQVBQTFlfSU5DUkVNRU5UX0JPT1NUEAIiegoJVHJhY2VGbGFnEhoKFlRSQUNFX0ZMQUdfVU5TUEVDSUZJRUQQABISCg5USFJFQURfUkVBRElFRBABEhwKGEtFUk5FTF9TVEFDS19TV0FQUEVEX09VVBACEh8KG1BST0NFU1NfQUREUkVTU19TV0FQUEVEX09VVBAE");

/**
 * Proto definition based on the Thread_v2 CSwitch class definition
 * See: https://learn.microsoft.com/en-us/windows/win32/etw/cswitch
 *
 * @generated from message perfetto.protos.CSwitchEtwEvent
 */
export type CSwitchEtwEvent = Message<"perfetto.protos.CSwitchEtwEvent"> & {
  /**
   * New thread ID after the switch.
   *
   * @generated from field: optional uint32 new_thread_id = 1;
   */
  newThreadId: number;

  /**
   * Previous thread ID.
   *
   * @generated from field: optional uint32 old_thread_id = 2;
   */
  oldThreadId: number;

  /**
   * Thread priority of the new thread.
   *
   * @generated from field: optional sint32 new_thread_priority = 3;
   */
  newThreadPriority: number;

  /**
   * Thread priority of the previous thread.
   *
   * @generated from field: optional sint32 old_thread_priority = 4;
   */
  oldThreadPriority: number;

  /**
   * The index of the C-state that was last used by the processor. A value of 0
   * represents the lightest idle state with higher values representing deeper
   * C-states.
   *
   * @generated from field: optional uint32 previous_c_state = 5;
   */
  previousCState: number;

  /**
   * @generated from field: optional perfetto.protos.CSwitchEtwEvent.OldThreadWaitReason old_thread_wait_reason = 6;
   */
  oldThreadWaitReason: CSwitchEtwEvent_OldThreadWaitReason;

  /**
   * @generated from field: optional perfetto.protos.CSwitchEtwEvent.OldThreadWaitMode old_thread_wait_mode = 7;
   */
  oldThreadWaitMode: CSwitchEtwEvent_OldThreadWaitMode;

  /**
   * @generated from field: optional perfetto.protos.CSwitchEtwEvent.OldThreadState old_thread_state = 8;
   */
  oldThreadState: CSwitchEtwEvent_OldThreadState;

  /**
   * Ideal wait time of the previous thread.
   *
   * @generated from field: optional sint32 old_thread_wait_ideal_processor = 9;
   */
  oldThreadWaitIdealProcessor: number;

  /**
   * Wait time for the new thread.
   *
   * @generated from field: optional uint32 new_thread_wait_time = 10;
   */
  newThreadWaitTime: number;
};

/**
 * Describes the message perfetto.protos.CSwitchEtwEvent.
 * Use `create(CSwitchEtwEventSchema)` to create a new message.
 */
export const CSwitchEtwEventSchema: GenMessage<CSwitchEtwEvent> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_etw_etw, 0);

/**
 * Wait reason for the previous thread. The ordering is important as based on
 * the OldThreadWaitReason definition from the link above. The following are
 * the possible values:
 *
 * @generated from enum perfetto.protos.CSwitchEtwEvent.OldThreadWaitReason
 */
export enum CSwitchEtwEvent_OldThreadWaitReason {
  /**
   * @generated from enum value: EXECUTIVE = 0;
   */
  EXECUTIVE = 0,

  /**
   * @generated from enum value: FREE_PAGE = 1;
   */
  FREE_PAGE = 1,

  /**
   * @generated from enum value: PAGE_IN = 2;
   */
  PAGE_IN = 2,

  /**
   * @generated from enum value: POOL_ALLOCATION = 3;
   */
  POOL_ALLOCATION = 3,

  /**
   * @generated from enum value: DELAY_EXECUTION = 4;
   */
  DELAY_EXECUTION = 4,

  /**
   * @generated from enum value: SUSPEND = 5;
   */
  SUSPEND = 5,

  /**
   * @generated from enum value: USER_REQUEST = 6;
   */
  USER_REQUEST = 6,

  /**
   * @generated from enum value: WR_EXECUTIVE = 7;
   */
  WR_EXECUTIVE = 7,

  /**
   * @generated from enum value: WR_FREE_PAGE = 8;
   */
  WR_FREE_PAGE = 8,

  /**
   * @generated from enum value: WR_PAGE_IN = 9;
   */
  WR_PAGE_IN = 9,

  /**
   * @generated from enum value: WR_POOL_ALLOCATION = 10;
   */
  WR_POOL_ALLOCATION = 10,

  /**
   * @generated from enum value: WR_DELAY_EXECUTION = 11;
   */
  WR_DELAY_EXECUTION = 11,

  /**
   * @generated from enum value: WR_SUSPENDED = 12;
   */
  WR_SUSPENDED = 12,

  /**
   * @generated from enum value: WR_USER_REQUEST = 13;
   */
  WR_USER_REQUEST = 13,

  /**
   * @generated from enum value: WR_EVENT_PAIR = 14;
   */
  WR_EVENT_PAIR = 14,

  /**
   * @generated from enum value: WR_QUEUE = 15;
   */
  WR_QUEUE = 15,

  /**
   * @generated from enum value: WR_LPC_RECEIVER = 16;
   */
  WR_LPC_RECEIVER = 16,

  /**
   * @generated from enum value: WR_LPC_REPLY = 17;
   */
  WR_LPC_REPLY = 17,

  /**
   * @generated from enum value: WR_VIRTUAL_MEMORY = 18;
   */
  WR_VIRTUAL_MEMORY = 18,

  /**
   * @generated from enum value: WR_PAGE_OUT = 19;
   */
  WR_PAGE_OUT = 19,

  /**
   * @generated from enum value: WR_RENDEZ_VOUS = 20;
   */
  WR_RENDEZ_VOUS = 20,

  /**
   * @generated from enum value: WR_KEYED_EVENT = 21;
   */
  WR_KEYED_EVENT = 21,

  /**
   * @generated from enum value: WR_TERMINATED = 22;
   */
  WR_TERMINATED = 22,

  /**
   * @generated from enum value: WR_PROCESS_IN_SWAP = 23;
   */
  WR_PROCESS_IN_SWAP = 23,

  /**
   * @generated from enum value: WR_CPU_RATE_CONTROL = 24;
   */
  WR_CPU_RATE_CONTROL = 24,

  /**
   * @generated from enum value: WR_CALLOUT_STACK = 25;
   */
  WR_CALLOUT_STACK = 25,

  /**
   * @generated from enum value: WR_KERNEL = 26;
   */
  WR_KERNEL = 26,

  /**
   * @generated from enum value: WR_RESOURCE = 27;
   */
  WR_RESOURCE = 27,

  /**
   * @generated from enum value: WR_PUSH_LOCK = 28;
   */
  WR_PUSH_LOCK = 28,

  /**
   * @generated from enum value: WR_MUTEX = 29;
   */
  WR_MUTEX = 29,

  /**
   * @generated from enum value: WR_QUANTUM_END = 30;
   */
  WR_QUANTUM_END = 30,

  /**
   * @generated from enum value: WR_DISPATCH_INT = 31;
   */
  WR_DISPATCH_INT = 31,

  /**
   * @generated from enum value: WR_PREEMPTED = 32;
   */
  WR_PREEMPTED = 32,

  /**
   * @generated from enum value: WR_YIELD_EXECUTION = 33;
   */
  WR_YIELD_EXECUTION = 33,

  /**
   * @generated from enum value: WR_FAST_MUTEX = 34;
   */
  WR_FAST_MUTEX = 34,

  /**
   * @generated from enum value: WR_GUARD_MUTEX = 35;
   */
  WR_GUARD_MUTEX = 35,

  /**
   * @generated from enum value: WR_RUNDOWN = 36;
   */
  WR_RUNDOWN = 36,

  /**
   * @generated from enum value: MAXIMUM_WAIT_REASON = 37;
   */
  MAXIMUM_WAIT_REASON = 37,
}

/**
 * Describes the enum perfetto.protos.CSwitchEtwEvent.OldThreadWaitReason.
 */
export const CSwitchEtwEvent_OldThreadWaitReasonSchema: GenEnum<CSwitchEtwEvent_OldThreadWaitReason> = /*@__PURE__*/
  enumDesc(file_protos_perfetto_trace_etw_etw, 0, 0);

/**
 * Wait mode for the previous thread. The ordering is important as based on
 * the OldThreadWaitMode definition from the link above. The following are the
 * possible values:
 *
 * @generated from enum perfetto.protos.CSwitchEtwEvent.OldThreadWaitMode
 */
export enum CSwitchEtwEvent_OldThreadWaitMode {
  /**
   * @generated from enum value: KERNEL_MODE = 0;
   */
  KERNEL_MODE = 0,

  /**
   * @generated from enum value: USER_MODE = 1;
   */
  USER_MODE = 1,
}

/**
 * Describes the enum perfetto.protos.CSwitchEtwEvent.OldThreadWaitMode.
 */
export const CSwitchEtwEvent_OldThreadWaitModeSchema: GenEnum<CSwitchEtwEvent_OldThreadWaitMode> = /*@__PURE__*/
  enumDesc(file_protos_perfetto_trace_etw_etw, 0, 1);

/**
 * State of the previous thread. The ordering is important as based on the
 * OldThreadState definition from the link above. The following are the
 * possible state values:
 *
 * @generated from enum perfetto.protos.CSwitchEtwEvent.OldThreadState
 */
export enum CSwitchEtwEvent_OldThreadState {
  /**
   * @generated from enum value: INITIALIZED = 0;
   */
  INITIALIZED = 0,

  /**
   * @generated from enum value: READY = 1;
   */
  READY = 1,

  /**
   * @generated from enum value: RUNNING = 2;
   */
  RUNNING = 2,

  /**
   * @generated from enum value: STANDBY = 3;
   */
  STANDBY = 3,

  /**
   * @generated from enum value: TERMINATED = 4;
   */
  TERMINATED = 4,

  /**
   * @generated from enum value: WAITING = 5;
   */
  WAITING = 5,

  /**
   * @generated from enum value: TRANSITION = 6;
   */
  TRANSITION = 6,

  /**
   * @generated from enum value: DEFERRED_READY = 7;
   */
  DEFERRED_READY = 7,
}

/**
 * Describes the enum perfetto.protos.CSwitchEtwEvent.OldThreadState.
 */
export const CSwitchEtwEvent_OldThreadStateSchema: GenEnum<CSwitchEtwEvent_OldThreadState> = /*@__PURE__*/
  enumDesc(file_protos_perfetto_trace_etw_etw, 0, 2);

/**
 * Proto definition based on the Thread_v2 CSwitch class definition
 * See: https://learn.microsoft.com/en-us/windows/win32/etw/readythread
 *
 * @generated from message perfetto.protos.ReadyThreadEtwEvent
 */
export type ReadyThreadEtwEvent = Message<"perfetto.protos.ReadyThreadEtwEvent"> & {
  /**
   * The thread identifier of the thread being readied for execution.
   *
   * @generated from field: optional uint32 t_thread_id = 1;
   */
  tThreadId: number;

  /**
   * @generated from field: optional perfetto.protos.ReadyThreadEtwEvent.AdjustReason adjust_reason = 2;
   */
  adjustReason: ReadyThreadEtwEvent_AdjustReason;

  /**
   *  The value by which the priority is being adjusted.
   *
   * @generated from field: optional sint32 adjust_increment = 3;
   */
  adjustIncrement: number;

  /**
   * @generated from field: optional perfetto.protos.ReadyThreadEtwEvent.TraceFlag flag = 4;
   */
  flag: ReadyThreadEtwEvent_TraceFlag;
};

/**
 * Describes the message perfetto.protos.ReadyThreadEtwEvent.
 * Use `create(ReadyThreadEtwEventSchema)` to create a new message.
 */
export const ReadyThreadEtwEventSchema: GenMessage<ReadyThreadEtwEvent> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_etw_etw, 1);

/**
 * The reason for the priority boost. The ordering is important as based on
 * the AdjustReason definition from the link above.
 *
 * @generated from enum perfetto.protos.ReadyThreadEtwEvent.AdjustReason
 */
export enum ReadyThreadEtwEvent_AdjustReason {
  /**
   * @generated from enum value: IGNORE_THE_INCREMENT = 0;
   */
  IGNORE_THE_INCREMENT = 0,

  /**
   * Apply the increment, which will decay incrementally at the end of each
   * quantum.
   *
   * @generated from enum value: APPLY_INCREMENT = 1;
   */
  APPLY_INCREMENT = 1,

  /**
   * Apply the increment as a boost that will decay in its entirety at quantum
   * (typically for priority donation).
   *
   * @generated from enum value: APPLY_INCREMENT_BOOST = 2;
   */
  APPLY_INCREMENT_BOOST = 2,
}

/**
 * Describes the enum perfetto.protos.ReadyThreadEtwEvent.AdjustReason.
 */
export const ReadyThreadEtwEvent_AdjustReasonSchema: GenEnum<ReadyThreadEtwEvent_AdjustReason> = /*@__PURE__*/
  enumDesc(file_protos_perfetto_trace_etw_etw, 1, 0);

/**
 * @generated from enum perfetto.protos.ReadyThreadEtwEvent.TraceFlag
 */
export enum ReadyThreadEtwEvent_TraceFlag {
  /**
   * @generated from enum value: TRACE_FLAG_UNSPECIFIED = 0;
   */
  TRACE_FLAG_UNSPECIFIED = 0,

  /**
   * The thread has been readied from DPC (deferred procedure call).
   *
   * @generated from enum value: THREAD_READIED = 1;
   */
  THREAD_READIED = 1,

  /**
   * The kernel stack is currently swapped out.
   *
   * @generated from enum value: KERNEL_STACK_SWAPPED_OUT = 2;
   */
  KERNEL_STACK_SWAPPED_OUT = 2,

  /**
   * The process address space is swapped out.
   *
   * @generated from enum value: PROCESS_ADDRESS_SWAPPED_OUT = 4;
   */
  PROCESS_ADDRESS_SWAPPED_OUT = 4,
}

/**
 * Describes the enum perfetto.protos.ReadyThreadEtwEvent.TraceFlag.
 */
export const ReadyThreadEtwEvent_TraceFlagSchema: GenEnum<ReadyThreadEtwEvent_TraceFlag> = /*@__PURE__*/
  enumDesc(file_protos_perfetto_trace_etw_etw, 1, 1);

