d5b1a8ac | 2014-04-30 14:00:29 | François Andriot |
RPM Packaging: update tdelibs |
||
A redhat/tdebase/tdebase-14.0.0-fix_starttde_trap.patch A redhat/tdelibs/tdelibs-14.0.0-reduce_tdehwlib_cpueagerness.patch |
||
diff --git a/redhat/tdebase/tdebase-14.0.0-fix_starttde_trap.patch b/redhat/tdebase/tdebase-14.0.0-fix_starttde_trap.patch new file mode 100644 index 0000000..fb50a6d --- /dev/null +++ b/redhat/tdebase/tdebase-14.0.0-fix_starttde_trap.patch @@ -0,0 +1,11 @@ +--- tdebase/starttde.ORI 2014-04-20 18:05:28.820084805 +0200 ++++ tdebase/starttde 2014-04-20 18:06:08.059237113 +0200 +@@ -81,7 +81,7 @@ + + # When the X server dies we get a HUP signal from xinit. We must ignore it + # because we still need to do some cleanup. +-trap '[starttde] echo GOT SIGHUP' HUP ++trap 'echo "[starttde] GOT SIGHUP"' HUP + + # Check if a TDE session is already running. + if kcheckrunning >/dev/null 2>&1; then diff --git a/redhat/tdelibs/tdelibs-14.0.0-reduce_tdehwlib_cpueagerness.patch b/redhat/tdelibs/tdelibs-14.0.0-reduce_tdehwlib_cpueagerness.patch new file mode 100644 index 0000000..dc0e67b --- /dev/null +++ b/redhat/tdelibs/tdelibs-14.0.0-reduce_tdehwlib_cpueagerness.patch @@ -0,0 +1,934 @@ +--- tdelibs/tdecore/tdehw/tdehardwaredevices.h.ORI 2014-03-09 14:50:49.667308933 +0100 ++++ tdelibs/tdecore/tdehw/tdehardwaredevices.h 2014-03-09 19:35:43.366162065 +0100 +@@ -23,6 +23,7 @@ + #include <tqobject.h> + #include <tqptrlist.h> + #include <tqmap.h> ++#include <tqdict.h> + #include <tqstring.h> + #include <tqstringlist.h> + +@@ -75,6 +76,7 @@ + + typedef TQPtrList<TDEGenericDevice> TDEGenericHardwareList; + typedef TQMap<TQString, TQString> TDEDeviceIDMap; ++typedef TQDict<TDECPUDevice> TDECPUDeviceCache; + + class TDECORE_EXPORT TDEHardwareDevices : public TQObject + { +@@ -141,6 +143,12 @@ + TDEStorageDevice* findDiskByUID(TQString uid); + + /** ++ * Return the CPU device with system path @arg syspath, or 0 if no device exists for that path ++ * @return TDEGenericDevice ++ */ ++ TDECPUDevice* findCPUBySystemPath(TQString syspath, bool inCache); ++ ++ /** + * Look up the device in the system PCI database + * @param vendorid a TQString containing the vendor ID in hexadecimal + * @param modelid a TQString containing the model ID in hexadecimal +@@ -222,6 +230,15 @@ + void setTriggerlessHardwareUpdatesEnabled(bool enable); + + /** ++ * Enable or disable automatic state updates of battery hardware devices. ++ * When enabled, your application will use ++ * additional CPU resources to continually poll triggerless hardware devices. ++ * Automatic updates are disabled by default. ++ * @param enable a bool specifiying whether or not automatic updates should be enabled ++ */ ++ void setBatteryUpdatesEnabled(bool enable); ++ ++ /** + * Convert a byte count to human readable form + * @param bytes a double containing the number of bytes + * @return a TQString containing the human readable byte count +@@ -246,6 +263,7 @@ + void processHotPluggedHardware(); + void processModifiedMounts(); + void processModifiedCPUs(); ++ void processBatteryDevices(); + void processStatelessDevices(); + void processEventDeviceKeyPressed(unsigned int keycode, TDEEventDevice* edevice); + +@@ -280,6 +298,7 @@ + int m_procMountsFd; + KSimpleDirWatch* m_cpuWatch; + TQTimer* m_cpuWatchTimer; ++ TQTimer* m_batteryWatchTimer; + TQTimer* m_deviceWatchTimer; + + TQSocketNotifier* m_devScanNotifier; +@@ -292,6 +311,8 @@ + TDEDeviceIDMap* usb_id_map; + TDEDeviceIDMap* pnp_id_map; + TDEDeviceIDMap* dpy_id_map; ++ ++ TDECPUDeviceCache m_cpuByPathCache; + + friend class TDEGenericDevice; + friend class TDEStorageDevice; +--- tdelibs/tdecore/tdehw/tdehardwaredevices.cpp.ORI 2014-03-09 10:18:31.643019852 +0100 ++++ tdelibs/tdecore/tdehw/tdehardwaredevices.cpp 2014-03-09 19:37:30.389672774 +0100 +@@ -70,6 +70,24 @@ + // Compile-time configuration + #include "config.h" + ++// Profiling stuff ++//#define CPUPROFILING ++//#define STATELESSPROFILING ++ ++#include <time.h> ++timespec diff(timespec start, timespec end) ++{ ++ timespec temp; ++ if ((end.tv_nsec-start.tv_nsec)<0) { ++ temp.tv_sec = end.tv_sec-start.tv_sec-1; ++ temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec; ++ } else { ++ temp.tv_sec = end.tv_sec-start.tv_sec; ++ temp.tv_nsec = end.tv_nsec-start.tv_nsec; ++ } ++ return temp; ++} ++ + // BEGIN BLOCK + // Copied from include/linux/genhd.h + #define GENHD_FL_REMOVABLE 1 +@@ -199,6 +217,10 @@ + m_deviceWatchTimer = new TQTimer(this); + connect( m_deviceWatchTimer, SIGNAL(timeout()), this, SLOT(processStatelessDevices()) ); + ++ // Special case for battery polling (longer delay, 5 seconds) ++ m_batteryWatchTimer = new TQTimer(this); ++ connect( m_batteryWatchTimer, SIGNAL(timeout()), this, SLOT(processBatteryDevices()) ); ++ + // Update internal device information + queryHardwareInformation(); + } +@@ -207,6 +229,7 @@ + TDEHardwareDevices::~TDEHardwareDevices() { + // Stop device scanning + m_deviceWatchTimer->stop(); ++ m_batteryWatchTimer->stop(); + + // [FIXME 0.01] + #if 0 +@@ -243,6 +266,7 @@ + if (nodezerocpufreq.exists()) { + m_cpuWatchTimer->start( 500, FALSE ); // 0.5 second repeating timer + } ++ m_batteryWatchTimer->stop(); // Battery devices are included in stateless devices + m_deviceWatchTimer->start( 1000, FALSE ); // 1 second repeating timer + } + else { +@@ -251,6 +275,20 @@ + } + } + ++void TDEHardwareDevices::setBatteryUpdatesEnabled(bool enable) { ++ if (enable) { ++ TQDir nodezerocpufreq("/sys/devices/system/cpu/cpu0/cpufreq"); ++ if (nodezerocpufreq.exists()) { ++ m_cpuWatchTimer->start( 500, FALSE ); // 0.5 second repeating timer ++ } ++ m_batteryWatchTimer->start( 5000, FALSE ); // 5 second repeating timer ++ } ++ else { ++ m_cpuWatchTimer->stop(); ++ m_batteryWatchTimer->stop(); ++ } ++} ++ + void TDEHardwareDevices::rescanDeviceInformation(TDEGenericDevice* hwdevice) { + rescanDeviceInformation(hwdevice, true); + } +@@ -270,6 +308,7 @@ + syspath += "/"; + } + TDEGenericDevice *hwdevice; ++ + // We can't use m_deviceList directly as m_deviceList can only have one iterator active against it at any given time + TDEGenericHardwareList devList = listAllPhysicalDevices(); + for ( hwdevice = devList.first(); hwdevice; hwdevice = devList.next() ) { +@@ -281,6 +320,30 @@ + return 0; + } + ++TDECPUDevice* TDEHardwareDevices::findCPUBySystemPath(TQString syspath, bool inCache=true) { ++ TDECPUDevice* cdevice; ++ ++ // Look for the device in the cache first ++ if(inCache && !m_cpuByPathCache.isEmpty()) { ++ cdevice = m_cpuByPathCache.find(syspath); ++ if(cdevice) { ++ return cdevice; ++ } ++ } ++ ++ // If the CPU was not found in cache, we need to parse the entire device list to get it. ++ cdevice = dynamic_cast<TDECPUDevice*>(findBySystemPath(syspath)); ++ if(cdevice) { ++ if(inCache) { ++ m_cpuByPathCache.insert(syspath, cdevice); // Add the device to the cache ++ } ++ return cdevice; ++ } ++ ++ return 0; ++} ++ ++ + TDEGenericDevice* TDEHardwareDevices::findByUniqueID(TQString uid) { + TDEGenericDevice *hwdevice; + // We can't use m_deviceList directly as m_deviceList can only have one iterator active against it at any given time +@@ -410,17 +473,29 @@ + // Detect what changed between the old cpu information and the new information, + // and emit appropriate events + ++#ifdef CPUPROFILING ++ timespec time1, time2, time3; ++ clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time1); ++ time3 = time1; ++ printf("TDEHardwareDevices::processModifiedCPUs() : begin at '%u'\n", time1.tv_nsec); ++#endif ++ + // Read new CPU information table + m_cpuInfo.clear(); + TQFile cpufile( "/proc/cpuinfo" ); + if ( cpufile.open( IO_ReadOnly ) ) { + TQTextStream stream( &cpufile ); +- while ( !stream.atEnd() ) { +- m_cpuInfo.append(stream.readLine()); +- } ++ // Using read() instead of readLine() inside a loop is 4 times faster ! ++ m_cpuInfo = TQStringList::split('\n', stream.read(), true); + cpufile.close(); + } + ++#ifdef CPUPROFILING ++ clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2); ++ printf("TDEHardwareDevices::processModifiedCPUs() : checkpoint1 at %u [%u]\n", time2.tv_nsec, diff(time1,time2).tv_nsec); ++ time1 = time2; ++#endif ++ + // Ensure "processor" is the first entry in each block and determine which cpuinfo type is in use + bool cpuinfo_format_x86 = true; + bool cpuinfo_format_arm = false; +@@ -431,39 +506,43 @@ + TQStringList::Iterator blockBegin = m_cpuInfo.begin(); + for (TQStringList::Iterator cpuit1 = m_cpuInfo.begin(); cpuit1 != m_cpuInfo.end(); ++cpuit1) { + curline1 = *cpuit1; +- curline1 = curline1.stripWhiteSpace(); + if (!(*blockBegin).startsWith("processor")) { + bool found = false; + TQStringList::Iterator cpuit2; ** Diff limit reached (max: 250 lines) ** |