Re: top: align CPU lines horizontally

2019-10-12 Thread Ted Unangst
Klemens Nanni wrote: > On Sat, Oct 12, 2019 at 05:38:13PM -0500, Scott Cheloha wrote: > > Also, just count how many spaces we need to print ncpuonline, > > then use that when printing the individual CPU lines. > Yup, here's a minimal diff that does that without additional buffers and > globals but

Re: top: align CPU lines horizontally

2019-10-12 Thread Klemens Nanni
On Sat, Oct 12, 2019 at 05:38:13PM -0500, Scott Cheloha wrote: > Also, just count how many spaces we need to print ncpuonline, > then use that when printing the individual CPU lines. Yup, here's a minimal diff that does that without additional buffers and globals but a single local static padding;

Re: top: align CPU lines horizontally

2019-10-12 Thread Scott Cheloha
On Sat, Oct 12, 2019 at 11:59:30PM +0200, Mark Kettenis wrote: > > Date: Sat, 12 Oct 2019 16:52:08 -0500 > > From: Scott Cheloha > > > > On Sat, Oct 12, 2019 at 02:51:04PM -0400, Ted Unangst wrote: > > > Klemens Nanni wrote: > > > > On Sat, Oct 12, 2019 at 09:53:44AM -0600, Theo de Raadt wrote: >

Re: top: align CPU lines horizontally

2019-10-12 Thread Mark Kettenis
> Date: Sat, 12 Oct 2019 16:52:08 -0500 > From: Scott Cheloha > > On Sat, Oct 12, 2019 at 02:51:04PM -0400, Ted Unangst wrote: > > Klemens Nanni wrote: > > > On Sat, Oct 12, 2019 at 09:53:44AM -0600, Theo de Raadt wrote: > > > > I am suggesting you put the spaces after the cpu#. > > > Is this bet

Re: top: align CPU lines horizontally

2019-10-12 Thread Scott Cheloha
On Sat, Oct 12, 2019 at 02:51:04PM -0400, Ted Unangst wrote: > Klemens Nanni wrote: > > On Sat, Oct 12, 2019 at 09:53:44AM -0600, Theo de Raadt wrote: > > > I am suggesting you put the spaces after the cpu#. > > Is this better? > > > > 4 CPUs: 0.0% user, 0.0% nice, 0.0% sys, 0.0% spin, 0.0%

Re: top: align CPU lines horizontally

2019-10-12 Thread Ted Unangst
Klemens Nanni wrote: > On Sat, Oct 12, 2019 at 09:53:44AM -0600, Theo de Raadt wrote: > > I am suggesting you put the spaces after the cpu#. > Is this better? > > 4 CPUs: 0.0% user, 0.0% nice, 0.0% sys, 0.0% spin, 0.0% intr, 100% > idle > > CPU 0 : 0.0% user, 0.0% nice, 0.0% sys, 0

Re: top: align CPU lines horizontally

2019-10-12 Thread Mark Kettenis
> Date: Sat, 12 Oct 2019 18:54:19 +0200 > From: Klemens Nanni > > On Sat, Oct 12, 2019 at 09:53:44AM -0600, Theo de Raadt wrote: > > I am suggesting you put the spaces after the cpu#. > Is this better? > > 4 CPUs: 0.0% user, 0.0% nice, 0.0% sys, 0.0% spin, 0.0% intr, 100% > idle > > CP

Re: sxipwm, pwmbl - work in progress, simplefb integration?

2019-10-12 Thread Mark Kettenis
Hi Krystian, I started working on integrating this. I fixed some small style issues (long lines, spaces, redundant braces). From various bits of documentation and a glance at the Linux driver it seems the list of prescaling factors is identical for all Allwinner SoCs. So I turned the array of p

Re: top: align CPU lines horizontally

2019-10-12 Thread Theo de Raadt
Klemens Nanni wrote: > On Sat, Oct 12, 2019 at 09:53:44AM -0600, Theo de Raadt wrote: > > I am suggesting you put the spaces after the cpu#. > Is this better? > > 4 CPUs: 0.0% user, 0.0% nice, 0.0% sys, 0.0% spin, 0.0% intr, 100% > idle > > CPU 0 : 0.0% user, 0.0% nice, 0.0% sys,

Re: top: align CPU lines horizontally

2019-10-12 Thread Klemens Nanni
On Sat, Oct 12, 2019 at 09:53:44AM -0600, Theo de Raadt wrote: > I am suggesting you put the spaces after the cpu#. Is this better? 4 CPUs: 0.0% user, 0.0% nice, 0.0% sys, 0.0% spin, 0.0% intr, 100% idle CPU 0 : 0.0% user, 0.0% nice, 0.0% sys, 0.0% spin, 0.0% intr, 100% idle CPU

Re: top: align CPU lines horizontally

2019-10-12 Thread Theo de Raadt
Klemens Nanni wrote: > On Sat, Oct 12, 2019 at 09:15:52AM -0600, Theo de Raadt wrote: > > CPU0: 0.0% user, 0.0% nice, 0.0% sys, 0.0% spin, 0.0% intr, 100% > > idle > > > > You've solved an inconsistancy, but choosing spacing like this doesn't make > > sense to me. > I could make it al

Re: top: align CPU lines horizontally

2019-10-12 Thread Klemens Nanni
On Sat, Oct 12, 2019 at 09:15:52AM -0600, Theo de Raadt wrote: > CPU0: 0.0% user, 0.0% nice, 0.0% sys, 0.0% spin, 0.0% intr, 100% > idle > > You've solved an inconsistancy, but choosing spacing like this doesn't make > sense to me. I could make it always use the minimum amount of spaces

Re: top: align CPU lines horizontally

2019-10-12 Thread Theo de Raadt
CPU0: 0.0% user, 0.0% nice, 0.0% sys, 0.0% spin, 0.0% intr, 100% idle You've solved an inconsistancy, but choosing spacing like this doesn't make sense to me.

top: Error out on too many arguments

2019-10-12 Thread Klemens Nanni
`top -b -- 3 foo bar' works but should not. OK? Index: top.c === RCS file: /cvs/src/usr.bin/top/top.c,v retrieving revision 1.101 diff -u -p -r1.101 top.c --- top.c 8 Oct 2019 20:51:03 - 1.101 +++ top.c 12 Oct

top: align CPU lines horizontally

2019-10-12 Thread Klemens Nanni
Toggling between combined and per CPU statistics always causes the state values to jump left or right; to make matters worse, if the window is wider than 80 columns, per CPU lines start with "CPUx states:" instead of "CPUx:". Examples of all three cases: 4 CPUs: 0.3% user, 0.0% nice, 0.6% s