Skip to content
Snippets Groups Projects
Commit 65999d9a authored by chrfranke's avatar chrfranke
Browse files

Add '-v ID,raw64[,...]' print format.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2976 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent a94f74ee
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,9 @@ NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
[CF] Add '-v ID,raw64[,...]' print format based on an patch provided
by Marcin Marszalek.
[CF] Add '-v ID,RAW_FORMAT[,ATTR_NAME]' option. This allows to add new
attributes without the need to enhance the '-v' option.
Rework attribute name and raw value formatting.
......
......@@ -196,6 +196,7 @@ const format_name_entry format_names[] = {
{"raw8" , RAWFMT_RAW8},
{"raw16" , RAWFMT_RAW16},
{"raw48" , RAWFMT_RAW48},
{"raw64" , RAWFMT_RAW64},
{"raw16(raw16)" , RAWFMT_RAW16_OPT_RAW16},
{"raw16(avg16)" , RAWFMT_RAW16_OPT_AVG16},
{"raw24/raw24" , RAWFMT_RAW24_RAW24},
......@@ -1832,6 +1833,16 @@ std::string ata_format_attr_raw_value(const ata_smart_attribute & attribute,
s = strprintf("%"PRIu64, rawvalue);
break;
case RAWFMT_RAW64:
// Some SSD vendors use bytes 3-10 from the Attribute
// Data Structure to store a 64-bit raw value.
rawvalue <<= 8;
rawvalue |= attribute.worst;
rawvalue <<= 8;
rawvalue |= attribute.current;
s = strprintf("%"PRIu64, rawvalue);
break;
case RAWFMT_RAW16_OPT_RAW16:
s = strprintf("%u", word[0]);
if (word[1] || word[2])
......
......@@ -641,6 +641,7 @@ enum ata_attr_raw_format
RAWFMT_RAW8,
RAWFMT_RAW16,
RAWFMT_RAW48,
RAWFMT_RAW64,
RAWFMT_RAW16_OPT_RAW16,
RAWFMT_RAW16_OPT_AVG16,
RAWFMT_RAW24_RAW24,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment