Package: acpitool
Version: 0.4.4-1
Severity: normal
Tags: patch

Some trivial typos cause failures on SMP machines.  For example:

----------------------------------------------------------------------
ravna:1$ acpitool -c
  CPU type               : Genuine Intel(R) CPU           T2600  @ 2.16GHz
  CPU speed              : 1000.000 MHz
  Bogomips               : on   : yes

# of CPU's found       : 2

  Processor ID           : 0
  Bus mastering control  : yes
  Power management       : yes
  Throttling control     : yes
  Limit interface        : yes
  Active C-state         : C3
  C-states (incl. C0)    : 4
  Usage of state C1      : 10 (0.0 %)
  Usage of state C2      : 90880740 (83.0 %)
  Usage of state C3      : 18653344 (17.0 %)
  T-state count          : 8
  Active T-state         : T0

  could not open file /proc/acpi/processor/CPU1/info
  Active C-state         : C3
  C-states (incl. C0)    : 7
  Usage of state C1      : 10 (0.0 %)
  Usage of state C2      : 90880740 (66.0 %)
  Usage of state C3      : 18653344 (13.6 %)
  Usage of state C4      : 10 (0.0 %)
  Usage of state C5      : 16073802 (11.7 %)
  Usage of state C6      : 12013235 (8.7 %)
 could not open file /proc/acpi/processor/CPU1/throttling
----------------------------------------------------------------------

There are two bugs here: (1) two files won't open, even though they
are present and have appropriate permissions, and (2) the C-state
information for cpu1 is wrong.  Here's a patch that fixes both bugs:

----------------------------------------------------------------------
--- src/acpitool.cpp.~1~        2006-02-05 09:48:15.000000000 -0500
+++ src/acpitool.cpp    2006-07-04 23:43:18.000000000 -0400
@@ -831,6 +831,7 @@
                                // cout << "  Bus Master Activity dc : " << 
bm_activity << endl;
 
                                file2_in.getline(str, 100); // states (line 
contains no information)
+                               cst_cnt=0;
                                while(!file2_in.eof())
                                {
                                        file2_in.getline(str, 100);  // cstate 
Cx
@@ -877,7 +878,7 @@
                                        bzero(temp, 80);
                                        strncpy(temp, str+25, 5);
                                        cout<<"  Active T-state         : 
"<<temp<<endl;
-                                       file2_in.close();
+                                       file_in.close();
                                }
                                else cout<<" could not open file 
"<<filename[i]<<endl;
                        }
----------------------------------------------------------------------

And here's correct output after patching:

----------------------------------------------------------------------
ravna:1$ src/acpitool -c
  CPU type               : Genuine Intel(R) CPU           T2600  @ 2.16GHz
  CPU speed              : 1000.000 MHz
  Bogomips               : on   : yes

# of CPU's found       : 2

  Processor ID           : 0
  Bus mastering control  : yes
  Power management       : yes
  Throttling control     : yes
  Limit interface        : yes
  Active C-state         : C2
  C-states (incl. C0)    : 4
  Usage of state C1      : 10 (0.0 %)
  Usage of state C2      : 90655127 (83.0 %)
  Usage of state C3      : 18609272 (17.0 %)
  T-state count          : 8
  Active T-state         : T0

  Processor ID           : 1
  Bus mastering control  : yes
  Power management       : yes
  Throttling control     : yes
  Limit interface        : yes
  Active C-state         : C2
  C-states (incl. C0)    : 4
  Usage of state C1      : 10 (0.0 %)
  Usage of state C2      : 16034035 (11.7 %)
  Usage of state C3      : 11985425 (8.7 %)
  T-state count          : 8
  Active T-state         : T0
----------------------------------------------------------------------

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17.3-cph1
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages acpitool depends on:
ii  libc6                         2.3.6-15   GNU C Library: Shared libraries
ii  libgcc1                       1:4.1.1-7  GCC support library
ii  libstdc++6                    4.1.1-7    The GNU Standard C++ Library v3

Versions of packages acpitool recommends:
ii  acpid                         1.0.4-5    Utilities for using ACPI power man

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to