Lines 1-5
Link Here
|
1 |
--- ProcessList.c.orig 2012-02-03 01:45:11.000000000 +0200 |
1 |
--- ProcessList.c.orig 2013-04-21 03:39:12.000000000 +0800 |
2 |
+++ ProcessList.c 2012-05-16 17:39:50.000000000 +0300 |
2 |
+++ ProcessList.c 2013-04-21 03:41:41.000000000 +0800 |
3 |
@@ -25,6 +25,19 @@ |
3 |
@@ -25,6 +25,19 @@ |
4 |
#include <time.h> |
4 |
#include <time.h> |
5 |
#include <assert.h> |
5 |
#include <assert.h> |
Lines 20-26
Link Here
|
20 |
/*{ |
20 |
/*{ |
21 |
#include "Vector.h" |
21 |
#include "Vector.h" |
22 |
#include "Hashtable.h" |
22 |
#include "Hashtable.h" |
23 |
@@ -749,11 +762,13 @@ |
23 |
@@ -685,7 +698,7 @@ |
|
|
24 |
unsigned long long int lasttimes = (process->utime + process->stime); |
25 |
if (! ProcessList_readStatFile(process, dirname, name, command)) |
26 |
goto errorReadingProcess; |
27 |
- Process_updateIOPriority(process); |
28 |
+// Process_updateIOPriority(process); |
29 |
float percent_cpu = (process->utime + process->stime - lasttimes) / period * 100.0; |
30 |
process->percent_cpu = MAX(MIN(percent_cpu, cpus*100.0), 0.0); |
31 |
if (isnan(process->percent_cpu)) process->percent_cpu = 0.0; |
32 |
@@ -764,13 +777,15 @@ |
24 |
|
33 |
|
25 |
void ProcessList_scan(ProcessList* this) { |
34 |
void ProcessList_scan(ProcessList* this) { |
26 |
unsigned long long int usertime, nicetime, systemtime, systemalltime, idlealltime, idletime, totaltime, virtalltime; |
35 |
unsigned long long int usertime, nicetime, systemtime, systemalltime, idlealltime, idletime, totaltime, virtalltime; |
Lines 32-43
Link Here
|
32 |
+ #ifndef __FreeBSD__ |
41 |
+ #ifndef __FreeBSD__ |
33 |
+ unsigned long long int swapFree = 0; |
42 |
+ unsigned long long int swapFree = 0; |
34 |
+ file = fopen(PROCMEMINFOFILE, "r"); |
43 |
+ file = fopen(PROCMEMINFOFILE, "r"); |
35 |
assert(file != NULL); |
44 |
if (file == NULL) { |
|
|
45 |
CRT_fatalError("Cannot open " PROCMEMINFOFILE); |
46 |
} |
36 |
- int cpus = this->cpuCount; |
47 |
- int cpus = this->cpuCount; |
37 |
{ |
48 |
{ |
38 |
char buffer[128]; |
49 |
char buffer[128]; |
39 |
while (fgets(buffer, 128, file)) { |
50 |
while (fgets(buffer, 128, file)) { |
40 |
@@ -788,6 +803,33 @@ |
51 |
@@ -805,6 +820,33 @@ |
41 |
this->usedMem = this->totalMem - this->freeMem; |
52 |
this->usedMem = this->totalMem - this->freeMem; |
42 |
this->usedSwap = this->totalSwap - swapFree; |
53 |
this->usedSwap = this->totalSwap - swapFree; |
43 |
fclose(file); |
54 |
fclose(file); |
Lines 70-73
Link Here
|
70 |
+ #endif |
81 |
+ #endif |
71 |
|
82 |
|
72 |
file = fopen(PROCSTATFILE, "r"); |
83 |
file = fopen(PROCSTATFILE, "r"); |
73 |
assert(file != NULL); |
84 |
if (file == NULL) { |