import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
import type { FtraceEvent } from "./ftrace_event_pb";
import type { FtraceParseStatus } from "./ftrace_stats_pb";
import type { Message } from "@bufbuild/protobuf";
/**
 * Describes the file protos/perfetto/trace/ftrace/ftrace_event_bundle.proto.
 */
export declare const file_protos_perfetto_trace_ftrace_ftrace_event_bundle: GenFile;
/**
 * The result of tracing one or more ftrace data pages from a single per-cpu
 * kernel ring buffer. If collating multiple pages' worth of events, all of
 * them come from contiguous pages, with no kernel data loss in between.
 *
 * @generated from message perfetto.protos.FtraceEventBundle
 */
export type FtraceEventBundle = Message<"perfetto.protos.FtraceEventBundle"> & {
    /**
     * @generated from field: optional uint32 cpu = 1;
     */
    cpu: number;
    /**
     * @generated from field: repeated perfetto.protos.FtraceEvent event = 2;
     */
    event: FtraceEvent[];
    /**
     * Set to true if there was data loss between the last time we've read from
     * the corresponding per-cpu kernel buffer, and the earliest event recorded
     * in this bundle.
     *
     * @generated from field: optional bool lost_events = 3;
     */
    lostEvents: boolean;
    /**
     * @generated from field: optional perfetto.protos.FtraceEventBundle.CompactSched compact_sched = 4;
     */
    compactSched?: FtraceEventBundle_CompactSched;
    /**
     * traced_probes always sets the ftrace_clock to "boot". That is not available
     * in older kernels (v3.x). In that case we fallback on "global" or "local".
     * When we do that, we report the fallback clock in each bundle so we can do
     * proper clock syncing at parsing time in TraceProcessor. We cannot use the
     * TracePacket timestamp_clock_id because: (1) there is no per-packet
     * timestamp for ftrace bundles; (2) "global" does not match CLOCK_MONOTONIC.
     * Having a dedicated and explicit flag allows us to correct further misakes
     * in future by looking at the kernel version.
     * This field has been introduced in perfetto v19 / Android T (13).
     * This field is omitted when the ftrace clock is just "boot", as that is the
     * default assumption (and for consistency with the past).
     *
     * @generated from field: optional perfetto.protos.FtraceClock ftrace_clock = 5;
     */
    ftraceClock: FtraceClock;
    /**
     * The timestamp according to the ftrace clock, taken at the same instant
     * as |boot_timestamp|. This is used to sync ftrace events when a non-boot
     * clock is used as the ftrace clock. We don't use the ClockSnapshot packet
     * because the ftrace global/local clocks don't match any of the clock_gettime
     * domains and can be only read by traced_probes.
     *
     * Only set when |ftrace_clock| != FTRACE_CLOCK_UNSPECIFIED.
     *
     * Implementation note: Populated by reading the 'now ts:' field in
     * tracefs/per_cpu/cpuX/stat.
     *
     * @generated from field: optional int64 ftrace_timestamp = 6;
     */
    ftraceTimestamp: bigint;
    /**
     * The timestamp according to CLOCK_BOOTTIME, taken at the same instant as
     * |ftrace_timestamp|. See documentation of |ftrace_timestamp| for
     * more info.
     *
     * Only set when |ftrace_clock| != FTRACE_CLOCK_UNSPECIFIED.
     *
     * @generated from field: optional int64 boot_timestamp = 7;
     */
    bootTimestamp: bigint;
    /**
     * @generated from field: repeated perfetto.protos.FtraceEventBundle.FtraceError error = 8;
     */
    error: FtraceEventBundle_FtraceError[];
    /**
     * Superseded by |previous_bundle_end_timestamp| in perfetto v47+. The
     * primary difference is that this field tracked the last timestamp read from
     * the per-cpu buffer, while the newer field tracks events that get
     * serialised into the trace.
     * Added in: perfetto v44.
     *
     * @generated from field: optional uint64 last_read_event_timestamp = 9;
     */
    lastReadEventTimestamp: bigint;
    /**
     * The timestamp (using ftrace clock) of the last event written into this
     * data source on this cpu. In other words: the last event in the previous
     * bundle.
     * Lets the trace processing find an initial timestamp after which ftrace
     * data is known to be valid across all cpus. Of particular importance when
     * the perfetto trace buffer is a ring buffer as well, as the overwriting of
     * oldest bundles can skew the first valid timestamp per cpu significantly.
     * Added in: perfetto v47.
     *
     * @generated from field: optional uint64 previous_bundle_end_timestamp = 10;
     */
    previousBundleEndTimestamp: bigint;
};
/**
 * Describes the message perfetto.protos.FtraceEventBundle.
 * Use `create(FtraceEventBundleSchema)` to create a new message.
 */
export declare const FtraceEventBundleSchema: GenMessage<FtraceEventBundle>;
/**
 * Optionally-enabled compact encoding of a batch of scheduling events. Only
 * a subset of events & their fields is recorded.
 * All fields (except comms) are stored in a structure-of-arrays form, one
 * entry in each repeated field per event.
 *
 * @generated from message perfetto.protos.FtraceEventBundle.CompactSched
 */
