diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-08 14:35:37 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-08 14:35:37 +0200 |
commit | adf922ec2800d53f5eedd469cf99c55946caeb43 (patch) | |
tree | d6b51f80928fdbf1892c3d4dbaae72fb288b88b9 | |
parent | a7bb3c1396056248a71ea188f217de3f4876947e (diff) | |
download | busybox-w32-adf922ec2800d53f5eedd469cf99c55946caeb43.tar.gz busybox-w32-adf922ec2800d53f5eedd469cf99c55946caeb43.tar.bz2 busybox-w32-adf922ec2800d53f5eedd469cf99c55946caeb43.zip |
*: a few more NOINLINEs
function old new delta
print_linkinfo - 815 +815
do_msg - 783 +783
INET_setroute - 757 +757
varvalue - 746 +746
do_sem - 637 +637
inflate_codes - 617 +617
INET6_setroute - 491 +491
edir - 370 +370
sync_cursor - 298 +298
update_utmp - 246 +246
searchLines - 165 +165
setup_alarm - 144 +144
may_wakeup - 101 +101
getNum 566 371 -195
refresh 1166 848 -318
rtcwake_main 809 479 -330
getty_main 2396 1921 -475
chpst_main 1373 746 -627
inflate_unzip_internal 1335 567 -768
evalvar 1384 612 -772
ipaddr_list_or_flush 2160 1246 -914
route_main 1585 245 -1340
ipcs_main 2523 1049 -1474
------------------------------------------------------------------------------
(add/remove: 13/0 grow/shrink: 0/10 up/down: 6170/-7213) Total: -1043 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | archival/libunarchive/decompress_unzip.c | 2 | ||||
-rw-r--r-- | docs/keep_data_small.txt | 4 | ||||
-rw-r--r-- | editors/ed.c | 2 | ||||
-rw-r--r-- | editors/vi.c | 2 | ||||
-rw-r--r-- | loginutils/getty.c | 2 | ||||
-rw-r--r-- | networking/libiproute/ipaddress.c | 2 | ||||
-rw-r--r-- | networking/route.c | 4 | ||||
-rw-r--r-- | runit/chpst.c | 2 | ||||
-rwxr-xr-x | scripts/mkdiff_obj | 39 | ||||
-rwxr-xr-x | scripts/mkdiff_obj_bloat | 33 | ||||
-rw-r--r-- | shell/ash.c | 2 | ||||
-rw-r--r-- | util-linux/ipcs.c | 4 | ||||
-rw-r--r-- | util-linux/rtcwake.c | 4 |
13 files changed, 89 insertions, 13 deletions
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c index c571ab438..feaa047bd 100644 --- a/archival/libunarchive/decompress_unzip.c +++ b/archival/libunarchive/decompress_unzip.c | |||
@@ -503,7 +503,7 @@ static void inflate_codes_setup(STATE_PARAM unsigned my_bl, unsigned my_bd) | |||
503 | md = mask_bits[bd]; | 503 | md = mask_bits[bd]; |
504 | } | 504 | } |
505 | /* called once from inflate_get_next_window */ | 505 | /* called once from inflate_get_next_window */ |
506 | static int inflate_codes(STATE_PARAM_ONLY) | 506 | static NOINLINE int inflate_codes(STATE_PARAM_ONLY) |
507 | { | 507 | { |
508 | unsigned e; /* table entry flag/number of extra bits */ | 508 | unsigned e; /* table entry flag/number of extra bits */ |
509 | huft_t *t; /* pointer to table entry */ | 509 | huft_t *t; /* pointer to table entry */ |
diff --git a/docs/keep_data_small.txt b/docs/keep_data_small.txt index 2ba24e4a1..079bac3a6 100644 --- a/docs/keep_data_small.txt +++ b/docs/keep_data_small.txt | |||
@@ -245,3 +245,7 @@ subCommand - 841 +841 loss | |||
245 | receive - 834 +834 loss | 245 | receive - 834 +834 loss |
246 | 246 | ||
247 | 855 bytes saved in total. | 247 | 855 bytes saved in total. |
248 | |||
249 | scripts/mkdiff_obj_bloat may be useful to automate this process: run | ||
250 | "scripts/mkdiff_obj_bloat NORMALLY_BUILT_TREE FORCED_NOINLINE_TREE" | ||
251 | and select modules which shrank. | ||
diff --git a/editors/ed.c b/editors/ed.c index 9084a17fb..dbd802075 100644 --- a/editors/ed.c +++ b/editors/ed.c | |||
@@ -951,7 +951,7 @@ static void deleteLines(int num1, int num2) | |||
951 | * Returns the line number which matches, or 0 if there was no match | 951 | * Returns the line number which matches, or 0 if there was no match |
952 | * with an error printed. | 952 | * with an error printed. |
953 | */ | 953 | */ |
954 | static int searchLines(const char *str, int num1, int num2) | 954 | static NOINLINE int searchLines(const char *str, int num1, int num2) |
955 | { | 955 | { |
956 | const LINE *lp; | 956 | const LINE *lp; |
957 | int len; | 957 | int len; |
diff --git a/editors/vi.c b/editors/vi.c index 4decbea17..a24b72303 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -1210,7 +1210,7 @@ static int next_tabstop(int col) | |||
1210 | } | 1210 | } |
1211 | 1211 | ||
1212 | //----- Synchronize the cursor to Dot -------------------------- | 1212 | //----- Synchronize the cursor to Dot -------------------------- |
1213 | static void sync_cursor(char *d, int *row, int *col) | 1213 | static NOINLINE void sync_cursor(char *d, int *row, int *col) |
1214 | { | 1214 | { |
1215 | char *beg_cur; // begin and end of "d" line | 1215 | char *beg_cur; // begin and end of "d" line |
1216 | char *tp; | 1216 | char *tp; |
diff --git a/loginutils/getty.c b/loginutils/getty.c index 838adf2e7..f44d387b6 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c | |||
@@ -583,7 +583,7 @@ static void touch(const char *filename) | |||
583 | } | 583 | } |
584 | 584 | ||
585 | /* update_utmp - update our utmp entry */ | 585 | /* update_utmp - update our utmp entry */ |
586 | static void update_utmp(const char *line, char *fakehost) | 586 | static NOINLINE void update_utmp(const char *line, char *fakehost) |
587 | { | 587 | { |
588 | struct utmp ut; | 588 | struct utmp ut; |
589 | struct utmp *utp; | 589 | struct utmp *utp; |
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index d042af07b..39af88324 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c | |||
@@ -94,7 +94,7 @@ static void print_queuelen(char *name) | |||
94 | printf("qlen %d", ifr.ifr_qlen); | 94 | printf("qlen %d", ifr.ifr_qlen); |
95 | } | 95 | } |
96 | 96 | ||
97 | static int print_linkinfo(const struct nlmsghdr *n) | 97 | static NOINLINE int print_linkinfo(const struct nlmsghdr *n) |
98 | { | 98 | { |
99 | struct ifinfomsg *ifi = NLMSG_DATA(n); | 99 | struct ifinfomsg *ifi = NLMSG_DATA(n); |
100 | struct rtattr * tb[IFLA_MAX+1]; | 100 | struct rtattr * tb[IFLA_MAX+1]; |
diff --git a/networking/route.c b/networking/route.c index 5d2540802..241be8e09 100644 --- a/networking/route.c +++ b/networking/route.c | |||
@@ -151,7 +151,7 @@ static int kw_lookup(const char *kwtbl, char ***pargs) | |||
151 | 151 | ||
152 | /* Add or delete a route, depending on action. */ | 152 | /* Add or delete a route, depending on action. */ |
153 | 153 | ||
154 | static void INET_setroute(int action, char **args) | 154 | static NOINLINE void INET_setroute(int action, char **args) |
155 | { | 155 | { |
156 | struct rtentry rt; | 156 | struct rtentry rt; |
157 | const char *netmask = NULL; | 157 | const char *netmask = NULL; |
@@ -336,7 +336,7 @@ static void INET_setroute(int action, char **args) | |||
336 | 336 | ||
337 | #if ENABLE_FEATURE_IPV6 | 337 | #if ENABLE_FEATURE_IPV6 |
338 | 338 | ||
339 | static void INET6_setroute(int action, char **args) | 339 | static NOINLINE void INET6_setroute(int action, char **args) |
340 | { | 340 | { |
341 | struct sockaddr_in6 sa6; | 341 | struct sockaddr_in6 sa6; |
342 | struct in6_rtmsg rt; | 342 | struct in6_rtmsg rt; |
diff --git a/runit/chpst.c b/runit/chpst.c index 21297daf6..270ec0aeb 100644 --- a/runit/chpst.c +++ b/runit/chpst.c | |||
@@ -92,7 +92,7 @@ enum { | |||
92 | OPT_2 = (1 << 20) * ENABLE_CHPST, | 92 | OPT_2 = (1 << 20) * ENABLE_CHPST, |
93 | }; | 93 | }; |
94 | 94 | ||
95 | static void edir(const char *directory_name) | 95 | static NOINLINE void edir(const char *directory_name) |
96 | { | 96 | { |
97 | int wdir; | 97 | int wdir; |
98 | DIR *dir; | 98 | DIR *dir; |
diff --git a/scripts/mkdiff_obj b/scripts/mkdiff_obj new file mode 100755 index 000000000..a6ec5e602 --- /dev/null +++ b/scripts/mkdiff_obj | |||
@@ -0,0 +1,39 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | filter() { | ||
4 | # sed removes " address: " prefixes which mess up diff | ||
5 | sed $'s/^\\(\t*\\)[ ]*[0-9a-f][0-9a-f]*:[ \t]*/\\1/' \ | ||
6 | | sed 's/__GI_//g' | ||
7 | } | ||
8 | |||
9 | test -d "$1" || exit 1 | ||
10 | test -d "$2" || exit 1 | ||
11 | |||
12 | { | ||
13 | ( | ||
14 | cd "$1" || exit 1 | ||
15 | find -name '*.o' -o -name '*.os' # -o -name '*.so' | ||
16 | ) | ||
17 | ( | ||
18 | cd "$2" || exit 1 | ||
19 | find -name '*.o' -o -name '*.os' # -o -name '*.so' | ||
20 | ) | ||
21 | } | sed 's:^\./::' | sort | uniq | \ | ||
22 | tee LST | \ | ||
23 | ( | ||
24 | IFS='' | ||
25 | while read -r oname; do | ||
26 | if ! test -f "$1/$oname"; then | ||
27 | echo "Only $2/$oname" | ||
28 | continue | ||
29 | fi | ||
30 | if ! test -f "$2/$oname"; then | ||
31 | echo "Only $1/$oname" | ||
32 | continue | ||
33 | fi | ||
34 | diff -q -- "$1/$oname" "$2/$oname" >/dev/null && continue | ||
35 | (cd "$1"; objdump -dr "$oname" | filter >"$oname.disasm") | ||
36 | (cd "$2"; objdump -dr "$oname" | filter >"$oname.disasm") | ||
37 | diff -u "$1/$oname.disasm" "$2/$oname.disasm" | ||
38 | done | ||
39 | ) | ||
diff --git a/scripts/mkdiff_obj_bloat b/scripts/mkdiff_obj_bloat new file mode 100755 index 000000000..63b2c2ee1 --- /dev/null +++ b/scripts/mkdiff_obj_bloat | |||
@@ -0,0 +1,33 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | test -d "$1" || exit 1 | ||
4 | test -d "$2" || exit 1 | ||
5 | |||
6 | { | ||
7 | ( | ||
8 | cd "$1" || exit 1 | ||
9 | find -name '*.o' -o -name '*.os' # -o -name '*.so' | ||
10 | ) | ||
11 | ( | ||
12 | cd "$2" || exit 1 | ||
13 | find -name '*.o' -o -name '*.os' # -o -name '*.so' | ||
14 | ) | ||
15 | } | sed 's:^\./::' | sort | uniq | \ | ||
16 | tee LST | \ | ||
17 | ( | ||
18 | IFS='' | ||
19 | while read -r oname; do | ||
20 | if ! test -f "$1/$oname"; then | ||
21 | echo "Only $2/$oname" | ||
22 | continue | ||
23 | fi | ||
24 | if ! test -f "$2/$oname"; then | ||
25 | echo "Only $1/$oname" | ||
26 | continue | ||
27 | fi | ||
28 | $1/scripts/bloat-o-meter $1/$oname $2/$oname | grep 'otal: 0 byte' >/dev/null && continue | ||
29 | $1/scripts/bloat-o-meter $1/$oname $2/$oname | ||
30 | size $1/$oname $2/$oname | ||
31 | echo | ||
32 | done | ||
33 | ) | ||
diff --git a/shell/ash.c b/shell/ash.c index 54af39ada..f2d372f4a 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -6376,7 +6376,7 @@ subevalvar(char *p, char *str, int strloc, int subtype, | |||
6376 | * ash -c 'echo ${#$1}' name:'$=1' | 6376 | * ash -c 'echo ${#$1}' name:'$=1' |
6377 | * ash -c 'echo ${#1#}' name:'1=#' | 6377 | * ash -c 'echo ${#1#}' name:'1=#' |
6378 | */ | 6378 | */ |
6379 | static ssize_t | 6379 | static NOINLINE ssize_t |
6380 | varvalue(char *name, int varflags, int flags, struct strlist *var_str_list) | 6380 | varvalue(char *name, int varflags, int flags, struct strlist *var_str_list) |
6381 | { | 6381 | { |
6382 | int num; | 6382 | int num; |
diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c index c8c6d76fa..c1103b093 100644 --- a/util-linux/ipcs.c +++ b/util-linux/ipcs.c | |||
@@ -242,7 +242,7 @@ static NOINLINE void do_shm(void) | |||
242 | } | 242 | } |
243 | 243 | ||
244 | 244 | ||
245 | static void do_sem(void) | 245 | static NOINLINE void do_sem(void) |
246 | { | 246 | { |
247 | int maxid, semid, id; | 247 | int maxid, semid, id; |
248 | struct semid_ds semary; | 248 | struct semid_ds semary; |
@@ -348,7 +348,7 @@ static void do_sem(void) | |||
348 | } | 348 | } |
349 | 349 | ||
350 | 350 | ||
351 | static void do_msg(void) | 351 | static NOINLINE void do_msg(void) |
352 | { | 352 | { |
353 | int maxid, msqid, id; | 353 | int maxid, msqid, id; |
354 | struct msqid_ds msgque; | 354 | struct msqid_ds msgque; |
diff --git a/util-linux/rtcwake.c b/util-linux/rtcwake.c index 278acf347..ee2f031b4 100644 --- a/util-linux/rtcwake.c +++ b/util-linux/rtcwake.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | static time_t rtc_time; | 33 | static time_t rtc_time; |
34 | 34 | ||
35 | static bool may_wakeup(const char *rtcname) | 35 | static NOINLINE bool may_wakeup(const char *rtcname) |
36 | { | 36 | { |
37 | ssize_t ret; | 37 | ssize_t ret; |
38 | char buf[128]; | 38 | char buf[128]; |
@@ -50,7 +50,7 @@ static bool may_wakeup(const char *rtcname) | |||
50 | return strncmp(buf, "enabled\n", 8) == 0; | 50 | return strncmp(buf, "enabled\n", 8) == 0; |
51 | } | 51 | } |
52 | 52 | ||
53 | static void setup_alarm(int fd, time_t *wakeup) | 53 | static NOINLINE void setup_alarm(int fd, time_t *wakeup) |
54 | { | 54 | { |
55 | struct tm *tm; | 55 | struct tm *tm; |
56 | struct linux_rtc_wkalrm wake; | 56 | struct linux_rtc_wkalrm wake; |