--- htop-1.0.1.orig/debian/changelog +++ htop-1.0.1/debian/changelog @@ -0,0 +1,406 @@ +htop (1.0.1-3) unstable; urgency=low + + * debian/rules: + - Retrieve CFLAGS from dpkg-buildflags as dpkg-buildpackage stopped to + export them. (Closes: #685670) + * debian/control: + - Build-depend on dpkg (>= 1.16.1) for using dpkg-buildflags. + + -- Eugene V. Lyubimkin Mon, 27 Aug 2012 19:51:54 +0300 + +htop (1.0.1-2) unstable; urgency=low + + * debian/patches: + - New patch 200-dont-delete-htoprc-if-symlink.patch from upstream VCS. + (Closes: #662087) + + -- Eugene V. Lyubimkin Mon, 30 Jul 2012 19:12:16 +0300 + +htop (1.0.1-1) unstable; urgency=low + + * New upstream release. + - Don't crash when trying to kill already finished process. + (Closes: #652563, 657675) + + -- Eugene V. Lyubimkin Sun, 19 Feb 2012 10:24:46 +0200 + +htop (1.0-1) unstable; urgency=low + + * New upstream release. + - Don't die after a terminal resize. (Closes: #464852) + - Don't abort when a number of processes are removed from the list at + once. (Closes: #541417) + - Fixed the inconsistency in the documentation about "[" and "]" keys. + (Closes: #610329) + * debian/patches: + - 100-fix-cgroups-crash.patch: deleted, upstream fixed it in a different + way. + - 600-openvz-veid-on-kernels-gt-2.6.18.patch: ported to new upstream + version. + - 700-ltrace-support.patch: ported to new upstream version. + - 700-ltrace-support.patch: ltrace hotkey is 'L', not 'l'. + * debian/control: + - Add libhwloc-dev to Build-Depends on non-linux architectures. + - Add libncursesw5-dev to Build-Depends, enabling unicode support. + * debian/rules: + - Enable native affinity functions on linux architectures and use hwloc + library everywhere else. + * debian/copyright: + - Updated upstream copyright years. + + -- Eugene V. Lyubimkin Sat, 26 Nov 2011 15:58:33 +0200 + +htop (0.9-4) unstable; urgency=low + + * debian/rules: + - Added 'build-arch' and 'build-indep' targets as suggested by Lintian. + * debian/patches: + - New patch 100-fix-cgroups-crash.patch fixing a crash when htop receives + an unexpected input from a cgroups file. (Closes: #628040) + + -- Eugene V. Lyubimkin Wed, 21 Sep 2011 21:17:17 +0300 + +htop (0.9-3) unstable; urgency=low + + * debian/rules: + - Enable cgroups support. (Closes: #627545) + * debian/README.source: + - added with standard instructions how to use quilt. + * debian/control: + - Fixed spelling as suggested by lintian. + - Bumped Standards-Version to 3.9.2, no changes needed. + + -- Eugene V. Lyubimkin Sun, 22 May 2011 12:05:09 +0300 + +htop (0.9-2) unstable; urgency=low + + * Upload to unstable. + + -- Eugene V. Lyubimkin Sun, 13 Feb 2011 10:41:53 +0200 + +htop (0.9-1) experimental; urgency=low + + * New upstream release. (Closes: #610229) + - Fixed by-process IO stats in some cases. (Closes: #526070) + - Do not display nan% as CPU load sometimes. (Closes: #590535) + * debian/patches: + - 600-openvz-veid-on-kernels-gt-2.6.18.patch: ported to new upstream + version. + - 700-ltrace-support.patch: refreshed. + * debian/control: + - Bumped Standards-Version to 3.9.1, no changes needed. + - Updated my mail address. + - Removed 'DM-Upload-Allowed' flag as not needed anymore. + * debian/copyright: + - Updated author copyright years. + * debian/watch: + - Removed 'uupdate' option, not needed for my workflow. + + -- Eugene V. Lyubimkin Sun, 16 Jan 2011 19:36:07 +0200 + +htop (0.8.3-1) unstable; urgency=low + + * New upstream release: + - 0.8.2 (LP: #385862): + - Integrated lsof output. (Closes: #426003) + - Handling of absend CPU should work now. (Closes: #494057, #476273) + - Fixed a crash when sorting by USER column. (Closes: #526362) + - Fixed display of gigabyte-sized values. + - Fixed incremental search. (Closes: #521376) + - Option to display hostname in the meters area. + - 0.8.3 + * debian/control: + - Suggested strace and ltrace. (Closes: #530449) + - Bumped Standards-Version to 3.8.2, no changes needed. + * debian/patches: + - 700-ltrace-support.patch: modified to not contradict with new upstream + release, the hotkey for ltrace output changed from 'l' to 'L'. + * debian/README: + - Added with note about ltrace support. + + -- Eugene V. Lyubimkin Mon, 29 Jun 2009 13:08:39 +0300 + +htop (0.8.1+svn149-2) unstable; urgency=low + + * debian/rules: + - Build with VServer support. (Closes: #522905) + + -- Eugene V. Lyubimkin Fri, 17 Apr 2009 21:54:45 +0300 + +htop (0.8.1+svn149-1) unstable; urgency=low + + * New upstream development snapshot: + - Allow building without PLPA support. (Closes: #521861) + * debian/patches: + - 010-make-desktop-file-valid.patch: deleted, merged upstream. + - 100-upstream-sort-by-processor-and-session.patch: deleted, merged + upstream. + - 110-upstream-fix-page-size-on-BSD.patch: deleted, merged upstream. + - 120-upstream-explain-cpu-bars-in-monochrome-mode.patch: deleted, merged + upstream. + - 200-filter-non-printable-characters.patch: deleted, upstream has own + version of this patch. + - 610-rename-veid-to-ctid.patch: deleted, merged upstream. + - 600-openvz-veid-on-kernels-gt-2.6.18.patch: refreshed. + - 800-tree-view-without-userland-threads.patch: deleted, merged upstream. + - 700-ltrace-support.patch: refreshed, added the description. + * debian/rules: + - Deal more robustly with config.{sub,guess} files, thanks to Roger Leigh. + + -- Eugene V. Lyubimkin Sun, 05 Apr 2009 11:51:34 +0300 + +htop (0.8.1-6) unstable; urgency=low + + * debian/patches: + - debian/patches/110-upstream-fix-page-size-on-BSD.patch was accidentally + incorrectly applied, causing zeroes in memory columns. Fixed. + * debian/rules: + - File Process.c somewhy is not regenerated during normal build process. + Regenerate it by hand. + + -- Eugene V. Lyubimkin Sun, 29 Mar 2009 22:37:49 +0300 + +htop (0.8.1-5) unstable; urgency=low + + * debian/patches: + - New 100-upstream-sort-by-processor-and-session.patch, cherry-picked from + upstream svn: allow sorting by 'processor' and 'session' columns. + (Closes: #501317) + - New debian/patches/110-upstream-fix-page-size-on-BSD.patch, + cherry-picked from upstream svn: fix page size on BSD systems. + (Closes: #485277) + - New debian/patches/120-upstream-explain-cpu-bars-in-monochrome-mode.patch, + cherry-picked from upstream svn: document meanings of chars in CPU bars + in monochrome mode. (Closes: #477222) + - 600-openvz-veid-on-kernels-gt-2.6.18.patch: added a description. + - 610-rename-veid-to-ctid.patch: added a description. + - 800-tree-view-without-userland-threads.patch: added a description. + * debian/control: + - Bump 'Standards-Version' to 3.8.1, no changes needed. + + -- Eugene V. Lyubimkin Sun, 29 Mar 2009 19:49:53 +0300 + +htop (0.8.1-4) unstable; urgency=low + + * debian/patches: + - New 600-openvz-veid-on-kernels-gt-2.6.18.patch: fix determining veid on + openvz-enabled kernels greater than 2.6.18. Patch by + Thorsten Schifferdecker . (Closes: #516846) + - New 610-rename-veid-to-ctid.patch: openvz: renames 'veid' -> 'ctid' since + it's now a preferred term. Patch by + Thorsten Schifferdecker . (Closes: #516847) + - New 700-ltrace-support.patch: add ltrace(1) support in addition to strace + support. Patch by . + - New 800-tree-view-with-userland-threads.patch: patch to fix tree view when + userland threads are hidden, taken from Ubuntu. + + -- Eugene V. Lyubimkin Mon, 02 Mar 2009 23:17:04 +0200 + +htop (0.8.1-3) unstable; urgency=low + + * debian/rules: + - Don't ship empty directories in the package. + + -- Eugene V. Lyubimkin Sun, 15 Feb 2009 13:56:41 +0200 + +htop (0.8.1-2) experimental; urgency=low + + * Disabled unicode support, it has both build and work problems yet. + (Closes: #507423) + * debian/patches: + - New patch 200-filter-non-printable-characters.patch to filter + non-printable characters in process names. Thanks to Josh Triplett + and Andrew O. Shadoura. (Closes: #504144) + - 010-make-desktop-file-valid.patch: comment added. + * debian/control: + - Added '${misc:Depends}' to 'Depends', fixes lintian warning. + - Added 'python-minimal' to 'Build-Depends' for MakeHeader.py. + + -- Eugene V. Lyubimkin Sat, 06 Dec 2008 11:03:18 +0200 + +htop (0.8.1-1) experimental; urgency=low + + * New maintainer. Thanks for work, Bartosz Fenski! + * New upstream release: + - Changes in 0.8.1 (Closes: #499928): + - Linux-VServer support. + - Battery meter (Closes: #484771). + - Fixed collection of IO stats in multithreaded processes. + - Removed assertion that fails on hardened kernels. + - Changes in 0.8.0 (Closes: #494646, #486213): + - Ability to change sort column with the mouse by + clicking column titles. + - Added support for Linux per-process IO statistics. + - Added Unicode support. + - Fixed display of CPU count for threaded processes. + - Avoid crashing when using many meters. + - Other fixes: + - Significantly increased line length limit (to 65535). + (Closes: #470280) + * debian/control: + - Bumped 'Standards-Version' to 3.8.0, no changes needed. + - Changed Build-Depends on debhelper to (>= 7) and 'libncurses5-dev' -> + 'libncursesw5-dev'. Added dependency on quilt (>= 0.40). + * debian/rules: + - Some cleanup, used debhelper v7 commands. + - Pass '--enable-taskstats' and '--enable-unicode' options to configure. + - Pass '--enable-openvz' to configure. (Closes: #480541) + * debian/patches: + - New 010-make-desktop-file-valid.patch: makes desktop file valid. + Thanks to Nathan Handler (Closes: #488912) + * debian/copyright: + - Fixed path for GPLv2 license. + * debian/menu: + - Set proper section, removed hint (now useless). + + -- Eugene V. Lyubimkin Sun, 16 Nov 2008 20:36:18 +0200 + +htop (0.7-1) unstable; urgency=low + + * New upstrem version. (Closes: #452634) + * Move URL to homepage header. + * Bumped Standards-Version (no changes needed). + * Fixed watch file. (Closes: #449631) + + -- Bartosz Fenski Sat, 26 Apr 2008 13:57:14 +0200 + +htop (0.6.6+svn20070915-1) unstable; urgency=low + + * New upstream snapshot with dedication to Nico Golde + (Closes: #410398, #410391, #427127) + - fixes problems with trailing newline in confi (Closes: #420856) + - fixes segfault on missing command line args (Closes: #435651) + - fixes FTBS with GCC 4.3 branch (Closes: #416852) + + -- Bartosz Fenski Sat, 15 Sep 2007 14:37:41 +0200 + +htop (0.6.3-1) unstable; urgency=low + + * New upstream version. + - allows to rekill tagged group of processes (Closes: #375219) + * Bumped Standards-Version to 3.7.2 (no changes needed). + + -- Bartosz Fenski Mon, 14 Aug 2006 13:03:15 +0200 + +htop (0.6.2-1) unstable; urgency=low + + * New upstream version. + - doesn't segfault running as root. (Closes: #354258) + + -- Bartosz Fenski Tue, 4 Jul 2006 07:53:58 +0200 + +htop (0.6-1) unstable; urgency=low + + * New upstream version. + - doesn't show pipe when some value is equal to zero. (Closes: #325058) + - allows renicing group of processes. (Closes: #317391) + + -- Bartosz Fenski Thu, 29 Dec 2005 13:22:07 +0100 + +htop (0.5.4-1) unstable; urgency=low + + * New upstream version. + - does not leave cruft on console on exit. (Closes: #334657) + + -- Bartosz Fenski Fri, 4 Nov 2005 17:25:27 +0100 + +htop (0.5.3-1) unstable; urgency=low + + * New upstream version. + * Bumped Standards-Version to 3.6.2 (no changes needed). + + -- Bartosz Fenski Tue, 20 Sep 2005 10:49:52 +0200 + +htop (0.5.2-1) unstable; urgency=low + + * New upstream bugfix release. + + -- Bartosz Fenski Wed, 8 Jun 2005 20:02:19 +0200 + +htop (0.5.1-1) unstable; urgency=low + + * New upstream version. + - correctly honors limits for nice values (Closes: #291502) + + -- Bartosz Fenski Sun, 10 Apr 2005 17:49:12 +0200 + +htop (0.5-2) unstable; urgency=low + + * watch file changed a little to handle weird upstream versions + * s/fenio@o2.pl/fenio@debian.org/ + + -- Bartosz Fenski Thu, 7 Apr 2005 12:00:11 +0200 + +htop (0.5-1) unstable; urgency=low + + * New upstream version. + - fixes problem with wrongly displayed CPU bar (Closes: #283212) + + -- Bartosz Fenski Sat, 27 Nov 2004 10:10:17 +0100 + +htop (0.4.1-3) unstable; urgency=low + + * Fixed handling of non-alphanumeric chars during search. + Thanks to Gian Piero Carrubba for noticing it (Closes: #269060) + * Added description of recursive search of processes to the manpage. + Should be now clear how does it work so (Closes: #269061) + + -- Bartosz Fenski Tue, 31 Aug 2004 21:40:15 +0200 + +htop (0.4.1-2) unstable; urgency=low + + * Included updated manpage. (Closes: #269064) + Thanks to Gian Piero Carrubba for provided patch. + + -- Bartosz Fenski Tue, 31 Aug 2004 21:08:13 +0200 + +htop (0.4.1-1) unstable; urgency=low + + * New upstream version. + - fixes FTBFS on some archs (Closes: #268373) + + -- Bartosz Fenski Fri, 27 Aug 2004 14:01:11 +0200 + +htop (0.4-1) unstable; urgency=low + + * New upstream version. + * Added debian/menu file. + + -- Bartosz Fenski Sun, 22 Aug 2004 13:09:12 +0200 + +htop (0.3.3-1) unstable; urgency=low + + * New upstream version. + * Added debian/watch file. + + -- Bartosz Fenski Sun, 20 Jun 2004 10:33:13 +0200 + +htop (0.3.1-1) unstable; urgency=low + + * New upstream version. + * Hopefully first official Debian release. (Closes: #248939) + Thanks for sponsoring goes to Cedric Delfosse. + * debian/rules: + - removed dh_installman, cause it's now included by upstream. + + -- Bartosz Fenski Mon, 31 May 2004 05:37:15 +0200 + +htop (0.3-1) unstable; urgency=low + + * New upstream version. + + -- Bartosz Fenski Thu, 20 May 2004 01:15:05 +0200 + +htop (0.2.1-1) unstable; urgency=low + + * New upstream version. + * Some updates to manual page. + + -- Bartosz Fenski Sat, 15 May 2004 10:15:03 +0200 + +htop (0.2-1) unstable; urgency=low + + * Initial Release. + + -- Bartosz Fenski Fri, 14 May 2004 10:37:04 +0200 + --- htop-1.0.1.orig/debian/watch +++ htop-1.0.1/debian/watch @@ -0,0 +1,4 @@ +version=3 +opts=dversionmangle=s/\+svn(.*)// \ +http://sf.net/htop/htop-(\d\.\d|\d\.\d\.\d)\.tar\.gz + --- htop-1.0.1.orig/debian/docs +++ htop-1.0.1/debian/docs @@ -0,0 +1,2 @@ +AUTHORS +README --- htop-1.0.1.orig/debian/menu +++ htop-1.0.1/debian/menu @@ -0,0 +1,2 @@ +?package(htop):needs="text" section="Applications/System/Monitoring"\ + title="htop" command="/usr/bin/htop" --- htop-1.0.1.orig/debian/compat +++ htop-1.0.1/debian/compat @@ -0,0 +1 @@ +7 --- htop-1.0.1.orig/debian/control +++ htop-1.0.1/debian/control @@ -0,0 +1,21 @@ +Source: htop +Section: utils +Priority: optional +Maintainer: Eugene V. Lyubimkin +Build-Depends: debhelper (>= 7), libncurses5-dev, libncursesw5-dev, + autotools-dev, quilt (>= 0.40), python-minimal, libhwloc-dev [!linux-any], + dpkg-dev (>= 1.16.1) +Standards-Version: 3.9.2 +Homepage: http://htop.sourceforge.net + +Package: htop +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: strace, ltrace +Description: interactive processes viewer + Htop is an ncursed-based process viewer similar to top, but it + allows one to scroll the list vertically and horizontally to see + all processes and their full command lines. + . + Tasks related to processes (killing, renicing) can be done without + entering their PIDs. --- htop-1.0.1.orig/debian/copyright +++ htop-1.0.1/debian/copyright @@ -0,0 +1,21 @@ +This package was debianized by Bartosz Fenski on +Fri, 14 May 2004 10:37:04 +0200. + +It was downloaded from http://htop.sourceforge.net + +Upstream Author: Hisham Muhammad + +Copyright: + +Copyright (C) 2004-2011 Hisham Muhammad + +License: + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +On Debian systems, the complete text of the GNU General Public License +can be found in the file `/usr/share/common-licenses/GPL-2'. + --- htop-1.0.1.orig/debian/rules +++ htop-1.0.1/debian/rules @@ -0,0 +1,74 @@ +#!/usr/bin/make -f + +#export DH_VERBOSE=1 + +include /usr/share/quilt/quilt.make + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) + +ifeq (linux,$(DEB_HOST_ARCH_OS)) + ARCH_DEPENDENT_CONFIGURE_PARAMS = --enable-native-affinity +else + ARCH_DEPENDENT_CONFIGURE_PARAMS = --enable-hwloc +endif + +CFLAGS = $(shell dpkg-buildflags --get CFLAGS) + +config.status: configure $(QUILT_STAMPFN) + dh_testdir + + [ -r config.sub.orig ] || \ + cp -f config.sub config.sub.orig + [ -r config.guess.orig ] || \ + cp -f config.guess config.guess.orig + + [ ! -r /usr/share/misc/config.sub ] || \ + cp -f /usr/share/misc/config.sub config.sub + [ ! -r /usr/share/misc/config.guess ] || \ + cp -f /usr/share/misc/config.guess config.guess + + CFLAGS="$(CFLAGS)" LDFLAGS="$(INSTALL_PROGRAM)" ./configure \ + --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info \ + --enable-taskstats --enable-openvz --enable-vserver \ + --enable-cgroup $(ARCH_DEPENDENT_CONFIGURE_PARAMS) + +build: build-stamp +build-arch: build +build-indep: build +build-stamp: config.status + scripts/MakeHeader.py Process.c + dh build --before dh_auto_configure + dh build --after dh_auto_configure + touch build-stamp + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp + + ([ -f Makefile ] && $(MAKE) distclean) || true + [ ! -r config.guess.orig ] || \ + mv -f config.guess.orig config.guess || : + [ ! -r config.sub.orig ] || \ + mv -f config.sub.orig config.sub || : + + dh_clean + +install: build + dh install --before dh_auto_install + $(MAKE) install DESTDIR=$(CURDIR)/debian/htop + find $(CURDIR)/debian/htop -type d -empty -delete + dh install --after dh_auto_install + +binary-indep: +binary-arch: install + dh binary-arch + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- htop-1.0.1.orig/debian/dirs +++ htop-1.0.1/debian/dirs @@ -0,0 +1 @@ +usr/bin --- htop-1.0.1.orig/debian/README.source +++ htop-1.0.1/debian/README.source @@ -0,0 +1,58 @@ +This package uses quilt to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. + +To configure quilt to use debian/patches instead of patches, you want +either to export QUILT_PATCHES=debian/patches in your environment +or use this snippet in your ~/.quiltrc: + + for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do + if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then + export QUILT_PATCHES=debian/patches + break + fi + done + +To get the fully patched source after unpacking the source package, cd to +the root level of the source package and run: + + quilt push -a + +The last patch listed in debian/patches/series will become the current +patch. + +To add a new set of changes, first run quilt push -a, and then run: + + quilt new + +where is a descriptive name for the patch, used as the filename in +debian/patches. Then, for every file that will be modified by this patch, +run: + + quilt add + +before editing those files. You must tell quilt with quilt add what files +will be part of the patch before making changes or quilt will not work +properly. After editing the files, run: + + quilt refresh + +to save the results as a patch. + +Alternately, if you already have an external patch and you just want to +add it to the build system, run quilt push -a and then: + + quilt import -P /path/to/patch + quilt push -a + +(add -p 0 to quilt import if needed). as above is the filename to +use in debian/patches. The last quilt push -a will apply the patch to +make sure it works properly. + +To remove an existing patch from the list of patches that will be applied, +run: + + quilt delete + +You may need to run quilt pop -a to unapply patches first before running +this command. --- htop-1.0.1.orig/debian/README +++ htop-1.0.1/debian/README @@ -0,0 +1,4 @@ +The Debian package for htop contains an additional feature to view output of +ltrace(1) utility for selected process, like the same of strace(1). This +feature is not accepted by upstream, so one shouldn't rely on its existence. +The current hotkey ('L') is also subject to change in newer versions. --- htop-1.0.1.orig/debian/patches/200-dont-delete-htoprc-if-symlink.patch +++ htop-1.0.1/debian/patches/200-dont-delete-htoprc-if-symlink.patch @@ -0,0 +1,17 @@ +Taken from upstream: http://htop.svn.sourceforge.net/viewvc/htop/trunk/Settings.c?view=patch&r1=286&r2=285&pathrev=286 + +Don't delete an old .htoprc if it's a symlink. + +--- trunk/Settings.c 2012/02/17 13:45:58 285 ++++ trunk/Settings.c 2012/03/05 11:12:58 286 +@@ -239,7 +239,9 @@ + mkdir(htopDir, 0700); + free(htopDir); + free(configDir); +- if (access(legacyDotfile, R_OK) != 0) { ++ struct stat st; ++ lstat(legacyDotfile, &st); ++ if (access(legacyDotfile, R_OK) != 0 || S_ISLNK(st.st_mode)) { + free(legacyDotfile); + legacyDotfile = NULL; + } --- htop-1.0.1.orig/debian/patches/700-ltrace-support.patch +++ htop-1.0.1/debian/patches/700-ltrace-support.patch @@ -0,0 +1,195 @@ +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 @@ + + /*{ + ++typedef enum TraceType_ { ++ STRACE, ++ LTRACE ++} TraceType; ++ + typedef struct TraceScreen_ { + Process* process; + Panel* display; + FunctionBar* bar; + bool tracing; ++ TraceType type; + } TraceScreen; + + }*/ +@@ -38,9 +44,10 @@ + + static int tsEvents[] = {KEY_F(4), KEY_F(5), 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->tracing = true; +@@ -56,7 +63,14 @@ + static void TraceScreen_draw(TraceScreen* this) { + attrset(CRT_colors[PANEL_HEADER_FOCUS]); + mvhline(0, 0, ' ', COLS); +- mvprintw(0, 0, "Trace of process %d - %s", this->process->pid, this->process->comm); ++ switch(this->type) { ++ case STRACE: ++ mvprintw(0, 0, "Trace of process %d - %s (STRACE)", this->process->pid, this->process->comm); ++ break; ++ case LTRACE: ++ mvprintw(0, 0, "Trace of process %d - %s (LTRACE)", this->process->pid, this->process->comm); ++ break; ++ } + attrset(CRT_colors[DEFAULT_COLOR]); + FunctionBar_draw(this->bar, NULL); + } +@@ -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."; ++ 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; ++ } + write(fdpair[1], message, strlen(message)); + exit(1); + } + fcntl(fdpair[0], F_SETFL, O_NONBLOCK); +- FILE* strace = fdopen(fdpair[0], "r"); ++ FILE* trace = fdopen(fdpair[0], "r"); + 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 @@ + } + 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 +=================================================================== +--- 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 @@ + 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 ++.B L ++Trace process library calls: if ltrace(1) is installed, pressing this key ++will attach it to the currently selected process, presenting a live ++update of library calls issued by the process. ++.TP + .B F1, h, ? + Go to the help screen + .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,7 @@ + mvaddstr(19, 0, " F2 S: setup F6 >: select sort column"); + mvaddstr(20, 0, " F1 h: show this help screen l: list open files with lsof"); + mvaddstr(21, 0, " F10 q: quit s: trace syscalls with strace"); ++ mvaddstr(22, 0, " L: trace library calls with ltrace"); + + attrset(CRT_colors[HELP_BOLD]); + mvaddstr( 9, 0, " Arrows"); mvaddstr( 9,40, " F5 t"); +@@ -152,10 +153,11 @@ + mvaddstr(19, 0, " F2 S"); mvaddstr(19,40, " F6 >"); + mvaddstr(20, 0, " ? F1 h"); mvaddstr(20,40, " l"); + mvaddstr(21, 0, " F10 q"); mvaddstr(21,40, " s"); ++ mvaddstr(22,40, " L"); + attrset(CRT_colors[DEFAULT_COLOR]); + + attrset(CRT_colors[HELP_BOLD]); +- mvaddstr(23,0, "Press any key to return."); ++ mvaddstr(24,0, "Press any key to return."); + attrset(CRT_colors[DEFAULT_COLOR]); + refresh(); + CRT_readKey(); +@@ -580,9 +582,20 @@ + Panel_onKey(panel, KEY_DOWN); + break; + } ++ case 'L': ++ { ++ TraceScreen* ts = TraceScreen_new((Process*) Panel_getSelected(panel), LTRACE); ++ TraceScreen_run(ts); ++ TraceScreen_delete(ts); ++ clear(); ++ FunctionBar_draw(defaultBar, NULL); ++ refreshTimeout = 0; ++ CRT_enableDelay(); ++ break; ++ } + case 's': + { +- TraceScreen* ts = TraceScreen_new((Process*) Panel_getSelected(panel)); ++ TraceScreen* ts = TraceScreen_new((Process*) Panel_getSelected(panel), STRACE); + TraceScreen_run(ts); + TraceScreen_delete(ts); + clear(); --- htop-1.0.1.orig/debian/patches/600-openvz-veid-on-kernels-gt-2.6.18.patch +++ htop-1.0.1/debian/patches/600-openvz-veid-on-kernels-gt-2.6.18.patch @@ -0,0 +1,42 @@ +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 @@ + return; + } + char filename[MAX_NAME+1]; +- snprintf(filename, MAX_NAME, "%s/%s/stat", dirname, name); ++ snprintf(filename, MAX_NAME, "%s/%s/status", dirname, name); + FILE* file = fopen(filename, "r"); + if (!file) + return; +- fscanf(file, +- "%*32u %*32s %*1c %*32u %*32u %*32u %*32u %*32u %*32u %*32u " +- "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u " +- "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u " +- "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u " +- "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u " +- "%*32u %*32u %*32u %*32u %*32u %*32u %*32u " +- "%*32u %*32u %32u %32u", +- &process->vpid, &process->ctid); ++ ++ char buffer[256]; ++ process->ctid = 0; ++ while (!feof(file)) { ++ char* ok = fgets(buffer, 255, file); ++ if (!ok) ++ break; ++ ++ if (String_startsWith(buffer, "envID:")) { ++ int ctid; ++ int ok = sscanf(buffer, "envID:\t%d", &ctid); ++ if (ok >= 1) { ++ process->ctid = ctid; ++ } ++ } ++ } + fclose(file); + } + --- htop-1.0.1.orig/debian/patches/series +++ htop-1.0.1/debian/patches/series @@ -0,0 +1,3 @@ +200-dont-delete-htoprc-if-symlink.patch +600-openvz-veid-on-kernels-gt-2.6.18.patch +700-ltrace-support.patch