|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Go to the source code of this file.
Classes | |
| struct | disk_t |
| struct | rec_t |
| struct | image_t |
Macros | |
| #define | CHECK(condition) |
| #define | DATA_START 64U |
| #define | CHUNKS 4U |
| #define | BS EMMC_BLOCK_SIZE |
Functions | |
| static void | disk_new (disk_t *d, uint32_t capacity) |
| static void | disk_power_cycle (disk_t *d) |
| static emmc_status_t | f_start (void *ctx, uint32_t *count) |
| static emmc_status_t | f_read (void *ctx, uint32_t lba, void *buf, uint32_t count, uint32_t budget) |
| static emmc_status_t | f_write (void *ctx, uint32_t lba, const void *buf, uint32_t count, uint32_t budget) |
| static void | f_lock (void *ctx) |
| static void | f_unlock (void *ctx) |
| static emmc_log_config_t | config (void) |
| static void | log_new (emmc_log_t *log, disk_t *d) |
| static void | drain (emmc_log_t *log, uint32_t now) |
| static uint32_t | ref_crc (const uint8_t *p, size_t n) |
| static uint32_t | rd32 (const uint8_t *p) |
| static void | decode (const disk_t *d) |
| static void | test_crc (void) |
| static void | test_no_io_before_arm (void) |
| static void | fill_payload (uint8_t *p, unsigned i) |
| static void | test_session_roundtrip (void) |
| static void | test_sessions_and_remount (void) |
| static void | test_flight_keeps_recording (void) |
| static void | test_flush_interval (void) |
| static void | test_backpressure (void) |
| static void | test_torn_write (void) |
| static void | test_torn_write_hole (void) |
| static void | test_stale_epoch (void) |
| static void | test_start_failure (void) |
| static void | test_write_retry (void) |
| static void | test_full (void) |
| static void | test_invalid_init (void) |
| int | main (void) |
Variables | |
| static const emmc_port_t | port = {f_start, f_read, f_write, f_lock, f_unlock} |
| static emmc_log_chunk_t | chunks [CHUNKS] |
| static uint8_t | scratch [BS] |
| static image_t | img |
| #define BS EMMC_BLOCK_SIZE |
Definition at line 24 of file test_emmc_log.c.
| #define CHECK | ( | condition | ) |
Definition at line 14 of file test_emmc_log.c.
Referenced by decode(), disk_new(), drain(), f_lock(), f_read(), f_start(), f_unlock(), f_write(), log_new(), test_backpressure(), test_crc(), test_flight_keeps_recording(), test_flush_interval(), test_full(), test_invalid_init(), test_no_io_before_arm(), test_session_roundtrip(), test_sessions_and_remount(), test_stale_epoch(), test_start_failure(), test_torn_write(), test_torn_write_hole(), and test_write_retry().
| #define CHUNKS 4U |
Definition at line 23 of file test_emmc_log.c.
Referenced by log_new(), and test_backpressure().
| #define DATA_START 64U |
Definition at line 22 of file test_emmc_log.c.
|
static |
Definition at line 130 of file test_emmc_log.c.
References DATA_START, emmc_log_config_t::data_start_lba, and emmc_log_default_config().
Referenced by log_new(), and test_invalid_init().
|
static |
Definition at line 183 of file test_emmc_log.c.
References b, disk_t::blocks, BS, disk_t::capacity, CHECK, DATA_START, img, o, r, rd32(), rd32(), and ref_crc().
Referenced by stardesign.directory::_fetch_auth(), backend.routers.layerx::_kind_of(), detail::serializer< BasicJsonType >::for(), backend.routers.flight::generate_rocket_diagram(), engine.pipeline.cea_cache::safe_print(), test_backpressure(), test_flight_keeps_recording(), test_flush_interval(), test_layerx_export::test_parquet_carries_the_same_table_with_units(), test_session_roundtrip(), test_sessions_and_remount(), test_stale_epoch(), test_layerx_export::test_the_fea_bundle_carries_the_named_files_and_its_peaks_are_the_histories_maxima(), test_torn_write(), ota_upload::upload(), ota_upload::upload_firmware(), and sense_testing_gui::upload_firmware_to_esp32().
|
static |
Definition at line 41 of file test_emmc_log.c.
References disk_t::blocks, BS, disk_t::capacity, CHECK, and NULL.
Referenced by test_backpressure(), test_flight_keeps_recording(), test_flush_interval(), test_full(), test_invalid_init(), test_no_io_before_arm(), test_session_roundtrip(), test_sessions_and_remount(), test_stale_epoch(), test_start_failure(), test_torn_write(), test_torn_write_hole(), and test_write_retry().
|
static |
Definition at line 49 of file test_emmc_log.c.
References b, disk_t::blocks, and disk_t::capacity.
Referenced by test_sessions_and_remount(), test_stale_epoch(), test_torn_write(), and test_torn_write_hole().
|
static |
Definition at line 141 of file test_emmc_log.c.
References CHECK, emmc_log_backlog(), emmc_log_service(), and EMMC_OK.
Referenced by anonymous_namespace{t7_bridge_main.cpp}::run_board(), test_backpressure(), test_flight_keeps_recording(), test_session_roundtrip(), test_sessions_and_remount(), test_stale_epoch(), test_torn_write(), and test_torn_write_hole().
|
static |
Definition at line 112 of file test_emmc_log.c.
References CHECK, disk_t::lock_depth, and disk_t::locks.
|
static |
Definition at line 68 of file test_emmc_log.c.
References disk_t::blocks, BS, CHECK, count(), EMMC_ERR_IO, EMMC_OK, disk_t::lock_depth, disk_t::powered_off, disk_t::reads, and disk_t::starts.
|
static |
Definition at line 57 of file test_emmc_log.c.
References disk_t::capacity, CHECK, count(), EMMC_OK, disk_t::lock_depth, disk_t::start_result, and disk_t::starts.
|
static |
Definition at line 119 of file test_emmc_log.c.
References CHECK, and disk_t::lock_depth.
|
static |
Definition at line 83 of file test_emmc_log.c.
References disk_t::blocks, BS, CHECK, count(), EMMC_ERR_IO, EMMC_OK, disk_t::lock_depth, disk_t::powered_off, disk_t::starts, disk_t::torn_armed, disk_t::torn_mask, disk_t::write_failures, and disk_t::writes.
|
static |
Definition at line 249 of file test_emmc_log.c.
References p.
Referenced by test_session_roundtrip().
|
static |
Definition at line 136 of file test_emmc_log.c.
References CHECK, CHUNKS, chunks, config(), emmc_log_init(), EMMC_OK, port, and scratch.
Referenced by test_backpressure(), test_flight_keeps_recording(), test_flush_interval(), test_full(), test_no_io_before_arm(), test_session_roundtrip(), test_sessions_and_remount(), test_stale_epoch(), test_start_failure(), test_torn_write(), test_torn_write_hole(), and test_write_retry().
| int main | ( | void | ) |
Definition at line 589 of file test_emmc_log.c.
References test_backpressure(), test_crc(), test_flight_keeps_recording(), test_flush_interval(), test_full(), test_invalid_init(), test_no_io_before_arm(), test_session_roundtrip(), test_sessions_and_remount(), test_stale_epoch(), test_start_failure(), test_torn_write(), test_torn_write_hole(), and test_write_retry().
|
static |
Definition at line 161 of file test_emmc_log.c.
References p.
Referenced by decode(), and test_torn_write_hole().
|
static |
Definition at line 150 of file test_emmc_log.c.
References p.
Referenced by decode(), test_crc(), and test_torn_write_hole().
|
static |
Definition at line 382 of file test_emmc_log.c.
References disk_t::blocks, CHECK, CHUNKS, DATA_START, decode(), disk_new(), drain(), emmc_log_stats_t::dropped, emmc_log_append(), emmc_log_backlog(), emmc_log_flush(), emmc_log_on_state(), EMMC_REC_DROPPED, FLIGHT_ARMED, FLIGHT_IDLE, img, log_new(), ok, p, r, rd32(), and emmc_log_t::stats.
Referenced by main().
|
static |
Definition at line 222 of file test_emmc_log.c.
References b, CHECK, emmc_log_crc32(), and ref_crc().
Referenced by main().
|
static |
Definition at line 330 of file test_emmc_log.c.
References disk_t::blocks, CHECK, DATA_START, decode(), disk_new(), drain(), emmc_log_append(), emmc_log_flush(), emmc_log_on_state(), EMMC_REC_STATE, FLIGHT_ARMED, FLIGHT_EV_APOGEE_DETECTED, FLIGHT_EV_ARM, FLIGHT_EV_LAUNCH_DETECTED, FLIGHT_EV_UNARM, FLIGHT_IDLE, FLIGHT_LAUNCHED, FLIGHT_RECOVERY, flight_state_next(), img, and log_new().
Referenced by main().
|
static |
Definition at line 363 of file test_emmc_log.c.
References disk_t::blocks, CHECK, DATA_START, decode(), disk_new(), emmc_log_on_state(), emmc_log_service(), EMMC_OK, FLIGHT_ARMED, FLIGHT_IDLE, img, log_new(), emmc_log_stats_t::pad_blocks, emmc_log_t::stats, and disk_t::writes.
Referenced by main().
|
static |
Definition at line 549 of file test_emmc_log.c.
References disk_t::blocks, CHECK, emmc_log_stats_t::chunks_lost, emmc_log_stats_t::chunks_written, DATA_START, emmc_log_t::disk, disk_new(), EMMC_DISK_FULL, EMMC_ERR_NOT_READY, emmc_log_append(), emmc_log_flush(), emmc_log_on_state(), emmc_log_service(), EMMC_OK, FLIGHT_ARMED, FLIGHT_IDLE, log_new(), emmc_log_t::recording, and emmc_log_t::stats.
Referenced by main().
|
static |
Definition at line 568 of file test_emmc_log.c.
References disk_t::blocks, CHECK, chunks, config(), emmc_log_config_t::data_start_lba, disk_new(), EMMC_ERR_PARAM, emmc_log_init(), EMMC_LOG_MAX_CHUNKS, NULL, port, scratch, and emmc_port_t::unlock.
Referenced by main().
|
static |
Definition at line 232 of file test_emmc_log.c.
References disk_t::blocks, CHECK, DATA_START, emmc_log_t::disk, disk_new(), EMMC_DISK_UNMOUNTED, emmc_log_append(), emmc_log_on_state(), emmc_log_service(), EMMC_OK, FLIGHT_IDLE, FLIGHT_SELF_TEST, log_new(), disk_t::reads, disk_t::starts, and disk_t::writes.
Referenced by main().
|
static |
Definition at line 255 of file test_emmc_log.c.
References disk_t::blocks, BS, disk_t::capacity, CHECK, emmc_log_stats_t::chunks_written, DATA_START, decode(), disk_new(), drain(), emmc_log_stats_t::dropped, emmc_log_append(), emmc_log_on_state(), EMMC_REC_SESSION_END, EMMC_REC_SESSION_START, fill_payload(), FLIGHT_ARMED, FLIGHT_IDLE, img, disk_t::lock_depth, disk_t::locks, log_new(), p, r, emmc_log_stats_t::records, disk_t::starts, and emmc_log_t::stats.
Referenced by main().
|
static |
Definition at line 297 of file test_emmc_log.c.
References disk_t::blocks, CHECK, DATA_START, decode(), disk_new(), disk_power_cycle(), drain(), emmc_log_append(), emmc_log_flush(), emmc_log_on_state(), end(), FLIGHT_ARMED, FLIGHT_IDLE, emmc_log_t::head, img, log_new(), and disk_t::starts.
Referenced by main().
|
static |
Definition at line 475 of file test_emmc_log.c.
References disk_t::blocks, CHECK, DATA_START, decode(), disk_new(), disk_power_cycle(), drain(), emmc_log_flush(), emmc_log_on_state(), emmc_log_t::epoch, FLIGHT_ARMED, FLIGHT_IDLE, emmc_log_t::head, img, and log_new().
Referenced by main().
|
static |
Definition at line 498 of file test_emmc_log.c.
References disk_t::blocks, CHECK, emmc_log_stats_t::chunks_lost, DATA_START, emmc_log_t::disk, disk_new(), EMMC_DISK_FAULT, EMMC_ERR_TIMEOUT, emmc_log_append(), emmc_log_flush(), emmc_log_on_state(), emmc_log_service(), EMMC_OK, FLIGHT_ARMED, FLIGHT_IDLE, log_new(), emmc_log_t::recording, disk_t::start_result, disk_t::starts, emmc_log_t::stats, and disk_t::writes.
Referenced by main().
|
static |
Definition at line 416 of file test_emmc_log.c.
References disk_t::blocks, CHECK, DATA_START, decode(), disk_new(), disk_power_cycle(), drain(), EMMC_ERR_IO, emmc_log_append(), emmc_log_flush(), emmc_log_on_state(), emmc_log_service(), FLIGHT_ARMED, FLIGHT_IDLE, emmc_log_t::head, img, log_new(), disk_t::torn_armed, and disk_t::torn_mask.
Referenced by main().
|
static |
Definition at line 446 of file test_emmc_log.c.
References b, disk_t::blocks, BS, CHECK, DATA_START, disk_new(), disk_power_cycle(), drain(), EMMC_ERR_IO, emmc_log_flush(), emmc_log_on_state(), emmc_log_service(), FLIGHT_ARMED, FLIGHT_IDLE, emmc_log_t::head, log_new(), rd32(), ref_crc(), disk_t::torn_armed, and disk_t::torn_mask.
Referenced by main().
|
static |
Definition at line 519 of file test_emmc_log.c.
References disk_t::blocks, CHECK, emmc_log_stats_t::chunks_lost, emmc_log_stats_t::chunks_written, DATA_START, emmc_log_t::disk, disk_new(), EMMC_DISK_FAULT, EMMC_DISK_MOUNTED, EMMC_ERR_IO, emmc_log_append(), emmc_log_flush(), emmc_log_on_state(), emmc_log_service(), EMMC_OK, FLIGHT_ARMED, FLIGHT_IDLE, log_new(), emmc_log_t::stats, emmc_log_stats_t::write_errors, and disk_t::write_failures.
Referenced by main().
|
static |
Definition at line 127 of file test_emmc_log.c.
|
static |
Definition at line 181 of file test_emmc_log.c.
Referenced by check_emmc_stall(), decode(), read_image(), test_backpressure(), test_flight_keeps_recording(), test_flush_interval(), test_session_roundtrip(), test_sessions_and_remount(), test_stale_epoch(), and test_torn_write().
Definition at line 125 of file test_emmc_log.c.
|
static |
Definition at line 128 of file test_emmc_log.c.
Referenced by anonymous_namespace{test_lc_linear_fit.cpp}::a_model_change_refits_without_a_capture(), anonymous_namespace{test_cubic_store_namespace.cpp}::add_point_rejects_unknown_uid(), anonymous_namespace{test_lc_linear_fit.cpp}::both_fits_are_serialized(), anonymous_namespace{test_lc_linear_fit.cpp}::cubic_model_is_unchanged(), disabled_board_orphan_is_not_applied(), emmc_log_init(), emmc_stm32_init(), anonymous_namespace{test_lc_tare.cpp}::fingerprint_tracks_what_the_curve_does(), anonymous_namespace{test_cubic_store_namespace.cpp}::kind_round_trip(), anonymous_namespace{test_cubic_store_namespace.cpp}::legacy_file_without_kind(), anonymous_namespace{test_lc_linear_fit.cpp}::linear_model_fits_a_line(), anonymous_namespace{test_lc_linear_fit.cpp}::linear_needs_two_points(), anonymous_namespace{test_lc_tare.cpp}::loaded_tare_is_corrected_by_recompute(), log_new(), anonymous_namespace{test_cubic_store_namespace.cpp}::logical_1_collision(), anonymous_namespace{test_lc_tare.cpp}::non_finite_offset_is_never_recorded(), port_start(), anonymous_namespace{test_cubic_store_namespace.cpp}::pt_lc_logical_collision(), anonymous_namespace{test_lc_linear_fit.cpp}::raw_coefficients_match_the_normalized_form(), fsw::elodin::ElodinClient::read_packet(), anonymous_namespace{test_lc_tare.cpp}::recompute_carries_tare_across_a_better_fit(), anonymous_namespace{test_cubic_store_namespace.cpp}::recovery_regenerates_overwritten_pt_curve(), removed_board_does_not_win_the_logical_map(), role_moved_to_t7_keeps_its_unit(), anonymous_namespace{test_lc_tare.cpp}::save_load_round_trip(), anonymous_namespace{test_lc_tare.cpp}::stale_audit_finds_a_missed_recompute(), t7_role_follows_within_t7(), anonymous_namespace{test_lc_linear_fit.cpp}::tare_cancels_zero_drift_on_linear_not_cubic(), anonymous_namespace{test_lc_linear_fit.cpp}::tared_reading(), test_invalid_init(), anonymous_namespace{test_cubic_store_namespace.cpp}::unreadable_file_is_not_overwritten(), anonymous_namespace{test_lc_tare.cpp}::unreadable_file_is_not_overwritten(), and anonymous_namespace{test_lc_tare.cpp}::untrusted_curves_keep_the_last_good_offset().