commit | 9fa224c5eadf64505ef2c41334f7125fe899176b | [log] [tgz] |
---|---|---|
author | Jonico Eustaquio <jonico.eustaquio@fii-na.com> | Wed Jan 10 13:08:52 2024 -0600 |
committer | Jonico Eustaquio <jonico.eustaquio@fii-na.com> | Fri May 10 21:17:37 2024 +0000 |
tree | 97cd1dd35dc28b90f069b968430b3e80262ba33d | |
parent | 0acff271cffc724fc0aa0c41e9b25ba2d7e8c5a6 [diff] |
Add SEL delete method and track record IDs Add SEL delete method which removes the line associated with the target entry from the SEL files. Upcoming record IDs to be used will now be stored into a vector to keep track of the next available record ID. The vector will be backed up to a file in case the phosphor-sel-logger service restarts. In the case of SEL entry deletion, the record ID with that associated entry can now be reused and will take priority in being used when a new SEL entry is added. If multiple entries are deleted, then the Record IDs will be reused in a LIFO fashion. Timestamps are updated for "Last Del Time" as specified by the spec. The SEL delete method is behind the "sel-delete" build option to preserve backwards stability since it requires a departure from the previous way that the next record ID is calculated. Tested: * Generated SEL entries. * Successfully removed a SEL entry using a dbus call: busctl call xyz.openbmc_project.Logging.IPMI \ /xyz/openbmc_project/Logging/IPMI xyz.openbmc_project.Logging.IPMI \ IpmiSelDelete q <RecordID> * The next SEL entry added uses the same Record ID associated with the entry that was previously deleted. Change-Id: If51f6bf2d7c61b73b5568874488cdd61031dc6ca Signed-off-by: Jonico Eustaquio <jonico.eustaquio@fii-na.com>
The SEL Logger daemon handles all requests to add new IPMI SEL records to the journal. SEL records stored in the journal are identified by the standard MESSAGE_ID metadata. Other metadata fields are used to store event-specific information for each record.
SEL records are identified in the journal using the MESSAGE_ID field.
The MESSAGE_ID for SEL records is "b370836ccf2f4850ac5bee185b77893a".
The additional metadata fields for a SEL record are
IPMI_SEL_RECORD_ID = Two byte unique SEL Record ID IPMI_SEL_RECORD_TYPE = The type of SEL entry (system or OEM) which determines the definition of the remaining bytes IPMI_SEL_GENERATOR_ID = The IPMI Generator ID (usually the IPMB Slave Address) of the requester IPMI_SEL_SENSOR_PATH = D-Bus path of the sensor in the event IPMI_SEL_EVENT_DIR = Direction of the event (assert or deassert) IPMI_SEL_DATA = Raw binary data included in the SEL record
The SEL Logger daemon exposes an interface for manually adding System and OEM type SEL events, and provides the capability to monitor for types of events and log them automatically.
The interface for System type events requires
The interface for OEM type events requires
The MESSAGE_ID and IPMI_SEL_RECORD_ID metadata fields are added by the daemon.
The SEL Logger daemon can be configured to watch for specific types of events and automatically log SEL records for them.
As an example, the SEL Logger has a "threshold event monitor" which implements a D-Bus match for any "PropertiesChanged" event on the xyz.openbmc_project.Sensor.Threshold
interface. The handler then checks for any new threshold events and logs SEL records accordingly.