Skip to content
Snippets Groups Projects
Commit 9e19366a authored by chrfranke's avatar chrfranke
Browse files

Print General Purpose Logs even if GPL feature bit is missing.

Change order of the extended log outputs.


git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2800 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 2520d1d2
Branches
No related tags found
No related merge requests found
CHANGELOG for smartmontools
$Id: CHANGELOG,v 1.803 2009/06/12 12:25:02 chrfranke Exp $
$Id: CHANGELOG,v 1.804 2009/06/13 14:56:20 chrfranke Exp $
The most recent version of this file is:
http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup
......@@ -41,6 +41,13 @@ NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
[CF] Print General Purpose Logs even if GPL feature bit is missing.
Needed for some older disks which implement READ LOG EXT but
do not report the GPL feature set.
Change order of the extended log outputs ('-l xerror',
'-l xselftest', '-l sataphy'). Extended logs are now printed
before their old versions.
[CF] autogen.sh: automake 1.10.2 and 1.11 are OK.
[CF] Fix syntax error in prototype of 'safe_snprintf()'.
......
......@@ -44,7 +44,7 @@
#include "utility.h"
#include "knowndrives.h"
const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.210 2009/04/16 21:24:08 chrfranke Exp $"
const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.211 2009/06/13 14:56:20 chrfranke Exp $"
ATACMDNAMES_H_CVSID ATACMDS_H_CVSID ATAPRINT_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID KNOWNDRIVES_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID;
// for passing global control variables
......@@ -2040,26 +2040,16 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
}
// Print SMART and/or GP log Directory and/or logs
// Get #pages for extended SMART logs
ata_smart_log_directory smartlogdir_buf, gplogdir_buf;
const ata_smart_log_directory * smartlogdir = 0, * gplogdir = 0;
if ( options.gp_logdir || options.smart_logdir
|| options.sataphy || options.smart_ext_error_log
|| options.smart_ext_selftest_log
|| !options.log_requests.empty() ) {
bool gpl_cap = !!isGeneralPurposeLoggingCapable(&drive);
bool gpl_try = gpl_cap;
if (!gpl_try && con->permissive) {
con->permissive--;
gpl_try = true;
}
if (!gpl_try) {
pout("Device does not support General Purpose Loggin (GPL) feature set\n"
"(override with '-T permissive' option)\n");
failuretest(OPTIONAL_CMD, returnval|=FAILSMART);
}
else {
PRINT_ON(con);
if (gpl_cap)
if (isGeneralPurposeLoggingCapable(&drive))
pout("General Purpose Logging (GPL) feature set supported\n");
// Detect directories needed
......@@ -2075,9 +2065,6 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
need_smart_logdir = true;
}
ata_smart_log_directory smartlogdir_buf, gplogdir_buf;
const ata_smart_log_directory * smartlogdir = 0, * gplogdir = 0;
// Read SMART Log directory
if (need_smart_logdir) {
if (ataReadLogDirectory(device, &smartlogdir_buf, false)){
......@@ -2156,6 +2143,7 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
else
PrintLogPages(type, log_buf.data() + offs*512, req.logaddr, req.page, ns, max_nsectors);
}
}
// Print SMART Extendend Comprehensive Error Log
if (options.smart_ext_error_log) {
......@@ -2174,34 +2162,6 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
}
}
// Print SMART Extendend Self-test Log
if (options.smart_ext_selftest_log) {
unsigned nsectors = GetNumLogSectors(gplogdir, 0x07, true);
if (!nsectors)
pout("SMART Extended Self-test Log (GP Log 0x07) does not exist\n");
else if (nsectors >= 256)
pout("SMART Extended Self-test Log size %u not supported\n", nsectors);
else {
raw_buffer log_07_buf(nsectors * 512);
ata_smart_extselftestlog * log_07 = (ata_smart_extselftestlog *)log_07_buf.data();
if (!ataReadExtSelfTestLog(device, log_07, nsectors))
failuretest(OPTIONAL_CMD, returnval|=FAILSMART);
else
PrintSmartExtSelfTestLog(log_07, nsectors, options.smart_ext_selftest_log);
}
}
// Print SATA Phy Event Counters
if (options.sataphy) {
unsigned char log_11[512] = {0, };
unsigned char features = (options.sataphy_reset ? 0x01 : 0x00);
if (!ataReadLogExt(device, 0x11, features, 0, log_11, 1))
failuretest(OPTIONAL_CMD, returnval|=FAILSMART);
else
PrintSataPhyEventCounters(log_11, options.sataphy_reset);
}
}
}
// Print SMART error log
if (con->smarterrorlog){
if (!isSmartErrorLogCapable(&smartval, &drive)){
......@@ -2220,6 +2180,23 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
}
}
// Print SMART Extendend Self-test Log
if (options.smart_ext_selftest_log) {
unsigned nsectors = GetNumLogSectors(gplogdir, 0x07, true);
if (!nsectors)
pout("SMART Extended Self-test Log (GP Log 0x07) does not exist\n");
else if (nsectors >= 256)
pout("SMART Extended Self-test Log size %u not supported\n", nsectors);
else {
raw_buffer log_07_buf(nsectors * 512);
ata_smart_extselftestlog * log_07 = (ata_smart_extselftestlog *)log_07_buf.data();
if (!ataReadExtSelfTestLog(device, log_07, nsectors))
failuretest(OPTIONAL_CMD, returnval|=FAILSMART);
else
PrintSmartExtSelfTestLog(log_07, nsectors, options.smart_ext_selftest_log);
}
}
// Print SMART self-test log
if (con->smartselftestlog){
if (!isSmartTestLogCapable(&smartval, &drive)){
......@@ -2314,6 +2291,16 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
}
}
// Print SATA Phy Event Counters
if (options.sataphy) {
unsigned char log_11[512] = {0, };
unsigned char features = (options.sataphy_reset ? 0x01 : 0x00);
if (!ataReadLogExt(device, 0x11, features, 0, log_11, 1))
failuretest(OPTIONAL_CMD, returnval|=FAILSMART);
else
PrintSataPhyEventCounters(log_11, options.sataphy_reset);
}
// START OF THE TESTING SECTION OF THE CODE. IF NO TESTING, RETURN
if (con->testcase==-1)
return returnval;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment