smartmontools SVN Rev 5640
Utility to control and monitor storage systems with "S.M.A.R.T."
|
#include "config.h"
#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "atacmdnames.h"
#include "atacmds.h"
#include "ataidentify.h"
#include "dev_interface.h"
#include "ataprint.h"
#include "smartctl.h"
#include "sg_unaligned.h"
#include "utility.h"
#include "knowndrives.h"
#include "farmcmds.h"
#include "farmprint.h"
Go to the source code of this file.
Classes | |
struct | devstat_entry_info |
Macros | |
#define | __STDC_FORMAT_MACROS 1 |
#define | P(n) (' ' <= p[n] && p[n] <= '~' ? (int)p[n] : '.') |
Functions | |
static const char * | infofound (const char *output) |
static bool | is_permissive () |
static std::string | format_st_er_desc (unsigned char CR, unsigned char FR, unsigned char ST, unsigned char ER, unsigned short SC, const ata_smart_errorlog_error_struct *lba28_regs, const ata_smart_exterrlog_error *lba48_regs) |
static std::string | format_st_er_desc (const ata_smart_errorlog_struct *data) |
static std::string | format_st_er_desc (const ata_smart_exterrlog_error_log *data) |
static const char * | get_form_factor (unsigned short word168) |
static int | find_msb (unsigned short word) |
static const char * | get_ata_major_version (const ata_identify_device *drive) |
static const char * | get_ata_minor_version (const ata_identify_device *drive) |
static const char * | get_pata_version (unsigned short word222, char(&buf)[32]) |
static const char * | get_sata_version (unsigned short word222) |
static const char * | get_sata_speed (int speed) |
static void | jset_sata_speed (const char *key, int value, int speed, const char *str) |
static void | print_sata_version_and_speed (unsigned short word222, unsigned short word076, unsigned short word077) |
static void | print_drive_info (const ata_identify_device *drive, const ata_size_info &sizes, int rpm, const drive_settings *dbentry, const char *dbversion) |
static const char * | OfflineDataCollectionStatus (unsigned char status_byte) |
static void | PrintSmartOfflineStatus (const ata_smart_values *data) |
static void | PrintSmartSelfExecStatus (const ata_smart_values *data, firmwarebug_defs firmwarebugs) |
static void | PrintSmartTotalTimeCompleteOffline (const ata_smart_values *data) |
static void | PrintSmartOfflineCollectCap (const ata_smart_values *data) |
static void | PrintSmartCapability (const ata_smart_values *data) |
static void | PrintSmartErrorLogCapability (const ata_smart_values *data, const ata_identify_device *identity) |
static void | PrintSmartShortSelfTestPollingTime (const ata_smart_values *data) |
static void | PrintSmartExtendedSelfTestPollingTime (const ata_smart_values *data) |
static void | PrintSmartConveyanceSelfTestPollingTime (const ata_smart_values *data) |
static int | find_failed_attr (const ata_smart_values *data, const ata_smart_thresholds_pvt *thresholds, const ata_vendor_attr_defs &defs, int onlyfailed) |
static void | set_json_globals_from_smart_attrib (int id, const char *name, const ata_vendor_attr_defs &defs, uint64_t rawval) |
static void | PrintSmartAttribWithThres (const ata_smart_values *data, const ata_smart_thresholds_pvt *thresholds, const ata_vendor_attr_defs &defs, int rpm, int onlyfailed, unsigned char format) |
static void | ataPrintSCTCapability (const ata_identify_device *drive) |
static void | PrintGeneralSmartValues (const ata_smart_values *data, const ata_identify_device *drive, firmwarebug_defs firmwarebugs) |
static unsigned | GetNumLogSectors (const ata_smart_log_directory *logdir, unsigned logaddr, bool gpl) |
static const char * | GetLogName (unsigned logaddr) |
static const char * | get_log_rw (unsigned logaddr) |
const ata_smart_log_directory * | fake_logdir (ata_smart_log_directory *logdir, const ata_print_options &options) |
static void | PrintLogDirectories (const ata_smart_log_directory *gplogdir, const ata_smart_log_directory *smartlogdir) |
static void | PrintLogPages (const char *type, const unsigned char *data, unsigned char logaddr, unsigned page, unsigned num_pages, unsigned max_pages) |
static const char * | get_device_statistics_page_name (int page) |
static void | set_json_globals_from_device_statistics (int page, int offset, int64_t val) |
static void | print_device_statistics_page (const json::ref &jref, const unsigned char *data, int page) |
static bool | print_device_statistics (ata_device *device, unsigned nsectors, const std::vector< int > &single_pages, bool all_pages, bool ssd_page, bool use_gplog) |
static bool | print_pending_defects_log (ata_device *device, unsigned nsectors, unsigned max_entries) |
static void | PrintSataPhyEventCounters (const unsigned char *data, bool reset) |
static std::string | format_milliseconds (unsigned msec) |
static const char * | get_error_log_state_desc (unsigned state) |
static int | PrintSmartErrorlog (const ata_smart_errorlog *data, firmwarebug_defs firmwarebugs) |
static int | PrintSmartExtErrorLog (ata_device *device, const firmwarebug_defs &firmwarebugs, const ata_smart_exterrlog *log, unsigned nsectors, unsigned max_errors) |
static int | ataPrintSmartSelfTestEntry (const json::ref &jref, unsigned testnum, unsigned char test_type, unsigned char test_status, unsigned short timestamp, uint64_t failing_lba, bool print_error_only, bool &print_header) |
static int | ataPrintSmartSelfTestlog (const ata_smart_selftestlog *log, bool allentries, firmwarebug_defs firmwarebugs) |
static int | PrintSmartExtSelfTestLog (const ata_smart_extselftestlog *log, unsigned nsectors, unsigned max_entries) |
static void | ataPrintSelectiveSelfTestLog (const ata_selective_self_test_log *log, const ata_smart_values *sv) |
static const char * | sct_ptemp (signed char x, char(&buf)[20]) |
static void | sct_jtemp2 (const json::ref &jref, const char *name, signed char x) |
static const char * | sct_pbar (int x, char(&buf)[64]) |
static const char * | sct_device_state_msg (unsigned char state) |
static int | ataPrintSCTStatus (const ata_sct_status_response *sts) |
static int | ataPrintSCTTempHist (const ata_sct_temperature_history_table *tmh) |
static void | ataPrintSCTErrorRecoveryControl (bool set, unsigned short read_timer, unsigned short write_timer, bool power_on, bool mfg_default=false) |
static void | print_aam_level (const char *msg, int level, int recommended=-1) |
static void | print_apm_level (const char *msg, int level) |
static void | print_ata_security_status (const char *msg, unsigned short state, unsigned short master_password_id) |
static void | print_standby_timer (const char *msg, int timer, const ata_identify_device &drive) |
int | ataPrintMain (ata_device *device, const ata_print_options &options) |
Variables | |
const char * | ataprint_cpp_cvsid |
const devstat_entry_info | devstat_info_0x00 [] |
const devstat_entry_info | devstat_info_0x01 [] |
const devstat_entry_info | devstat_info_0x02 [] |
const devstat_entry_info | devstat_info_0x03 [] |
const devstat_entry_info | devstat_info_0x04 [] |
const devstat_entry_info | devstat_info_0x05 [] |
const devstat_entry_info | devstat_info_0x06 [] |
const devstat_entry_info | devstat_info_0x07 [] |
const devstat_entry_info * | devstat_infos [] |
const int | num_devstat_infos = sizeof(devstat_infos)/sizeof(devstat_infos[0]) |
#define __STDC_FORMAT_MACROS 1 |
Definition at line 14 of file ataprint.cpp.
#define P | ( | n | ) | (' ' <= p[n] && p[n] <= '~' ? (int)p[n] : '.') |
int ataPrintMain | ( | ata_device * | device, |
const ata_print_options & | options | ||
) |
Definition at line 3357 of file ataprint.cpp.
|
static |
Definition at line 1354 of file ataprint.cpp.
|
static |
Definition at line 3174 of file ataprint.cpp.
|
static |
Definition at line 3017 of file ataprint.cpp.
|
static |
Definition at line 3102 of file ataprint.cpp.
|
static |
Definition at line 2822 of file ataprint.cpp.
|
static |
Definition at line 2575 of file ataprint.cpp.
|
static |
Definition at line 2670 of file ataprint.cpp.
const ata_smart_log_directory * fake_logdir | ( | ata_smart_log_directory * | logdir, |
const ata_print_options & | options | ||
) |
Definition at line 1525 of file ataprint.cpp.
|
static |
Definition at line 1122 of file ataprint.cpp.
|
static |
Definition at line 428 of file ataprint.cpp.
|
static |
Definition at line 2163 of file ataprint.cpp.
|
inlinestatic |
Definition at line 383 of file ataprint.cpp.
|
inlinestatic |
Definition at line 395 of file ataprint.cpp.
|
static |
Definition at line 67 of file ataprint.cpp.
|
static |
Definition at line 436 of file ataprint.cpp.
|
static |
Definition at line 462 of file ataprint.cpp.
|
static |
Definition at line 1765 of file ataprint.cpp.
|
static |
Definition at line 2182 of file ataprint.cpp.
|
static |
Definition at line 408 of file ataprint.cpp.
|
static |
Definition at line 1496 of file ataprint.cpp.
|
static |
Definition at line 546 of file ataprint.cpp.
|
static |
Definition at line 583 of file ataprint.cpp.
|
static |
Definition at line 559 of file ataprint.cpp.
|
static |
Definition at line 1426 of file ataprint.cpp.
|
static |
Definition at line 1410 of file ataprint.cpp.
|
static |
Definition at line 40 of file ataprint.cpp.
|
static |
Definition at line 46 of file ataprint.cpp.
|
static |
Definition at line 602 of file ataprint.cpp.
|
static |
Definition at line 832 of file ataprint.cpp.
|
static |
Definition at line 3199 of file ataprint.cpp.
|
static |
Definition at line 3230 of file ataprint.cpp.
|
static |
Definition at line 3260 of file ataprint.cpp.
|
static |
Definition at line 1909 of file ataprint.cpp.
|
static |
Definition at line 1797 of file ataprint.cpp.
|
static |
Definition at line 644 of file ataprint.cpp.
|
static |
Definition at line 2026 of file ataprint.cpp.
|
static |
Definition at line 621 of file ataprint.cpp.
|
static |
Definition at line 3323 of file ataprint.cpp.
|
static |
Definition at line 1374 of file ataprint.cpp.
|
static |
Definition at line 1541 of file ataprint.cpp.
|
static |
Definition at line 1630 of file ataprint.cpp.
|
static |
Definition at line 2089 of file ataprint.cpp.
|
static |
Definition at line 1197 of file ataprint.cpp.
|
static |
Definition at line 1047 of file ataprint.cpp.
|
static |
Definition at line 1106 of file ataprint.cpp.
|
static |
Definition at line 2198 of file ataprint.cpp.
|
static |
Definition at line 1072 of file ataprint.cpp.
|
static |
Definition at line 1093 of file ataprint.cpp.
|
static |
Definition at line 2354 of file ataprint.cpp.
|
static |
print_error_only
Definition at line 2738 of file ataprint.cpp.
|
static |
Definition at line 997 of file ataprint.cpp.
|
static |
Definition at line 862 of file ataprint.cpp.
|
static |
Definition at line 890 of file ataprint.cpp.
|
static |
Definition at line 1080 of file ataprint.cpp.
|
static |
Definition at line 987 of file ataprint.cpp.
|
static |
Definition at line 3003 of file ataprint.cpp.
|
static |
Definition at line 2973 of file ataprint.cpp.
|
static |
Definition at line 2981 of file ataprint.cpp.
|
static |
Definition at line 2965 of file ataprint.cpp.
|
static |
Definition at line 1774 of file ataprint.cpp.
|
static |
Definition at line 1143 of file ataprint.cpp.
const char* ataprint_cpp_cvsid |
Definition at line 36 of file ataprint.cpp.
const devstat_entry_info devstat_info_0x00[] |
Definition at line 1666 of file ataprint.cpp.
const devstat_entry_info devstat_info_0x01[] |
Definition at line 1671 of file ataprint.cpp.
const devstat_entry_info devstat_info_0x02[] |
Definition at line 1688 of file ataprint.cpp.
const devstat_entry_info devstat_info_0x03[] |
Definition at line 1695 of file ataprint.cpp.
const devstat_entry_info devstat_info_0x04[] |
Definition at line 1708 of file ataprint.cpp.
const devstat_entry_info devstat_info_0x05[] |
Definition at line 1717 of file ataprint.cpp.
const devstat_entry_info devstat_info_0x06[] |
Definition at line 1735 of file ataprint.cpp.
const devstat_entry_info devstat_info_0x07[] |
Definition at line 1743 of file ataprint.cpp.
const devstat_entry_info* devstat_infos[] |
Definition at line 1749 of file ataprint.cpp.
const int num_devstat_infos = sizeof(devstat_infos)/sizeof(devstat_infos[0]) |
Definition at line 1763 of file ataprint.cpp.