Age | Commit message (Collapse) | Author |
|
Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by
Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower
overhead call to bb_perror_msg() when only a string was being printed
with no parameters. This saves space for some CPU architectures because
it avoids the overhead of a call to a variadic function. However there
has never been a simple version of bb_error_msg(), and since 2007 many
new calls to bb_perror_msg() have been added that only take a single
parameter and so could have been using bb_simple_perror_message().
This changeset introduces 'simple' versions of bb_info_msg(),
bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and
bb_herror_msg_and_die(), and replaces all calls that only take a
single parameter, or use something like ("%s", arg), with calls to the
corresponding 'simple' version.
Since it is likely that single parameter calls to the variadic functions
may be accidentally reintroduced in the future a new debugging config
option WARN_SIMPLE_MSG has been introduced. This uses some macro magic
which will cause any such calls to generate a warning, but this is
turned off by default to avoid use of the unpleasant macros in normal
circumstances.
This is a large changeset due to the number of calls that have been
replaced. The only files that contain changes other than simple
substitution of function calls are libbb.h, libbb/herror_msg.c,
libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c,
networking/udhcp/common.h and util-linux/mdev.c additonal macros have
been added for logging so that single parameter and multiple parameter
logging variants exist.
The amount of space saved varies considerably by architecture, and was
found to be as follows (for 'defconfig' using GCC 7.4):
Arm: -92 bytes
MIPS: -52 bytes
PPC: -1836 bytes
x86_64: -938 bytes
Note that for the MIPS architecture only an exception had to be made
disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h)
because it made these files larger on MIPS.
Signed-off-by: James Byrne <james.byrne@origamienergy.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Patch by Luís Marques <luismarques@lowrisc.org>
function old new delta
lpd_main 749 757 +8
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Kconfig-language.txt was deleted in commit 4fa499a17b52b back in 2006.
Move to docs/ as suggested by Xabier Oneca:
http://lists.busybox.net/pipermail/busybox/2014-May/080914.html
Also update references to it everywhere.
Signed-off-by: Kartik Agaram <akkartik@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
By the time we reach exit in parent, child already exited or execed.
We should not re-run libc cleanup code.
While at it, introduce bb_daemon_helper() and add a few comments.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Those two spaces after tab have no effect, and always a nuisance when editing.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
It confused me more than once
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Benefits are: drops reference to out-of-line putchar(), fixes a few cases
of failed string merge.
function old new delta
i2cdump_main 1488 1502 +14
sha256_process_block64 423 433 +10
sendmail_main 1183 1185 +2
list_table 1114 1116 +2
i2cdetect_main 1235 1237 +2
fdisk_main 2852 2854 +2
builtin_type 119 121 +2
unicode_conv_to_printable2 325 324 -1
scan_recursive 380 378 -2
mkfs_minix_main 2687 2684 -3
buffer_fill_and_print 178 169 -9
putchar 152 - -152
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 7/4 up/down: 34/-167) Total: -133 bytes
text data bss dec hex filename
937788 932 17676 956396 e97ec busybox_old
937564 932 17676 956172 e970c busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
unix_do_one 548 540 -8
process_timer_stats 508 500 -8
process_irq_counts 532 524 -8
lpd_main 839 831 -8
hwclock_main 502 494 -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/6 up/down: 0/-50) Total: -40 bytes
Signed-off-by: Ron Yorston <rmy@tigress.co.uk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
packed_usage 28706 28623 -83
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
xmalloc_reads
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
|
|
This change retains "or later" state! No licensing _changes_ here,
only form is adjusted (article, space between "GPL" and "v2" and so on).
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
BB_EXECVP_or_die - 47 +47
time_main 1042 1043 +1
chrt_main 371 364 -7
ionice_main 292 282 -10
setsid_main 69 56 -13
nohup_main 236 223 -13
cttyhack_main 266 253 -13
chroot_main 94 81 -13
chpst_main 746 733 -13
timeout_main 297 279 -18
taskset_main 541 522 -19
vfork_child 67 45 -22
parse 975 953 -22
lpd_main 770 748 -22
launch_helper 192 170 -22
tcpudpsvd_main 1810 1782 -28
nice_main 190 156 -34
env_main 242 206 -36
run_command 221 174 -47
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/17 up/down: 48/-352) Total: -304 bytes
Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
xgetpwuid - 27 +27
uid2uname_utoa - 22 +22
gid2group_utoa - 22 +22
uid2uname - 18 +18
gid2group - 18 +18
buffer_fill_and_print 179 196 +17
print_user 12 24 +12
print_group 12 24 +12
get_cached 89 99 +10
...
print_common 134 120 -14
vlock_main 415 396 -19
logger_main 410 387 -23
crontab_main 642 609 -33
bb_getpwuid 42 - -42
bb_getgrgid 42 - -42
bb_getug 80 - -80
------------------------------------------------------------------------------
(add/remove: 6/3 grow/shrink: 9/11 up/down: 187/-296) Total: -109 bytes
|
|
|
|
lpqr_main 1114 1149 +35
lpd_main 748 768 +20
|
|
|
|
instead of xmalloc_open_read_close.
function old new delta
xmalloc_xopen_read_close - 34 +34
xmalloc_open_read_close 163 171 +8
passwd_main 1070 1074 +4
rexecve 254 257 +3
handle_incoming_and_exit 2657 2659 +2
parse_command 1509 1510 +1
buffer_fill_and_print 76 73 -3
evaltreenr 599 589 -10
evaltree 599 589 -10
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/3 up/down: 52/-23) Total: 29 bytes
|
|
lpd_main 761 747 -14
|
|
|
|
|
|
*: trailing whitespace removal
|
|
as this is not needed.
|
|
|
|
function old new delta
exec_helper - 227 +227
sane 66 117 +51
packed_usage 23806 23828 +22
lpd_main 486 504 +18
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 3/0 up/down: 318/0) Total: 318 bytes
|
|
function old new delta
tftp_protocol - 1173 +1173
tftpd_main - 500 +500
tftp_option_get - 102 +102
packed_usage 23650 23662 +12
applet_names 1809 1815 +6
applet_main 1100 1104 +4
applet_nameofs 550 552 +2
tftp_main 302 301 -1
get_nport 32 - -32
tftp 1172 - -1172
------------------------------------------------------------------------------
(add/remove: 3/2 grow/shrink: 4/1 up/down: 1799/-1205) Total: 594 bytes
text data bss dec hex filename
796479 662 7420 804561 c46d1 busybox_old
797153 662 7420 805235 c4973 busybox_unstripped
|
|
function old new delta
procps_scan 1265 1298 +33
aliascmd 278 283 +5
parse_file_cmd 116 120 +4
dname_enc 373 377 +4
setcmd 90 93 +3
execcmd 57 60 +3
count_lines 72 74 +2
process_command_subs 340 339 -1
test_main 409 407 -2
mknod_main 179 177 -2
handle_incoming_and_exit 2653 2651 -2
argstr 1312 1310 -2
shiftcmd 131 128 -3
exitcmd 46 43 -3
dotcmd 297 294 -3
breakcmd 86 83 -3
evalpipe 353 349 -4
evalcommand 1180 1176 -4
evalcmd 109 105 -4
send_tree 374 369 -5
mkfifo_main 82 77 -5
evalsubshell 152 147 -5
typecmd 75 69 -6
letcmd 61 55 -6
add_cmd 1190 1183 -7
main 891 883 -8
ash_main 1415 1407 -8
parse_stream 1377 1367 -10
alloc_procps_scan 55 - -55
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148) Total: -94 bytes
text data bss dec hex filename
797195 658 7428 805281 c49a1 busybox_old
797101 658 7428 805187 c4943 busybox_unstripped
|
|
|
|
|
|
lpr: more robust error reporting
*: introduce and use xchroot
libbb: full_read/write now will report partial data counts prior to error
isdirectory.c: style fixes
lpd_main 249 486 +237
xchroot - 29 +29
get_response_or_say_and_die 110 139 +29
full_write 52 60 +8
full_read 55 63 +8
static.newline 1 - -1
switch_root_main 404 400 -4
chpst_main 1089 1079 -10
getopt32 1370 1359 -11
chroot_main 115 101 -14
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 4/4 up/down: 311/-40) Total: 271 bytes
text data bss dec hex filename
798472 728 7484 806684 c4f1c busybox_old
798775 728 7484 806987 c504b busybox_unstripped
|
|
|
|
|
|
|
|
|
|
|
|
|
|
text data bss dec hex filename
392 0 0 392 188 lpq.o
1378 0 0 1378 562 lpr.o
142 0 0 142 8e parse_prt.o
|