//
// Copyright (C) 2018 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/android/android_log.proto (package perfetto.protos, syntax proto2)
/* eslint-disable */

import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
import type { AndroidLogId, AndroidLogPriority } from "../../common/android_log_constants_pb";
import { file_protos_perfetto_common_android_log_constants } from "../../common/android_log_constants_pb";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file protos/perfetto/trace/android/android_log.proto.
 */
export const file_protos_perfetto_trace_android_android_log: GenFile = /*@__PURE__*/
  fileDesc("Ci9wcm90b3MvcGVyZmV0dG8vdHJhY2UvYW5kcm9pZC9hbmRyb2lkX2xvZy5wcm90bxIPcGVyZmV0dG8ucHJvdG9zIrIEChBBbmRyb2lkTG9nUGFja2V0EjoKBmV2ZW50cxgBIAMoCzIqLnBlcmZldHRvLnByb3Rvcy5BbmRyb2lkTG9nUGFja2V0LkxvZ0V2ZW50EjYKBXN0YXRzGAIgASgLMicucGVyZmV0dG8ucHJvdG9zLkFuZHJvaWRMb2dQYWNrZXQuU3RhdHMa5AIKCExvZ0V2ZW50Ei0KBmxvZ19pZBgBIAEoDjIdLnBlcmZldHRvLnByb3Rvcy5BbmRyb2lkTG9nSWQSCwoDcGlkGAIgASgFEgsKA3RpZBgDIAEoBRILCgN1aWQYBCABKAUSEQoJdGltZXN0YW1wGAUgASgEEgsKA3RhZxgGIAEoCRIxCgRwcmlvGAcgASgOMiMucGVyZmV0dG8ucHJvdG9zLkFuZHJvaWRMb2dQcmlvcml0eRIPCgdtZXNzYWdlGAggASgJEjwKBGFyZ3MYCSADKAsyLi5wZXJmZXR0by5wcm90b3MuQW5kcm9pZExvZ1BhY2tldC5Mb2dFdmVudC5BcmcaYAoDQXJnEgwKBG5hbWUYASABKAkSEwoJaW50X3ZhbHVlGAIgASgDSAASFQoLZmxvYXRfdmFsdWUYAyABKAJIABIWCgxzdHJpbmdfdmFsdWUYBCABKAlIAEIHCgV2YWx1ZRpDCgVTdGF0cxIRCgludW1fdG90YWwYASABKAQSEgoKbnVtX2ZhaWxlZBgCIAEoBBITCgtudW1fc2tpcHBlZBgDIAEoBA", [file_protos_perfetto_common_android_log_constants]);

/**
 * @generated from message perfetto.protos.AndroidLogPacket
 */
export type AndroidLogPacket = Message<"perfetto.protos.AndroidLogPacket"> & {
  /**
   * @generated from field: repeated perfetto.protos.AndroidLogPacket.LogEvent events = 1;
   */
  events: AndroidLogPacket_LogEvent[];

  /**
   * @generated from field: optional perfetto.protos.AndroidLogPacket.Stats stats = 2;
   */
  stats?: AndroidLogPacket_Stats;
};

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

/**
 * @generated from message perfetto.protos.AndroidLogPacket.LogEvent
 */
