diff options
author | Guido Falsi <madpilot@FreeBSD.org> | 2013-04-28 09:48:25 +0000 |
---|---|---|
committer | Guido Falsi <madpilot@FreeBSD.org> | 2013-04-28 09:48:25 +0000 |
commit | 9575980d924d7dd95403b99ac69e208b326e5f01 (patch) | |
tree | 139c55c71c4c2c933b7391cebf274dc2cb5acdac /sysutils/htop/files | |
parent | 5c2da02b91e861d4dcee8c345475a99c8e964e2a (diff) |
Notes
Diffstat (limited to 'sysutils/htop/files')
-rw-r--r-- | sysutils/htop/files/patch-Process.c | 20 | ||||
-rw-r--r-- | sysutils/htop/files/patch-Process.h | 16 | ||||
-rw-r--r-- | sysutils/htop/files/patch-ProcessList.c | 23 | ||||
-rw-r--r-- | sysutils/htop/files/patch-htop.c | 38 |
4 files changed, 91 insertions, 6 deletions
diff --git a/sysutils/htop/files/patch-Process.c b/sysutils/htop/files/patch-Process.c new file mode 100644 index 000000000000..406eb791fbf9 --- /dev/null +++ b/sysutils/htop/files/patch-Process.c @@ -0,0 +1,20 @@ +--- Process.c.orig 2013-04-21 03:33:42.000000000 +0800 ++++ Process.c 2013-04-21 03:34:27.000000000 +0800 +@@ -602,7 +602,7 @@ + bool Process_changePriorityBy(Process* this, size_t delta) { + return Process_setPriority(this, this->nice + delta); + } +- ++/* + IOPriority Process_updateIOPriority(Process* this) { + IOPriority ioprio = syscall(SYS_ioprio_get, IOPRIO_WHO_PROCESS, this->pid); + this->ioPriority = ioprio; +@@ -613,7 +613,7 @@ + syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, this->pid, ioprio); + return (Process_updateIOPriority(this) == ioprio); + } +- ++*/ + /* + [1] Note that before kernel 2.6.26 a process that has not asked for + an io priority formally uses "none" as scheduling class, but the diff --git a/sysutils/htop/files/patch-Process.h b/sysutils/htop/files/patch-Process.h new file mode 100644 index 000000000000..6aa0eed780bc --- /dev/null +++ b/sysutils/htop/files/patch-Process.h @@ -0,0 +1,16 @@ +--- Process.h.orig 2013-04-21 03:34:39.000000000 +0800 ++++ Process.h 2013-04-21 03:34:49.000000000 +0800 +@@ -179,11 +179,11 @@ + bool Process_setPriority(Process* this, int priority); + + bool Process_changePriorityBy(Process* this, size_t delta); +- ++/* + IOPriority Process_updateIOPriority(Process* this); + + bool Process_setIOPriority(Process* this, IOPriority ioprio); +- ++*/ + /* + [1] Note that before kernel 2.6.26 a process that has not asked for + an io priority formally uses "none" as scheduling class, but the diff --git a/sysutils/htop/files/patch-ProcessList.c b/sysutils/htop/files/patch-ProcessList.c index 022dd9f70b0a..f6e24a285cc3 100644 --- a/sysutils/htop/files/patch-ProcessList.c +++ b/sysutils/htop/files/patch-ProcessList.c @@ -1,5 +1,5 @@ ---- ProcessList.c.orig 2012-02-03 01:45:11.000000000 +0200 -+++ ProcessList.c 2012-05-16 17:39:50.000000000 +0300 +--- ProcessList.c.orig 2013-04-21 03:39:12.000000000 +0800 ++++ ProcessList.c 2013-04-21 03:41:41.000000000 +0800 @@ -25,6 +25,19 @@ #include <time.h> #include <assert.h> @@ -20,7 +20,16 @@ /*{ #include "Vector.h" #include "Hashtable.h" -@@ -749,11 +762,13 @@ +@@ -685,7 +698,7 @@ + unsigned long long int lasttimes = (process->utime + process->stime); + if (! ProcessList_readStatFile(process, dirname, name, command)) + goto errorReadingProcess; +- Process_updateIOPriority(process); ++// Process_updateIOPriority(process); + float percent_cpu = (process->utime + process->stime - lasttimes) / period * 100.0; + process->percent_cpu = MAX(MIN(percent_cpu, cpus*100.0), 0.0); + if (isnan(process->percent_cpu)) process->percent_cpu = 0.0; +@@ -764,13 +777,15 @@ void ProcessList_scan(ProcessList* this) { unsigned long long int usertime, nicetime, systemtime, systemalltime, idlealltime, idletime, totaltime, virtalltime; @@ -32,12 +41,14 @@ + #ifndef __FreeBSD__ + unsigned long long int swapFree = 0; + file = fopen(PROCMEMINFOFILE, "r"); - assert(file != NULL); + if (file == NULL) { + CRT_fatalError("Cannot open " PROCMEMINFOFILE); + } - int cpus = this->cpuCount; { char buffer[128]; while (fgets(buffer, 128, file)) { -@@ -788,6 +803,33 @@ +@@ -805,6 +820,33 @@ this->usedMem = this->totalMem - this->freeMem; this->usedSwap = this->totalSwap - swapFree; fclose(file); @@ -70,4 +81,4 @@ + #endif file = fopen(PROCSTATFILE, "r"); - assert(file != NULL); + if (file == NULL) { diff --git a/sysutils/htop/files/patch-htop.c b/sysutils/htop/files/patch-htop.c new file mode 100644 index 000000000000..a78e482384c0 --- /dev/null +++ b/sysutils/htop/files/patch-htop.c @@ -0,0 +1,38 @@ +--- htop.c.orig 2012-10-05 07:55:31.000000000 +0800 ++++ htop.c 2013-04-21 03:47:54.882373049 +0800 +@@ -126,7 +126,7 @@ + mvaddstr(13, 0, " Space: tag processes F: cursor follows process"); + mvaddstr(14, 0, " U: untag all processes + -: expand/collapse tree"); + mvaddstr(15, 0, " F9 k: kill process/tagged processes P M T: sort by CPU%, MEM% or TIME"); +- mvaddstr(16, 0, " ] F7: higher priority (root only) i: set IO priority"); ++ mvaddstr(16, 0, " ] F7: higher priority (root only)"); + mvaddstr(17, 0, " [ F8: lower priority (+ nice) I: invert sort order"); + #if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY) + if (pl->cpuCount > 1) +@@ -146,7 +146,7 @@ + mvaddstr(13, 0, " Space"); mvaddstr(13,40, " F"); + mvaddstr(14, 0, " U"); mvaddstr(14,40, " + -"); + mvaddstr(15, 0, " F9 k"); mvaddstr(15,40, "P M T"); +- mvaddstr(16, 0, " ] F7"); mvaddstr(16,40, " i"); ++ mvaddstr(16, 0, " ] F7"); + mvaddstr(17, 0, " [ F8"); mvaddstr(17,40, " I"); + mvaddstr(18,40, " F6 >"); + #if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY) +@@ -850,7 +850,7 @@ + ((Object*)sortPanel)->delete((Object*)sortPanel); + refreshTimeout = 0; + break; +- } ++ }/* + case 'i': + { + Process* p = (Process*) Panel_getSelected(panel); +@@ -869,7 +869,7 @@ + ProcessList_printHeader(pl, Panel_getHeader(panel)); + refreshTimeout = 0; + break; +- } ++ }*/ + case 'I': + { + refreshTimeout = 0; |