Migrating from version 0.8.5¶
RAS Daemon up to version 0.8.5 had ras-mc-ctl written in Perl.
Such tool was rewritten in Python to bring several new features, specially
when dealing with database.
This chapter describes the difference between the previous version and its current implementation.
Migrating ras-mc-ctl DIMM commands¶
The Python implementation of ras-mc-ctl places all EDAC and DIMM
operations below the dimm command. mem is an alias for dimm.
The old Perl implementation accepted these options directly at the top
level, so most command lines need only the new command name.
For example, replace:
$ sudo ras-mc-ctl --status
with:
$ sudo ras-mc-ctl dimm --status
DIMM command mapping¶
The following table maps every DIMM operation provided by the Perl tool.
ras-mc-ctl ≤ v0.8.5 (Perl) |
ras-mc-ctl > v0.8.5 (Python) |
Notes |
|---|---|---|
|
|
Prints the detected vendor and model. |
|
|
Quote vendor or model values containing spaces. |
|
|
Returns failure when no EDAC driver is loaded. |
|
|
Compares configured and sysfs labels. |
|
|
Reads Locator and Bank Locator from DMI. |
|
|
Writes labels to EDAC sysfs. |
|
|
|
|
|
Selects an alternate primary label database. |
|
|
Sizes are scaled automatically. |
|
|
There is no non-human option in the Python tool. The logic will automatically move from MB to GB, TB, … as the memory size grows. |
|
|
Consolidates ranks which have the same label. |
|
|
Displays each EDAC location separately. |
|
|
Suppresses DIMM status and diagnostic messages. |
|
|
Shows the DIMM-specific command reference. |
Several DIMM actions may still be requested together. For example:
$ sudo ras-mc-ctl dimm --mainboard --print-labels --error-count
They run in the same order as in the Perl implementation. A failure in any requested action makes the command exit unsuccessfully. Ordinary per-action failures do not prevent the remaining actions from being attempted.
DIMM and database operations¶
The Perl tool allowed DIMM and database reports in one invocation. The Python command groups are deliberately separate. Replace a mixed command such as:
$ sudo ras-mc-ctl --status --summary
with two commands:
$ sudo ras-mc-ctl dimm --status
$ sudo ras-mc-ctl db --summary
Mainboard detection and overrides¶
Automatic mainboard detection continues to support
${sysconfdir}/ras/mainboard. A static override contains vendor and
model assignments:
vendor = Example Computer Corporation
model = Example Server 2000
Alternatively, the file may name a helper:
script = /usr/libexec/ras-mainboard
The helper must write the same vendor=... and model=... assignments
to standard output. As with the Perl tool, the configured command is run by
the shell, so the mainboard file must only be writable by trusted
administrators.
When no complete configured override is available, the tool reads DMI data
from sysfs and then falls back to dmidecode. The new --dmidecode
option bypasses the configuration file and sysfs detection. The new
--vendor and --model options override individual detected values;
specify both when a complete manual identity is desired:
$ sudo ras-mc-ctl dimm --print-labels \
--vendor "Example Computer Corporation" --model "Example Server 2000"
Label database paths¶
The default files continue to reside below the configured system directory:
${sysconfdir}/ras/dimm_labels.dbis the primary label database;files in
${sysconfdir}/ras/dimm_labels.d/extend that database;${sysconfdir}/ras/mainboardoptionally overrides board detection.
${sysconfdir} is normally /etc, but follows the value selected when
rasdaemon is built and installed. --labeldb FILE replaces only the
primary database; the configured dimm_labels.d directory is still read.
Exit status and quiet operation¶
Successful DIMM operations exit with status zero. A missing EDAC driver,
missing DIMMs, invalid counters, failure to obtain DMI data required by an
operation, or another failed requested operation produces a nonzero status.
Invalid option combinations, such as --delay without
--register-labels or --per-rank without --error-count, are
rejected before any action runs.
dimm --quiet suppresses runtime DIMM status and diagnostic messages. It
does not suppress command-line syntax errors or data explicitly requested by
options such as --layout or --error-count.
Migrating ras-mc-ctl database commands¶
The Python implementation places all database operations below the
database command. db is its shorter alias. For example, replace:
$ sudo ras-mc-ctl --summary
with:
$ sudo ras-mc-ctl db --summary
Database command mapping¶
The following table maps every database operation provided by the Perl tool.
ras-mc-ctl ≤ v0.8.5 (Perl) |
ras-mc-ctl > v0.8.5 (Python) |
Notes |
|---|---|---|
|
|
Uses event-specific groupings and separates remote records by hostname. |
|
|
Known EXTLOG, CXL and NVIDIA values are decoded in text output. |
|
|
The date is interpreted in the local timezone of the client. |
|
|
Applies the same inclusive lower date boundary. |
|
|
Uses the registered grouping for each selected HiSilicon table. |
|
|
Displays records from the corresponding autodiscovered tables. |
|
Add |
Alias for |
|
|
Groups the DDR register dumps by address. |
|
|
Displays detailed DDR register-dump records. |
|
|
Groups records by severity and subsystem. |
|
|
Displays detailed CorsicaDpu records. |
|
|
Selects |
|
|
Static platform identifiers are replaced by discovered table names. |
|
|
Shows the database-specific command reference. |
Summary reports¶
db --summary retains the event-specific purpose of the Perl report while
discovering the available tables at runtime. Known tables are grouped as
follows:
Event table |
Summary fields |
|---|---|
|
Error type, DIMM label and EDAC location |
|
Error type and message |
|
MPIDR |
NVIDIA tables |
Signature and socket |
CXL tables |
Memory device |
|
Decoded error type and severity |
|
Device name |
|
Device |
|
Action result |
|
Error message |
|
Signal code |
KunPeng OEM and common tables |
Severity and module |
KunPeng PCIe local table |
Severity and submodule |
|
Address |
|
Severity and subsystem |
Other discovered tables |
Hostname and table count |
The Python tool also provides database reports which have no Perl equivalent:
db --table-summarycounts events by hostname and table;db --errors-per-tablelists counts for non-empty tables;db --countsupports configurable grouping, filtering and ordering;db --untilsupplies an inclusive upper date boundary;db --hostnameselects one host in a remote database;db --jsonproduces machine-readable output.
Database backends and timestamps¶
The Perl tool read one fixed SQLite database. The Python command reads the
backend and connection parameters from the rasdaemon configuration and
supports SQLite, MySQL/MariaDB and PostgreSQL. SQLite continues to use the
local timestamps recorded on its single host. MySQL and PostgreSQL store UTC
timestamps so records from hosts in different timezones can be combined;
ras-mc-ctl displays and filters them in the local timezone of the client.