Re: top: align CPU lines horizontally

2022-09-05 Thread Klemens Nanni
cheloha's "days" fix for top(1) reminded me of this diff in my tree. original thread: https://marc.info/?l=openbsd-tech=157089317007317=2 On Sun, Oct 13, 2019 at 01:58:43AM +0200, Klemens Nanni wrote: > On Sat, Oct 12, 2019 at 05:38:13PM -0500, Scott Cheloha wrote: > > Also, just count how many

Re: top: align CPU lines horizontally

2019-10-13 Thread Mark Kettenis
> Date: Sun, 13 Oct 2019 01:58:43 +0200 > From: 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

RE: top: align CPU lines horizontally

2019-10-13 Thread zeurkous
[not subscribed, please Cc, thanks] Through the archives, me's watched this discussion with some bemusement. Me'd like to see another option considered: just printing the device name, instead of using the custom CPU* format. No patch right now, might come tonight, claws full of other work :(

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

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,

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,

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 > >

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

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

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: 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%