export type AndroidLogPacket_LogEvent = Message<"perfetto.protos.AndroidLogPacket.LogEvent"> & {
  /**
   * The log buffer (e.g. MAIN, SYSTEM, RADIO) the event comes from.
   *
   * @generated from field: optional perfetto.protos.AndroidLogId log_id = 1;
   */
  logId: AndroidLogId;

  /**
   * PID (TGID), TID and UID of the task that emitted the event.
   *
   * @generated from field: optional int32 pid = 2;
   */
  pid: number;

  /**
   * @generated from field: optional int32 tid = 3;
   */
  tid: number;

  /**
   * @generated from field: optional int32 uid = 4;
   */
  uid: number;

  /**
   * Timestamp [ns]. The clock source is CLOCK_REALTIME, unlike many other
   * Perfetto trace events that instead use CLOCK_BOOTTIME. The trace
   * processor will take care of realigning clocks using the ClockSnapshot(s).
   *
   * @generated from field: optional uint64 timestamp = 5;
   */
  timestamp: bigint;

  /**
   * When log_id == LID_EVENTS, |tag| corresponds to the event name defined in
   * the second column of /system/etc/event-log-tags. For all other events,
   * |tag| is the app-specified argument passed to __android_log_write().
   *
   * @generated from field: optional string tag = 6;
   */
  tag: string;

  /**
   * Empty when log_id == LID_EVENTS.
   *
   * @generated from field: optional perfetto.protos.AndroidLogPriority prio = 7;
   */
  prio: AndroidLogPriority;

  /**
   * Empty when log_id == LID_EVENTS.
   *
   * @generated from field: optional string message = 8;
   */
  message: string;

  /**
   * Only populated when log_id == LID_EVENTS.
   *
   * @generated from field: repeated perfetto.protos.AndroidLogPacket.LogEvent.Arg args = 9;
   */
  args: AndroidLogPacket_LogEvent_Arg[];
};

/**
 * Describes the message perfetto.protos.AndroidLogPacket.LogEvent.
 * Use `create(AndroidLogPacket_LogEventSchema)` to create a new message.
 */
export const AndroidLogPacket_LogEventSchema: GenMessage<AndroidLogPacket_LogEvent> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_android_log, 0, 0);

/**
 * @generated from message perfetto.protos.AndroidLogPacket.LogEvent.Arg
 */
export type AndroidLogPacket_LogEvent_Arg = Message<"perfetto.protos.AndroidLogPacket.LogEvent.Arg"> & {
  /**
   * @generated from field: optional string name = 1;
   */
  name: string;

  /**
   * @generated from oneof perfetto.protos.AndroidLogPacket.LogEvent.Arg.value
   */
  value: {
    /**
     * @generated from field: int64 int_value = 2;
     */
    value: bigint;
    case: "intValue";
  } | {
    /**
     * @generated from field: float float_value = 3;
     */
    value: number;
    case: "floatValue";
  } | {
    /**
     * @generated from field: string string_value = 4;
     */
    value: string;
    case: "stringValue";
  } | { case: undefined; value?: undefined };
};

/**
 * Describes the message perfetto.protos.AndroidLogPacket.LogEvent.Arg.
 * Use `create(AndroidLogPacket_LogEvent_ArgSchema)` to create a new message.
 */
export const AndroidLogPacket_LogEvent_ArgSchema: GenMessage<AndroidLogPacket_LogEvent_Arg> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_android_log, 0, 0, 0);

/**
 * Stats are emitted only upon Flush() and are monotonic (i.e. they are
 * absolute counters since the beginning of the lifetime of the tracing
 * session and NOT relative to the previous Stats snapshot).
 *
 * @generated from message perfetto.protos.AndroidLogPacket.Stats
 */
export type AndroidLogPacket_Stats = Message<"perfetto.protos.AndroidLogPacket.Stats"> & {
  /**
   * Total number of log events seen, including errors and skipped entries
   * (num of events stored in the trace = total - failed - skipped).
   *
   * @generated from field: optional uint64 num_total = 1;
   */
  numTotal: bigint;

  /**
   * Parser failures.
   *
   * @generated from field: optional uint64 num_failed = 2;
   */
  numFailed: bigint;

  /**
   * Messages skipped due to filters.
   *
   * @generated from field: optional uint64 num_skipped = 3;
   */
  numSkipped: bigint;
};

/**
 * Describes the message perfetto.protos.AndroidLogPacket.Stats.
 * Use `create(AndroidLogPacket_StatsSchema)` to create a new message.
 */
export const AndroidLogPacket_StatsSchema: GenMessage<AndroidLogPacket_Stats> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_android_log, 0, 1);

