aboutsummaryrefslogtreecommitdiff
path: root/miscutils/hexedit.c
AgeCommit message (Collapse)Author
2020-12-14libbb: add and use infrastructure for fixed page size optimizationDenys Vlasenko
function old new delta procps_scan 1121 1118 -3 getpagesize 6 - -6 rpm_main 1037 1027 -10 rpm2cpio_main 120 110 -10 ptok 38 21 -17 time_main 1282 1261 -21 mkswap_main 317 278 -39 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/6 up/down: 0/-106) Total: -106 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-07-02libbb: reduce the overhead of single parameter bb_error_msg() callsJames Byrne
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>
2018-12-28config: update size informationDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2018-07-23hexedit: fixes for redraw and down movement causing SEGV on attempt to accessDenys Vlasenko
"Go to:" command was not updating row position, making next "down" movements for one screenful print empty lines instead of showing the contents. If the file is whole pages long, "down" movement at EOF was advancing position +16 bytes, mapping the next portion (entirely past the end of the file), then finding out that the new position is beyond the EOF, rolling it back -16 bytes... ending up with this postion pointing *before* the mapped portion. Any next access (e.g. "move right" key) SEGVs. function old new delta hexedit_main 1170 1184 +14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2018-01-14config: add size estimations for a few appletsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-15hexedit: code shrinkDenys Vlasenko
function old new delta hexedit_main 1171 1170 -1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-15hexedit: fixes to "goto address" codeDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-14hexedit: position in correct column on "goto" commandDenys Vlasenko
function old new delta hexedit_main 1169 1202 +33 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-14hexedit: code shrinkDenys Vlasenko
function old new delta hexedit_main 1176 1169 -7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-14hexdump: code shrinkDenys Vlasenko
function old new delta remap 173 178 +5 move_mapping_lower 107 109 +2 move_mapping_further 141 143 +2 hexedit_main 1191 1176 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 9/-15) Total: -6 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-14hexedit: implement "[enter] goto offset" keyDenys Vlasenko
This is a must if you need to edit sector 123456789999 on your /dev/disk. text data bss dec hex filename 922745 481 6832 930058 e310a busybox_old 923023 481 6832 930336 e3220 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-14hexedit: restore screen on exitDenys Vlasenko
function old new delta hexedit_main 998 1082 +84 restore_term - 29 +29 remap 168 173 +5 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 118/0) Total: 118 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-14hexedit: optimize output bufferingDenys Vlasenko
function old new delta hexedit_main 970 998 +28 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-13hexedit: implement page up/downDenys Vlasenko
function old new delta hexedit_main 924 970 +46 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-13hexedit: smarter redrawDenys Vlasenko
function old new delta format_line 197 209 +12 hexedit_main 930 924 -6 redraw_cur_line 104 94 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 12/-16) Total: -4 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-13hexedit: new appletDenys Vlasenko
function old new delta hexedit_main - 930 +930 format_line - 197 +197 remap - 168 +168 move_mapping_further - 141 +141 move_mapping_lower - 107 +107 redraw_cur_line - 104 +104 packed_usage 31802 31812 +10 applet_names 2688 2696 +8 applet_main 1552 1556 +4 applet_suid 97 98 +1 applet_install_loc 194 195 +1 ------------------------------------------------------------------------------ (add/remove: 7/0 grow/shrink: 5/0 up/down: 1671/0) Total: 1671 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>