Print human-readable flash simulator statistics and block health map to standard output.
MCO_RET mco_flashsim_print_stat(
/*IN*/ mco_flashsim_h fs,
/*IN*/ unsigned int blocks_per_line
);
fs
blocks_per_line
This function outputs a comprehensive diagnostic report for the flash simulator to
stdout. The report includes:
- Aggregated I/O operation counts (reads, writes, erases, copies),
- Total data volume transferred (in bytes and megabytes),
- Simulated timing statistics,
- A visual block health map using ASCII characters:
.— healthy block,!— block with a programming/erase error (MCO_BLOCK_STATE_ERROR),X— block marked as bad (MCO_BLOCK_STATE_BAD).The function is intended for debugging, testing, and performance analysis. It internally calls
mco_flashsim_get_stat()to collect data.Note: This function performs dynamic memory allocation for the block state array. Ensure sufficient heap space is available.
MCO_S_OK
MCO_E_INVALID_HANDLE
MCO_E_NOMEM
MCO_E_DISK
// Print flash stats with 64 blocks per line
MCO_RET rc = mco_flashsim_print_stat(fs, 64);
if (rc == MCO_S_OK) {
printf("Flash simulator report generated.\n");
}