From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82D66C2B9F4 for ; Mon, 28 Jun 2021 09:42:59 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A31BE61C51 for ; Mon, 28 Jun 2021 09:42:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A31BE61C51 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GD2hw643Nz30B4 for ; Mon, 28 Jun 2021 19:42:56 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bytedance-com.20150623.gappssmtp.com header.i=@bytedance-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=eKrzh3Lz; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=bytedance.com (client-ip=2607:f8b0:4864:20::32e; helo=mail-ot1-x32e.google.com; envelope-from=yulei.sh@bytedance.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bytedance-com.20150623.gappssmtp.com header.i=@bytedance-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=eKrzh3Lz; dkim-atps=neutral Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GD2hQ51PZz30B2 for ; Mon, 28 Jun 2021 19:42:28 +1000 (AEST) Received: by mail-ot1-x32e.google.com with SMTP id v5-20020a0568301bc5b029045c06b14f83so18105319ota.13 for ; Mon, 28 Jun 2021 02:42:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=09Ybf+zNUEIiJjwDqTv9wiEwvK3qLEbSiHl8kpoaKgs=; b=eKrzh3Lz1bwUmkZ9nyRWy5+NSsn3mk8FlwmUgikAnvjwgocOS8BBhzO11z42GpBzbz priO0BJZQA2OLHxIYrdvaYh22v7qBDITHgO+CVFBS8LCBdez9zkA70PXAKxQmaR5xzLI h1jfOiZpbnbIV/1B6pD8yqM75dqXBLV+5IJ3709hxCXbCmgJntcdXlmz5nbZ/sBXCpWD Ki2LYXqNjgOowDivOZXCsM0ddMLjpv5fE1ZJO/09z75vHpjCioff1Vn2uB29Hjq/CKCR D68JW7oyS75QyX3f8okHQEFi2tyyATUSQBktozoUsKETdU3dwebrRhy0PBi8SB/MIRef qxLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=09Ybf+zNUEIiJjwDqTv9wiEwvK3qLEbSiHl8kpoaKgs=; b=sbVIYJ/l/GiZy0u2iHB2CcqkTmoU60BLrz4SWmQD78sXx9VrgNaCdErZeWHVWEDIvL TpLq58PXNsrcPQzMOsa6X4pbSKAH47Zqy/wBtFj7KzzL8t4pndL3CyV0ACnBUAA/sPJ0 m8qv5uJ5dueOBTseZz4TxxJetZw735Eq2eT7mkw2cexf1tTyLSZxnllGilC2lq/vHscQ ATC7jy7tshKoIq0qHnmTdXerDfhHuTN0tsA67j9NMcfIjU/6UyL/HH69R9wibQCY1tno /dv6kLyUSQkmnqiwPdKvvqOlZtG2H4GLzvg3yvwzAYYoIIOsxluF2/dglVg5ChXXo8aE fydg== X-Gm-Message-State: AOAM530+bQuxUcQyKoazNHf9qqgdnneYxw863b6F2HAl2+zBEDSjH7sE FXrCZToVS+tqgtZSRtO+fh2MJKpcPRSoKPSKIQh/3dnMcEJDKS/E X-Google-Smtp-Source: ABdhPJw14zBEK8T467lDARH1hqg+dyL4d4IEPImtP5T9nfcKMwuS2cYBto+iz5fK96g6r5flnWvekssYWuo++Pj9LJQ= X-Received: by 2002:a9d:6081:: with SMTP id m1mr20233786otj.226.1624873344880; Mon, 28 Jun 2021 02:42:24 -0700 (PDT) MIME-Version: 1.0 From: Lei Yu Date: Mon, 28 Jun 2021 17:42:14 +0800 Message-ID: Subject: ipmi sel log revisited To: openbmc Content-Type: text/plain; charset="UTF-8" X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "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