Total server power consumpion

Lei YU mine260309 at gmail.com
Fri Oct 19 13:44:48 AEDT 2018


On Thu, Oct 18, 2018 at 4:58 PM Alexander Soldatov <a.soldatov at yadro.com> wrote:
>   We have faced with the problem of showing total server power consumption in the webui. Total power consumption is calculated as sum of the PSUs input powers. Input power values are read from PSU using PMBus protocol and are published in the Linux sysfs.  We are using our proprietary PSU driver. So I have an idea. Driver should create virtual hwmon device with total power parameters. We could use standart phopshor-hwmon to publish total power in DBus.
>   But the phosphor-hwmon requires the physical device path (calloutPath). This parameter is transmitted using %p option of the udev. There is no path for the virtual device. The phosphor-hwmon does not get calloutPath and exits with error.

phosphor-hwmon has two arguments, -o (dev-path) or -p (path). You could use -p
to specify the hwmon path directly.

>   There are some questions:
>   1. How is this problem solved in other projects (the Witherspoon etc.)?
Witherspoon's total power is reported by occ, which is handled by occ-hwmon
driver.

>   2. The Witherspoon server has 2,2 kW PSUs. The maximum value of power in linux sysfs on the 32 bit system is 2147483647 µW. How the correct power view is solved?
The code use unit64_t for Value property, so it is ok.

>   3. How does the phosphor-hwmon use calloutPath besides logs info output?
>   4. Does it make sense to give the phosphor-hwmon an ability to work with virtual devices?
It could work with -p argument.


More information about the openbmc mailing list