//
// Copyright (C) 2019 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/profiling/java_hprof_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/profiling/java_hprof_config.proto.
 */
export const file_protos_perfetto_config_profiling_java_hprof_config: GenFile = /*@__PURE__*/
  fileDesc("Cjhwcm90b3MvcGVyZmV0dG8vY29uZmlnL3Byb2ZpbGluZy9qYXZhX2hwcm9mX2NvbmZpZy5wcm90bxIPcGVyZmV0dG8ucHJvdG9zIuECCg9KYXZhSHByb2ZDb25maWcSFwoPcHJvY2Vzc19jbWRsaW5lGAEgAygJEgsKA3BpZBgCIAMoBBIbChN0YXJnZXRfaW5zdGFsbGVkX2J5GAcgAygJElUKFmNvbnRpbnVvdXNfZHVtcF9jb25maWcYAyABKAsyNS5wZXJmZXR0by5wcm90b3MuSmF2YUhwcm9mQ29uZmlnLkNvbnRpbnVvdXNEdW1wQ29uZmlnEh8KF21pbl9hbm9ueW1vdXNfbWVtb3J5X2tiGAQgASgNEhIKCmR1bXBfc21hcHMYBSABKAgSFQoNaWdub3JlZF90eXBlcxgGIAMoCRpoChRDb250aW51b3VzRHVtcENvbmZpZxIVCg1kdW1wX3BoYXNlX21zGAEgASgNEhgKEGR1bXBfaW50ZXJ2YWxfbXMYAiABKA0SHwoXc2Nhbl9waWRzX29ubHlfb25fc3RhcnQYAyABKAg");

/**
 * Configuration for managed app heap graph snapshots.
 *
 * @generated from message perfetto.protos.JavaHprofConfig
 */
export type JavaHprofConfig = Message<"perfetto.protos.JavaHprofConfig"> & {
  /**
   * Command line allowlist, matched against the /proc/<pid>/cmdline (not the
   * comm string). The semantics of this field were changed since its original
   * introduction.
   *
   * On Android T+ (13+), this field can specify a single wildcard (*), and
   * the profiler will attempt to match it in two possible ways:
   * * if the pattern starts with a '/', then it is matched against the first
   *   segment of the cmdline (i.e. argv0). For example "/bin/e*" would match
   *   "/bin/echo".
   * * otherwise the pattern is matched against the part of argv0
   *   corresponding to the binary name (this is unrelated to /proc/pid/exe).
   *   For example "echo" would match "/bin/echo".
   *
   * On Android S (12) and below, both this pattern and /proc/pid/cmdline get
   * normalized prior to an exact string comparison. Normalization is as
   * follows: (1) trim everything beyond the first null or "@" byte; (2) if
   * the string contains forward slashes, trim everything up to and including
   * the last one.
   *
   * Implementation note: in either case, at most 511 characters of cmdline
   * are considered.
   *
   * @generated from field: repeated string process_cmdline = 1;
   */
  processCmdline: string[];

  /**
   * For watermark based triggering or local debugging.
   *
   * @generated from field: repeated uint64 pid = 2;
   */
  pid: bigint[];

  /**
   * Only profile target if it was installed by one of the packages given.
   * Special values are:
   * * @system: installed on the system partition
   * * @product: installed on the product partition
   * * @null: sideloaded
   * Supported on Android 12+.
   *
   * @generated from field: repeated string target_installed_by = 7;
   */
  targetInstalledBy: string[];

  /**
   * Dump at a predefined interval.
   *
   * @generated from field: optional perfetto.protos.JavaHprofConfig.ContinuousDumpConfig continuous_dump_config = 3;
   */
  continuousDumpConfig?: JavaHprofConfig_ContinuousDumpConfig;

  /**
   * Do not profile processes whose anon RSS + swap < given value.
   *
   * @generated from field: optional uint32 min_anonymous_memory_kb = 4;
   */
  minAnonymousMemoryKb: number;

  /**
   * Include the process' /proc/self/smaps.
   * This only shows maps that:
   * * start with /system
   * * start with /vendor
   * * start with /data/app
   * * contain "extracted in memory from Y", where Y matches any of the above
   *
   * @generated from field: optional bool dump_smaps = 5;
   */
  dumpSmaps: boolean;

  /**
   * Exclude objects of the following types from the profile. This can be
   * useful if lots of uninteresting objects, e.g. "sun.misc.Cleaner".
   *
   * @generated from field: repeated string ignored_types = 6;
   */
  ignoredTypes: string[];
};

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

/**
 * If dump_interval_ms != 0, the following configuration is used.
 *
 * @generated from message perfetto.protos.JavaHprofConfig.ContinuousDumpConfig
 */
export type JavaHprofConfig_ContinuousDumpConfig = Message<"perfetto.protos.JavaHprofConfig.ContinuousDumpConfig"> & {
  /**
   * ms to wait before first continuous dump.
   * A dump is always created at the beginning of the trace.
   *
   * @generated from field: optional uint32 dump_phase_ms = 1;
   */
  dumpPhaseMs: number;

  /**
   * ms to wait between following dumps.
   *
   * @generated from field: optional uint32 dump_interval_ms = 2;
   */
  dumpIntervalMs: number;

  /**
   * If true, scans all the processes to find `process_cmdline` and filter by
   * `min_anonymous_memory_kb` only at data source start. Default on Android
   * S-.
   *
   * If false, rescans all the processes to find on every dump. Default on
   * Android T+.
   *
   * @generated from field: optional bool scan_pids_only_on_start = 3;
   */
  scanPidsOnlyOnStart: boolean;
};

/**
 * Describes the message perfetto.protos.JavaHprofConfig.ContinuousDumpConfig.
 * Use `create(JavaHprofConfig_ContinuousDumpConfigSchema)` to create a new message.
 */
export const JavaHprofConfig_ContinuousDumpConfigSchema: GenMessage<JavaHprofConfig_ContinuousDumpConfig> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_config_profiling_java_hprof_config, 0, 0);

