[PATCH 2/2] pstree: New applet, v6
Lauri Kasanen
curaga at operamail.com
Fri Dec 3 17:01:33 UTC 2010
Morning.
After finally managing to understand the uhm.. nice function procps_scan, I could drop ~700 bytes from pstree. Adding the -p option (from Eric) adds back ~100 bytes.
Thus, v6 is ~600 bytes smaller than v5. I'm afraid I'm out of obvious and non-obvious size reduction targets now, though.
v6:
- shrink by removing out_int
- size shrink by replacing read_proc with procps_scan
It was possible afterall ;) but only after the separation of check_thread.
- shrink: move thread check to procps_scan
- wrap unicode support in out_char in ENABLE_UNICODE
- support the -p option (Eric Lammerts)
function old new delta
dump_tree - 802 +802
pstree_main - 449 +449
add_proc - 221 +221
.rodata 8867 9023 +156
dump_by_user - 111 +111
tree_equal - 105 +105
new_proc - 83 +83
out_newline - 61 +61
static.C - 48 +48
out_char - 41 +41
procps_scan 1175 1211 +36
packed_usage 1034 1060 +26
out_string - 25 +25
find_proc - 24 +24
applet_main 80 88 +8
applet_names 61 68 +7
applet_nameofs 20 22 +2
------------------------------------------------------------------------------
(add/remove: 12/1 grow/shrink: 6/0 up/down: 2205/0) Total: 2205 bytes
text data bss dec hex filename
69257 1522 8384 79163 1353b busybox_old
71819 1522 8384 81725 13f3d busybox_unstripped
The above output includes the previous patch to libbb. For reference, v5 was "Total: 2759 bytes" on my machine.
- Lauri
--
_______________________________________________
Surf the Web in a faster, safer and easier way:
Download Opera 9 at http://www.opera.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-pstree-New-applet.patch
Type: application/octet-stream
Size: 10627 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20101203/77c2a575/attachment-0001.obj>
More information about the busybox
mailing list