[PATCH v2] bloat-o-meter: line wrapped at 75 columns instead of 80

Jones Syue 薛懷宗 jonessyue at qnap.com
Wed Mar 13 01:22:00 UTC 2024


> This patch replaces the 78 "-" prints with 75 "-". And replace the 80
> columns summary line with 77 columns. ("%s" is considered as two chars
> and should be filled with whitespace " ", so 77 = 75 + 2)

This is an example which showing how this patch wrapped line to 75 columns,
use awk to count the line length and prepend it to each line's head[1].
Before applying this patch, the seperation line and summary line are 
wrapped to 78 columns:

72 crond_dummy_func                                       -     211    +211
72 .rodata                                            59300   59404    +104
72 crond_main                                           704     709      +5
72 static.crond_dummy_local_int                           -       4      +4
72 crond_dummy_global_int                                 -       4      +4
78 ------------------------------------------------------------------------------
78 (add/remove: 3/0 grow/shrink: 2/0 up/down: 328/0)             Total: 328 bytes

After applying this patch, the seperation line and summary line are 
wrapped to 75 columns:

72 crond_dummy_func                                       -     211    +211
72 .rodata                                            59300   59404    +104
72 crond_main                                           704     709      +5
72 static.crond_dummy_local_int                           -       4      +4
72 crond_dummy_global_int                                 -       4      +4
75 ---------------------------------------------------------------------------
75 (add/remove: 3/0 grow/shrink: 2/0 up/down: 328/0)          Total: 328 bytes

[1]
while read -r line; \
do \
  awk '{ print length, $line }'; \
done < <(~/busybox/scripts/bloat-o-meter ~/busybox_unstripped_{orig,fix});

--
Regards,
Jones Syue | 薛懷宗
QNAP Systems, Inc.


More information about the busybox mailing list