OpenVZ Forum


Home » General » Support » Top Patch exists?
Top Patch exists? [message #7665] Thu, 19 October 2006 18:39 Go to next message
mckayfer is currently offline  mckayfer
Messages: 3
Registered: October 2006
Location: Germany
Junior Member
Hello,
I want to know, if there already exists a patch for top, so that if I use the top command in a virtual System only the tasks which runs on the virtual system and not all tasks are shown?

If yes, do anybody also know, where I can find it?

Thanks so far

Re: Top Patch exists? [message #7666 is a reply to message #7665] Thu, 19 October 2006 20:17 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

http://download.openvz.org/contrib/utils/vzprocps-2.0.11-6.1 2.swsoft.src.rpm

http://static.openvz.org/userbars/openvz-developer.png
Re: Top Patch exists? [message #7684 is a reply to message #7666] Fri, 20 October 2006 10:19 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

Hi,

compiling these vzproc tools a error occured:
on a debian system i download it, patched in the order like in vzproc.spec and :

# make

gcc -D_GNU_SOURCE -O3 -Wall -Wstrict-prototypes -Wshadow -I/usr/src/openvz/vzproc/procps-2.0.11.orig -I/usr/include/ncurses -I/usr/X11R6/include -fwritable-strings -c top.c
In file included from top.c:114:
proc/sysinfo.h:7:20: vzlist.h: No such file or directory
make: *** [top.o] Error 1

-> to fix, I snipped the vzlist.h out of the vzctl-3.0.12/include/vzlist.h and copied to proc/vzlist.h and modify proc/sysinfo.h, to use the proc/vzlist.h

again:

# make
gcc -Wl,-warn-common -o top top.o proc/libproc.a proc/libproc.a -lncurses
proc/libproc.a(compare.o)(.data+0x0): multiple definition of `ve_status'
top.o(.data+0x18): first defined here
proc/libproc.a(readproc.o)(.data+0x0): multiple definition of `ve_status'
top.o(.data+0x18): first defined here
proc/libproc.a(status.o)(.data+0x0): multiple definition of `ve_status'
top.o(.data+0x18): first defined here
proc/libproc.a(sysinfo.o)(.data+0x0): multiple definition of `ve_status'
top.o(.data+0x18): first defined here
proc/libproc.a(whattime.o)(.data+0x0): multiple definition of `ve_status'
top.o(.data+0x18): first defined here
collect2: ld returned 1 exit status
make: *** [top] Error 1

it's a debian system with :
gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)
Re: Top Patch exists? [message #7687 is a reply to message #7684] Fri, 20 October 2006 11:16 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

find ve_status function and remove one of them.
I suppose you need vzlist.h from kernel, not vzctl one.


http://static.openvz.org/userbars/openvz-developer.png
Re: Top Patch exists? [message #7692 is a reply to message #7687] Fri, 20 October 2006 15:22 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

Hi,

> find ve_status function and remove one of them.

You point me in the right direction Smile

> I suppose you need vzlist.h from kernel, not vzctl one.
Sorry, i found no vzlist.h in kernel-source, and inspecting some files - i found out it's from vzctl!

the fix:
comment out the ve_status

/* char *ve_status[]= {
* "running",
* "stopped",
* "mounted"
* };
*/

and build it again.

then you can use the 2 builed tools: ps and top

# ps -E <VEID>
VEID PID TTY STAT TIME COMMAND
<VEID> 13107 ? S 0:00 init [2]
<VEID> 14404 ? S 0:00 /sbin/syslogd
<VEID> 14532 ? S 0:00 /usr/sbin/exim4 -bd -q30m
<VEID> 14539 ? S 0:00 /usr/sbin/cron

# top -e -n1, gives me a N/A, nor VEID is printed :-/

PID USER PRI NI SIZE RSS SHARE VEID STAT %CPU %MEM TIME CPU COMMAN
1 root 16 0 2656 536 456 N/A S 0.0 0.0 0:00 0 init
[...]

Thanks!
Re: Top Patch exists? [message #7694 is a reply to message #7666] Fri, 20 October 2006 16:27 Go to previous messageGo to next message
mckayfer is currently offline  mckayfer
Messages: 3
Registered: October 2006
Location: Germany
Junior Member
Hello,
I download the rpm file and tried to install it with
rpm -install vzprocps...
I get an error message "user dim does not exist - using root"
I don't understand it Crying or Very Sad
What I have to do, that it works?
Sorry for so easy questions, but I'm not a "Linux every day user".

Thanks so far!
Re: Top Patch exists? [message #7704 is a reply to message #7694] Sat, 21 October 2006 13:38 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

Hi,


pre:

To prevent a compile error, copy the vzlist.h out of the source tree of vzctl (in the dircetory ./include/) and copy to /usr/include/linux/vzlist.h

Modify the /usr/include/linux/vzlist.h:

from
char *ve_status[]= {
"running",
"stopped",
"mounted"
};

to:

/*
* char *ve_status[]= {
* "running",
* "stopped",
* "mounted"
* };
*/

and build the tools:

# rpm -iv --rebuild vzprocps-2.0.11-6.12.swsoft.src.rpm


[Updated on: Sat, 21 October 2006 13:45]

Report message to a moderator

Re: Top Patch exists? [message #7720 is a reply to message #7692] Mon, 23 October 2006 07:47 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

when running top, press e (or E, don't remember) Smile


http://static.openvz.org/userbars/openvz-developer.png
Re: Top Patch exists? [message #7721 is a reply to message #7694] Mon, 23 October 2006 07:48 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

It is a bug in built RPM :/ does it prevent you from using these tools?


http://static.openvz.org/userbars/openvz-developer.png
Re: Top Patch exists? [message #7727 is a reply to message #7721] Mon, 23 October 2006 10:18 Go to previous messageGo to next message
mckayfer is currently offline  mckayfer
Messages: 3
Registered: October 2006
Location: Germany
Junior Member
Actually yes!

Would be grat if you can fix it, as fast as possible.

I need it for the University and have a Deadline on Friday. Shocked

Thanks so far
Re: Top Patch exists? [message #7728 is a reply to message #7727] Mon, 23 October 2006 10:35 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

http://download.openvz.org/contrib/utils/vzprocps-2.0.11-6.1 3.swsoft.i386.rpm

http://static.openvz.org/userbars/openvz-developer.png
Re: Top Patch exists? [message #7737 is a reply to message #7728] Mon, 23 October 2006 15:04 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

Hi dev,

the problem is, that vztop cannot filter the top stats through any commands:

Print a additional VEID column:
# vztop -e

brings up: (as a example)

[...]

PID USER PRI NI SIZE RSS SHARE VEID STAT %CPU %MEM TIME CPU COMMAND
28912 root 16 0 1516 520 452 N/A S 0.0 0.0 0:00 0 init
29114 root 16 0 1568 540 440 N/A S 0.0 0.0 0:00 0 syslogd
29240 Debian-e 16 0 4436 892 668 N/A S 0.0 0.0 0:00 0 exim4
29248 root 20 0 3476 884 652 N/A S 0.0 0.0 0:00 0 sshd
29251 root 16 0 1764 644 532 N/A S 0.0 0.0 0:00 0 cron
14669 root 16 0 1548 528 448 N/A S 0.0 0.0 0:00 0 inetd
8462 root 16 0 10212 496 332 N/A S 0.0 0.0 0:00 0 vzctl
8463 root 15 0 2568 1432 1152 N/A S 0.0 0.1 0:00 0 bash
8468 root 16 0 3552 1868 1444 N/A S 0.0 0.1 0:00 0 mc
8470 root 15 0 2576 1468 1180 N/A S 0.0 0.1 0:00 0 bash
8524 root 17 0 2084 1120 824 N/A R 0.0 0.1 0:00 0 vztop

you can see the N/A fields, should be the VEID ...
That's the problem,

and

Filter top-stat of <VEID> only!
# vztop -E <VEID>

print only the headers, no processes,
but
# vzps -E <VEID> axf

Show correctly the VEID field!

VEID PID TTY STAT TIME COMMAND
902 28912 ? S 0:00 init [2]
902 29114 ? S 0:00 /sbin/syslogd
902 29240 ? S 0:00 /usr/sbin/exim4 -bd -q30m
902 29248 ? S 0:00 /usr/sbin/sshd
902 29251 ? S 0:00 /usr/sbin/cron
902 14669 ? S 0:00 /usr/sbin/inetd

Re: Top Patch exists? [message #7765 is a reply to message #7737] Tue, 24 October 2006 18:54 Go to previous message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

Hi,

for debian, precrated vzprocps can be downloaded:

i386:
http://debian.systs.org/pool/openvz-test/v/vzprocps/vzprocps _2.0.11-1dso1_i386.deb

amd64:
http://debian.systs.org/pool/openvz-test/v/vzprocps/vzprocps _2.0.11-1dso1_amd64.deb
Previous Topic: FC6 VPS
Next Topic: OpenSuse 10 template
Goto Forum:
  


Current Time: Wed Jul 31 18:38:29 GMT 2024

Total time taken to generate the page: 0.02693 seconds