Skip to content
Snippets Groups Projects
Commit cde86942 authored by ballen4705's avatar ballen4705
Browse files

Changed numbering of entries in ATA error log printout to make it clearer which is

the most recent and which is the oldest.


git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@276 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 8e633679
No related branches found
No related tags found
No related merge requests found
43 44
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "smartctl.h" #include "smartctl.h"
#include "extern.h" #include "extern.h"
const char *CVSid2="$Id: ataprint.c,v 1.43 2002/11/07 19:07:20 ballen4705 Exp $" const char *CVSid2="$Id: ataprint.c,v 1.44 2002/11/14 14:57:20 ballen4705 Exp $"
CVSID1 CVSID2 CVSID3 CVSID6; CVSID1 CVSID2 CVSID3 CVSID6;
// for passing global control variables // for passing global control variables
...@@ -505,7 +505,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ ...@@ -505,7 +505,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
return; return;
} }
QUIETON(con); QUIETON(con);
// if log pointer out of range, return // If log pointer out of range, return
if (data->error_log_pointer>5){ if (data->error_log_pointer>5){
pout("Invalid Error Log index = %02x (T13/1321D rev 1c" pout("Invalid Error Log index = %02x (T13/1321D rev 1c"
"Section 8.41.6.8.2.2 gives valid range from 1 to 5)\n\n", "Section 8.41.6.8.2.2 gives valid range from 1 to 5)\n\n",
...@@ -513,6 +513,12 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ ...@@ -513,6 +513,12 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
return; return;
} }
// Some internal consistency checking of the data structures
if ((data->ata_error_count-data->error_log_pointer)%5) {
pout("Warning: ATA error count %d inconsistent with error log pointer %d\n\n",
data->ata_error_count,data->error_log_pointer);
}
// starting printing error log info // starting printing error log info
if (data->ata_error_count<=5) if (data->ata_error_count<=5)
pout( "ATA Error Count: %d\n", (int)data->ata_error_count); pout( "ATA Error Count: %d\n", (int)data->ata_error_count);
...@@ -553,7 +559,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ ...@@ -553,7 +559,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
// See table 42 of ATA5 spec // See table 42 of ATA5 spec
QUIETON(con); QUIETON(con);
pout("Error %d occurred at disk power-on lifetime: %d hours\n", pout("Error %d occurred at disk power-on lifetime: %d hours\n",
(int)(5-k), (int)data->errorlog_struct[i].error_struct.timestamp); (int)(data->ata_error_count+k-4), (int)data->errorlog_struct[i].error_struct.timestamp);
QUIETOFF(con); QUIETOFF(con);
pout("When the command that caused the error occurred, the device was %s.\n",msgstate); pout("When the command that caused the error occurred, the device was %s.\n",msgstate);
pout("After command completion occurred, registers were:\n"); pout("After command completion occurred, registers were:\n");
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "smartctl.h" #include "smartctl.h"
#include "extern.h" #include "extern.h"
const char *CVSid2="$Id: ataprint.cpp,v 1.43 2002/11/07 19:07:20 ballen4705 Exp $" const char *CVSid2="$Id: ataprint.cpp,v 1.44 2002/11/14 14:57:20 ballen4705 Exp $"
CVSID1 CVSID2 CVSID3 CVSID6; CVSID1 CVSID2 CVSID3 CVSID6;
// for passing global control variables // for passing global control variables
...@@ -505,7 +505,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ ...@@ -505,7 +505,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
return; return;
} }
QUIETON(con); QUIETON(con);
// if log pointer out of range, return // If log pointer out of range, return
if (data->error_log_pointer>5){ if (data->error_log_pointer>5){
pout("Invalid Error Log index = %02x (T13/1321D rev 1c" pout("Invalid Error Log index = %02x (T13/1321D rev 1c"
"Section 8.41.6.8.2.2 gives valid range from 1 to 5)\n\n", "Section 8.41.6.8.2.2 gives valid range from 1 to 5)\n\n",
...@@ -513,6 +513,12 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ ...@@ -513,6 +513,12 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
return; return;
} }
// Some internal consistency checking of the data structures
if ((data->ata_error_count-data->error_log_pointer)%5) {
pout("Warning: ATA error count %d inconsistent with error log pointer %d\n\n",
data->ata_error_count,data->error_log_pointer);
}
// starting printing error log info // starting printing error log info
if (data->ata_error_count<=5) if (data->ata_error_count<=5)
pout( "ATA Error Count: %d\n", (int)data->ata_error_count); pout( "ATA Error Count: %d\n", (int)data->ata_error_count);
...@@ -553,7 +559,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ ...@@ -553,7 +559,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
// See table 42 of ATA5 spec // See table 42 of ATA5 spec
QUIETON(con); QUIETON(con);
pout("Error %d occurred at disk power-on lifetime: %d hours\n", pout("Error %d occurred at disk power-on lifetime: %d hours\n",
(int)(5-k), (int)data->errorlog_struct[i].error_struct.timestamp); (int)(data->ata_error_count+k-4), (int)data->errorlog_struct[i].error_struct.timestamp);
QUIETOFF(con); QUIETOFF(con);
pout("When the command that caused the error occurred, the device was %s.\n",msgstate); pout("When the command that caused the error occurred, the device was %s.\n",msgstate);
pout("After command completion occurred, registers were:\n"); pout("After command completion occurred, registers were:\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment