import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
import type { FollowerEvent, PerfEvents_Timebase } from "../../common/perf_events_pb";
import type { Message } from "@bufbuild/protobuf";
/**
 * Describes the file protos/perfetto/config/profiling/perf_event_config.proto.
 */
export declare const file_protos_perfetto_config_profiling_perf_event_config: GenFile;
/**
 * Configuration for the traced_perf profiler.
 *
 * Example config for basic cpu profiling:
 *   perf_event_config {
 *     timebase {
 *       frequency: 80
 *     }
 *     callstack_sampling {
 *       scope {
 *         target_cmdline: "surfaceflinger"
 *         target_cmdline: "system_server"
 *       }
 *       kernel_frames: true
 *     }
 *   }
 *
 * Next id: 20
 *
 * @generated from message perfetto.protos.PerfEventConfig
 */
export type PerfEventConfig = Message<"perfetto.protos.PerfEventConfig"> & {
    /**
     * What event to sample on, and how often.
     * Defined in common/perf_events.proto.
     *
     * @generated from field: optional perfetto.protos.PerfEvents.Timebase timebase = 15;
     */
    timebase?: PerfEvents_Timebase;
    /**
     * Other events associated with the leader described in the timebase.
     *
     * @generated from field: repeated perfetto.protos.FollowerEvent followers = 19;
     */
    followers: FollowerEvent[];
    /**
     * If set, the profiler will sample userspace processes' callstacks at the
     * interval specified by the |timebase|.
     * If unset, the profiler will record only the event counts.
     *
     * @generated from field: optional perfetto.protos.PerfEventConfig.CallstackSampling callstack_sampling = 16;
     */
    callstackSampling?: PerfEventConfig_CallstackSampling;
    /**
     * How often the per-cpu ring buffers are read by the producer.
     * If unset, an implementation-defined default is used.
     *
     * @generated from field: optional uint32 ring_buffer_read_period_ms = 8;
     */
    ringBufferReadPeriodMs: number;
    /**
     * Size (in 4k pages) of each per-cpu ring buffer that is filled by the
     * kernel. If set, must be a power of two.
     * If unset, an implementation-defined default is used.
     *
     * @generated from field: optional uint32 ring_buffer_pages = 3;
     */
    ringBufferPages: number;
    /**
     * Drop samples if the heap memory held by the samples in the unwinder queue
     * is above the given limit. This counts the memory across all concurrent data
     * sources (not just this one's), and there is no fairness guarantee - the
     * whole quota might be used up by a concurrent source.
     *
     * @generated from field: optional uint64 max_enqueued_footprint_kb = 17;
     */
    maxEnqueuedFootprintKb: bigint;
    /**
     * Stop the data source if traced_perf's combined {RssAnon + Swap} memory
     * footprint exceeds this value.
     *
     * @generated from field: optional uint32 max_daemon_memory_kb = 13;
     */
    maxDaemonMemoryKb: number;
    /**
     * Timeout for the remote /proc/<pid>/{maps,mem} file descriptors for a
     * sampled process. This is primarily for Android, where this lookup is
     * asynchronous. As long as the producer is waiting, the associated samples
     * will be kept enqueued (putting pressure on the capacity of the shared
     * unwinding queue). Once a lookup for a process expires, all associated
     * samples are discarded. However, if the lookup still succeeds after the
     * timeout, future samples will be handled normally.
     * If unset, an implementation-defined default is used.
     *
     * @generated from field: optional uint32 remote_descriptor_timeout_ms = 9;
     */
    remoteDescriptorTimeoutMs: number;
    /**
     * Optional period for clearing state cached by the unwinder. This is a heavy
     * operation that is only necessary for traces that target a wide set of
     * processes, and require the memory footprint to be reset periodically.
     * If unset, the cached state will not be cleared.
     *
     * @generated from field: optional uint32 unwind_state_clear_period_ms = 10;
     */
    unwindStateClearPeriodMs: number;
    /**
     * If set, only profile target if it was installed by a package with one of
     * these names. Special values:
     * * "@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 = 18;
     */
    targetInstalledBy: string[];
    /**
     * Note: legacy configs had to set |all_cpus| to true to pass parsing.
     * We rely on this to detect such configs.
     *
     * @generated from field: optional bool all_cpus = 1;
     */
    allCpus: boolean;
    /**
     * @generated from field: optional uint32 sampling_frequency = 2;
     */
    samplingFrequency: number;
    /**
     * @generated from field: optional bool kernel_frames = 12;
     */
    kernelFrames: boolean;
    /**
     * @generated from field: repeated int32 target_pid = 4;
     */
    targetPid: number[];
    /**
     * @generated from field: repeated string target_cmdline = 5;
     */
    targetCmdline: string[];
    /**
     * @generated from field: repeated int32 exclude_pid = 6;
     */
    excludePid: number[];
    /**
     * @generated from field: repeated string exclude_cmdline = 7;
     */
    excludeCmdline: string[];
    /**
     * @generated from field: optional uint32 additional_cmdline_count = 11;
     */
    additionalCmdlineCount: number;
};
/**
 * Describes the message perfetto.protos.PerfEventConfig.
 * Use `create(PerfEventConfigSchema)` to create a new message.
 */
