diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2018-01-09 03:09:10 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2018-01-09 03:09:10 +0000 |
commit | 605b21190ce9af77ee3533e12b2e59a7f883ffee (patch) | |
tree | bec664a8f7fde19b399af40a4be20a6d3c18b6b8 /src/sg_logs.c | |
parent | a0df198b498b114e901cb022acddcc14330275da (diff) | |
download | sg3_utils-605b21190ce9af77ee3533e12b2e59a7f883ffee.tar.gz |
FreeBSD port now works with NVMe SNTL and sg3_ses pass-through (NVME-MI); man page cleanups; improve SNTL translation to VPD page 0x83
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@743 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_logs.c')
-rw-r--r-- | src/sg_logs.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/sg_logs.c b/src/sg_logs.c index bf1a5ce2..94c3b504 100644 --- a/src/sg_logs.c +++ b/src/sg_logs.c @@ -5117,6 +5117,7 @@ show_pending_defects_page(const uint8_t * resp, int len, const struct opts_t * op) { int num, pl, pc; + uint32_t count; const uint8_t * bp; char str[PCB_STR_LEN]; @@ -5140,7 +5141,7 @@ show_pending_defects_page(const uint8_t * resp, int len, } switch (pc) { case 0x0: - printf(" Pending defect count:"); + printf(" Pending defect count: "); if ((pl < 8) || (num < 8)) { if (num < 8) pr2serr("\n truncated by response length, expected " @@ -5150,10 +5151,17 @@ show_pending_defects_page(const uint8_t * resp, int len, pl); break; } - printf(" %u\n", sg_get_unaligned_be32(bp + 4)); + count = sg_get_unaligned_be32(bp + 4); + if (0 == count) { + printf("0\n"); + break; + } + printf("%3u | LBA Accumulated power_on\n", count); + printf("-----------------------------|---------------"); + printf("-----------hours---------\n"); break; default: - printf(" Pending defect: %d\n", pc); + printf(" Pending defect %4d: ", pc); if ((pl < 16) || (num < 16)) { if (num < 16) pr2serr("\n truncated by response length, expected " @@ -5163,7 +5171,7 @@ show_pending_defects_page(const uint8_t * resp, int len, pl); break; } - printf(" LBA: 0x%" PRIx64 " accumulated_power_on_hours: %u\n", + printf(" 0x%-16" PRIx64 " %5u\n", sg_get_unaligned_be64(bp + 8), sg_get_unaligned_be32(bp + 4)); break; |