[PATCH] add nmeter applet

Rob Landley rob at landley.net
Tue Feb 14 02:44:03 UTC 2006


On Tuesday 14 February 2006 2:29 am, Denis Vlasenko wrote:
> > Ok, looking slightly more closely at it, you have a point.  I was misled
> > by the "based on nanotop.c" comment, and thought it was collecting what I
> > always consider the most useful statistic: percentage CPU usage in user,
> > system, iowait, and idle (which requires iterating through processes
> > because loadavg just doesn't cut it).
>
> Not true. nmeter's collect_cpu() uses this /proc file in order to get nice
> CPU usage bar:
>
> # cat /proc/stat
> cpu  16091 0 5029 119503 15712 395 399 0
> cpu0 16091 0 5029 119503 15712 395 399 0
> ...  ^^^^^ ^ ^^^^
>      usr nice sys idle iowait irq softirq steal
>
> (dunno what is "steal", I just looked into
> linux-2.6.15.1.org/fs/proc/proc_misc.c)

Yup.  (Reading up on it.  Never implemented a top variant myself before.)

That's in jiffies.  You have to figure out how many jiffies per second there 
are (top.c has the world's ugliest hack for this), and snapshot previous 
values in order to turn that into percentage usage over any given time 
period.  But it seems pretty straightforward, and the jiffy determination 
wouldn't be so bad if it was in libbb...

> > I want to look at this more closely, which means after 1.1.1 ships. 
> > (It's close, I just got sidetracked _again_...)
>
> No problem.

Not getting sidetracked on this right now.  Poking at bug list for low hanging 
fruit, then going to bed...

The makefile's been updated with the new sed invocation and the USE() macros, 
and I've a checkin to date.c pending about another hour's work (probably not 
tonight).

The three blocking bugs off the top of my head are mount (which is actually a 
bundle of around 5 bugs, but I've got a handle on that), sed handling null 
bytes (hopefully I'll get that checked in tomorrow), and the whole passwd.c 
upgrade and salt usage (which involves factoring out the sha1 code and 
resurrecting sha1 password support, to do it properly).

Anything else that's "must have" for the 1.1.1 release?

Rob
> --
> vda

-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list