[PATCH] new applet: nmeter

Bernhard Fischer rep.nop at aon.at
Thu Jul 6 15:49:49 UTC 2006


On Thu, Jul 06, 2006 at 05:37:28PM +0200, Denis Vlasenko wrote:
>On Wednesday 05 July 2006 23:31, Bernhard Fischer wrote:
>> >> looks rather large relative to what it does.
>> >

>> What about expanding S_STAT() and MALLOC_STAT()? The latter looks like
>> it wants xmalloc() instead of malloc.
>
>xmalloc - done. Do you mean - get rid of macros nd expand them by hand?

Yes. I think it would be more readable then, but that may be just me..

>> >+0000021c t collect_blk - large because has both 2.4 and 2.6 functions
>> 
>> Perhaps it's worthwile to be able to toggle support for 2.4 and 2.6
>> separately in the config-machinery like we already have for modutils?
>
>I mostly merged 2.4 and 2.6 code instead. The code which is different
>for 2.4/2.6 is just:
>
>        if (is26) {
>                i = rdval_diskstats(prepare(&proc_diskstats), data);
>        } else {
>                i = rdval(prepare(&proc_stat), s->lookfor, data, 1, 2);
>                // Linux 2.4 reports bio in Kbytes, convert to sectors:
>                data[0] *= 2;
>                data[1] *= 2;
>        }

Looks better, yes. Still should there be the possibility to turn 2.6 or
2.4 support completely off? It would save at lease the int if not more..

>> I'd certainly perfer the possibility to turn off support for a series i
>> will never run on.
>> 
>> >+00000292 T nmeter_main
>> >+000002b7 t collect_cpu
>> 
>> Didn't look, but is this memset stanza really needed/benefical in collect_cpu?
>
>It is used fot filling the cpu bar:
>
>[SSSSSSSSSSSSSUUUUUUUUUUUUUUUUDDDDDDDDDDDDDDDDD.............]
>
>How do you propose to do it?

Ah, the memset is of course ok then.
cheers,



More information about the busybox mailing list