Re: Why is /sys/class/power_supply/CMB1/energy_now not exported?

From: Michal Hocko
Date: Tue Jul 22 2008 - 10:19:38 EST


On Tue, Jul 22, 2008 at 09:49:03AM +0400, Alexey Starikovskiy wrote:
> It looks like you use current_now as power, not multiplying it by voltage.

You are right, my calculation are simply wrong. I have mixed remaining
capacity (calculated for 2.6.25-2 and 2.6.26) with remaining capacity
and some nonsense for the first 2.6.25 (table below was updated).

Nevertheless, what can be the reason for such a different result for
distrbution kernel?

> You should either not multiply anything, then you have similar units -- charge and current,
> or multiply _both_ by voltage_now, then again you have similar units -- power and energy.
> In these both cases you'll have hours or remaining capacity.
>
[...]
>>
>> I have tried 3 configurations:
>> * 2.6.25 - Vanilla kernel with config-2.6.25 config and result output in
>> powertop-2.6.25-good
>> * 2.6.25-2 - Debian distribution kernel with config-2.6.25-2 config and
>> powertop-2.6.25-2-bad output
>> * 2.6.26 - Vanilla kernel with config-2.6.26 config and result output in
>> powertop-2.6.26-good
>>
>> with the following scenario (powertop patched with attached
>> charge-read.patch):
>> * wait for /sys/class/power_class/CMB1/status FULL on AC
>> * get values from all files in ..CMB1 to output file
>> * unplug AC
>> * run powertop
>> * get values from all files in CMB1 again to the same file
>> * get output of power consumption to the output file
>>
>>
>> | 2.6.25 2.6.25-2 2.6.26
>> ===========================================================================
>> voltage_now | 12222000 12206000 12218000
>> charge_now | 4850000 4850000 4850000
>> current_now | 1398000 1334000 1313000
>> ---------------------------------------------------------------------------
>> reported | 16.6 1.4 16.3
>> consumption |
>> ---------------------------------------------------------------------------
reported | 3.5 41.7 3.6
capacity |
---------------------------------------------------------------------------
calculated | 3.46 3.63 3.69
capacity |
===========================================================================
[...]

--
Michal Hocko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/