export type FtraceEventBundle_CompactSched = Message<"perfetto.protos.FtraceEventBundle.CompactSched"> & {
    /**
     * Interned table of unique strings for this bundle.
     *
     * @generated from field: repeated string intern_table = 5;
     */
    internTable: string[];
    /**
     * Delta-encoded timestamps across all sched_switch events within this
     * bundle. The first is absolute, each next one is relative to its
     * predecessor.
     *
     * @generated from field: repeated uint64 switch_timestamp = 1 [packed = true];
     */
    switchTimestamp: bigint[];
    /**
     * @generated from field: repeated int64 switch_prev_state = 2 [packed = true];
     */
    switchPrevState: bigint[];
    /**
     * @generated from field: repeated int32 switch_next_pid = 3 [packed = true];
     */
    switchNextPid: number[];
    /**
     * @generated from field: repeated int32 switch_next_prio = 4 [packed = true];
     */
    switchNextPrio: number[];
    /**
     * One per event, index into |intern_table| corresponding to the
     * next_comm field of the event.
     *
     * @generated from field: repeated uint32 switch_next_comm_index = 6 [packed = true];
     */
    switchNextCommIndex: number[];
    /**
     * Delta-encoded timestamps across all sched_waking events within this
     * bundle. The first is absolute, each next one is relative to its
     * predecessor.
     *
     * @generated from field: repeated uint64 waking_timestamp = 7 [packed = true];
     */
    wakingTimestamp: bigint[];
    /**
     * @generated from field: repeated int32 waking_pid = 8 [packed = true];
     */
    wakingPid: number[];
    /**
     * @generated from field: repeated int32 waking_target_cpu = 9 [packed = true];
     */
    wakingTargetCpu: number[];
    /**
     * @generated from field: repeated int32 waking_prio = 10 [packed = true];
     */
    wakingPrio: number[];
    /**
     * One per event, index into |intern_table| corresponding to the
     * comm field of the event.
     *
     * @generated from field: repeated uint32 waking_comm_index = 11 [packed = true];
     */
    wakingCommIndex: number[];
    /**
     * @generated from field: repeated uint32 waking_common_flags = 12 [packed = true];
     */
    wakingCommonFlags: number[];
};
/**
 * Describes the message perfetto.protos.FtraceEventBundle.CompactSched.
 * Use `create(FtraceEventBundle_CompactSchedSchema)` to create a new message.
 */
export declare const FtraceEventBundle_CompactSchedSchema: GenMessage<FtraceEventBundle_CompactSched>;
/**
 * Errors encountered during parsing of the raw ftrace data. In case of ring
 * buffer layout errors, the parser skips the rest of the offending kernel
 * buffer page and continues from the next page.
 * See also FtraceStats.ftrace_parse_errors, which collates all unique errors
 * seen within the duration of the trace (even if the affected bundles get
 * overwritten in ring buffer mode).
 *
 * @generated from message perfetto.protos.FtraceEventBundle.FtraceError
 */
export type FtraceEventBundle_FtraceError = Message<"perfetto.protos.FtraceEventBundle.FtraceError"> & {
    /**
     * Timestamp of the data that we're unable to parse, in the ftrace clock
     * domain. Currently, we use the base timestamp of the tracing page
     * containing the bad record rather than the time of the record itself.
     *
     * @generated from field: optional uint64 timestamp = 1;
     */
    timestamp: bigint;
    /**
     * @generated from field: optional perfetto.protos.FtraceParseStatus status = 2;
     */
    status: FtraceParseStatus;
};
/**
 * Describes the message perfetto.protos.FtraceEventBundle.FtraceError.
 * Use `create(FtraceEventBundle_FtraceErrorSchema)` to create a new message.
 */
export declare const FtraceEventBundle_FtraceErrorSchema: GenMessage<FtraceEventBundle_FtraceError>;
/**
 * @generated from enum perfetto.protos.FtraceClock
 */
export declare enum FtraceClock {
    /**
     * There is no FTRACE_CLOCK_BOOT entry as that's the default assumption. When
     * the ftrace clock is "boot", it's just omitted (so UNSPECIFIED == BOOT).
     *
     * @generated from enum value: FTRACE_CLOCK_UNSPECIFIED = 0;
     */
    UNSPECIFIED = 0,
    /**
     * @generated from enum value: FTRACE_CLOCK_UNKNOWN = 1;
     */
    UNKNOWN = 1,
    /**
     * @generated from enum value: FTRACE_CLOCK_GLOBAL = 2;
     */
    GLOBAL = 2,
    /**
     * @generated from enum value: FTRACE_CLOCK_LOCAL = 3;
     */
    LOCAL = 3,
    /**
     * @generated from enum value: FTRACE_CLOCK_MONO_RAW = 4;
     */
    MONO_RAW = 4
}
/**
 * Describes the enum perfetto.protos.FtraceClock.
 */
export declare const FtraceClockSchema: GenEnum<FtraceClock>;
//# sourceMappingURL=ftrace_event_bundle_pb.d.ts.map