On Tue, 2005-05-10 at 18:26 +0300, Giorgos Keramidas wrote:> On 2005-05-10 10:41, Andre Guibert de Bruet <andy@siliconlandmark.com> wrote: > > On Tue, 10 May 2005, Skip Ford wrote: > > > PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU CPU > > > COMM > > >AND > > >1352 skip 1 96 0 18968K 16276K select 0:21 0.00% 0.00% > > >Xor > > > 691 skip 1 8 0 4784K 3940K wait 0:08 0.00% 0.00% > > > mut > > > 684 skip 1 96 0 2336K 1948K select 0:07 0.00% 0.00% > > > scr > > > 667 root 1 4 0 24268K 23196K accept 0:06 0.00% 0.00% > > > per > > > 580 root 1 20 0 22896K 21948K pause 0:04 0.00% 0.00% > > > per > > > 447 root 1 96 0 2864K 1724K select 0:02 0.00% 0.00% > > > ntp > > > > What is the length of the longest username that you have on your system? > > Ah, yes! Good thought. This could affect the width of the USERNAME > column and push everything too far to the right. If this is the case, > I'd probably vote for optionally limiting the length of the username > column to, say, 8 columns at most.I would also vote for limiting it to 8 characters. Even with longer usernames, I suspect 8 characters will be enough to identify particular users (and if it's not there is always they UID view). Doing this would also allow us to eliminate the nasty code in src/usr.bin/top/machine.c which causes top to be unusable on a machine with a significant number of user accounts. See http://lists.freebsd.org/pipermail/freebsd-stable/2005-April/014275.html for details. Gavin
On 2005-05-11 13:50, Gavin Atkinson <gavin.atkinson@ury.york.ac.uk> wrote:>> Ah, yes! Good thought. This could affect the width of the USERNAME >> column and push everything too far to the right. If this is the case, >> I'd probably vote for optionally limiting the length of the username >> column to, say, 8 columns at most. > > I would also vote for limiting it to 8 characters. Even with longer > usernames, I suspect 8 characters will be enough to identify particular > users (and if it's not there is always they UID view).That's an option too. I'm currently trying to get top to display something like this (80 columns are used for text, so use a slightly wider terminal to view this properly: -------------------------------------------------------------------------------+ last pid: 11090; load averages: 1.27, 1.26, 0.86 up 0+01:11:11 03:07:43| 71 processes: 3 running, 68 sleeping | CPU states: 11.2% user, 0.0% nice, 77.1% system, 0.8% interrupt, 10.9% idle | Mem: 50M Active, 348M Inact, 70M Wired, 20M Cache, 60M Buf, 6340K Free | Swap: 5000M Total, 5000M Free | | PID USERNAME PRI NICE SIZE RES STATE TIME WCPU COMMAND/NTHR | 4738 root 108 0 1360K 836K RUN 1:28 22.80% find/1 | 638 giorgos -8 0 13496K 4672K pcmwr 1:33 1.03% mpg123/1 | 11062 giorgos 96 0 2428K 1520K RUN 0:00 1.54% top/1 | -------------------------------------------------------------------------------+ This includes at least the following changes (some not visible): + The entire header line is limited to the window width too. + The USERNAME column is hard-limited to 8 characters. + The THR column is displayed as /1 after the COMMAND, like the prstat(1M) command of recent Solaris versions. + The CPU/WCPU columns occupy the same space and can be toggled with the 'C' keyboard command. + When UID numbers are displayed, hitting 'u' will read a UID instead of a username. + When the view is toggled between processes/threads, the NTHR part becomes the thread ID of the particular thread. Hopefully, I'll have these changes running on CURRENT before the weekend. If no strong objections are voiced for any of these changes, I'll test it on CURRENT for a while, then ask for approval of a commit to HEAD and merge it to 5-STABLE after it's been tested enough on CURRENT. - Giorgos
Hello! In message to <freebsd-stable@freebsd.org> sent Wed, 11 May 2005 13:50:07 +0100 you wrote: >> Ah, yes! Good thought. This could affect the width of the USERNAME >> column and push everything too far to the right. If this is the case, >> I'd probably vote for optionally limiting the length of the username >> column to, say, 8 columns at most. GA> I would also vote for limiting it to 8 characters. Even with longer GA> usernames, I suspect 8 characters will be enough to identify particular GA> users (and if it's not there is always they UID view). GA> Doing this would also allow us to eliminate the nasty code in GA> src/usr.bin/top/machine.c which causes top to be unusable on a machine GA> with a significant number of user accounts. See GA> http://lists.freebsd.org/pipermail/freebsd-stable/2005-April/014275.htm GA> l for details. Another idea, may I? Make USERNAME column 8-char's wide first, and expand it later whenever longer username needs to be displayed - no built-in length limit - no need to scan all usernames at start -- Slawomir Piotrowski