[htop-general] htop-0.8.1 & htop-svn-r139 OpenVZ bug / fix
Brought to you by:
loderunner
From: Wolfgang F. <wo...@un...> - 2008-10-12 18:58:18
|
Hello, both htop-0.8.1 and htop svn revision 139 fail to parse VPID and VEID from /proc/${pid}/stat with the following kernels: * linux-image-2.6.18-12-fza-686 (openvz.org debian etch repo) * linux-image-2.6.24-6-fza-686 (openvz.org debian lenny repo) * The current git kernel on x86_64 On the 3 systems tested, a small patch fixed the issue: ------------------------------------------------------------------------ diff -Nru htop-svn-r138/ProcessList.c htop-svn-r138--openvz-fix/ProcessList.c --- htop-svn-r138/ProcessList.c 2008-09-23 08:29:03.000000000 +0200 +++ htop-svn-r138--openvz-fix/ProcessList.c 2008-10-12 20:26:21.000000000 +0200 @@ -636,7 +636,7 @@ "%*u %*u %*u %*u %*u %*u %*u %*u " "%*u %*u %*u %*u %*u %*u %*u %*u " "%*u %*u %*u %*u %*u %*u %*u " - "%u %u", + "%*u %*u %u %u", &process->vpid, &process->veid); fclose(status); } ------------------------------------------------------------------------ The safest way to handle this would be to use /proc/${pid}/statm instead of "stat" although performance is the price for that. Greetings, -- Wolfgang Frisch PGP: 0xBBA32FD3 (http://de.wikipedia.org/wiki/GNU_Privacy_Guard) Jabber: wo...@un... (http://hp.kairaven.de/jabber/) |