export declare const PerfEventConfigSchema: GenMessage<PerfEventConfig>;
/**
 * @generated from message perfetto.protos.PerfEventConfig.CallstackSampling
 */
export type PerfEventConfig_CallstackSampling = Message<"perfetto.protos.PerfEventConfig.CallstackSampling"> & {
    /**
     * Defines a set of processes for which samples are retained/skipped. If
     * unset, all samples are kept, but beware that it will be very heavy on the
     * stack unwinder, which might start dropping samples due to overload.
     *
     * @generated from field: optional perfetto.protos.PerfEventConfig.Scope scope = 1;
     */
    scope?: PerfEventConfig_Scope;
    /**
     * If true, callstacks will include the kernel-space frames. Such frames can
     * be identified by a magical "kernel" string as their mapping name.
     * Requires traced_perf to be running as root, or kptr_restrict to have been
     * manually unrestricted. On Android, the platform should do the right thing
     * on debug builds.
     * This does *not* disclose KASLR, as only the function names are emitted.
     *
     * @generated from field: optional bool kernel_frames = 2;
     */
    kernelFrames: boolean;
    /**
     * Whether to record and unwind userspace callstacks. If unset, defaults to
     * including userspace (UNWIND_DWARF) both for backwards compatibility and
     * as the most common default (this defaulting is only applicable if the
     * outer CallstackSampling message is explicitly set).
     *
     * @generated from field: optional perfetto.protos.PerfEventConfig.UnwindMode user_frames = 3;
     */
    userFrames: PerfEventConfig_UnwindMode;
};
/**
 * Describes the message perfetto.protos.PerfEventConfig.CallstackSampling.
 * Use `create(PerfEventConfig_CallstackSamplingSchema)` to create a new message.
 */
export declare const PerfEventConfig_CallstackSamplingSchema: GenMessage<PerfEventConfig_CallstackSampling>;
/**
 * @generated from message perfetto.protos.PerfEventConfig.Scope
 */
export type PerfEventConfig_Scope = Message<"perfetto.protos.PerfEventConfig.Scope"> & {
    /**
     * Process ID (TGID) allowlist. If this list is not empty, only matching
     * samples will be retained. If multiple allow/deny-lists are
     * specified by the config, then all of them are evaluated for each sampled
     * process.
     *
     * @generated from field: repeated int32 target_pid = 1;
     */
    targetPid: number[];
    /**
     * 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 target_cmdline = 2;
     */
    targetCmdline: string[];
    /**
     * List of excluded pids.
     *
     * @generated from field: repeated int32 exclude_pid = 3;
     */
    excludePid: number[];
    /**
     * List of excluded cmdlines. See description of |target_cmdline| for how
     * this is handled.
     *
     * @generated from field: repeated string exclude_cmdline = 4;
     */
    excludeCmdline: string[];
    /**
     * Number of additional command lines to sample. Only those which are
     * neither explicitly included nor excluded will be considered. Processes
     * are accepted on a first come, first served basis.
     *
     * @generated from field: optional uint32 additional_cmdline_count = 5;
     */
    additionalCmdlineCount: number;
    /**
     * If set to N, all encountered processes will be put into one of the N
     * possible bins, and only one randomly-chosen bin will be selected for
     * unwinding. The binning is simply "pid % N", under the assumption that
     * low-order bits of pids are roughly uniformly distributed. Other explicit
     * inclusions/exclusions in this |Scope| message are still respected.
     *
     * The profiler will report the chosen shard in PerfSampleDefaults, and the
     * values will be queryable in trace processor under the "stats" table as
     * "perf_process_shard_count" and "perf_chosen_process_shard".
     *
     * NB: all data sources in a config that set |process_shard_count| must set
     * it to the same value. The profiler will choose one bin for all those data
     * sources.
     *
     * @generated from field: optional uint32 process_shard_count = 6;
     */
    processShardCount: number;
};
/**
 * Describes the message perfetto.protos.PerfEventConfig.Scope.
 * Use `create(PerfEventConfig_ScopeSchema)` to create a new message.
 */
export declare const PerfEventConfig_ScopeSchema: GenMessage<PerfEventConfig_Scope>;
/**
 * Userspace unwinding mode. A possible future addition is kernel-unwound
 * callchains for frame pointer based systems.
 *
 * @generated from enum perfetto.protos.PerfEventConfig.UnwindMode
 */
export declare enum PerfEventConfig_UnwindMode {
    /**
     * @generated from enum value: UNWIND_UNKNOWN = 0;
     */
    UNWIND_UNKNOWN = 0,
    /**
     * Do not unwind userspace:
     *
     * @generated from enum value: UNWIND_SKIP = 1;
     */
    UNWIND_SKIP = 1,
    /**
     * Use libunwindstack (default):
     *
     * @generated from enum value: UNWIND_DWARF = 2;
     */
    UNWIND_DWARF = 2,
    /**
     * Use userspace frame pointer unwinder:
     *
     * @generated from enum value: UNWIND_FRAME_POINTER = 3;
     */
    UNWIND_FRAME_POINTER = 3
}
/**
 * Describes the enum perfetto.protos.PerfEventConfig.UnwindMode.
 */
export declare const PerfEventConfig_UnwindModeSchema: GenEnum<PerfEventConfig_UnwindMode>;
//# sourceMappingURL=perf_event_config_pb.d.ts.map