blob: 68e0d6ae85eba2dca2381db47590876193684a2e [file]
// Copyright 2026 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//! Linux/Starnix `libc` syscall executor for `usbfs` trace recording and verification.
pub mod linux_ffs_daemon;
use libc as _;
use linux_uapi as _;
use serde as _;
use serde_json as _;
use usbfs_trace_schema::{DivergenceManifest, RecordedTrace, Scenario};
use zerocopy as _;
/// Execution mode for [`linux_exec`].
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ExecutionMode {
/// Execute a [`Scenario`] against real Linux and record a [`RecordedTrace`].
Record,
/// Replay a [`RecordedTrace`] and assert outcomes match.
Replay { apply_divergences: bool },
}
/// Executes a declarative [`Scenario`] against Linux and records its [`RecordedTrace`].
pub fn record_scenario(_scenario: &Scenario, _control_addr: &str) -> RecordedTrace {
todo!("b/579597237: implement usbfs Linux trace recorder")
}
/// Replays a [`RecordedTrace`] over `libc` syscalls and verifies every step outcome.
pub fn replay_trace(
_trace: &RecordedTrace,
_divergences: &DivergenceManifest,
_apply_divergences: bool,
_control_addr: &str,
) {
todo!("b/579597237: implement usbfs live syscall trace replayer")
}