By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 3199
Collapse All | Expand All

(-)tdelibs-trinity-14.0.13_/tdecore/tdehw/tdehardwaredevices.h (-1 / +3 lines)
Lines 294-300 Link Here
294
294
295
		struct udev *m_udevStruct;
295
		struct udev *m_udevStruct;
296
		struct udev_monitor *m_udevMonitorStruct;
296
		struct udev_monitor *m_udevMonitorStruct;
297
		TDEGenericHardwareList m_deviceList;
297
		TDEGenericHardwareList m_deviceList, m_deviceListPrc;
298
		int m_procMountsFd;
298
		int m_procMountsFd;
299
		KSimpleDirWatch* m_cpuWatch;
299
		KSimpleDirWatch* m_cpuWatch;
300
		TQTimer* m_cpuWatchTimer;
300
		TQTimer* m_cpuWatchTimer;
Lines 314-319 Link Here
314
		
314
		
315
		TDECPUDeviceCache m_cpuByPathCache;
315
		TDECPUDeviceCache m_cpuByPathCache;
316
316
317
		TDEGenericDevice *hwdevicePrc;
318
317
	friend class TDEGenericDevice;
319
	friend class TDEGenericDevice;
318
	friend class TDEStorageDevice;
320
	friend class TDEStorageDevice;
319
	friend class TDECPUDevice;
321
	friend class TDECPUDevice;
(-)tdelibs-trinity-14.0.13_/tdecore/tdehw/tdehardwaredevices.cpp (-9 / +28 lines)
Lines 41-46 Link Here
41
#include <unistd.h>
41
#include <unistd.h>
42
#include <fcntl.h>
42
#include <fcntl.h>
43
43
44
#include <algorithm>
45
44
// Network devices
46
// Network devices
45
#include <sys/types.h>
47
#include <sys/types.h>
46
#include <ifaddrs.h>
48
#include <ifaddrs.h>
Lines 132-138 Link Here
132
}
134
}
133
#endif // defined(WITH_UDISKS) || defined(WITH_UDISKS2) || defined(WITH_NETWORK_MANAGER_BACKEND)
135
#endif // defined(WITH_UDISKS) || defined(WITH_UDISKS2) || defined(WITH_NETWORK_MANAGER_BACKEND)
134
136
135
TDEHardwareDevices::TDEHardwareDevices() {
137
TDEHardwareDevices::TDEHardwareDevices() : hwdevicePrc(NULL) {
136
	// Initialize members
138
	// Initialize members
137
	pci_id_map = 0;
139
	pci_id_map = 0;
138
	usb_id_map = 0;
140
	usb_id_map = 0;
Lines 479-484 Link Here
479
	// Detect what changed between the old cpu information and the new information,
481
	// Detect what changed between the old cpu information and the new information,
480
	// and emit appropriate events
482
	// and emit appropriate events
481
483
484
	timespec timeStart, timeCur;
485
	clock_gettime(CLOCK_MONOTONIC, &timeStart);
486
482
#ifdef CPUPROFILING
487
#ifdef CPUPROFILING
483
	timespec time1, time2, time3;
488
	timespec time1, time2, time3;
484
	clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time1);
489
	clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time1);
Lines 872-883 Link Here
872
	printf("TDEHardwareDevices::processModifiedCPUs() : end at %u [%u]\n", time2.tv_nsec, diff(time1,time2).tv_nsec);
877
	printf("TDEHardwareDevices::processModifiedCPUs() : end at %u [%u]\n", time2.tv_nsec, diff(time1,time2).tv_nsec);
873
	printf("TDEHardwareDevices::processModifiedCPUs() : total time: %u\n", diff(time3,time2).tv_nsec);
878
	printf("TDEHardwareDevices::processModifiedCPUs() : total time: %u\n", diff(time3,time2).tv_nsec);
874
#endif
879
#endif
880
881
    clock_gettime(CLOCK_MONOTONIC, &timeCur);
882
    //Stretching the execution period at 10% from the consumed time and not lesser for 500 ms
