smartmontools SVN Rev 5640
Utility to control and monitor storage systems with "S.M.A.R.T."
|
#include "config.h"
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include "scsicmds.h"
#include "atacmds.h"
#include "dev_interface.h"
#include "scsiprint.h"
#include "smartctl.h"
#include "utility.h"
#include "sg_unaligned.h"
#include "farmcmds.h"
#include "farmprint.h"
Go to the source code of this file.
Macros | |
#define | __STDC_FORMAT_MACROS 1 |
#define | GBUF_SIZE 65532 |
#define | ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) |
#define | LOG_RESP_LEN 252 |
#define | LOG_RESP_LONG_LEN ((62 * 256) + 252) |
#define | LOG_RESP_TAPE_ALERT_LEN 0x144 |
#define | SCSI_SUPP_LOG_PAGES_MAX_COUNT (252 + (62 * 128) + 126) |
#define | SCSI_VERSION_SPC_4 0x6 |
#define | SCSI_VERSION_SPC_5 0x7 |
#define | SCSI_VERSION_SPC_6 0xd /* T10/BSR INCITS 566, proposed in 23-015r0 */ |
#define | SCSI_VERSION_HIGHEST SCSI_VERSION_SPC_6 |
#define | T10_VENDOR_SEAGATE "SEAGATE" |
#define | T10_VENDOR_HITACHI_1 "HITACHI" |
#define | T10_VENDOR_HITACHI_2 "HL-DT-ST" |
#define | T10_VENDOR_HITACHI_3 "HGST" |
Functions | |
static bool | seagate_or_hitachi (void) |
static bool | all_ffs (const uint8_t *bp, int b_len) |
static std::string | rtrim (const std::string &s, const char *t=" \t\n\r\f\v") |
static void | scsiGetSupportedLogPages (scsi_device *device) |
static int | scsiGetSmartData (scsi_device *device, bool attribs) |
static int | scsiPrintActiveTapeAlerts (scsi_device *device, int peripheral_type, bool from_health) |
static void | scsiGetStartStopData (scsi_device *device) |
static void | scsiPrintPendingDefectsLPage (scsi_device *device) |
static void | scsiPrintGrownDefectListLen (scsi_device *device, bool prefer12) |
static uint64_t | variableLengthIntegerParam (const unsigned char *ucp) |
static void | scsiPrintSeagateCacheLPage (scsi_device *device) |
static void | scsiPrintSeagateFactoryLPage (scsi_device *device) |
static void | scsiPrintErrorCounterLog (scsi_device *device) |
static int | scsiPrintSelfTest (scsi_device *device) |
static int | scsiPrintBackgroundResults (scsi_device *device, bool only_pow_time) |
static int64_t | scsiGetTimeUnitInNano (const uint8_t *ucp, int num, uint16_t ti_pc) |
static void | scsiPrintTimeUnitInNano (int leadin_spaces, uint64_t intervals, int64_t timeUnitInNS) |
static int | scsiPrintGStatsPerf (scsi_device *device) |
static int | scsiPrintSSMedia (scsi_device *device) |
static int | scsiPrintZBDeviceStats (scsi_device *device) |
static int | scsiPrintTapeDeviceStats (scsi_device *device) |
static int | scsiPrintFormatStatus (scsi_device *device) |
static void | show_sas_phy_event_info (const json::ref &jref, int peis, unsigned int val, unsigned thresh_val) |
static void | show_sas_port_param (int port_num, unsigned char *ucp, int param_len) |
static int | show_protocol_specific_port_page (unsigned char *resp, int len) |
static int | scsiPrintSasPhy (scsi_device *device, int reset) |
static int | scsiGetDriveInfo (scsi_device *device, uint8_t *peripheral_type, bool &have_zbc, bool all) |
static int | scsiSmartEnable (scsi_device *device) |
static int | scsiSmartDisable (scsi_device *device) |
static void | scsiPrintTemp (scsi_device *device) |
static void | scsiPrintEnviroReporting (scsi_device *device) |
int | scsiPrintMain (scsi_device *device, const scsi_print_options &options) |
Variables | |
const char * | scsiprint_c_cvsid |
uint8_t | gBuf [GBUF_SIZE] |
static bool | gSmartLPage = false |
static bool | gTempLPage = false |
static bool | gSelfTestLPage = false |
static bool | gStartStopLPage = false |
static bool | gReadECounterLPage = false |
static bool | gWriteECounterLPage = false |
static bool | gVerifyECounterLPage = false |
static bool | gNonMediumELPage = false |
static bool | gLastNErrorEvLPage = false |
static bool | gBackgroundResultsLPage = false |
static bool | gProtocolSpecificLPage = false |
static bool | gTapeAlertsLPage = false |
static bool | gSSMediaLPage = false |
static bool | gFormatStatusLPage = false |
static bool | gEnviroReportingLPage = false |
static bool | gEnviroLimitsLPage = false |
static bool | gUtilizationLPage = false |
static bool | gPendDefectsLPage = false |
static bool | gBackgroundOpLPage = false |
static bool | gLPSMisalignLPage = false |
static bool | gTapeDeviceStatsLPage = false |
static bool | gZBDeviceStatsLPage = false |
static bool | gGenStatsAndPerfLPage = false |
static bool | gSeagateCacheLPage = false |
static bool | gSeagateFactoryLPage = false |
static bool | gSeagateFarmLPage = false |
static bool | gIecMPage = true |
static int | modese_len = 0 |
static int | scsi_version |
static char | scsi_vendor [8+1] |
static const char * | logSenStr = "Log Sense" |
static const char * | logSenRspStr = "Log Sense response" |
static const char * | gsap_s = "General statistics and performance" |
static const char * | ssm_s = "Solid state media" |
static const char * | zbds_s = "Zoned block device statistics" |
static const char * | lp_s = "log page" |
static const char *const | severities = "CWI" |
static const char * | self_test_code [] |
static const char * | self_test_result [] |
static const char * | bms_status [] |
static const char * | reassign_status [] |
static const char * | peripheral_dt_arr [32] |
static const char * | transport_proto_arr [] |
#define __STDC_FORMAT_MACROS 1 |
Definition at line 15 of file scsiprint.cpp.
#define ARRAY_SIZE | ( | arr | ) | (sizeof(arr) / sizeof((arr)[0])) |
Definition at line 39 of file scsiprint.cpp.
#define GBUF_SIZE 65532 |
Definition at line 34 of file scsiprint.cpp.
#define LOG_RESP_LEN 252 |
Definition at line 42 of file scsiprint.cpp.
#define LOG_RESP_LONG_LEN ((62 * 256) + 252) |
Definition at line 43 of file scsiprint.cpp.
#define LOG_RESP_TAPE_ALERT_LEN 0x144 |
Definition at line 44 of file scsiprint.cpp.
#define SCSI_SUPP_LOG_PAGES_MAX_COUNT (252 + (62 * 128) + 126) |
Definition at line 47 of file scsiprint.cpp.
#define SCSI_VERSION_HIGHEST SCSI_VERSION_SPC_6 |
Definition at line 90 of file scsiprint.cpp.
#define SCSI_VERSION_SPC_4 0x6 |
Definition at line 87 of file scsiprint.cpp.
#define SCSI_VERSION_SPC_5 0x7 |
Definition at line 88 of file scsiprint.cpp.
#define SCSI_VERSION_SPC_6 0xd /* T10/BSR INCITS 566, proposed in 23-015r0 */ |
Definition at line 89 of file scsiprint.cpp.
#define T10_VENDOR_HITACHI_1 "HITACHI" |
Definition at line 96 of file scsiprint.cpp.
#define T10_VENDOR_HITACHI_2 "HL-DT-ST" |
Definition at line 97 of file scsiprint.cpp.
#define T10_VENDOR_HITACHI_3 "HGST" |
Definition at line 98 of file scsiprint.cpp.
#define T10_VENDOR_SEAGATE "SEAGATE" |
Definition at line 95 of file scsiprint.cpp.
|
static |
Definition at line 122 of file scsiprint.cpp.
|
static |
Definition at line 134 of file scsiprint.cpp.
|
static |
Definition at line 2826 of file scsiprint.cpp.
|
static |
Definition at line 372 of file scsiprint.cpp.
|
static |
Definition at line 491 of file scsiprint.cpp.
|
static |
Definition at line 143 of file scsiprint.cpp.
|
static |
Definition at line 1457 of file scsiprint.cpp.
|
static |
Definition at line 430 of file scsiprint.cpp.
|
static |
Definition at line 1302 of file scsiprint.cpp.
|
static |
Definition at line 3324 of file scsiprint.cpp.
|
static |
Definition at line 933 of file scsiprint.cpp.
|
static |
Definition at line 2185 of file scsiprint.cpp.
|
static |
Definition at line 654 of file scsiprint.cpp.
|
static |
Definition at line 1522 of file scsiprint.cpp.
int scsiPrintMain | ( | scsi_device * | device, |
const scsi_print_options & | options | ||
) |
Definition at line 3494 of file scsiprint.cpp.
|
static |
Definition at line 575 of file scsiprint.cpp.
|
static |
Definition at line 2728 of file scsiprint.cpp.
|
static |
Definition at line 773 of file scsiprint.cpp.
|
static |
Definition at line 842 of file scsiprint.cpp.
|
static |
Definition at line 1090 of file scsiprint.cpp.
|
static |
Definition at line 1723 of file scsiprint.cpp.
|
static |
Definition at line 1910 of file scsiprint.cpp.
|
static |
Definition at line 3300 of file scsiprint.cpp.
|
static |
Definition at line 1503 of file scsiprint.cpp.
|
static |
Definition at line 1782 of file scsiprint.cpp.
|
static |
Definition at line 3263 of file scsiprint.cpp.
|
static |
Definition at line 3226 of file scsiprint.cpp.
|
static |
Definition at line 109 of file scsiprint.cpp.
|
static |
Definition at line 2704 of file scsiprint.cpp.
|
static |
Definition at line 2320 of file scsiprint.cpp.
|
static |
Definition at line 2523 of file scsiprint.cpp.
|
static |
Definition at line 759 of file scsiprint.cpp.
|
static |
Definition at line 1271 of file scsiprint.cpp.
|
static |
Definition at line 68 of file scsiprint.cpp.
|
static |
Definition at line 59 of file scsiprint.cpp.
uint8_t gBuf[GBUF_SIZE] |
Definition at line 41 of file scsiprint.cpp.
|
static |
Definition at line 65 of file scsiprint.cpp.
|
static |
Definition at line 64 of file scsiprint.cpp.
|
static |
Definition at line 63 of file scsiprint.cpp.
|
static |
Definition at line 72 of file scsiprint.cpp.
|
static |
Definition at line 80 of file scsiprint.cpp.
|
static |
Definition at line 58 of file scsiprint.cpp.
|
static |
Definition at line 69 of file scsiprint.cpp.
|
static |
Definition at line 57 of file scsiprint.cpp.
|
static |
Definition at line 67 of file scsiprint.cpp.
|
static |
Definition at line 60 of file scsiprint.cpp.
|
static |
Definition at line 54 of file scsiprint.cpp.
|
static |
Definition at line 102 of file scsiprint.cpp.
|
static |
Definition at line 75 of file scsiprint.cpp.
|
static |
Definition at line 76 of file scsiprint.cpp.
|
static |
Definition at line 77 of file scsiprint.cpp.
|
static |
Definition at line 52 of file scsiprint.cpp.
|
static |
Definition at line 50 of file scsiprint.cpp.
|
static |
Definition at line 62 of file scsiprint.cpp.
|
static |
Definition at line 53 of file scsiprint.cpp.
|
static |
Definition at line 61 of file scsiprint.cpp.
|
static |
Definition at line 70 of file scsiprint.cpp.
|
static |
Definition at line 51 of file scsiprint.cpp.
|
static |
Definition at line 66 of file scsiprint.cpp.
|
static |
Definition at line 56 of file scsiprint.cpp.
|
static |
Definition at line 55 of file scsiprint.cpp.
|
static |
Definition at line 71 of file scsiprint.cpp.
|
static |
Definition at line 101 of file scsiprint.cpp.
|
static |
Definition at line 100 of file scsiprint.cpp.
|
static |
Definition at line 105 of file scsiprint.cpp.
|
static |
Definition at line 83 of file scsiprint.cpp.
|
static |
Definition at line 2769 of file scsiprint.cpp.
|
static |
Definition at line 1283 of file scsiprint.cpp.
|
static |
Definition at line 94 of file scsiprint.cpp.
|
static |
Definition at line 86 of file scsiprint.cpp.
const char* scsiprint_c_cvsid |
Definition at line 36 of file scsiprint.cpp.
|
static |
Definition at line 1055 of file scsiprint.cpp.
|
static |
Definition at line 1066 of file scsiprint.cpp.
|
static |
Definition at line 427 of file scsiprint.cpp.
|
static |
Definition at line 103 of file scsiprint.cpp.
|
static |
Definition at line 2805 of file scsiprint.cpp.
|
static |
Definition at line 104 of file scsiprint.cpp.