Hello community,
here is the log from the commit of package kpowersave
checked in at Mon Apr 10 01:17:43 CEST 2006.
--------
--- arch/i386/kpowersave/kpowersave.changes 2006-04-07 16:13:53.000000000 +0200
+++ kpowersave/kpowersave.changes 2006-04-09 23:50:15.000000000 +0200
@@ -1,0 +2,11 @@
+Sun Apr 9 20:23:26 CEST 2006 - dkukawka@suse.de
+
+- rereleased official stable version 0.6 with this changes:
+ * fixed bug #164683 (fixed detailed dialog for machines without
+ CPUFreq support and more than one CPU/Core and/or throttling)
+ * reduced unneeded calls of getCPUNum()
+ * added fix from Daniel Gollub to be able to fake CPU info from
+ /proc and /sys for development and QA tests
+ * fixed compiler warnings
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kpowersave.spec ++++++
--- /var/tmp/diff_new_pack.LbVxWN/_old 2006-04-10 01:17:34.000000000 +0200
+++ /var/tmp/diff_new_pack.LbVxWN/_new 2006-04-10 01:17:34.000000000 +0200
@@ -17,7 +17,7 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: KDE Front-End to powersave Package, Battery Monitor, and General Power Management Support
Version: 0.6.0
-Release: 3
+Release: 5
ExclusiveArch: %ix86 x86_64 ia64 ppc
Requires: powersave >= 0.12.7 powersave-libs >= 0.12.7 yast2-power-management /sbin/pidof /usr/X11R6/bin/xset
Source: %{name}-%{version}.tar.bz2
@@ -80,6 +80,14 @@
/opt/kde3/lib*/libkdeinit_kpowersave.*
%changelog -n kpowersave
+* Sun Apr 09 2006 - dkukawka@suse.de
+- rereleased official stable version 0.6 with this changes:
+ * fixed bug #164683 (fixed detailed dialog for machines without
+ CPUFreq support and more than one CPU/Core and/or throttling)
+ * reduced unneeded calls of getCPUNum()
+ * added fix from Daniel Gollub to be able to fake CPU info from
+ /proc and /sys for development and QA tests
+ * fixed compiler warnings
* Tue Apr 04 2006 - dkukawka@suse.de
- released official stable version 0.6 with this changes:
* added german version of the handbook
++++++ kpowersave-0.6.0.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kpowersave-0.6.0/ChangeLog new/kpowersave-0.6.0/ChangeLog
--- old/kpowersave-0.6.0/ChangeLog 2006-04-07 13:43:04.000000000 +0200
+++ new/kpowersave-0.6.0/ChangeLog 2006-04-09 21:27:23.000000000 +0200
@@ -1,3 +1,53 @@
+2006-04-09 Danny Kukawka
+
+ Retagged v0.6.0 and released new version.
+
+2006-04-09 Danny Kukawka
+
+ * ChangeLog.package, doc/doxy/changelog.dox: updated Changelogs
+ * NEWS: updated release news for v0.6.0
+
+2006-04-09 Danny Kukawka
+
+ * doc/doxy/fixed_bugs.dox: added SUSE/Novell bug #164683
+ * src/detaileddialog.cpp: Added call setProcessorThrottling()
+ every 2 secs if throttling is supported or if there is more than
+ one CPU/core in the system. Added call checkCPUSpeedThrottling()
+ in setProcessorThrottling() to get always actual data. Fixed
+ connects to use local pointer to pdaemon object.
+ This all (including changes since 2006-04-07) should fix
+ SUSE/Novell bug #164683
+ * src/inactivity.cpp: fixed compiler warning
+
+2006-04-09 Danny Kukawka
+
+ Added slightly adopted patch from Daniel Gollub to fake the CPU
+ system information in proc and sys for development and tests:
+ * configure.in.in: added configure option --enable-fake-cpu
+ * src/pdaemon.cpp: added ifdef and related changes to fake
+ the path to the CPU informations under /tmp/foo
+
+ * src/pdaemon.cpp: fixed warning for compare unsigned and signed
+
+2006-04-09 Danny Kukawka
+
+ * src/detaileddialog.cpp: set processorbar to deactivated if the
+ cpuspeed < 0 (cpu is offline) and the machine only support
+ throttling
+ * src/pdaemon.cpp: fixed throttling-case if cpu is offline
+
+2006-04-08 Danny Kukawka
+
+ * src/detaileddialog.cpp: reduced usage of getCPUNum(), fixed
+ display processor freq, if the cPU is back from offline. Added
+ check to reduce unneded changes in processorbars if nothing changed.
+ * src/detaileddialog.h: added private variable to store the numbers
+ in the system
+ * src/pdaemon.cpp: reduced usage of getCPUNum() by replace with
+ a variable (numOfCPUs)
+ * src/pdaemon.h: added private variable to store the numbers in
+ the system
+
2006-04-07 Danny Kukawka
Released new version v0.6.0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kpowersave-0.6.0/ChangeLog.package new/kpowersave-0.6.0/ChangeLog.package
--- old/kpowersave-0.6.0/ChangeLog.package 2006-04-07 13:43:04.000000000 +0200
+++ new/kpowersave-0.6.0/ChangeLog.package 2006-04-09 21:27:23.000000000 +0200
@@ -5,6 +5,17 @@
* *
*******************************************************************
-------------------------------------------------------------------
+Sun Apr 9 20:23:26 CEST 2006 - dkukawka@suse.de
+
+- rereleased official stable version 0.6 with this changes:
+ * fixed bug #164683 (fixed detailed dialog for machines without
+ CPUFreq support and more than one CPU/Core and/or throttling)
+ * reduced unneeded calls of getCPUNum()
+ * added fix from Daniel Gollub to be able to fake CPU info from
+ /proc and /sys for development and QA tests
+ * fixed compiler warnings
+
+-------------------------------------------------------------------
Tue Apr 4 21:12:37 CEST 2006 - dkukawka@suse.de
- released official stable version 0.6 with this changes:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kpowersave-0.6.0/NEWS new/kpowersave-0.6.0/NEWS
--- old/kpowersave-0.6.0/NEWS 2006-04-07 13:43:04.000000000 +0200
+++ new/kpowersave-0.6.0/NEWS 2006-04-09 21:27:24.000000000 +0200
@@ -27,6 +27,9 @@
- added support for lock screen via gnome-screensaver (only under GNOME)
- added fake keyevent (shift) after resume if machine was locked before
suspend to show the login dialog automatically
+- fixed detailed dialog for machines without CPUFreq and more than one CPU/
+ Core or with throttling support (see SUSE bug #164683).
+- added patch from Daniel Gollub to be able to fake CPU infos for develop
- fixed errorhandling for YaST power management module (SUSE specific)
- changed link for report bug opened via the applet menu if this is a
SUSE package. Open now the related opensuse.org wiki page.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kpowersave-0.6.0/configure.in.in new/kpowersave-0.6.0/configure.in.in
--- old/kpowersave-0.6.0/configure.in.in 2006-04-07 13:43:05.000000000 +0200
+++ new/kpowersave-0.6.0/configure.in.in 2006-04-09 21:27:26.000000000 +0200
@@ -6,6 +6,7 @@
AC_ARG_ENABLE(debug-msg, [ --enable-debug-msg build with debug messages],enable_debug_msg=$enableval,enable_debug_msg=auto)
AC_ARG_ENABLE(yast-entry, [ --enable-yast-entry build with a YaST entry in the applet menu],enable_yast_entry=$enableval,enable_yast_entry=auto)
+AC_ARG_ENABLE(fake-cpu, [ --enable-fake-cpu use fake cpu environment],enable_fake_cpu=$enableval,enable_fake_cpu=auto)
YAST_ENTRY="no"
@@ -53,6 +54,13 @@
echo "enabled YaST menu entry: $YAST_ENTRY"
fi
+if test x$enable_fake_cpu = xyes; then
+ AC_DEFINE([FAKE_CPU],1,[Fake /sys and /proc - for developing])
+ echo "enabled faked sysfs - proc environment: yes"
+else
+ echo "enabled faked sysfs - proc environment: no"
+fi
+
pkg_modules="dbus-1 >= 0.33, hal >= 0.5.4, powersave >= 0.12.7, powersave-dbus >= 0.12.7"
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kpowersave-0.6.0/doc/doxy/changelog.dox new/kpowersave-0.6.0/doc/doxy/changelog.dox
--- old/kpowersave-0.6.0/doc/doxy/changelog.dox 2006-04-07 13:42:30.000000000 +0200
+++ new/kpowersave-0.6.0/doc/doxy/changelog.dox 2006-04-09 21:20:55.000000000 +0200
@@ -2,6 +2,14 @@
* \page changelog Changelog
* \section changelist_sec All changes in the package since init
*
+* Sun Apr 9 20:23:26 CEST 2006 - dkukawka@suse.de
+* - rereleased official stable version 0.6 with this changes:
+* - fixed bug #164683 (fixed detailed dialog for machines without CPUFreq support and more than one CPU/Core
+* and/or throttling)
+* - reduced unneeded calls of getCPUNum()
+* - added fix from Daniel Gollub to be able to fake CPU info from /proc and /sys for development and QA tests
+* - fixed compiler warnings
+*
* Tue Apr 4 21:12:37 CEST 2006 - dkukawka@suse.de
* - released official stable version 0.6 with this changes:
* - added german version of the handbook
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kpowersave-0.6.0/doc/doxy/fixed_bugs.dox new/kpowersave-0.6.0/doc/doxy/fixed_bugs.dox
--- old/kpowersave-0.6.0/doc/doxy/fixed_bugs.dox 2006-04-07 13:42:30.000000000 +0200
+++ new/kpowersave-0.6.0/doc/doxy/fixed_bugs.dox 2006-04-09 21:20:55.000000000 +0200
@@ -4,6 +4,9 @@
*
* You will find the newest bugs at the top of this list.
*
+* \li Bug \b #134683 - KPowersave: Disables CPUs show as "Processor 2: 100% 734017 MHz" \n \n
+* Fixed update processor info on machines with more than one CPU/Core and/or no CPUFreq support.
+* Check now every two seconds for updates/changes in /sys and /proc.
* \li Bug \b #121965 - KPowersave should not complain about missing powersaved \n \n
Added new errormessage with checkbox to disable the message.
* \li Bug \b #116440 - KPowersave: missing space in minute field in several languages [de,fr,it,pt_BR] \n \n
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kpowersave-0.6.0/src/detaileddialog.cpp new/kpowersave-0.6.0/src/detaileddialog.cpp
--- old/kpowersave-0.6.0/src/detaileddialog.cpp 2006-04-07 13:42:12.000000000 +0200
+++ new/kpowersave-0.6.0/src/detaileddialog.cpp 2006-04-09 21:17:59.000000000 +0200
@@ -54,7 +54,7 @@
pixmap = _pixmap;
int batteries = numBatteries();
- int cpus = pd->getCPUNum();
+ numOfCPUs = pd->getCPUNum();
this->setCaption(i18n("KPowersave Information Dialog"));
@@ -65,7 +65,7 @@
if (batteries > 1) batteries++;
- ProcessorGridLayout = new QGridLayout(ProcessorFrame, cpus, 2, 0, 5, "ProcessorGridLayout");
+ ProcessorGridLayout = new QGridLayout(ProcessorFrame, numOfCPUs, 2, 0, 5, "ProcessorGridLayout");
if (batteries > 0) {
BatteryGroup->setTitle(i18n("Battery state:").remove(":"));
@@ -89,8 +89,8 @@
BatteryGridLayout->addWidget( PBar, i , 1);
}
BatteryFrame->adjustSize();
- connect(pdaemon, SIGNAL(generalDataChanged()), this, SLOT(setBattery()));
- connect(pdaemon, SIGNAL(batteryInfoEvent()), this, SLOT(setBattery()));
+ connect(pd, SIGNAL(generalDataChanged()), this, SLOT(setBattery()));
+ connect(pd, SIGNAL(batteryInfoEvent()), this, SLOT(setBattery()));
setBattery();
} else {
BatteryGroup->hide();
@@ -100,7 +100,7 @@
ProcessorPictogram->setPixmap(SmallIcon("processor", 22));
- for (int i = 0; i < cpus; i++) {
+ for (int i = 0; i < numOfCPUs; i++) {
QLabel *Label = new QLabel(ProcessorFrame, "ProcessorLabel");
Label->setText( i18n( "Processor %1" ).arg(i + 1));
ProcessorGridLayout->addWidget( Label, i , 0);
@@ -114,9 +114,9 @@
ProcessorFrame->adjustSize();
connect(OkButton, SIGNAL(clicked()), this, SLOT(closeDetailedDlg()));
- connect(pdaemon, SIGNAL(generalDataChanged()), this, SLOT(setAC()));
- connect(pdaemon, SIGNAL(schemeDataChanged()), this, SLOT(setInfos()));
- connect(pdaemon, SIGNAL(generalDataChanged()), this, SLOT(setInfos()));
+ connect(pd, SIGNAL(generalDataChanged()), this, SLOT(setAC()));
+ connect(pd, SIGNAL(schemeDataChanged()), this, SLOT(setInfos()));
+ connect(pd, SIGNAL(generalDataChanged()), this, SLOT(setInfos()));
if (pd->cpufreq_policy != CPU_UNSUPP) {
// Check if cpufreq is available
@@ -124,9 +124,10 @@
setProcessor();
} else {
// .. if not, use cpu throttling
- pd->checkCPUSpeedThrottling();
+ if (!pd->getCPUThrottlingState() || numOfCPUs <= 1) {
+ connect(pd, SIGNAL(generalDataChanged()), this, SLOT(setProcessorThrottling()));
+ }
setProcessorThrottling();
- connect(pdaemon, SIGNAL(generalDataChanged()), this, SLOT(setProcessorThrottling()));
}
setAC();
@@ -234,19 +235,25 @@
pd->checkCPUSpeed();
- for (int i=0; i < (int) pd->getCPUNum(); i++) {
+ for (int i=0; i < numOfCPUs; i++) {
myDebug("ID: %i(%i) cur_freq: %i max_freq: %i", i, pd->cpufreq_speed.count(), pd->cpufreq_speed[i], pd->cpufreq_max_speed[i]);
//ProcessorPBar[i]->setTextEnabled(true);
if (pd->cpufreq_speed[i] > 0) {
- // get max cpu freq and set it to the max of the progressbar
- int maxfreq = pd->cpufreq_max_speed[i];
- ProcessorPBar[i]->setTotalSteps(maxfreq);
-
- // display 1400 MHz instead of 1400%
- ProcessorPBar[i]->setFormat(i18n("%v MHz"));
- ProcessorPBar[i]->setProgress(pd->cpufreq_speed[i]);
- ProcessorPBar[i]->setEnabled(true);
+ // CPU/Core is back from offline
+ if(ProcessorPBar[i]->progress() == 0)
+ pd->getCPUMaxSpeed();
+
+ if(ProcessorPBar[i]->progress() != pd->cpufreq_speed[i]) {
+ // get max cpu freq and set it to the max of the progressbar
+ int maxfreq = pd->cpufreq_max_speed[i];
+ ProcessorPBar[i]->setTotalSteps(maxfreq);
+
+ // display 1400 MHz instead of 1400%
+ ProcessorPBar[i]->setFormat(i18n("%v MHz"));
+ ProcessorPBar[i]->setProgress(pd->cpufreq_speed[i]);
+ ProcessorPBar[i]->setEnabled(true);
+ }
} else {
ProcessorPBar[i]->setFormat(i18n("deactivated"));
ProcessorPBar[i]->setProgress(0);
@@ -263,8 +270,9 @@
myDebug("detaileddialog::setProcessorThrottling");
bool throttling = pd->getCPUThrottlingState();
+ pd->checkCPUSpeedThrottling();
- for (int i=0; i < (int) pd->getCPUNum(); i++) {
+ for (int i=0; i < numOfCPUs; i++) {
if (throttling)
myDebug("Throttling CPU - freq: %i throttling state: %i %%",
pd->cpufreq_speed[i], pd->cpu_throttling[i]);
@@ -278,6 +286,10 @@
ProcessorPBar[i]->setFormat(i18n(ProgressString));
ProcessorPBar[i]->setProgress(100 - pd->cpu_throttling[i]);
ProcessorPBar[i]->setEnabled(true);
+ } else if (throttling && pd->cpufreq_speed[i] < 0) {
+ ProcessorPBar[i]->setFormat(i18n("deactivated"));
+ ProcessorPBar[i]->setProgress(0);
+ ProcessorPBar[i]->setEnabled(FALSE);
} else {
ProcessorPBar[i]->setTotalSteps(pd->cpufreq_speed[i]);
ProcessorPBar[i]->setFormat(i18n("%v MHz"));
@@ -285,6 +297,14 @@
ProcessorPBar[i]->setEnabled(true);
}
}
+
+ if (throttling || numOfCPUs > 1) {
+ // currently there are no events we can use to get actual data
+ // so we recheck data ever 2 secs to register changes in the
+ // throttling state and if a CPU/core online state change
+ QTimer::singleShot(2000, this, SLOT(setProcessorThrottling()));
+ }
+
}
/*!
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kpowersave-0.6.0/src/detaileddialog.h new/kpowersave-0.6.0/src/detaileddialog.h
--- old/kpowersave-0.6.0/src/detaileddialog.h 2006-04-07 13:42:12.000000000 +0200
+++ new/kpowersave-0.6.0/src/detaileddialog.h 2006-04-09 21:17:59.000000000 +0200
@@ -75,6 +75,9 @@
//! pointer to the kpowersave class
QPixmap *pixmap;
+ //! the numbers of CPUs in the system
+ int numOfCPUs;
+
//! list of progressbars for battery information
/*!
* This QValueList with type KProgress contains the list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kpowersave-0.6.0/src/inactivity.cpp new/kpowersave-0.6.0/src/inactivity.cpp
--- old/kpowersave-0.6.0/src/inactivity.cpp 2006-04-07 13:42:12.000000000 +0200
+++ new/kpowersave-0.6.0/src/inactivity.cpp 2006-04-09 21:17:59.000000000 +0200
@@ -168,7 +168,7 @@
else {
idleTime = 0;
}
- myDebug ("autosuspend::checkXInactivity - idleTime: %d", idleTime);
+ myDebug ("autosuspend::checkXInactivity - idleTime: %f", (double)idleTime);
}
/*!
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kpowersave-0.6.0/src/pdaemon.cpp new/kpowersave-0.6.0/src/pdaemon.cpp
--- old/kpowersave-0.6.0/src/pdaemon.cpp 2006-04-07 13:42:12.000000000 +0200
+++ new/kpowersave-0.6.0/src/pdaemon.cpp 2006-04-09 21:17:59.000000000 +0200
@@ -65,6 +65,7 @@
on_AC_power = AC_UNKNOWN;
perc = -1;
left = -1;
+ numOfCPUs = -1;
standby_allowed = 0;
suspend2disk_allowed = 0;
suspend2ram_allowed = 0;
@@ -842,6 +843,9 @@
int cpu_id=0;
QDir tmp_dir;
QString cpu_path = "/sys/devices/system/cpu/cpu0/";
+#ifdef FAKE_CPU
+ cpu_path.prepend("/tmp/foo");
+#endif
QString tmp_path = tmp_dir.absFilePath(cpu_path, true);
while (tmp_dir.exists(tmp_path)) {
@@ -871,13 +875,19 @@
int fd;
char buf[15];
QString cpu_device = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq";
+#ifdef FAKE_CPU
+ cpu_device.prepend("/tmp/foo");
+#endif
// first check path for the kernel on-demand-govenour then
// for the use userspace case
update_info_cpufreq_speed_changed = false;
cpufreq_speed.clear();
- for (int cpu_id=0; cpu_id < getCPUNum(); cpu_id++) {
+ if (numOfCPUs == -1)
+ numOfCPUs = getCPUNum();
+
+ for (int cpu_id=0; cpu_id < numOfCPUs; cpu_id++) {
new_value = -1;
@@ -920,7 +930,11 @@
myDebug("pDaemon::checkCPUSpeedThrottling()");
QStringList lines;
- QFile cpu_info( "/proc/cpuinfo" );
+ QString cpu_file = "/proc/cpuinfo";
+#ifdef FAKE_CPU
+ cpu_file.prepend("/tmp/foo");
+#endif
+ QFile cpu_info(cpu_file);
// clear cpufreq list
cpufreq_speed.clear();
@@ -942,6 +956,10 @@
cpufreq_speed.append(line.toInt());
}
}
+
+ while ((int) cpufreq_speed.count() < numOfCPUs) {
+ cpufreq_speed.append(-1);
+ }
cpu_info.close();
return 0;
@@ -961,8 +979,12 @@
QStringList lines;
QFileInfo *fi;
QString cpu_dirname;
+ QString dir_acpi_processor = "/proc/acpi/processor/";
+#ifdef FAKE_CPU
+ dir_acpi_processor.prepend("/tmp/foo");
+#endif
- QDir d_throttling("/proc/acpi/processor/");
+ QDir d_throttling(dir_acpi_processor);
if (!d_throttling.exists())
return false;
@@ -1023,11 +1045,17 @@
int maxfreq;
char buf[15];
QString cpu_device_max = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq";
+#ifdef FAKE_CPU
+ cpu_device_max.prepend("/tmp/foo");
+#endif
cpufreq_max_speed.clear();
+ if (numOfCPUs == -1)
+ numOfCPUs = getCPUNum();
+
// while (!access(cpu_device_max, R_OK)) {
- for (int cpu_id=0; cpu_id < getCPUNum(); cpu_id++) {
+ for (int cpu_id=0; cpu_id < numOfCPUs; cpu_id++) {
fd = open(cpu_device_max, O_RDONLY);
if (read(fd, buf, 14) > 0){
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kpowersave-0.6.0/src/pdaemon.h new/kpowersave-0.6.0/src/pdaemon.h
--- old/kpowersave-0.6.0/src/pdaemon.h 2006-04-07 13:42:12.000000000 +0200
+++ new/kpowersave-0.6.0/src/pdaemon.h 2006-04-09 21:17:59.000000000 +0200
@@ -108,6 +108,9 @@
/*! This contains the number of available brightness levels for internal usage. */
int availableBrightnessLevels;
+ //! Integer with the numbers of CPUs in the system
+ int numOfCPUs;
+
//! read data from daemon
int readDaemonData();
//! Go back to daemon mode
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...