883
    m_cpuWatchTimer->start( std::max(500, int((((1000000000ll*timeCur.tv_sec+timeCur.tv_nsec)-(1000000000ll*timeStart.tv_sec+timeStart.tv_nsec))*9)/1000000)), FALSE );
875
}
884
}
876
885
877
void TDEHardwareDevices::processStatelessDevices() {
886
void TDEHardwareDevices::processStatelessDevices() {
878
	// Some devices do not emit changed signals
887
	// Some devices do not emit changed signals
879
	// So far, network cards and sensors need to be polled
888
	// So far, network cards and sensors need to be polled
880
	TDEGenericDevice *hwdevice;
881
889
882
#ifdef STATELESSPROFILING
890
#ifdef STATELESSPROFILING
883
	timespec time1, time2, time3;
891
	timespec time1, time2, time3;
Lines 886-904 Link Here
886
	time3 = time1;
894
	time3 = time1;
887
#endif
895
#endif
888
896
897
	timespec timeStart, timeCur;
898
	clock_gettime(CLOCK_MONOTONIC, &timeStart);
899
	timeCur = timeStart;
900
889
	// We can't use m_deviceList directly as m_deviceList can only have one iterator active against it at any given time
901
	// We can't use m_deviceList directly as m_deviceList can only have one iterator active against it at any given time
890
	TDEGenericHardwareList devList = listAllPhysicalDevices();
902
	if(!hwdevicePrc) {
891
	for ( hwdevice = devList.first(); hwdevice; hwdevice = devList.next() ) {
903
	    m_deviceListPrc = listAllPhysicalDevices();
892
		if ((hwdevice->type() == TDEGenericDeviceType::RootSystem) || (hwdevice->type() == TDEGenericDeviceType::Network) || (hwdevice->type() == TDEGenericDeviceType::OtherSensor) || (hwdevice->type() == TDEGenericDeviceType::Event) || (hwdevice->type() == TDEGenericDeviceType::Battery) || (hwdevice->type() == TDEGenericDeviceType::PowerSupply)) {
904
	    hwdevicePrc = m_deviceListPrc.first();
893
			rescanDeviceInformation(hwdevice, false);
905
	}
894
			emit hardwareUpdated(hwdevice);
906
	while( hwdevicePrc && ((1000000000ll*timeCur.tv_sec+timeCur.tv_nsec)-(1000000000ll*timeStart.tv_sec+timeStart.tv_nsec)) < 100000000 ) {	//Not more for 100 ms
895
			emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
907
		if ((hwdevicePrc->type() == TDEGenericDeviceType::RootSystem) || (hwdevicePrc->type() == TDEGenericDeviceType::Network) || (hwdevicePrc->type() == TDEGenericDeviceType::OtherSensor) || (hwdevicePrc->type() == TDEGenericDeviceType::Event) || (hwdevicePrc->type() == TDEGenericDeviceType::Battery) || (hwdevicePrc->type() == TDEGenericDeviceType::PowerSupply)) {
908
			rescanDeviceInformation(hwdevicePrc, false);
909
			emit hardwareUpdated(hwdevicePrc);
910
			emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevicePrc->uniqueID());
911
896
#ifdef STATELESSPROFILING
912
#ifdef STATELESSPROFILING
897
			clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2);
913
			clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2);
898
			printf("TDEHardwareDevices::processStatelessDevices() : '%s' finished at %u [%u]\n", (hwdevice->name()).ascii(), time2.tv_nsec, diff(time1,time2).tv_nsec);
914
			printf("TDEHardwareDevices::processStatelessDevices() : '%s' finished at %u [%u]\n", (hwdevicePrc->name()).ascii(), time2.tv_nsec, diff(time1,time2).tv_nsec);
899
			time1 = time2;
915
			time1 = time2;
900
#endif
916
#endif
901
		}
917
		}
918
919
		hwdevicePrc = m_deviceListPrc.next();
920
		clock_gettime(CLOCK_MONOTONIC, &timeCur);
902
	}
921
	}
903
922
904
#ifdef STATELESSPROFILING
923
#ifdef STATELESSPROFILING

Return to bug 3199