Re: [PATCH] time: fix max resident set size unit

2023-12-31 Thread Denys Vlasenko
Applied, thank you.

Looks like ALL memory fields are in kbytes, so ptok() is wrong everywhere.
I'm commenting it out.

On Wed, Dec 20, 2023 at 12:30 PM Natanael Copa  wrote:
>
> The ru_maxrss is already in Kbytes and not pages.
>
> function old new   delta
> time_main   11951190  -5
> --
> (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-5)   Total: -5 bytes
>textdata bss dec hex filename
>  828010   142682008  844286   ce1fe busybox_old
>  828005   142682008  844281   ce1f9 busybox_unstripped
>
> fixes: https://bugs.busybox.net/show_bug.cgi?id=15751
> ---
>
> Good catch!
>
> Thanks!
>
>  miscutils/time.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/miscutils/time.c b/miscutils/time.c
> index 5a8fa4c0b..b90b582b0 100644
> --- a/miscutils/time.c
> +++ b/miscutils/time.c
> @@ -281,7 +281,7 @@ static void summarize(const char *fmt, char **command, 
> resource_t *resp)
>  ptok(pagesize, (UL) 
> resp->ru.ru_ixrss)) / cpu_ticks);
> break;
> case 'M':   /* Maximum resident set size.  */
> -   printf("%lu", ptok(pagesize, (UL) 
> resp->ru.ru_maxrss));
> +   printf("%lu", (UL) resp->ru.ru_maxrss);
> break;
> case 'O':   /* Outputs.  */
> printf("%lu", resp->ru.ru_oublock);
> --
> 2.43.0
>
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[PATCH] time: fix max resident set size unit

2023-12-20 Thread Natanael Copa
The ru_maxrss is already in Kbytes and not pages.

function old new   delta
time_main   11951190  -5
--
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-5)   Total: -5 bytes
   textdata bss dec hex filename
 828010   142682008  844286   ce1fe busybox_old
 828005   142682008  844281   ce1f9 busybox_unstripped

fixes: https://bugs.busybox.net/show_bug.cgi?id=15751
---

Good catch!

Thanks!

 miscutils/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/miscutils/time.c b/miscutils/time.c
index 5a8fa4c0b..b90b582b0 100644
--- a/miscutils/time.c
+++ b/miscutils/time.c
@@ -281,7 +281,7 @@ static void summarize(const char *fmt, char **command, 
resource_t *resp)
 ptok(pagesize, (UL) 
resp->ru.ru_ixrss)) / cpu_ticks);
break;
case 'M':   /* Maximum resident set size.  */
-   printf("%lu", ptok(pagesize, (UL) 
resp->ru.ru_maxrss));
+   printf("%lu", (UL) resp->ru.ru_maxrss);
break;
case 'O':   /* Outputs.  */
printf("%lu", resp->ru.ru_oublock);
-- 
2.43.0

___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox