//
// Copyright (C) 2020 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/config/track_event/track_event_config.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 { Message } from "@bufbuild/protobuf";

/**
 * Describes the file protos/perfetto/config/track_event/track_event_config.proto.
 */
export const file_protos_perfetto_config_track_event_track_event_config: GenFile = /*@__PURE__*/
  fileDesc("Cjtwcm90b3MvcGVyZmV0dG8vY29uZmlnL3RyYWNrX2V2ZW50L3RyYWNrX2V2ZW50X2NvbmZpZy5wcm90bxIPcGVyZmV0dG8ucHJvdG9zIq4CChBUcmFja0V2ZW50Q29uZmlnEhsKE2Rpc2FibGVkX2NhdGVnb3JpZXMYASADKAkSGgoSZW5hYmxlZF9jYXRlZ29yaWVzGAIgAygJEhUKDWRpc2FibGVkX3RhZ3MYAyADKAkSFAoMZW5hYmxlZF90YWdzGAQgAygJEiYKHmRpc2FibGVfaW5jcmVtZW50YWxfdGltZXN0YW1wcxgFIAEoCBIhChl0aW1lc3RhbXBfdW5pdF9tdWx0aXBsaWVyGAYgASgEEiAKGGZpbHRlcl9kZWJ1Z19hbm5vdGF0aW9ucxgHIAEoCBIjChtlbmFibGVfdGhyZWFkX3RpbWVfc2FtcGxpbmcYCCABKAgSIgoaZmlsdGVyX2R5bmFtaWNfZXZlbnRfbmFtZXMYCSABKAg");

/**
 * The following fields define the set of enabled trace categories. Each list
 * item is a glob.
 *
 * To determine if category is enabled, it is checked against the filters in
 * the following order:
 *
 *   1. Exact matches in enabled categories.
 *   2. Exact matches in enabled tags.
 *   3. Exact matches in disabled categories.
 *   4. Exact matches in disabled tags.
 *   5. Pattern matches in enabled categories.
 *   6. Pattern matches in enabled tags.
 *   7. Pattern matches in disabled categories.
 *   8. Pattern matches in disabled tags.
 *
 * If none of the steps produced a match:
 *  - In the C++ SDK (`perfetto::Category`), categories are enabled by
 *  default.
 *  - In the C SDK (`PerfettoTeCategory`), categories are disabled by default.
 *
 * Examples:
 *
 *  - To enable all non-slow/debug categories:
 *
 *       enabled_categories: "*"
 *
 *  - To enable specific categories:
 *
 *       disabled_categories: "*"
 *       enabled_categories: "my_category"
 *       enabled_categories: "my_category2"
 *
 *  - To enable only categories with a specific tag:
 *
 *       disabled_tags: "*"
 *       enabled_tags: "my_tag"
 *
 *
 * @generated from message perfetto.protos.TrackEventConfig
 */
export type TrackEventConfig = Message<"perfetto.protos.TrackEventConfig"> & {
  /**
   * Default: []
   *
   * @generated from field: repeated string disabled_categories = 1;
   */
  disabledCategories: string[];

  /**
   * Default: []
   *
   * @generated from field: repeated string enabled_categories = 2;
   */
  enabledCategories: string[];

  /**
   * Default: ["slow", "debug"]
   *
   * @generated from field: repeated string disabled_tags = 3;
   */
  disabledTags: string[];

  /**
   * Default: []
   *
   * @generated from field: repeated string enabled_tags = 4;
   */
  enabledTags: string[];

  /**
   * Default: false (i.e. enabled by default)
   *
   * @generated from field: optional bool disable_incremental_timestamps = 5;
   */
  disableIncrementalTimestamps: boolean;

  /**
   * Allows to specify a custom unit different than the default (ns).
   * Also affects thread timestamps if enable_thread_time_sampling = true.
   * A multiplier of 1000 means that a timestamp = 3 should be interpreted as
   * 3000 ns = 3 us.
   * Default: 1 (if unset, it should be read as 1).
   *
   * @generated from field: optional uint64 timestamp_unit_multiplier = 6;
   */
  timestampUnitMultiplier: bigint;

  /**
   * Default: false (i.e. debug_annotations is NOT filtered out by default)
   * When true, any debug annotations provided as arguments to the
   * TRACE_EVENT macros are not written into the trace. Typed arguments will
   * still be emitted even if set to true.
   *
   * @generated from field: optional bool filter_debug_annotations = 7;
   */
  filterDebugAnnotations: boolean;

  /**
   * Default : false (i.e. disabled)
   * When true, the SDK samples and emits the current thread time counter value
   * for each event on the current thread's track. This value represents the
   * total CPU time consumed by that thread since its creation. Note that if a
   * thread is not scheduled by OS for some duration, that time won't be
   * included in thread_time.
   * Learn more : "CLOCK_THREAD_CPUTIME_ID" flag at
   * https://linux.die.net/man/3/clock_gettime
   *
   * @generated from field: optional bool enable_thread_time_sampling = 8;
   */
  enableThreadTimeSampling: boolean;

  /**
   * Default: false (i.e. dynamic event names are NOT filtered out by default)
   * When true, event_names wrapped in perfetto::DynamicString will be filtered
   * out.
   *
   * @generated from field: optional bool filter_dynamic_event_names = 9;
   */
  filterDynamicEventNames: boolean;
};

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

