FTL诊断:checkpoint扫描增加逐块ECC状态统计(区分编程质量与搜索逻辑)
This commit is contained in:
@@ -493,6 +493,9 @@ static void ftl_scan_checks_raw(void)
|
||||
uint32_t run_start = 0;
|
||||
uint32_t run_prev = 0;
|
||||
uint32_t run_len = 0;
|
||||
uint32_t run_ecc_fail = 0;
|
||||
uint32_t run_ecc_first = 0;
|
||||
uint32_t run_ecc_last = 0;
|
||||
uint8_t run_epoch = 0;
|
||||
uint8_t run_open = 0;
|
||||
|
||||
@@ -506,18 +509,34 @@ static void ftl_scan_checks_raw(void)
|
||||
gd5f_read_from_cache(0, buf, sizeof(buf));
|
||||
if (buf[0] == 'D' && buf[1] == 'h' && buf[2] == 'a') {
|
||||
const uint8_t ep = buf[3];
|
||||
int ecc = 0;
|
||||
|
||||
total++;
|
||||
ecc = gd5f_check_ecc();
|
||||
if (ecc != GD5F_OK) {
|
||||
run_ecc_fail++;
|
||||
if (!run_ecc_fail) {
|
||||
run_ecc_first = i;
|
||||
}
|
||||
run_ecc_last = i;
|
||||
}
|
||||
if (!run_open || (i != run_prev + 1) || (ep != run_epoch)) {
|
||||
if (run_open) {
|
||||
DBG_INFO("check run: blk %lu..%lu epoch=%u (%lu blocks)",
|
||||
(unsigned long)run_start, (unsigned long)run_prev,
|
||||
(unsigned int)run_epoch, (unsigned long)run_len);
|
||||
if (run_ecc_fail) {
|
||||
DBG_INFO(" run ecc-fail: %lu blocks (blk %lu..%lu)",
|
||||
(unsigned long)run_ecc_fail,
|
||||
(unsigned long)run_ecc_first,
|
||||
(unsigned long)run_ecc_last);
|
||||
}
|
||||
ftl_dump_checkheader(run_start);
|
||||
}
|
||||
run_start = i;
|
||||
run_epoch = ep;
|
||||
run_len = 0;
|
||||
run_ecc_fail = 0;
|
||||
run_open = 1;
|
||||
}
|
||||
run_prev = i;
|
||||
@@ -528,6 +547,12 @@ static void ftl_scan_checks_raw(void)
|
||||
DBG_INFO("check run: blk %lu..%lu epoch=%u (%lu blocks)",
|
||||
(unsigned long)run_start, (unsigned long)run_prev,
|
||||
(unsigned int)run_epoch, (unsigned long)run_len);
|
||||
if (run_ecc_fail) {
|
||||
DBG_INFO(" run ecc-fail: %lu blocks (blk %lu..%lu)",
|
||||
(unsigned long)run_ecc_fail,
|
||||
(unsigned long)run_ecc_first,
|
||||
(unsigned long)run_ecc_last);
|
||||
}
|
||||
ftl_dump_checkheader(run_start);
|
||||
}
|
||||
DBG_INFO("check scan done: %lu checkpoint blocks", (unsigned long)total);
|
||||
|
||||
Reference in New Issue
Block a user