ipmi sel log revisited

Lei Yu yulei.sh at bytedance.com
Mon Jun 28 19:42:14 AEST 2021


This email is to describe the current status and issues related ipmi
sel log in OpenBMC, and propose a possible solution.

# Background
There are two backends of the ipmi sel log:
* The logging entry on DBus
* The ipmi_sel log stored in "/var/log/ipmi_sel"

The configuration option `SEL_LOGGER_SEND_TO_LOGGING_SERVICE` in
phosphor-sel-logger is used to control which way to use.

## The logging entry on DBus
The logging entries on DBus in /xyz/openbmc_project/logging/entry/
will be parsed and converted to IPMI sel logs.
This includes two types of logs:
* The logging entries with a CALLOUT path in the associations.
* The logging entries with SEL metadata[1] in the "AdditionalData".
For the both logging entries, the ipmid will parse the entry and
convert it to a SEL entry.

## The ipmi_sel log stored in "/var/log/ipmi_sel"
The log is sent to the journal log with specific MESSAGE_ID and properties.
rsyslog filters such logs and save the "/var/log/ipmi_sel" [2]

## Comparison
Both methods have pros and cons:

| Method        | Pros                              | Cons
                 |
| ------        | ----                              | ----
                 |
| Logging entry | Use DBus data model               | Complicate and
slow to parse      |
|               | Support both ipmi sel and redfish |
                 |
|               |                                   |
                 |
| ipmi_sel      | Easy and quick to parse           | Data is
separated from DBus       |
|               |                                   | ipmi sel and
redfish is separated |

# The proposed solution
The openbmc usually uses the DBus as the data model and all the
services consume data from DBus, and the upstream phosphor-host-ipmid
already supports the logging entries, the proposal is to re-use the
logging entry on DBus as the data source, and improve the cons: to
make it faster to parse in ipmid.

The idea is:
1. On BMC startup, let ipmid parse all the logging entries in the
background and generate the SEL entries in RAM;
2. Use a match to get a callback on logging entries' add/delete
events, and update the SEL entries in RAM when a logging entry is
added or deleted;
3. Use the SEL entries in RAM directly when `ipmi sel list|elist` is called.

This way improves `ipmitool sel list` speed and possibly resolve the
issue of the current logging entry model.

Comments are welcome.

[1]: https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Logging/SEL.metadata.yaml
[2]: https://github.com/openbmc/openbmc/blob/master/meta-intel-openbmc/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog.conf

-- 
BRs,
Lei YU


More information about the openbmc mailing list