I have made an update for the top(1) utility in the FreeBSD base system to get it from the 3.5b12 version to the 3.8b1 version. I have tried them on the amd64 architecture on FreeBSD -current and FreeBSD 7.0 and on the i386 architecture on FreeBSD 7.0. The big new features are a line upper part with kernel statistics (context-switches, traps, interrupts, faults etc) and the FLG table (if you window is big enough) Some features specific to FreeBSD (dual display (press m)), threaded processes, and jails have been ported to 3.8b1. The biggest fix (AFAICT) is the TIME and CPU table for threaded processes, which are now calculated properly. The new code can be found on http://www.mavetju.org/~edwin/freebsd-top-3.8b1-A.tar.gz Go to 3.8b1/usr.sbin/top and run "make" there to produce the binary, then run it via "./top". Please report any issues with it (compile time, run time) and a way to reproduce it (if possible). Thanks for your help! Edwin -- Edwin Groothuis edwin@freebsd.org http://www.mavetju.org
Edwin Groothuis ?????:> I have made an update for the top(1) utility in the FreeBSD base > system to get it from the 3.5b12 version to the 3.8b1 version. > > I have tried them on the amd64 architecture on FreeBSD -current and > FreeBSD 7.0 and on the i386 architecture on FreeBSD 7.0. > > The big new features are a line upper part with kernel statistics > (context-switches, traps, interrupts, faults etc) and the FLG table > (if you window is big enough) > > Some features specific to FreeBSD (dual display (press m)), threaded > processes, and jails have been ported to 3.8b1. > > The biggest fix (AFAICT) is the TIME and CPU table for threaded > processes, which are now calculated properly. > > The new code can be found on > http://www.mavetju.org/~edwin/freebsd-top-3.8b1-A.tar.gz > Go to 3.8b1/usr.sbin/top and run "make" there to produce the binary, > then run it via "./top". > > Please report any issues with it (compile time, run time) and a way > to reproduce it (if possible). Thanks for your help! > > Edwin >Some strange. Count running processes not match with system top ========= system top ============last pid: 30285; load averages: 0.99, 0.91, 0.91 up 0+21:08:49 12:10:40 45 processes: 2 running, 43 sleeping CPU: 24.3% user, 0.0% nice, 1.3% system, 0.0% interrupt, 74.4% idle Mem: 236M Active, 1693M Inact, 414M Wired, 137M Cache, 214M Buf, 5187M Free Swap: 4096M Total, 4096M Free PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 87008 root 1 8 0 58728K 43028K wait 0 0:05 0.00% ruby18 87002 root 1 44 0 5688K 1124K select 2 0:02 0.00% script 1168 root 1 44 0 22872K 4308K select 3 0:01 0.00% sshd 30284 root 1 97 0 97420K 90844K CPU1 1 0:01 0.00% cc1plus 721 root 1 44 0 10696K 4000K select 0 0:01 0.00% sendmail 86980 lissyara 1 44 0 33764K 4840K select 2 0:00 0.00% sshd 584 root 1 44 0 5688K 1364K select 2 0:00 0.00% syslogd 733 root 1 8 0 6744K 1436K nanslp 0 0:00 0.00% cron 52451 lissyara 1 44 0 33764K 4840K select 0 0:00 0.00% sshd ======== new top =========last pid: 30280; load avg: 0.99, 0.91, 0.91; up 0+21:08:48 12:10:39 99 processes: 6 running, 76 sleeping, 17 waiting CPU: 23.6% user, 0.0% nice, 1.9% system, 0.0% interrupt, 74.5% idle Kernel: 4192 ctxsw, 21398 trap, 4 intr, 1000 soft, 4 fork, 21427 flt, 26140 fr Mem: 239M Active, 1693M Inact, 414M Wired, 137M Cache, 214M Buf, 5184M Free Swap: 4096M Total, 4096M Free PID USERNAME THR PRI NICE SIZE RES STATE FLG C TIME CPU COMMAND 30279 root 1 98 0 97M 91M CPU1 + 1 0:01 48.94% cc1plus 30280 root 1 -8 0 2176K 1688K piperd + 0 0:00 0.14% as 30277 root 1 8 0 7060K 1884K wait + 1 0:00 0.06% sh 30278 root 1 8 0 4600K 1284K wait + 0 0:00 0.06% c++ 30245 root 1 44 0 8112K 2220K select + 0 0:00 0.04% top 30219 root 1 44 0 8112K 2284K CPU2 + 2 0:00 0.02% top 86980 lissyara 1 44 0 33M 4840K select 2 0:00 0.01% sshd 29472 root 1 8 0 3200K 1392K wait + 3 0:00 0.01% make 87008 root 1 8 0 57M 42M wait + 0 0:05 0.00% ruby18 87002 root 1 44 0 5688K 1124K select + 2 0:02 0.00% script 1168 root 1 44 0 22M 4308K select s 3 0:01 0.00% sshd =====================FreeBSD serv2.hos-ting.ru 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Sat Sep 27 14:50:59 MSD 2008 lissyara@serv2.hos-ting.ru:/usr/obj/usr/src/sys/HOSTING amd64
Stefan `Sec` Zehl
2008-Sep-28 09:34 UTC
Request for testing - top 3.8b1 in the base system
Hi, On Sun, Sep 28, 2008 at 15:46 +1000, Edwin Groothuis wrote:> The new code can be found on > http://www.mavetju.org/~edwin/freebsd-top-3.8b1-A.tar.gz > Go to 3.8b1/usr.sbin/top and run "make" there to produce the binary, > then run it via "./top".compiles and runs fine on my box: FreeBSD ice 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #17: Wed Sep 3 23:59:58 CEST 2008 root@ice:/usr/obj/usr/src/sys/ICE amd64> Please report any issues with it (compile time, run time) and a way > to reproduce it (if possible). Thanks for your help!The number of sleeping processes is much lower than system top: oldtop: 480 processes: 3 running, 450 sleeping, 2 stopped, 7 zombie, 18 waiting newtop: 190 processes: 3 running, 160 sleeping, 2 stopped, 7 zombie, 18 waiting Interestingly, the system top appears to be the one in error: ice:~>ps auxww|wc -l 194 Other than that, i could see no obvious problems. CU, Sec -- I think the IDE issue is a good point. People with IDE hardware in their machines should be punished by making them wait to boot... -- terry@lambert.org
Edwin Groothuis wrote, On 28.9.2008 7:46:> I have made an update for the top(1) utility in the FreeBSD base > system to get it from the 3.5b12 version to the 3.8b1 version. > > I have tried them on the amd64 architecture on FreeBSD -current and > FreeBSD 7.0 and on the i386 architecture on FreeBSD 7.0. > > The big new features are a line upper part with kernel statistics > (context-switches, traps, interrupts, faults etc) and the FLG table > (if you window is big enough) > > Some features specific to FreeBSD (dual display (press m)), threaded > processes, and jails have been ported to 3.8b1. > > The biggest fix (AFAICT) is the TIME and CPU table for threaded > processes, which are now calculated properly. > > The new code can be found on > http://www.mavetju.org/~edwin/freebsd-top-3.8b1-A.tar.gz > Go to 3.8b1/usr.sbin/top and run "make" there to produce the binary, > then run it via "./top". > > Please report any issues with it (compile time, run time) and a way > to reproduce it (if possible). Thanks for your help!Is this 7.0+ only? I run 6.3 and I see the following when I start it: last pid: -1077944144; loa 0.52, 0.28, 0.26; up 11+15:31:33 11:33:05 0 processes: CPU: 0.1% user, 0.6% nice, -0.7% system, -0.6% interrupt, -0.4% idle Kernel: 1 intr Mem: 235M Active, 458M Inact, 219M Wired, 42M Cache, 111M Buf, 39M Free Swap: 3000M Total, 181M Used, 2819M Free, 6% Inuse sysctlnametomib: No such file or directory And no processes.> > Edwin >-- VH -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 215 bytes Desc: OpenPGP digital signature Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20080928/adbb35fa/signature.pgp
On Sun, Sep 28, 2008 at 11:33:57AM +0200, Stefan `Sec` Zehl wrote:> Hi, > > On Sun, Sep 28, 2008 at 15:46 +1000, Edwin Groothuis wrote: > > The new code can be found on > > http://www.mavetju.org/~edwin/freebsd-top-3.8b1-A.tar.gz > > Go to 3.8b1/usr.sbin/top and run "make" there to produce the binary, > > then run it via "./top". > > compiles and runs fine on my box: > > FreeBSD ice 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #17: Wed Sep 3 23:59:58 CEST 2008 root@ice:/usr/obj/usr/src/sys/ICE amd64 > > > Please report any issues with it (compile time, run time) and a way > > to reproduce it (if possible). Thanks for your help! > > The number of sleeping processes is much lower than system top: > > oldtop: 480 processes: 3 running, 450 sleeping, 2 stopped, 7 zombie, 18 waiting > newtop: 190 processes: 3 running, 160 sleeping, 2 stopped, 7 zombie, 18 waitingOh yes, I forgot about that: The old top(1) and new top(1) counts the processes different: - "ps xauw | wc" gives 265 - "ps xauwH | wc" gives 295 (expand threads) - old top gives 240 processes. - old top + "S" (system processes) gives 292 processes. - old top + "H" (threads) gives 240 "processes" - old top + "S" (system processes) + "H" (threads) gives 292 "processes" - new top gives 260 processes - new top + "S" (system processes) gives 260 processes - new top + "H" (threads) gives 292 *threads* - new top + "S" (system processes) + "H" (threads) gives 292 *threads* This is only for the summary menu, not for the process list. Thanks for your feedback, it is surely something which needs to be written down in the official announcement. Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://www.mavetju.org/weblog/
sthaug@nethelp.no
2008-Sep-28 10:20 UTC
Request for testing - top 3.8b1 in the base system
> The big new features are a line upper part with kernel statistics > (context-switches, traps, interrupts, faults etc) and the FLG table > (if you window is big enough)Would it be possible to document the values in the FLG field? The meaning wasn't obvious to me... Steinar Haug, Nethelp consulting, sthaug@nethelp.no
-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 On Sun, 28 Sep 2008 15:46:20 +1000 Edwin Groothuis <edwin@freebsd.org> wrote:> Please report any issues with it (compile time, run time) and a way > to reproduce it (if possible). Thanks for your help!FreeBSD black 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #1: Thu Sep 11 15:05:17 CEST 2008 nikola@black:/usr/obj/usr/src/sys/GENERIC i386 Core2Quad Q6600, 2G RAM, compiling mplayer, in H mode I got this: last pid: 70762; load avg: 1.22, 0.54, 0.33; up 0+16:48:11 14:08:01 177 threads: 11 running, 147 sleeping, 19 waiting CPU: 27.6% user, 0.0% nice, 3.3% system, 0.7% interrupt, 68.4% idle Kernel: 246626 ctxsw, 5063 trap, 362 intr, 354 soft, 5 fork, 4591 flt, 728 fr Mem: 891M Active, 774M Inact, 233M Wired, 89M Cache, 112M Buf, 3668K Free Swap: 4096M Total, 4096M Free PID USERNAME PRI NICE SIZE RES STATE FLG C TIME CPU COMMAND 70729 root 104 0 74M 72M CPU2 + 2 0:05 100.64% cc1 47252 nikola 53 0 379M 84M RUN + 0 21:20 8.34% Xorg 47290 nikola 44 0 59M 46M CPU3 + 1 7:06 1.81% compiz 47972 nikola 44 0 112M 61M select s 3 11:09 1.15% amule 70730 root -8 0 2912K 1592K piperd + 0 0:00 0.92% as 47579 nikola 44 0 66M 23M CPU0 3 0:23 0.46% Terminal 47547 nikola 45 0 332M 251M RUN 1 6:58 0.39% firefox-bin 17027 nikola 96 0 26M 23M RUN + 3 1:30 0.38% conky 61107 nikola 4 0 47M 18M select s 1 0:01 0.28% mousepad 47284 nikola 44 0 14M 7844K select s 2 0:17 0.21% gnome-screensaver 861 root 44 0 3268K 896K select s 0 0:12 0.21% moused 47263 nikola 44 0 21M 13M select s 0 0:12 0.21% scim-panel-gtk 47296 nikola 44 0 45M 15M select + 3 0:15 0.17% xfce4-panel 47299 nikola 44 0 17M 11M select + 2 1:20 0.16% xfce4-netload-plugi 47547 nikola 44 0 332M 251M ucond 0 0:54 0.11% firefox-bin 47310 nikola 44 0 27M 20M select s 2 0:32 0.07% emerald 986 haldaemon 44 0 6812K 4004K select s 3 0:27 0.07% hald 23567 nikola 44 0 6744K 3788K select s 0 0:18 0.06% scim-launcher 67253 nikola 44 0 45M 33M select s 3 0:34 0.05% skype 53739 nikola 44 0 45M 35M select + 2 0:34 0.05% compiz 47263 nikola 44 0 21M 13M select s 0 0:20 0.05% scim-panel-gtk Is it normal to have 100.64% for cc1? Btw, an aesthetic observation, in H mode the USERNAME column shrinks and expands if username has less or more than 9 characters. :-) Thanks. - -- Nikola Le?i? = ?????? ????? fingerprint : FEF3 66AF C90E EDC3 D878 7CDC 956D F4AB A377 1C9B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iJwEAQEDAAYFAkjfd24ACgkQ/MM/0rYIoZiGogP9EMyfOCVBJwTnZZapTN5RERN+ eJiDbb6ww6SOLZQDAt23Qq/ia2dIgtCq2a533CCGVAx2VjnHnivM19ireBTMP5sa 7+sRGWxjfa6L+cv2jQsHnZkBLPkDC4+iVFL57PMXvbsB4gQww62ZPrxWbgu46t78 g78gaqiGtbwmQNZiJyg=yYdi -----END PGP SIGNATURE-----
Yay I was hoping someone would pick this up. Edwin: I will pick up your changes and roll them back in to the source. Then I can distribute an official release of 3.8 and make it non-beta. I will respond to other comments in separate messages. Bill LeFebvre
Giorgos Keramidas
2008-Sep-28 16:16 UTC
Request for testing - top 3.8b1 in the base system
On Sun, 28 Sep 2008 15:46:20 +1000, Edwin Groothuis <edwin@freebsd.org> wrote:> I have made an update for the top(1) utility in the FreeBSD base > system to get it from the 3.5b12 version to the 3.8b1 version.Thank you! :)
On Sun, Sep 28, 2008 at 02:24:09PM +0200, Nikola Le??i?? wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: RIPEMD160 > > On Sun, 28 Sep 2008 15:46:20 +1000 > Edwin Groothuis <edwin@freebsd.org> wrote: > > > Please report any issues with it (compile time, run time) and a way > > to reproduce it (if possible). Thanks for your help! > > FreeBSD black 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #1: Thu Sep 11 > 15:05:17 CEST 2008 nikola@black:/usr/obj/usr/src/sys/GENERIC i386 > > Core2Quad Q6600, 2G RAM, compiling mplayer, in H mode I got this: > > last pid: 70762; load avg: 1.22, 0.54, 0.33; up 0+16:48:11 14:08:01 > 177 threads: 11 running, 147 sleeping, 19 waiting > CPU: 27.6% user, 0.0% nice, 3.3% system, 0.7% interrupt, 68.4% idle > Kernel: 246626 ctxsw, 5063 trap, 362 intr, 354 soft, 5 fork, 4591 flt, 728 fr > Mem: 891M Active, 774M Inact, 233M Wired, 89M Cache, 112M Buf, 3668K Free > Swap: 4096M Total, 4096M Free > > PID USERNAME PRI NICE SIZE RES STATE FLG C TIME CPU COMMAND > 70729 root 104 0 74M 72M CPU2 + 2 0:05 100.64% cc1 > 47252 nikola 53 0 379M 84M RUN + 0 21:20 8.34% Xorg > 47290 nikola 44 0 59M 46M CPU3 + 1 7:06 1.81% compiz > 47972 nikola 44 0 112M 61M select s 3 11:09 1.15% amule > 70730 root -8 0 2912K 1592K piperd + 0 0:00 0.92% as > 47579 nikola 44 0 66M 23M CPU0 3 0:23 0.46% Terminal > 47547 nikola 45 0 332M 251M RUN 1 6:58 0.39% firefox-bin > 17027 nikola 96 0 26M 23M RUN + 3 1:30 0.38% conky > 61107 nikola 4 0 47M 18M select s 1 0:01 0.28% mousepad > 47284 nikola 44 0 14M 7844K select s 2 0:17 0.21% gnome-screensaver > 861 root 44 0 3268K 896K select s 0 0:12 0.21% moused > 47263 nikola 44 0 21M 13M select s 0 0:12 0.21% scim-panel-gtk > 47296 nikola 44 0 45M 15M select + 3 0:15 0.17% xfce4-panel > 47299 nikola 44 0 17M 11M select + 2 1:20 0.16% xfce4-netload-plugi > 47547 nikola 44 0 332M 251M ucond 0 0:54 0.11% firefox-bin > 47310 nikola 44 0 27M 20M select s 2 0:32 0.07% emerald > 986 haldaemon 44 0 6812K 4004K select s 3 0:27 0.07% hald > 23567 nikola 44 0 6744K 3788K select s 0 0:18 0.06% scim-launcher > 67253 nikola 44 0 45M 33M select s 3 0:34 0.05% skype > 53739 nikola 44 0 45M 35M select + 2 0:34 0.05% compiz > 47263 nikola 44 0 21M 13M select s 0 0:20 0.05% scim-panel-gtk > > Is it normal to have 100.64% for cc1?I would assume so, as your machine has more than one logical or physical processor. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |
Jeremy Chadwick wrote:> On Sun, Sep 28, 2008 at 02:24:09PM +0200, Nikola Le??i?? wrote:>> Is it normal to have 100.64% for cc1? > > I would assume so, as your machine has more than one logical or > physical processor. >No, that was a per-thread display he posted. Altho undesirable I can come up with some plausible reasons why it is exceeding 100%, all related to the uncertainty of trying to perform accurate measurements on a moving target. I suppose I could cap the percentage at 100 just for aesthetic reasons, and to keep it from overflowing the column. Bill
On Sun, Sep 28, 2008 at 03:46:45PM -0400, William LeFebvre wrote:> Jeremy Chadwick wrote: >> On Sun, Sep 28, 2008 at 02:24:09PM +0200, Nikola Le??i?? wrote: > >>> Is it normal to have 100.64% for cc1? >> >> I would assume so, as your machine has more than one logical or >> physical processor. >> > > No, that was a per-thread display he posted. Altho undesirable I can > come up with some plausible reasons why it is exceeding 100%, all > related to the uncertainty of trying to perform accurate measurements on > a moving target. I suppose I could cap the percentage at 100 just for > aesthetic reasons, and to keep it from overflowing the column.Ah ha. That could also explain why gstat(8) has the same problem (%busy column occasionally being >100, sometimes 102-103%). A simple & 100 on the displayed value should suffice, yep. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |
On Sun, 28 Sep 2008 15:46:20 +1000 Edwin Groothuis <edwin@freebsd.org> wrote:> I have made an update for the top(1) utility in the FreeBSD base > system to get it from the 3.5b12 version to the 3.8b1 version. > [...] > Please report any issues with it (compile time, run time) and a way > to reproduce it (if possible). Thanks for your help! >There are some new warnings generated during compilation with WARNS=1 due to the use of -DSIGWINCH on the command line (since it has already been defined in signal.h). Though of course it doesn't have any effect on the functionality. -- Bruce Cran
* Edwin Groothuis <edwin@freebsd.org> [080927 23:04] wrote:> I have made an update for the top(1) utility in the FreeBSD base > system to get it from the 3.5b12 version to the 3.8b1 version.Hey Edwin, any chance you have the time to add to top(1) a flag that will restrict top(1) to only view a certain pid or list of pids? This would be really helpful in the threaded view to watch a single process. -Alfred
* Edwin Groothuis (edwin@freebsd.org) wrote:> I have made an update for the top(1) utility in the FreeBSD base > system to get it from the 3.5b12 version to the 3.8b1 version.Looks good, thanks! IO mode seems to have changed a bit, giving different values to 3.5, it seems while 3.5 gives you the count for the sample period, 3.8 always gives you a per-second rate, e.g. top -mio -s 20: 3.8: 44181 freaky 240 0 240 0 0 240 99.74% cat 3.5: 44181 freaky 4664 5 4667 0 0 4667 100.00% cat This might be confusing, since it means values from two different top -mio's are no longer directly comparable. 3.8 also seems to be lacking IO sorting options; "o vcsw" etc are missing. Will they be returning? Also, the [number] argument given to -m io has no effect: top -m io 10 Setting it after loading with "n 10<enter>" causes top to exit. -- Thomas 'Freaky' Hurst http://hur.st/
On Sun, Sep 28, 2008 at 03:46:20PM +1000, Edwin Groothuis wrote:> I have made an update for the top(1) utility in the FreeBSD base > system to get it from the 3.5b12 version to the 3.8b1 version. > > I have tried them on the amd64 architecture on FreeBSD -current and > FreeBSD 7.0 and on the i386 architecture on FreeBSD 7.0. > > The big new features are a line upper part with kernel statistics > (context-switches, traps, interrupts, faults etc) and the FLG table > (if you window is big enough) > > Some features specific to FreeBSD (dual display (press m)), threaded > processes, and jails have been ported to 3.8b1. > > The biggest fix (AFAICT) is the TIME and CPU table for threaded > processes, which are now calculated properly. > > The new code can be found on > http://www.mavetju.org/~edwin/freebsd-top-3.8b1-A.tar.gz > Go to 3.8b1/usr.sbin/top and run "make" there to produce the binary, > then run it via "./top". > > Please report any issues with it (compile time, run time) and a way > to reproduce it (if possible). Thanks for your help! > > EdwinI found another bug. The new top doesn't handle newlines in full commandlines correctly -- if there is a command whose commandline contains a newline, which is quite common while some compilation is in progress, it is just printed out as it is, breaking the one-process-per-line layout. -- (-K JohnNy alias Partial Derivative ? [home] http://johnny64.fixinko.sk/ [icq] 338328204 [abandoned] [jabber] JohnNy64@swissjabber.org [skype] JohnNy64-konik [abandoned] -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 195 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20081001/541806bf/attachment.pgp
2008/9/28 Edwin Groothuis <edwin@freebsd.org>:> I have made an update for the top(1) utility in the FreeBSD base > system to get it from the 3.5b12 version to the 3.8b1 version. > > I have tried them on the amd64 architecture on FreeBSD -current and > FreeBSD 7.0 and on the i386 architecture on FreeBSD 7.0. > > The big new features are a line upper part with kernel statistics > (context-switches, traps, interrupts, faults etc) and the FLG table > (if you window is big enough) > > Some features specific to FreeBSD (dual display (press m)), threaded > processes, and jails have been ported to 3.8b1. > > The biggest fix (AFAICT) is the TIME and CPU table for threaded > processes, which are now calculated properly. > > The new code can be found on > http://www.mavetju.org/~edwin/freebsd-top-3.8b1-A.tar.gz > Go to 3.8b1/usr.sbin/top and run "make" there to produce the binary, > then run it via "./top". > > Please report any issues with it (compile time, run time) and a way > to reproduce it (if possible). Thanks for your help! > > Edwin > > -- > Edwin Groothuis > edwin@freebsd.org > http://www.mavetju.orgHello. I have one issue, maybe not so important though. I've compiled top 3.8b1 on my 7.1-PRERELEASE and it looks like "t" hotkey (toggle displaying "top" process) don't work at all. (Sorry if somebody has pointed out that one already. I haven't read all thread so thoroughly. ) -- Best regards, Jeff.
2008/9/28 Edwin Groothuis <edwin@freebsd.org>:> I have made an update for the top(1) utility in the FreeBSD base > system to get it from the 3.5b12 version to the 3.8b1 version. > > I have tried them on the amd64 architecture on FreeBSD -current and > FreeBSD 7.0 and on the i386 architecture on FreeBSD 7.0. > > The big new features are a line upper part with kernel statistics > (context-switches, traps, interrupts, faults etc) and the FLG table > (if you window is big enough) > > Some features specific to FreeBSD (dual display (press m)), threaded > processes, and jails have been ported to 3.8b1. > > The biggest fix (AFAICT) is the TIME and CPU table for threaded > processes, which are now calculated properly. > > The new code can be found on > http://www.mavetju.org/~edwin/freebsd-top-3.8b1-A.tar.gz > Go to 3.8b1/usr.sbin/top and run "make" there to produce the binary, > then run it via "./top". > > Please report any issues with it (compile time, run time) and a way > to reproduce it (if possible). Thanks for your help! > > Edwinbtw, on my 6.2 it never changes 'Processes' count on 'S' press and always shows all(+system ) procs (as if it in 'S' mode). Base top does it. That is because 3.81 top has different semantics between active procs and total ones. 'Processes' count displays active procs (+ threads in 'H' mode). My small patch represents this. The first number displays actually displayed procs(and threads) and the second one displays all procs(and threads) in system. Index: top/freebsd-top-3.8b1-A/contrib/top/top.c ==================================================================--- top/freebsd-top-3.8b1-A/contrib/top/top.c (revision 5702) +++ top/freebsd-top-3.8b1-A/contrib/top/top.c (working copy) @@ -567,7 +567,8 @@ i_loadave(system_info.last_pid, system_info.load_avg); i_uptime(&(gstate->statics->boottime), &curr_time); i_timeofday(&curr_time); - i_procstates(system_info.p_total, system_info.procstates, gstate->pselect.threads); + i_procstates(system_info.p_total, system_info.p_active, + system_info.procstates, gstate->pselect.threads); if (gstate->show_cpustates) { i_cpustates(system_info.cpustates); @@ -601,7 +602,8 @@ u_loadave(system_info.last_pid, system_info.load_avg); i_timeofday(&curr_time); u_uptime(&(gstate->statics->boottime), &curr_time); - u_procstates(system_info.p_total, system_info.procstates, gstate->pselect.threads); + u_procstates(system_info.p_total, system_info.p_active, + system_info.procstates, gstate->pselect.threads); u_cpustates(system_info.cpustates); u_kernel(system_info.kernel); u_memory(system_info.memory); Index: top/freebsd-top-3.8b1-A/contrib/top/display.c ==================================================================--- top/freebsd-top-3.8b1-A/contrib/top/display.c (revision 5702) +++ top/freebsd-top-3.8b1-A/contrib/top/display.c (working copy) @@ -1042,6 +1042,7 @@ } static int ltotal = 0; +static int lactive = 0; static int lthreads = 0; /* @@ -1050,13 +1051,14 @@ void -i_procstates(int total, int *brkdn, int threads) +i_procstates(int total, int active, int *brkdn, int threads) { /* write current number of processes and remember the value */ display_fmt(0, y_procstate, 0, 0, - "%d %s: ", total, threads ? "threads" : "processes"); + "%d/%d %s: ", active, total, threads ? "threads" : "processes"); ltotal = total; + lactive = active; /* remember where the summary starts */ x_procstate = virt_x; @@ -1073,24 +1075,24 @@ } void -u_procstates(int total, int *brkdn, int threads) +u_procstates(int total, int active, int *brkdn, int threads) { /* if threads state has changed, do a full update */ if (lthreads != threads) { - i_procstates(total, brkdn, threads); + i_procstates(total, active, brkdn, threads); return; } /* update number of processes only if it has changed */ - if (ltotal != total) + if (ltotal != total || lactive != active) { display_fmt(0, y_procstate, 0, 0, - "%d", total); + "%d/%d", active, total); /* if number of digits differs, rewrite the label */ - if (digits(total) != digits(ltotal)) + if (digits(total) != digits(ltotal) || digits(active) != digits(lactive)) { display_fmt(-1, -1, 0, 0, " %s: ", threads ? "threads" : "processes"); x_procstate = virt_x; @@ -1098,6 +1100,7 @@ /* save new total */ ltotal = total; + lactive = active; } /* see if any of the state numbers has changed */ Index: top/freebsd-top-3.8b1-A/contrib/top/display.h ==================================================================--- top/freebsd-top-3.8b1-A/contrib/top/display.h (revision 5702) +++ top/freebsd-top-3.8b1-A/contrib/top/display.h (working copy) @@ -49,8 +49,8 @@ void i_uptime(time_t *bt, time_t *tod); void u_uptime(time_t *bt, time_t *tod); void i_timeofday(time_t *tod); -void i_procstates(int total, int *brkdn, int threads); -void u_procstates(int total, int *brkdn, int threads); +void i_procstates(int total, int active, int *brkdn, int threads); +void u_procstates(int total, int active, int *brkdn, int threads); void i_cpustates(int *states); void u_cpustates(int *states); void z_cpustates(); -- wbr, pluknet _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
On Sun, Sep 28, 2008 at 03:46:20PM +1000, Edwin Groothuis wrote:> I have made an update for the top(1) utility in the FreeBSD base > system to get it from the 3.5b12 version to the 3.8b1 version. >[...]> Please report any issues with it (compile time, run time) and a way > to reproduce it (if possible). Thanks for your help! >There's an overflow bug in format_k2 in 3.5b12 that means that top can corrupt the SIZE field of processes which allocate 2TB or more of memory; that seems to be fixed in 3.8b1 but I've noticed that if a process allocates over 2TB then it doesn't show up at the top of the display when sorting by SIZE in 3.8b1; I suspect there must be another overflow somewhere. I'm sure it'll be a good few years before anyone actually hits this bug running real programs, but I don't know if it might affect other things. -- Bruce Cran -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20081219/fe38a1a6/attachment.pgp