|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Go to the source code of this file.
Functions | |
| static void | put16 (uint8_t *p, uint16_t v) |
| static void | put32 (uint8_t *p, uint32_t v) |
| static uint16_t | get16 (const uint8_t *p) |
| static uint32_t | get32 (const uint8_t *p) |
| uint32_t | emmc_log_crc32 (const void *data, uint32_t len) |
| static void | lock (emmc_log_t *log) |
| static void | unlock (emmc_log_t *log) |
| static uint8_t * | block_at (emmc_log_t *log, uint8_t chunk, uint8_t block) |
| static void | chunk_complete (emmc_log_t *log) |
| static void | close_block (emmc_log_t *log) |
| static void | seal (emmc_log_t *log) |
| static bool | acquire (emmc_log_t *log) |
| static bool | put_record (emmc_log_t *log, uint8_t type, uint32_t t_ms, const void *data, uint8_t len) |
| static bool | keep (emmc_log_t *log, uint8_t type, uint32_t t_ms, const void *data, uint8_t len) |
| emmc_log_config_t | emmc_log_default_config (void) |
| emmc_status_t | emmc_log_init (emmc_log_t *log, const emmc_port_t *port, void *context, const emmc_log_config_t *config, emmc_log_chunk_t *chunks, uint8_t chunk_count, uint8_t *scratch) |
| bool | emmc_log_on_state (emmc_log_t *log, flight_state_t from, flight_state_t to, uint32_t now_ms) |
| bool | emmc_log_append (emmc_log_t *log, uint8_t type, uint32_t t_ms, const void *data, uint8_t len) |
| void | emmc_log_flush (emmc_log_t *log) |
| uint8_t | emmc_log_backlog (const emmc_log_t *log) |
| static void | stop (emmc_log_t *log, emmc_disk_state_t why) |
| static void | release_write_chunk (emmc_log_t *log, bool written) |
| static emmc_status_t | probe (emmc_log_t *log, uint32_t k, bool *valid, uint32_t *session) |
| static emmc_status_t | search (emmc_log_t *log, uint32_t lo, uint32_t hi, uint32_t *end) |
| static emmc_status_t | format (emmc_log_t *log) |
| static emmc_status_t | mount (emmc_log_t *log) |
| emmc_status_t | emmc_log_service (emmc_log_t *log, uint32_t now_ms) |
|
static |
Definition at line 104 of file emmc_log.c.
References emmc_log_t::arm_index, emmc_log_chunk_t::bytes, emmc_log_t::chunk_arm, emmc_log_t::chunk_state, emmc_log_t::chunks, EMMC_CHUNK_FILLING, EMMC_CHUNK_FREE, EMMC_LOG_CHUNK_BYTES, emmc_log_t::fill_aged, emmc_log_t::fill_block, emmc_log_t::fill_chunk, emmc_log_t::fill_offset, emmc_log_t::fill_started_ms, and emmc_log_t::has_fill.
Referenced by put_record().
|
static |
Definition at line 63 of file emmc_log.c.
References emmc_log_chunk_t::bytes, chunk, emmc_log_t::chunks, and EMMC_BLOCK_SIZE.
Referenced by close_block(), emmc_log_service(), put_record(), and seal().
|
static |
Definition at line 67 of file emmc_log.c.
References emmc_log_t::chunk_count, emmc_log_t::chunk_state, EMMC_CHUNK_READY, emmc_log_t::fill_chunk, and emmc_log_t::has_fill.
Referenced by close_block(), and seal().
|
static |
Definition at line 73 of file emmc_log.c.
References b, block_at(), chunk_complete(), EMMC_LOG_CHUNK_BLOCKS, EMMC_LOG_KIND_DATA, emmc_log_t::fill_block, emmc_log_t::fill_chunk, emmc_log_t::fill_offset, and put16().
Referenced by put_record(), and seal().
| bool emmc_log_append | ( | emmc_log_t * | log, |
| uint8_t | type, | ||
| uint32_t | t_ms, | ||
| const void * | data, | ||
| uint8_t | len ) |
Definition at line 235 of file emmc_log.c.
References keep(), lock, ok, emmc_log_t::recording, and unlock().
Referenced by sink(), test_backpressure(), test_flight_keeps_recording(), test_full(), test_no_io_before_arm(), test_session_roundtrip(), test_sessions_and_remount(), test_start_failure(), test_torn_write(), test_write_retry(), to_emmc(), and to_emmc().
| uint8_t emmc_log_backlog | ( | const emmc_log_t * | log | ) |
Definition at line 252 of file emmc_log.c.
References emmc_log_t::chunk_count, emmc_log_t::chunk_state, and EMMC_CHUNK_READY.
Referenced by drain(), emmc_stm32_writer_task(), fly(), service_card(), and test_backpressure().
| uint32_t emmc_log_crc32 | ( | const void * | data, |
| uint32_t | len ) |
Definition at line 31 of file emmc_log.c.
References p.
Referenced by emmc_log_service(), format(), mount(), probe(), and test_crc().
| emmc_log_config_t emmc_log_default_config | ( | void | ) |
Definition at line 167 of file emmc_log.c.
References emmc_log_config_t::data_start_lba, EMMC_LOG_DEFAULT_DATA_START, emmc_log_config_t::flush_interval_ms, emmc_log_config_t::read_budget_ms, emmc_log_config_t::write_attempts, and emmc_log_config_t::write_budget_ms.
Referenced by config(), emmc_stm32_init(), anonymous_namespace{idle_e2e.cpp}::world_init(), and world_init().
| void emmc_log_flush | ( | emmc_log_t * | log | ) |
Definition at line 246 of file emmc_log.c.
References lock, seal(), and unlock().
Referenced by test_backpressure(), test_flight_keeps_recording(), test_full(), test_sessions_and_remount(), test_stale_epoch(), test_start_failure(), test_torn_write(), test_torn_write_hole(), and test_write_retry().
| emmc_status_t emmc_log_init | ( | emmc_log_t * | log, |
| const emmc_port_t * | port, | ||
| void * | context, | ||
| const emmc_log_config_t * | config, | ||
| emmc_log_chunk_t * | chunks, | ||
| uint8_t | chunk_count, | ||
| uint8_t * | scratch ) |
Definition at line 177 of file emmc_log.c.
References emmc_log_t::chunk_count, chunks, emmc_log_t::chunks, config, emmc_log_t::config, emmc_log_t::context, emmc_log_t::disk, EMMC_DISK_UNMOUNTED, EMMC_ERR_PARAM, EMMC_LOG_MAX_CHUNKS, EMMC_OK, NULL, emmc_log_t::port, port, emmc_log_t::scratch, and scratch.
Referenced by emmc_stm32_init(), log_new(), test_invalid_init(), anonymous_namespace{idle_e2e.cpp}::world_init(), and world_init().
| bool emmc_log_on_state | ( | emmc_log_t * | log, |
| flight_state_t | from, | ||
| flight_state_t | to, | ||
| uint32_t | now_ms ) |
Definition at line 200 of file emmc_log.c.
References emmc_log_t::arm_index, emmc_log_t::disk, EMMC_DISK_FAULT, EMMC_DISK_FULL, EMMC_REC_SESSION_END, EMMC_REC_SESSION_START, EMMC_REC_STATE, flight_state_logs_to_emmc(), keep(), lock, ok, emmc_log_t::recording, seal(), unlock(), and emmc_log_t::unreported_drops.
Referenced by app_set_state(), change_state(), anonymous_namespace{idle_e2e.cpp}::set_state(), 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().
| emmc_status_t emmc_log_service | ( | emmc_log_t * | log, |
| uint32_t | now_ms ) |
Definition at line 424 of file emmc_log.c.
References arm(), b, emmc_log_t::base_session, block_at(), emmc_log_chunk_t::bytes, emmc_log_t::capacity, emmc_log_t::chunk_arm, emmc_log_t::chunk_state, emmc_log_t::chunks, emmc_log_t::config, emmc_log_t::context, emmc_log_config_t::data_start_lba, emmc_log_t::disk, EMMC_CHUNK_READY, EMMC_DISK_FAULT, EMMC_DISK_FULL, EMMC_DISK_MOUNTED, EMMC_DISK_UNMOUNTED, EMMC_ERR_NOT_READY, EMMC_LOG_BLOCK_MAGIC, EMMC_LOG_CHUNK_BLOCKS, emmc_log_crc32(), EMMC_OK, emmc_log_t::epoch, emmc_log_t::fill_aged, emmc_log_t::fill_started_ms, emmc_log_config_t::flush_interval_ms, emmc_log_t::has_fill, emmc_log_t::head, lock, mount(), emmc_log_t::port, put32(), release_write_chunk(), seal(), emmc_log_t::stats, stop(), unlock(), emmc_port_t::write, emmc_log_config_t::write_attempts, emmc_log_config_t::write_budget_ms, emmc_log_t::write_chunk, emmc_log_stats_t::write_errors, and emmc_log_t::write_tries.
Referenced by drain(), emmc_stm32_writer_task(), service_card(), test_flush_interval(), test_full(), test_no_io_before_arm(), test_start_failure(), test_torn_write(), test_torn_write_hole(), and test_write_retry().
|
static |
Definition at line 324 of file emmc_log.c.
References emmc_log_t::capacity, emmc_log_t::config, emmc_log_t::context, emmc_log_config_t::data_start_lba, EMMC_BLOCK_SIZE, EMMC_LOG_BLOCK_MAGIC, emmc_log_crc32(), EMMC_LOG_LAYOUT_VERSION, EMMC_LOG_SUPER_MAGIC, EMMC_OK, emmc_log_t::epoch, get32(), emmc_log_t::port, put32(), emmc_port_t::read, emmc_log_config_t::read_budget_ms, emmc_log_t::scratch, emmc_port_t::write, and emmc_log_config_t::write_budget_ms.
Referenced by detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::binary_reader(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::exception_message(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_binary(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_number(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_string(), stardesign.jsformat::js_to_fixed(), pareto_throat_dp_pressures::main(), run_layer1_region_b_coop_pressures::main(), run_layer1_region_b_injector_geometry::main(), sensitivity_cd_assumptions_layer1::main(), mount(), config_loader::print_config_summary(), print_floating_point_to_stream(), print_integer_to_stream(), engine.optimizer.main_optimizer::run_full_engine_optimization_with_flight_sim(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::sax_parse(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::unexpect_eof(), and detail::binary_writer< BasicJsonType, CharType >::write_compact_float().
|
static |
|
static |
|
static |
Definition at line 146 of file emmc_log.c.
References emmc_log_stats_t::dropped, EMMC_REC_DROPPED, put32(), put_record(), emmc_log_stats_t::records, emmc_log_t::stats, and emmc_log_t::unreported_drops.
Referenced by emmc_log_append(), emmc_log_on_state(), detail::json_sax_dom_callback_parser< BasicJsonType >::end_array(), detail::json_sax_dom_callback_parser< BasicJsonType >::handle_value(), detail::json_sax_dom_callback_parser< BasicJsonType >::key(), detail::json_sax_dom_callback_parser< BasicJsonType >::start_array(), detail::json_sax_dom_callback_parser< BasicJsonType >::start_object(), and xfer().
|
static |
Definition at line 49 of file emmc_log.c.
References emmc_log_t::context, emmc_port_t::lock, and emmc_log_t::port.
|
static |
Definition at line 354 of file emmc_log.c.
References emmc_log_t::base_session, emmc_log_t::capacity, config, emmc_log_t::config, emmc_log_t::context, emmc_log_config_t::data_start_lba, emmc_log_t::disk, EMMC_DISK_MOUNTED, EMMC_ERR_PARAM, EMMC_LOG_CHUNK_BLOCKS, emmc_log_crc32(), EMMC_LOG_LAYOUT_VERSION, EMMC_LOG_SUPER_MAGIC, EMMC_OK, end(), emmc_log_t::epoch, format(), get32(), emmc_log_t::head, lock, NULL, emmc_log_t::port, probe(), emmc_port_t::read, emmc_log_config_t::read_budget_ms, emmc_log_t::scratch, search(), emmc_port_t::start, and unlock().
Referenced by emmc_log_service().
|
static |
Definition at line 284 of file emmc_log.c.
References b, emmc_log_t::config, emmc_log_t::context, emmc_log_config_t::data_start_lba, EMMC_LOG_BLOCK_MAGIC, emmc_log_crc32(), EMMC_LOG_KIND_DATA, EMMC_LOG_KIND_PAD, EMMC_LOG_PAYLOAD_BYTES, EMMC_OK, emmc_log_t::epoch, get16(), get32(), emmc_log_t::port, emmc_port_t::read, emmc_log_config_t::read_budget_ms, and emmc_log_t::scratch.
Referenced by fsw::calibration::LcTareStore::fingerprint(), mount(), fsw::calibration::LcTareStore::recompute(), fsw::calibration::LcTareStore::recompute_all(), fsw::calibration::LcTareStore::recompute_stale(), and search().
|
static |
|
static |
Definition at line 13 of file emmc_log.c.
References p.
Referenced by emmc_log_service(), format(), keep(), and put_record().
|
static |
Definition at line 120 of file emmc_log.c.
References acquire(), block_at(), close_block(), EMMC_LOG_HEADER_BYTES, EMMC_LOG_PAYLOAD_BYTES, EMMC_LOG_RECORD_HEADER_BYTES, emmc_log_t::fill_block, emmc_log_t::fill_chunk, emmc_log_t::fill_offset, emmc_log_t::has_fill, p, and put32().
Referenced by keep().
|
static |
Definition at line 270 of file emmc_log.c.
References emmc_log_t::chunk_count, emmc_log_t::chunk_state, emmc_log_stats_t::chunks_lost, emmc_log_stats_t::chunks_written, EMMC_CHUNK_FREE, lock, emmc_log_t::stats, unlock(), emmc_log_t::write_chunk, and emmc_log_t::write_tries.
Referenced by emmc_log_service().
|
static |
Definition at line 84 of file emmc_log.c.
References block_at(), chunk_complete(), close_block(), EMMC_LOG_CHUNK_BLOCKS, EMMC_LOG_KIND_PAD, emmc_log_t::fill_block, emmc_log_t::fill_chunk, emmc_log_t::fill_offset, emmc_log_t::has_fill, emmc_log_stats_t::pad_blocks, and emmc_log_t::stats.
Referenced by emmc_log_flush(), emmc_log_on_state(), emmc_log_service(), and stop().
|
static |
|
static |
Definition at line 262 of file emmc_log.c.
References emmc_log_t::disk, lock, emmc_log_t::recording, seal(), and unlock().
Referenced by combined_gui.TopBarWidget::_apply_abort_state(), actuator_testing_gui.ActuatorTestingWindow::_on_send_heartbeat_changed(), sense_testing_gui.SenseTestingGUIWindow::_on_send_heartbeat_changed(), gui.App::_toggle_connect(), combined_gui.TopBarWidget::abort(), actuator_testing_gui.ActuatorTestingWindow::closeEvent(), combined_gui.SensorDebugDialog::closeEvent(), gui.App::closeEvent(), lc_calibration_gui.LCPlotWindow::closeEvent(), pt_multi_gui.PTPlotWindow::closeEvent(), sense_testing_gui.SenseTestingGUIWindow::closeEvent(), emmc_log_service(), combined_gui.TopBarWidget::on_mode_button_clicked(), combined_gui.TopBarWidget::request_state(), and ball_valve_gui.BallValveGui::toggle_heartbeats().
|
static |
Definition at line 55 of file emmc_log.c.
References emmc_log_t::context, emmc_log_t::port, and emmc_port_t::unlock.
Referenced by emmc_log_append(), emmc_log_flush(), emmc_log_on_state(), emmc_log_service(), mount(), release_write_chunk(), and stop().