sysfs: add support for ACPI 4.0 power meters - #860
Open
dongjiang1989 wants to merge 1 commit into
Open
Conversation
Add GetPowerMeters() to enumerate ACPI power meter devices exposed by the kernel driver drivers/hwmon/acpi_power_meter.c via the ACPI bus path /sys/bus/acpi/drivers/power_meter/ACPI000D:*. The PowerMeter struct covers: - Standard hwmon attributes (power1_average, *_interval, alarm, etc.) - Optional capping attributes (power1_cap, cap_min/max/hyst) - ACPI extension attributes (accuracy, is_battery, model/serial/OEM) - The measures/ subdirectory (list of measured devices) All optional fields use pointer types and are nil when the firmware does not expose them, ensuring graceful degradation across different ACPI implementations. Returns nil, nil when the ACPI bus path does not exist, matching the behaviour of GetRaplZones. Closes prometheus#753 Signed-off-by: dongjiang <dongjiang@xiaomi.com> Signed-off-by: dongjiang <dongjiang1989@126.com>
dongjiang1989
force-pushed
the
add-powermeter
branch
from
August 13, 2026 13:28
efa792e to
93c044d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
GetPowerMeters()to thesysfspackage to enumerate ACPI 4.0 power meter devices exposed by the kernel driverdrivers/hwmon/acpi_power_meter.cvia the ACPI bus path/sys/bus/acpi/drivers/power_meter/ACPI000D:*.Closes #753.