Re: [PATCH v2] top: fix and merge code to parse /proc/meminfo

2014-07-29 Thread Denys Vlasenko
Fixed in git, thanks! ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox

Re: [PATCH v2] top: fix and merge code to parse /proc/meminfo

2014-07-28 Thread Timo Teras
On Sun, 27 Jul 2014 21:50:28 +0200 Denys Vlasenko vda.li...@googlemail.com wrote: On Mon, Jul 21, 2014 at 1:14 PM, Timo Teräs timo.te...@iki.fi wrote: display_header() code to parse meminfo as is was buggy: - uninitialized variables were used if meminfo was not as expected - meminfo

Re: [PATCH v2] top: fix and merge code to parse /proc/meminfo

2014-07-28 Thread Ralf Friedl
Timo Teras wrote: On Sun, 27 Jul 2014 21:50:28 +0200 Denys Vlasenko vda.li...@googlemail.com wrote: Applied, thanks! Thanks, though I noticed now a weirdness that did not happen before. +static void parse_meminfo(unsigned long meminfo[MI_MAX]) +{ ... + memset(meminfo, 0,

Re: [PATCH v2] top: fix and merge code to parse /proc/meminfo

2014-07-28 Thread Timo Teras
On Mon, 28 Jul 2014 16:27:37 +0200 Ralf Friedl ralf.fri...@online.de wrote: Timo Teras wrote: On Sun, 27 Jul 2014 21:50:28 +0200 Denys Vlasenko vda.li...@googlemail.com wrote: Applied, thanks! Thanks, though I noticed now a weirdness that did not happen before. +static void

Re: [PATCH v2] top: fix and merge code to parse /proc/meminfo

2014-07-28 Thread Bartosz Gołaszewski
2014-07-28 17:25 GMT+02:00 Timo Teras timo.te...@iki.fi: So something like: diff --git a/procps/top.c b/procps/top.c index 62f9421..119c32b 100644 --- a/procps/top.c +++ b/procps/top.c @@ -536,7 +536,7 @@ static void parse_meminfo(unsigned long meminfo[MI_MAX]) FILE *f;

Re: [PATCH v2] top: fix and merge code to parse /proc/meminfo

2014-07-28 Thread Timo Teras
On Mon, 28 Jul 2014 17:52:41 +0200 Bartosz Gołaszewski bartekg...@gmail.com wrote: 2014-07-28 17:25 GMT+02:00 Timo Teras timo.te...@iki.fi: So something like: diff --git a/procps/top.c b/procps/top.c index 62f9421..119c32b 100644 --- a/procps/top.c +++ b/procps/top.c @@ -536,7

Re: [PATCH v2] top: fix and merge code to parse /proc/meminfo

2014-07-28 Thread Bartosz Gołaszewski
2014-07-28 18:48 GMT+02:00 Timo Teras timo.te...@iki.fi: I was taking sizeof of individual element: meminfo[0]. Alternative would be sizeof *meminfo. I prefer not to expand to the actual type. It's easier to change if needed, and the correctness more obvious as you don't need to look what was

Re: [PATCH v2] top: fix and merge code to parse /proc/meminfo

2014-07-27 Thread Denys Vlasenko
On Mon, Jul 21, 2014 at 1:14 PM, Timo Teräs timo.te...@iki.fi wrote: display_header() code to parse meminfo as is was buggy: - uninitialized variables were used if meminfo was not as expected - meminfo parsing failed on new kernels (3.14+) as new field 'MemAvailable' was introduced between

[PATCH v2] top: fix and merge code to parse /proc/meminfo

2014-07-21 Thread Timo Teräs
display_header() code to parse meminfo as is was buggy: - uninitialized variables were used if meminfo was not as expected - meminfo parsing failed on new kernels (3.14+) as new field 'MemAvailable' was introduced between MemFree and Buffers - shared memory was handled only for ancient kernels