openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* ipmi sel log revisited
@ 2021-06-28  9:42 Lei Yu
  2021-09-15  9:08 ` Lei Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Lei Yu @ 2021-06-28  9:42 UTC (permalink / raw)
  To: openbmc

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ipmi sel log revisited
  2021-06-28  9:42 ipmi sel log revisited Lei Yu
@ 2021-09-15  9:08 ` Lei Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Lei Yu @ 2021-09-15  9:08 UTC (permalink / raw)
  To: openbmc

On Mon, Jun 28, 2021 at 5:42 PM Lei Yu <yulei.sh@bytedance.com> wrote:
>
> 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.

The above idea is now implemented by the below series of patches.
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-host-ipmid/+/46893


-- 
BRs,
Lei YU

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-15  9:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28  9:42 ipmi sel log revisited Lei Yu
2021-09-15  9:08 ` Lei Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).