sysfs: add support for ACPI 4.0 power meters - #860
Merged
Conversation
dongjiang1989
force-pushed
the
add-powermeter
branch
from
August 13, 2026 13:28
efa792e to
93c044d
Compare
SuperQ
reviewed
Aug 27, 2026
SuperQ
reviewed
Aug 27, 2026
dongjiang1989
force-pushed
the
add-powermeter
branch
2 times, most recently
from
August 28, 2026 03:18
35c9157 to
a8cad45
Compare
Member
Author
|
Thanks @SuperQ Update, Please recheck it |
SuperQ
reviewed
Aug 28, 2026
SuperQ
requested changes
Aug 28, 2026
dongjiang1989
force-pushed
the
add-powermeter
branch
from
August 28, 2026 13:06
39021ca to
41d3e55
Compare
Member
Author
|
@SuperQ Update & git rebase done Please recheck it |
dongjiang1989
force-pushed
the
add-powermeter
branch
from
August 28, 2026 13:11
41d3e55 to
d7290a2
Compare
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 an empty slice with os.ErrNotExist when the ACPI bus path does not exist. Note: power1_accuracy is preserved as a string because the kernel emits it as a formatted percent value (e.g. "1.50%"). Closes prometheus#753 Signed-off-by: dongjiang <dongjiang1989@126.com>
dongjiang1989
force-pushed
the
add-powermeter
branch
from
August 28, 2026 13:11
d7290a2 to
cc9155c
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.