Re: important newlib patches

Craig Small <[email protected]> Sun, 6 Mar 2022 15:10:31 +1100
Newsgroups gmane.linux.procps.devel
Message-ID <CALy8Cw5=B2nt4Sxq6+zmbHOz9RntxCBDT0TFAkmeNxehuowK2g@mail.gmail.com>
Hi Jim,
  They're now pushed.

I must admit I was a bit dubious about patch 6. Why does %cpu versus pcpu
matter? Seriously from 3.3.0 in 2011? Surely Jim has got something strange
going on here?

$ ps -o %cpu,jimwasright
%CPU COMMAND        pu,jimwasright
 0.0 bash           pu,jimwasright
 0.0 ps             pu,jimwasright

Must be the %c of %cpu is getting snagged on the scanfs somewhere.

Option parsing, is so, so very easy to get wrong. Even the standard getopt
and friends have issues.

 - Craig



On Sat, 5 Mar 2022 at 05:37, Jim Warner <[email protected]> wrote:

> On 2/28/22 3:34 AM, Craig Small wrote:
> > It also depends on how long the system has been up:
> > up 17 days, 11:21,  1 user,  load average: 0.35, 0.65, 1.02
> > ELAPSED of a process is  335,50 which is about 13 days.  But it looks a
> > like neater code-wise anyhow.
> >  ...
> > That's pretty neat actually, CPU load versus total run time.  ps
> > probably should have that too as it makes *way* more sense to use %CUU
> > rather than %CPU in a one-shot setup.
>
> Hi Craig,
>
> Your observation about the ELAPSED value inspired me to refactor top's
> scale_tics function to better reflect times.  Then I inspired myself to
> offer users some control over such scaling.
>
> [ my blind spot is rebooting 9 separate linux distributions daily ]
>
> Also, your comments on ps and cpu utilization further inspired me to add
> that new library item to the ps repertoire.
>
> [ that was before I realized ps already offered 4 similar options ]
>
> And while not at all inspiring, along the way I discovered two insidious
> bugs.  One was in the library and the other was in ps.
>
> The attached represents the vegetables of my efforts (or maybe fruits).
>
> Regards,
>
> Jim
>
> p.s. Now I'm gonna be uninspired for the time being.
>