commit | 57fb664c133d31a1f094441f29f30552004bb487 | [log] [tgz] |
---|---|---|
author | Faisal Awada <faisal@us.ibm.com> | Fri Feb 21 16:52:54 2025 -0600 |
committer | Faisal Awada <faisal@us.ibm.com> | Wed Mar 12 20:35:18 2025 -0500 |
tree | 5a11c0e6a5f00eee159d8021c08694ed8f1020a0 | |
parent | cb36acd0204d31bb37d868781fd3d0b674ec8dd0 [diff] |
psutil: Add PSU Event Log Reporting Methods This commit introduces new methods in the Updater class to log errors and create Platform Event Logs for PSU failures and I2C-related issues. The following methods are added: - createServiceableEventLog: Creates a serviceable Platform Event Log using xyz.openbmc_project.Logging.Create. Takes an error name, severity, and additional data as parameters. Retrieves the logging service and calls the D-Bus method to create the log. - getI2CAdditionalData: Retrieves I2C-related callout data, including I2C bus ID, address, and error number. Formats the ID and address as hexadecimal strings and returns them as a map. - callOutI2CEventLog: Reports a Event Log for I2C failures. Collects PSU inventory path, priority, and I2C-specific callout data. Merges any additional provided data and creates a Event Log. - callOutPsuEventLog: Reports a Event Log for general PSU failures. Includes PSU inventory callout information and priority. - callOutSWEventLog: Reports Event Log for software-related PSU file issues.Logs errors using predefined PSU firmware file issue messages. These changes improve fault logging and troubleshooting capabilities in PSU management by ensuring proper logging and event recording. - callOutGoodEventLog: Reports a successful PSU firmware update Event Log along with the firmware level. - Added accessor functions to provide control over Event logging, allowing: - Enabling/disabling Event logging at runtime. - Tracking if Event Log has been logged in the current session. Accessor functions: - enableEventLogging() - disableEventLogging() - isEventLogEnabled() - enableEventLoggedThisSession() - isEventLoggedThisSession() Test: Verified each function correctly generates Event Log in openBmc. The test was conducted by writing a standalone test program that: 1 - Calls createServiceableEventLog() with various error names, severity levels, and additionalData then check the generated Event Log. 2 - Calls getI2CAdditionalData() and verifies the returned data contains the correct I2C bus ID, Address and error number. 3 - Calls callOutI2CEventLog() with simulated I2C error and checks the generated Event Log. 4 - Calls callOutPsuEventLog() and callOutSWEventLog() with different input data and verifies the correct error messages are logged. Change-Id: Id52b3e1c0b2a3b09ae3ac5d93bc53e02d335d6c7 Signed-off-by: Faisal Awada <faisal@us.ibm.com>
This repository contains applications for configuring and monitoring devices that deliver power to the system.
Actively-maintained applications:
Legacy applications:
To build all applications in this repository:
meson setup build ninja -C build
To clean the repository and remove all build output:
rm -rf build
You can specify meson options to customize the build process. For example, you can specify:
Several applications in this repository require a PSU JSON config to run. The JSON config file provides information for:
There is an example psu.json to describe the necessary configurations.
inventoryPMBusAccessType
defines the pmbus access type, which tells the service which sysfs type to use to read the attributes. The possible values are:
/sys/bus/i2c/devices/3-0069/
/sys/bus/i2c/devices/3-0069/hwmon/hwmonX/
/sys/kernel/debug/pmbus/hwmonX/
/sys/kernel/debug/<driver>.<instance>/
/sys/kernel/debug/pmbus/hwmonX/cffps1/
fruConfigs
defines the mapping between the attribute file and the FRU inventory interface and property. The configuration example below indicates that the service will read part_number
attribute file from a directory specified by the above pmbus access type, and assign to PartNumber
property in xyz.openbmc_project.Inventory.Decorator.Asset
interface.
"fruConfigs": [ { "propertyName": "PartNumber", "fileName": "part_number", "interface": "xyz.openbmc_project.Inventory.Decorator.Asset" } ]
psuDevices
defines the kernel device dir for each PSU in inventory. The configuration example below indicates that powersupply0
's device is located in /sys/bus/i2c/devices/3-0069
.
"psuDevices": { "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0" : "/sys/bus/i2c/devices/3-0069", }