smartmontools SVN Rev 5618
Utility to control and monitor storage systems with "S.M.A.R.T."
Macros | Functions | Variables
nvmeprint.cpp File Reference
#include "config.h"
#include "nvmeprint.h"
#include "utility.h"
#include "dev_interface.h"
#include "nvmecmds.h"
#include "atacmds.h"
#include "scsicmds.h"
#include "smartctl.h"
#include "sg_unaligned.h"
#include <inttypes.h>
Include dependency graph for nvmeprint.cpp:

Go to the source code of this file.

Macros

#define __STDC_FORMAT_MACROS   1
 

Functions

static bool le128_is_non_zero (const unsigned char(&val)[16])
 
static const char * le128_to_str (char(&str)[64], uint64_t hi, uint64_t lo, unsigned bytes_per_unit)
 
static const char * le128_to_str (char(&str)[64], const unsigned char(&val)[16], unsigned bytes_per_unit=0)
 
static const char * lbacap_to_str (char(&str)[64], uint64_t lba_cnt, int lba_bits)
 
static void lbacap_to_js (const json::ref &jref, uint64_t lba_cnt, int lba_bits)
 
static const char * kelvin_to_str (char(&str)[64], int k)
 
static void print_drive_info (const nvme_id_ctrl &id_ctrl, const nvme_id_ns &id_ns, unsigned nsid, bool show_all)
 
static const char * format_power (char(&str)[16], unsigned power, unsigned scale)
 
static void print_drive_capabilities (const nvme_id_ctrl &id_ctrl, const nvme_id_ns &id_ns, unsigned nsid, bool show_all)
 
static void print_critical_warning (unsigned char w)
 
static void print_smart_log (const nvme_smart_log &smart_log, const nvme_id_ctrl &id_ctrl, bool show_all)
 
static void print_error_log (const nvme_error_log_page *error_log, unsigned read_entries, unsigned max_entries)
 
static void print_self_test_log (const nvme_self_test_log &self_test_log, unsigned nsid)
 
int nvmePrintMain (nvme_device *device, const nvme_print_options &options)
 

Variables

const char * nvmeprint_cvsid
 

Macro Definition Documentation

◆ __STDC_FORMAT_MACROS

#define __STDC_FORMAT_MACROS   1

Definition at line 12 of file nvmeprint.cpp.

Function Documentation

◆ format_power()

static const char * format_power ( char(&)  str[16],
unsigned  power,
unsigned  scale 
)
static

Definition at line 211 of file nvmeprint.cpp.

◆ kelvin_to_str()

static const char * kelvin_to_str ( char(&)  str[64],
int  k 
)
static

Definition at line 99 of file nvmeprint.cpp.

◆ lbacap_to_js()

static void lbacap_to_js ( const json::ref jref,
uint64_t  lba_cnt,
int  lba_bits 
)
static

Definition at line 92 of file nvmeprint.cpp.

◆ lbacap_to_str()

static const char * lbacap_to_str ( char(&)  str[64],
uint64_t  lba_cnt,
int  lba_bits 
)
static

Definition at line 86 of file nvmeprint.cpp.

◆ le128_is_non_zero()

static bool le128_is_non_zero ( const unsigned char(&)  val[16])
static

Definition at line 32 of file nvmeprint.cpp.

◆ le128_to_str() [1/2]

static const char * le128_to_str ( char(&)  str[64],
const unsigned char(&)  val[16],
unsigned  bytes_per_unit = 0 
)
static

Definition at line 71 of file nvmeprint.cpp.

◆ le128_to_str() [2/2]

static const char * le128_to_str ( char(&)  str[64],
uint64_t  hi,
uint64_t  lo,
unsigned  bytes_per_unit 
)
static

Definition at line 43 of file nvmeprint.cpp.

◆ nvmePrintMain()

int nvmePrintMain ( nvme_device device,
const nvme_print_options options 
)

Definition at line 652 of file nvmeprint.cpp.

◆ print_critical_warning()

static void print_critical_warning ( unsigned char  w)
static

Definition at line 336 of file nvmeprint.cpp.

◆ print_drive_capabilities()

static void print_drive_capabilities ( const nvme_id_ctrl id_ctrl,
const nvme_id_ns id_ns,
unsigned  nsid,
bool  show_all 
)
static

Definition at line 226 of file nvmeprint.cpp.

◆ print_drive_info()

static void print_drive_info ( const nvme_id_ctrl id_ctrl,
const nvme_id_ns id_ns,
unsigned  nsid,
bool  show_all 
)
static

Definition at line 108 of file nvmeprint.cpp.

◆ print_error_log()

static void print_error_log ( const nvme_error_log_page error_log,
unsigned  read_entries,
unsigned  max_entries 
)
static

Definition at line 448 of file nvmeprint.cpp.

◆ print_self_test_log()

static void print_self_test_log ( const nvme_self_test_log self_test_log,
unsigned  nsid 
)
static

Definition at line 545 of file nvmeprint.cpp.

◆ print_smart_log()

static void print_smart_log ( const nvme_smart_log smart_log,
const nvme_id_ctrl id_ctrl,
bool  show_all 
)
static

Definition at line 372 of file nvmeprint.cpp.

Variable Documentation

◆ nvmeprint_cvsid

const char* nvmeprint_cvsid
Initial value:
= "$Id: nvmeprint.cpp 5604 2024-03-29 16:14:52Z chrfranke $"
#define NVMEPRINT_H_CVSID
Definition: nvmeprint.h:14

Definition at line 16 of file nvmeprint.cpp.