Age | Commit message (Collapse) | Author |
|
function old new delta
packed_usage 33993 34008 +15
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
shells
function old new delta
xgettimeofday - 11 +11
get_local_var_value 280 281 +1
svlogd_main 1323 1322 -1
change_epoch 67 66 -1
timestamp_and_log 461 458 -3
hwclock_main 301 298 -3
fmt_time_bernstein_25 135 132 -3
step_time 331 326 -5
script_main 1207 1202 -5
machtime 34 28 -6
curtime 61 54 -7
ts_main 423 415 -8
nmeter_main 761 751 -10
gettime1900d 67 46 -21
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/12 up/down: 12/-73) Total: -61 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
sleep1 - 9 +9
run_shutdown_and_kill_processes 97 95 -2
restore_state_and_exit 116 114 -2
reread_partition_table 67 65 -2
flush_buffer_cache 80 78 -2
chat_main 1302 1300 -2
timeout_main 310 307 -3
telnet_main 1235 1232 -3
stop_handler 86 83 -3
process_action 1078 1075 -3
nbdclient_main 1185 1182 -3
init_main 789 786 -3
getty_main 1541 1538 -3
do_time 410 407 -3
runsv_main 1682 1677 -5
pause_and_low_level_reboot 59 54 -5
inetd_main 1917 1911 -6
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/16 up/down: 9/-50) Total: -41 bytes
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>
|
|
If logging to stderr and/or syslog the -v option can be given one or
more times to increase the log verbosity. If mdev is used as hotplug
helper the log level is fixed set to 2 if mdev.log is found an appended
because there is no possiblity to pass arguments to the hotplug helper.
Signed-off-by: Jan Klötzke <jan@kloetzke.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
If mdev is run as daemon it should be possible to forward the debug
messages to syslog. This feature might be useful if mdev is run with -s
during boot too. OTOH it makes no sense for the daemon to log to
mdev.log. This can be handled by a syslog daemon way better. If the
daemon stays in the foreground due to -f, the messages are still written
to stderr as before.
Signed-off-by: Jan Klötzke <jan@kloetzke.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
If the netlink read() failed with ENOBUFS we know that we have missed at
least one message due to a socket receive buffer overrun. The only way
how to recover is to drop the old socket, open a fresh one and make a
cold-plug scan of the current system state.
Signed-off-by: Jan Klötzke <jan@kloetzke.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Jan Klötzke <jan@kloetzke.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
The socket receive buffer turned out to be too small for real world
systems. Use the same size as udevd to be on the safe side. As this is
just a limit and the memory is not allocated by the kernel until really
needed there is actually no memory wasted.
Signed-off-by: Jan Klötzke <jan@kloetzke.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
recursive_action1 - 316 +316
file_action_grep 161 164 +3
add_to_prg_cache_if_socket 202 205 +3
depmod_main 509 511 +2
writeFileToTarball 488 489 +1
parse_module 281 282 +1
fileAction 207 208 +1
act 189 190 +1
add_to_dirlist 65 64 -1
writeTarFile 196 194 -2
uuidcache_init 47 45 -2
uuidcache_check_device 109 107 -2
true_action 8 6 -2
run_parts_main 310 308 -2
netstat_main 534 532 -2
lsusb_main 29 27 -2
lspci_main 45 43 -2
initial_scan 138 136 -2
grep_main 845 843 -2
find_main 482 480 -2
config_file_action 437 435 -2
chmod_main 142 140 -2
dirAction 14 10 -4
diff_main 1544 1540 -4
chown_main 154 148 -6
skip_dir 136 129 -7
dir_act 191 184 -7
recursive_action 453 69 -384
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 7/20 up/down: 328/-439) Total: -111 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
PLATFORM_LINUX is a hidden configuration option which is disabled by
default and enabled at over a hundred locations for features that are
deemed to be Linux specific.
The only effect of PLATFORM_LINUX is to control compilation of
libbb/match_fstype.c. This file is only needed by mount and umount.
Remove all references to PLATFORM_LINUX and compile match_fstype.c
if mount or umount is enabled.
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
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>
|
|
function old new delta
create_and_bind_to_netlink - 134 +134
ifplugd_main 1117 1052 -65
uevent_main 399 306 -93
mdev_main 314 215 -99
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/3 up/down: 134/-257) Total: -123 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Adds the -d option to run mdev in daemon mode handling hotplug events
from the kernel like udev. If the system generates many hotplug events
this mode of operation will consume less resources than registering
mdev as hotplug helper or using the uevent applet.
function old new delta
daemon_loop - 152 +152
initial_scan - 127 +127
open_mdev_log - 85 +85
mdev_main 255 314 +59
packed_usage 33284 33316 +32
process_action 1051 992 -59
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 2/1 up/down: 455/-59) Total: 396 bytes
Signed-off-by: Jan Klötzke <jan@kloetzke.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
process_action - 1051 +1051
mdev_main 1324 255 -1069
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 1051/-1069) Total: -18 bytes
Signed-off-by: Jan Klötzke <jan@kloetzke.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
This purely moves code from main() to separate functions for better
extensibility.
Signed-off-by: Jan Klötzke <jan@kloetzke.net>
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>
|
|
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>
|
|
Currently some new devices that have a bus but no class will
be missed by mdev coldplug device creation after boot. This
happens because mdev recursively searches /sys/class which will
by definition only find class devices.
Some important devices such as iio and gpiochip does not have
a class. But users will need them.
This switches from using /sys/class as the place to look for
devices to create to using /sys/dev where all char and block
devices are listed.
The subsystem lookup code that provide the G.subsystem
environment variable is changed from using the directory
name of the class device to instead dereference the
"subsystem" symlink for the device, and look at the last
element of the path of the symlink for the subsystem, which
will work with class devices and bus devices alike. (The new
bus-only devices only symlink to the /sys/bus/* hierarchy.)
We delete the legacy kernel v2.6.2x /sys/block device path
code as part of this change. It's too old to be kept alive.
Tested on kernel v4.6-rc2 with a bunch of devices, including
some IIO and gpiochip devices.
With a print inserted before make_device() the log looks
like so:
Create device from "/sys/dev/char/1:1", subsystem "mem"
Create device from "/sys/dev/char/1:2", subsystem "mem"
Create device from "/sys/dev/char/1:3", subsystem "mem"
Create device from "/sys/dev/char/1:5", subsystem "mem"
(...)
Create device from "/sys/dev/block/179:56", subsystem "block"
Create device from "/sys/dev/block/179:64", subsystem "block"
function old new delta
mdev_main 1388 1346 -42
dirAction 134 14 -120
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-162) Total: -162 bytes
Cc: Isaac Dunham <ibid.ag@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
The config item is FEATURE_USE_BSS_TAIL. When it is off (default):
function old new delta
read_config 210 228 +18
doCommands 2279 2294 +15
ipneigh_list_or_flush 763 772 +9
ipaddr_list_or_flush 1256 1261 +5
display_process_list 1301 1306 +5
conspy_main 1378 1383 +5
do_lzo_compress 352 355 +3
do_lzo_decompress 565 567 +2
push 46 44 -2
inetd_main 2136 2134 -2
uevent_main 421 418 -3
addLines 97 92 -5
bb_common_bufsiz1 8193 1024 -7169
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 8/5 up/down: 62/-7181) Total: -7119 bytes
text data bss dec hex filename
829850 4086 9080 843016 cdd08 busybox_old
829901 4086 1904 835891 cc133 busybox_unstripped
FEATURE_USE_BSS_TAIL=y:
read_config 210 228 +18
doCommands 2279 2294 +15
ipneigh_list_or_flush 763 772 +9
ipaddr_list_or_flush 1256 1261 +5
display_process_list 1301 1306 +5
conspy_main 1378 1383 +5
do_lzo_compress 352 355 +3
do_lzo_decompress 565 567 +2
inetd_main 2136 2134 -2
bb_common_bufsiz1 8193 - -8193
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 8/1 up/down: 62/-8195) Total: -8133 bytes
text data bss dec hex filename
829850 4086 9080 843016 cdd08 busybox_old
829911 4086 880 834877 cbd3d busybox_unstripped
FIXME: setup_common_bufsiz() calls are missing.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
xget_uidgid 30 25 -5
make_device 2188 2183 -5
main 797 792 -5
get_uidgid 240 225 -15
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
make_device 2182 2188 +6
parse_command 1440 1443 +3
parse_params 1497 1499 +2
install_main 773 769 -4
mkdir_main 168 160 -8
getoptscmd 641 632 -9
builtin_umask 158 147 -11
bb_parse_mode 431 410 -21
umaskcmd 286 258 -28
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/6 up/down: 11/-81) Total: -70 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Introduce a library routine to package the idiom:
p = xmalloc(b, n);
memcpy(p, b, n);
and use it where possible. The example in traceroute used xzalloc
but it didn't need to.
function old new delta
xmemdup - 32 +32
last_main 834 826 -8
make_device 2321 2311 -10
common_traceroute_main 3698 3685 -13
readtoken1 3182 3168 -14
procps_scan 1222 1206 -16
forkchild 655 638 -17
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/6 up/down: 32/-78) Total: -46 bytes
Signed-off-by: Ron Yorston <rmy@frippery.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
This was seen to happen if two mdevs are run in parallel,
mdev.seq is empty, and the "newer" one manages to write it first.
function old new delta
mdev_main 1366 1388 +22
atoll - 20 +20
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
is_prefixed_with - 18 +18
complete_username 78 77 -1
man_main 737 735 -2
fsck_device 429 427 -2
unpack_ar_archive 80 76 -4
strip_unsafe_prefix 105 101 -4
singlemount 1054 1050 -4
rtc_adjtime_is_utc 90 86 -4
resolve_mount_spec 88 84 -4
parse_one_line 1029 1025 -4
parse_conf 1460 1456 -4
may_wakeup 83 79 -4
loadkmap_main 219 215 -4
get_irqs_from_stat 103 99 -4
get_header_cpio 913 909 -4
findfs_main 79 75 -4
fbsplash_main 1230 1226 -4
load_crontab 776 771 -5
expand_vars_to_list 1151 1146 -5
date_main 881 876 -5
skip_dev_pfx 30 24 -6
make_device 2199 2193 -6
complete_cmd_dir_file 773 767 -6
run_applet_and_exit 715 708 -7
uudecode_main 321 313 -8
pwdx_main 197 189 -8
execute 568 560 -8
i2cdetect_main 1186 1176 -10
procps_scan 1242 1230 -12
procps_read_smaps 1017 1005 -12
process_module 746 734 -12
patch_main 1903 1891 -12
nfsmount 3572 3560 -12
stack_machine 126 112 -14
process_timer_stats 449 435 -14
match_fstype 111 97 -14
do_ipaddr 1344 1330 -14
open_list_and_close 359 343 -16
get_header_tar 1795 1779 -16
prepend_new_eth_table 340 323 -17
fsck_main 1811 1794 -17
find_iface_state 56 38 -18
dnsd_main 1321 1303 -18
base_device 179 158 -21
find_keyword 104 82 -22
handle_incoming_and_exit 2785 2762 -23
parse_and_put_prompt 774 746 -28
modinfo 347 317 -30
find_action 204 171 -33
update_passwd 1470 1436 -34
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/49 up/down: 18/-540) Total: -522 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
516530c932bd17d87c9eb4347a490be051e495f4 uses $DEVNAME variable
for device node name. This is fine, but only works for hotplugging,
"mdev -s" will behave differently when DEVNAME and basename(path)
differ.
This patch extracts the DEVNAME from the uevent sysfs file in
make_device(), thus works for hot- and coldplugging; so using
the environment DEVNAME on hotplug events is no longer necessary.
Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
The error was "error: 'struct globals' has no member named 'parser'"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Sequential run of concurrent mdev's was too simplistic:
they waited for /dev/mdev.seq to match. This could sometimes
cause cumulative loss of time on the order of a second.
Added SIGCHLD signaling from exiting mdev to all other mdev's.
Added debugging required to see that code actually works as intended.
Example of /dev/mdev.log (with "woken up" elevated from dbg lvl 3 to 2):
mdev[1023]: first seq written
^^^^ seq, not pid
mdev[1023]: 35.022395 ACTION:add SUBSYSTEM:module DEVNAME:(null) DEVPATH:/module/lib80211
mdev[1023]: rule matched, line -1
^^^^^^^ means "default rule"
mdev[1023]: 35.022676 exiting
^^^^^^^^^ second,usec timestamp
mdev[1024]: 35.069691 ACTION:add SUBSYSTEM:vc DEVNAME:vcs9 DEVPATH:/devices/virtual/vc/vcs9
mdev[1024]: dev 7,9
mdev[1025]: 35.069889 waiting for '1024'
mdev[1026]: 35.069946 waiting for '1024'
mdev[1027]: 35.070151 waiting for '1024'
mdev[1024]: rule matched, line -1
mdev[1024]: mknod vcs9 (7,9) 20660 0:0
mdev[1024]: 35.070346 exiting
mdev[1025]: woken up
mdev[1026]: woken up
mdev[1025]: 35.071213 ACTION:add SUBSYSTEM:vc DEVNAME:vcsa9 DEVPATH:/devices/virtual/vc/vcsa9
^^^^^^^^^ took only a millisecond to start running after prev mdev exited
mdev[1025]: dev 7,137
mdev[1027]: woken up
mdev[1025]: rule matched, line -1
mdev[1025]: mknod vcsa9 (7,137) 20660 0:0
mdev[1025]: 35.072109 exiting
function old new delta
mdev_main 849 1372 +523
curtime - 59 +59
dirAction 87 134 +47
static.ts - 8 +8
keywords 19 12 -7
make_device 2189 2119 -70
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
make_device 1998 2189 +191
clean_up_cur_rule 61 96 +35
dirAction 75 87 +12
mdev_main 838 849 +11
packed_usage 29272 29273 +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/0 up/down: 250/0) Total: 250 bytes
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
mdev_main 797 801 +4
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
|
|
It was colliding with matching of devnames with slashes.
We need a more generic way to examine env.vars in rules anyway.
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
make_device 1843 2083 +240
mdev_main 712 804 +92
packed_usage 29236 29251 +15
keywords 288 19 -269
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 347/-269) Total: 78 bytes
text data bss dec hex filename
887506 497 7584 895587 daa63 busybox_old
887982 497 7584 896063 dac3f busybox_unstripped
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: Javier Viguera <javier.viguera@digi.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|