aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches
diff options
context:
space:
mode:
authorEugene V. Lyubimkin <jackyf@debian.org>2014-05-01 13:16:56 +0300
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:34 +0200
commit43997d37137cc1e4a1a5be654aa16d4992045e34 (patch)
treeb89a3360498e310adb64b337d849ea25aa0e51f0 /debian/patches
parent51516557d375ac91e0a1a6f0525c3def1d3d79b0 (diff)
parentf75ab6d2c11e8a8e18191b087564aedebbeb96c5 (diff)
downloaddebian_htop-43997d37137cc1e4a1a5be654aa16d4992045e34.tar.gz
debian_htop-43997d37137cc1e4a1a5be654aa16d4992045e34.tar.bz2
debian_htop-43997d37137cc1e4a1a5be654aa16d4992045e34.zip
Imported Debian patch 1.0.3-1debian/1.0.3-1
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/600-openvz-veid-on-kernels-gt-2.6.18.patch6
-rw-r--r--debian/patches/610-io-priority-only-on-linux.patch73
-rw-r--r--debian/patches/700-ltrace-support.patch157
3 files changed, 102 insertions, 134 deletions
diff --git a/debian/patches/600-openvz-veid-on-kernels-gt-2.6.18.patch b/debian/patches/600-openvz-veid-on-kernels-gt-2.6.18.patch
index c1f5247..8ab16bc 100644
--- a/debian/patches/600-openvz-veid-on-kernels-gt-2.6.18.patch
+++ b/debian/patches/600-openvz-veid-on-kernels-gt-2.6.18.patch
@@ -1,9 +1,9 @@
Fix determining OpenVZ VEID on Linux kernels >= 2.6.18.
Index: htop/ProcessList.c
===================================================================
---- htop.orig/ProcessList.c 2011-01-16 17:02:59.000000000 +0200
-+++ htop/ProcessList.c 2011-01-16 18:05:01.000000000 +0200
-@@ -438,19 +438,26 @@
+--- htop.orig/ProcessList.c 2014-05-01 11:43:17.000000000 +0300
++++ htop/ProcessList.c 2014-05-01 11:43:26.000000000 +0300
+@@ -586,19 +586,26 @@
return;
}
char filename[MAX_NAME+1];
diff --git a/debian/patches/610-io-priority-only-on-linux.patch b/debian/patches/610-io-priority-only-on-linux.patch
index 12e29a9..62db759 100644
--- a/debian/patches/610-io-priority-only-on-linux.patch
+++ b/debian/patches/610-io-priority-only-on-linux.patch
@@ -1,6 +1,8 @@
---- a/Process.c
-+++ b/Process.c
-@@ -39,6 +39,10 @@ in the source distribution for its full text.
+Index: htop/Process.c
+===================================================================
+--- htop.orig/Process.c 2014-04-29 21:11:25.000000000 +0300
++++ htop/Process.c 2014-05-01 12:00:02.000000000 +0300
+@@ -39,6 +39,10 @@
#endif
#define PAGE_SIZE_KB ( PAGE_SIZE / ONE_K )
@@ -11,15 +13,15 @@
/*{
#include "Object.h"
#include "Affinity.h"
-@@ -517,6 +521,7 @@ static void Process_writeField(Process* this, RichString* str, ProcessField fiel
- #ifdef HAVE_CGROUP
- case CGROUP: snprintf(buffer, n, "%-10s ", this->cgroup); break;
+@@ -617,6 +621,7 @@
+ #ifdef HAVE_OOM
+ case OOM: snprintf(buffer, n, Process_pidFormat, this->oom); break;
#endif
+ #ifdef HAVE_IO_PRIORITY
case IO_PRIORITY: {
int klass = IOPriority_class(this->ioPriority);
if (klass == IOPRIO_CLASS_NONE) {
-@@ -535,6 +540,7 @@ static void Process_writeField(Process* this, RichString* str, ProcessField fiel
+@@ -635,6 +640,7 @@
}
break;
}
@@ -27,7 +29,7 @@
default:
snprintf(buffer, n, "- ");
}
-@@ -603,6 +609,7 @@ bool Process_changePriorityBy(Process* this, size_t delta) {
+@@ -709,6 +715,7 @@
return Process_setPriority(this, this->nice + delta);
}
@@ -35,7 +37,7 @@
IOPriority Process_updateIOPriority(Process* this) {
IOPriority ioprio = syscall(SYS_ioprio_get, IOPRIO_WHO_PROCESS, this->pid);
this->ioPriority = ioprio;
-@@ -613,6 +620,7 @@ bool Process_setIOPriority(Process* this, IOPriority ioprio) {
+@@ -719,6 +726,7 @@
syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, this->pid, ioprio);
return (Process_updateIOPriority(this) == ioprio);
}
@@ -43,53 +45,46 @@
/*
[1] Note that before kernel 2.6.26 a process that has not asked for
---- a/ProcessList.c
-+++ b/ProcessList.c
-@@ -685,7 +685,9 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
+Index: htop/ProcessList.c
+===================================================================
+--- htop.orig/ProcessList.c 2014-05-01 11:52:18.000000000 +0300
++++ htop/ProcessList.c 2014-05-01 12:00:02.000000000 +0300
+@@ -798,8 +798,10 @@
unsigned long long int lasttimes = (process->utime + process->stime);
if (! ProcessList_readStatFile(process, dirname, name, command))
goto errorReadingProcess;
+ #ifdef HAVE_IO_PRIORITY
- Process_updateIOPriority(process);
+ if (this->flags & PROCESS_FLAG_IOPRIO)
+ Process_updateIOPriority(process);
+ #endif
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;
---- a/htop.c
-+++ b/htop.c
-@@ -126,7 +126,11 @@ static void showHelp(ProcessList* pl) {
- 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");
-+#ifdef HAVE_IO_PRIORITY
- mvaddstr(16, 0, " ] F7: higher priority (root only) i: set IO priority");
-+#else
-+ mvaddstr(16, 0, " ] F7: higher priority (root only)");
-+#endif
- mvaddstr(17, 0, " [ F8: lower priority (+ nice) I: invert sort order");
+Index: htop/htop.c
+===================================================================
+--- htop.orig/htop.c 2014-04-29 21:11:25.000000000 +0300
++++ htop/htop.c 2014-05-01 12:00:02.000000000 +0300
+@@ -96,7 +96,11 @@
#if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY)
- if (pl->cpuCount > 1)
-@@ -146,7 +150,10 @@ static void showHelp(ProcessList* pl) {
- 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");
+ { .key = " a: ", .info = "set CPU affinity" },
+ #endif
+#ifdef HAVE_IO_PRIORITY
-+ mvaddstr(16,40, " i");
+ { .key = " i: ", .info = "set IO prority" },
++#else
++ { .key = " ", .info = "" },
+#endif
- mvaddstr(17, 0, " [ F8"); mvaddstr(17,40, " I");
- mvaddstr(18,40, " F6 >");
- #if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY)
-@@ -851,6 +858,7 @@ int main(int argc, char** argv) {
- refreshTimeout = 0;
+ { .key = " l: ", .info = "list open files with lsof" },
+ { .key = " s: ", .info = "trace syscalls with strace" },
+ { .key = " ", .info = "" },
+@@ -856,6 +860,7 @@
+ }
break;
}
+ #ifdef HAVE_IO_PRIORITY
case 'i':
{
Process* p = (Process*) Panel_getSelected(panel);
-@@ -870,6 +878,7 @@ int main(int argc, char** argv) {
+@@ -875,6 +880,7 @@
refreshTimeout = 0;
break;
}
diff --git a/debian/patches/700-ltrace-support.patch b/debian/patches/700-ltrace-support.patch
index c3695c8..44b5d70 100644
--- a/debian/patches/700-ltrace-support.patch
+++ b/debian/patches/700-ltrace-support.patch
@@ -1,11 +1,11 @@
Add support for 'ltrace' in addition to 'strace' support.
Index: htop/TraceScreen.c
===================================================================
---- htop.orig/TraceScreen.c 2011-01-16 17:02:59.000000000 +0200
-+++ htop/TraceScreen.c 2011-01-16 18:15:07.000000000 +0200
-@@ -23,11 +23,17 @@
-
- /*{
+--- htop.orig/TraceScreen.c 2014-05-01 12:58:42.000000000 +0300
++++ htop/TraceScreen.c 2014-05-01 12:59:07.000000000 +0300
+@@ -29,10 +29,16 @@
+ #include "Panel.h"
+ #include "FunctionBar.h"
+typedef enum TraceType_ {
+ STRACE,
@@ -15,26 +15,25 @@ Index: htop/TraceScreen.c
typedef struct TraceScreen_ {
Process* process;
Panel* display;
- FunctionBar* bar;
bool tracing;
+ TraceType type;
} TraceScreen;
}*/
-@@ -38,9 +44,10 @@
+@@ -43,9 +49,10 @@
- static int tsEvents[] = {KEY_F(4), KEY_F(5), 27};
+ static int tsEvents[] = {KEY_F(3), KEY_F(4), KEY_F(8), KEY_F(9), 27};
-TraceScreen* TraceScreen_new(Process* process) {
+TraceScreen* TraceScreen_new(Process* process, TraceType type) {
TraceScreen* this = (TraceScreen*) malloc(sizeof(TraceScreen));
this->process = process;
+ this->type = type;
- this->display = Panel_new(0, 1, COLS, LINES-2, LISTITEM_CLASS, true, ListItem_compare);
- this->bar = FunctionBar_new(tsFunctions, tsKeys, tsEvents);
+ this->display = Panel_new(0, 1, COLS, LINES-2, false, Class(ListItem));
this->tracing = true;
-@@ -56,7 +63,14 @@
- static void TraceScreen_draw(TraceScreen* this) {
+ return this;
+@@ -59,7 +66,14 @@
+ static void TraceScreen_draw(TraceScreen* this, IncSet* inc) {
attrset(CRT_colors[PANEL_HEADER_FOCUS]);
mvhline(0, 0, ' ', COLS);
- mvprintw(0, 0, "Trace of process %d - %s", this->process->pid, this->process->comm);
@@ -47,25 +46,32 @@ Index: htop/TraceScreen.c
+ break;
+ }
attrset(CRT_colors[DEFAULT_COLOR]);
- FunctionBar_draw(this->bar, NULL);
+ IncSet_drawBar(inc);
}
-@@ -73,15 +87,24 @@
- dup2(fdpair[1], STDERR_FILENO);
- fcntl(fdpair[1], F_SETFL, O_NONBLOCK);
- sprintf(buffer, "%d", this->process->pid);
-- execlp("strace", "strace", "-p", buffer, NULL);
-- const char* message = "Could not execute 'strace'. Please make sure it is available in your $PATH.";
+@@ -90,16 +104,31 @@
+ int ok = fcntl(fdpair[1], F_SETFL, O_NONBLOCK);
+ if (ok != -1) {
+ sprintf(buffer, "%d", this->process->pid);
+- execlp("strace", "strace", "-p", buffer, NULL);
++ switch(this->type) {
++ case STRACE:
++ execlp("strace", "strace", "-p", buffer, NULL);
++ break;
++ case LTRACE:
++ execlp("ltrace", "ltrace", "-p", buffer, NULL);
++ break;
++ }
++ }
+ const char* message;
+ switch(this->type) {
+ case STRACE:
-+ execlp("strace", "strace", "-p", buffer, NULL);
+ message = "Could not execute 'strace'. Please make sure it is available in your $PATH.";
+ break;
+ case LTRACE:
-+ execlp("ltrace", "ltrace", "-p", buffer, NULL);
+ message = "Could not execute 'ltrace'. Please make sure it is available in your $PATH.";
+ break;
-+ }
+ }
+- const char* message = "Could not execute 'strace'. Please make sure it is available in your $PATH.";
write(fdpair[1], message, strlen(message));
exit(1);
}
@@ -75,66 +81,40 @@ Index: htop/TraceScreen.c
Panel* panel = this->display;
- int fd_strace = fileno(strace);
+ int fd_trace = fileno(trace);
- TraceScreen_draw(this);
CRT_disableDelay();
bool contLine = false;
-@@ -90,13 +113,13 @@
- while (looping) {
- fd_set fds;
- FD_ZERO(&fds);
-- FD_SET(fd_strace, &fds);
-+ FD_SET(fd_trace, &fds);
- struct timeval tv;
- tv.tv_sec = 0; tv.tv_usec = 500;
-- int ready = select(fd_strace+1, &fds, NULL, NULL, &tv);
-+ int ready = select(fd_trace+1, &fds, NULL, NULL, &tv);
- int nread = 0;
- if (ready > 0)
-- nread = fread(buffer, 1, 1000, strace);
-+ nread = fread(buffer, 1, 1000, trace);
- if (nread && this->tracing) {
- char* line = buffer;
- buffer[nread] = '\0';
-@@ -171,6 +194,6 @@
- }
+ bool follow = false;
+@@ -125,13 +154,13 @@
+ fd_set fds;
+ FD_ZERO(&fds);
+ // FD_SET(STDIN_FILENO, &fds);
+- FD_SET(fd_strace, &fds);
++ FD_SET(fd_trace, &fds);
+ struct timeval tv;
+ tv.tv_sec = 0; tv.tv_usec = 500;
+- int ready = select(fd_strace+1, &fds, NULL, NULL, &tv);
++ int ready = select(fd_trace+1, &fds, NULL, NULL, &tv);
+ int nread = 0;
+- if (ready > 0 && FD_ISSET(fd_strace, &fds))
++ if (ready > 0 && FD_ISSET(fd_trace, &fds))
+- nread = fread(buffer, 1, 1000, strace);
++ nread = fread(buffer, 1, 1000, trace);
+ if (nread && this->tracing) {
+ char* line = buffer;
+ buffer[nread] = '\0';
+@@ -224,6 +253,6 @@
+
kill(child, SIGTERM);
waitpid(child, NULL, 0);
- fclose(strace);
+ fclose(trace);
CRT_enableDelay();
}
-Index: htop/TraceScreen.h
-===================================================================
---- htop.orig/TraceScreen.h 2009-06-29 13:18:40.000000000 +0300
-+++ htop/TraceScreen.h 2011-01-16 18:15:07.000000000 +0200
-@@ -25,15 +25,21 @@
- #include "FunctionBar.h"
-
-
-+typedef enum TraceType_ {
-+ STRACE,
-+ LTRACE
-+} TraceType;
-+
- typedef struct TraceScreen_ {
- Process* process;
- Panel* display;
- FunctionBar* bar;
- bool tracing;
-+ TraceType type;
- } TraceScreen;
-
-
--TraceScreen* TraceScreen_new(Process* process);
-+TraceScreen* TraceScreen_new(Process* process, TraceType type);
-
- void TraceScreen_delete(TraceScreen* this);
-
-Index: htop/htop.1
+Index: htop/htop.1.in
===================================================================
---- htop.orig/htop.1.in 2011-01-16 17:02:59.000000000 +0200
-+++ htop/htop.1.in 2011-01-16 18:15:07.000000000 +0200
-@@ -54,6 +54,11 @@
+--- htop.orig/htop.1.in 2014-05-01 12:58:42.000000000 +0300
++++ htop/htop.1.in 2014-05-01 12:59:07.000000000 +0300
+@@ -67,6 +67,11 @@
Display open files for a process: if lsof(1) is installed, pressing this key
will display the list of file descriptors opened by the process.
.TP
@@ -148,25 +128,18 @@ Index: htop/htop.1
.TP
Index: htop/htop.c
===================================================================
---- htop.orig/htop.c 2011-01-16 17:02:59.000000000 +0200
-+++ htop/htop.c 2011-01-16 18:15:07.000000000 +0200
-@@ -133,6 +133,6 @@
- mvaddstr(19, 0, " F2 S: setup l: list open files with lsof");
- mvaddstr(20, 0, " F1 h: show this help screen s: trace syscalls with strace");
-- mvaddstr(21, 0, " F10 q: quit");
-+ mvaddstr(21, 0, " F10 q: quit L: trace library calls with ltrace");
-
- attrset(CRT_colors[HELP_BOLD]);
- mvaddstr( 9, 0, " Arrows"); mvaddstr( 9,40, " F5 t");
-@@ -152,6 +152,6 @@
- mvaddstr(19, 0, " F2 S"); mvaddstr(19,40, " l");
- mvaddstr(20, 0, " ? F1 h"); mvaddstr(20,40, " s");
-- mvaddstr(21, 0, " F10 q");
-+ mvaddstr(21, 0, " F10 q"); mvaddstr(21,40, " L");
- attrset(CRT_colors[DEFAULT_COLOR]);
-
- attrset(CRT_colors[HELP_BOLD]);
-@@ -580,11 +582,24 @@
+--- htop.orig/htop.c 2014-05-01 12:58:42.000000000 +0300
++++ htop/htop.c 2014-05-01 12:59:07.000000000 +0300
+@@ -103,7 +103,7 @@
+ #endif
+ { .key = " l: ", .info = "list open files with lsof" },
+ { .key = " s: ", .info = "trace syscalls with strace" },
+- { .key = " ", .info = "" },
++ { .key = " L: ", .info = "trace library calls with ltrace" },
+ { .key = " F2 S: ", .info = "setup" },
+ { .key = " F1 h: ", .info = "show this help screen" },
+ { .key = " F10 q: ", .info = "quit" },
+@@ -711,11 +711,24 @@
Panel_onKey(panel, KEY_DOWN);
break;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy