How can I help debugging?

Well, the real bug with powertop is that it is showing power usage even when on
AC in Jean-Paul“s laptop.
This is the information he sent me:

********************************************
On battery:

neptune:~# cat /proc/acpi/battery/BAT0/state
present:                 yes
capacity state:          ok
charging state:          discharging
present rate:            unknown
remaining capacity:      2785 mAh
present voltage:         11439 mV

neptune:~# cat /proc/acpi/battery/BAT0/info
present:                 yes
design capacity:         4400 mAh
last full capacity:      3841 mAh
battery technology:      rechargeable
design voltage:          11196 mV
design capacity warning: 384 mAh
design capacity low:     192 mAh
capacity granularity 1:  120 mAh
capacity granularity 2:  8 mAh
model number:            255/259
serial number:           00001
battery type:            LiON
OEM info:                OEM

neptune:~# ls /proc/acpi/thermal_zone/THRM/
cooling_mode  polling_frequency  state  temperature  trip_points
neptune:~# cat /proc/acpi/thermal_zone/THRM/temperature
temperature:             11 C

On charge:

neptune:~# cat /proc/acpi/battery/BAT0/state
present:                 yes
capacity state:          ok
charging state:          charging
present rate:            unknown
remaining capacity:      2615 mAh
present voltage:         11771 mV

**********************************************************

Bellow is a possible patch for this:


diff -uNr -B -b powertop-1.7/display.c powertop-1.7_teste/display.c
--- powertop-1.7/display.c      2007-06-17 22:16:33.000000000 -0300
+++ powertop-1.7_teste/display.c        2007-06-27 09:23:33.000000000 -0300
@@ -187,6 +187,7 @@
void show_acpi_power_line(double rate, double cap, double capdelta, time_t ti)
{
      char buffer[1024];
+       extern dontcount;

      sprintf(buffer,  _("no ACPI power usage estimate available") );

@@ -199,7 +200,7 @@
              if (ti>180 && capdelta > 0)
                      sprintf(c, _("(long term: %3.1fW,/%3.1fh)"),
3600*capdelta / ti, cap / (3600*capdelta/ti+0.01));
      }
-       else if (ti>120 && capdelta > 0.001)
+       else if (ti>120 && capdelta > 0.001 && !dontcount)
              sprintf(buffer, _("Power usage (5 minute ACPI estimate)
: %5.1f W (%3.1f hours left)"), 3600*capdelta / ti, cap /
(3600*capdelta/ti+0.01));

      mvwprintw(acpi_power_window, 0, 0, buffer);
diff -uNr -B -b powertop-1.7/powertop.c powertop-1.7_teste/powertop.c
--- powertop-1.7/powertop.c     2007-06-17 22:16:31.000000000 -0300
+++ powertop-1.7_teste/powertop.c       2007-06-27 09:40:05.000000000 -0300
@@ -69,6 +69,7 @@
int            linesize;
int            linectotal;

+int             dontcount = 0;

double last_bat_cap = 0;
double prev_bat_cap = 0;
@@ -299,7 +300,6 @@
              return;

      while ((dirent = readdir(dir))) {
-               int dontcount = 0;
              double voltage = 0.0;
              double amperes_drawn = 0.0;
              double watts_drawn = 0.0;

_______________________________________________
Power mailing list
[email protected]
http://www.bughost.org/mailman/listinfo/power

Reply via email to