[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] Re: [lwip-users] "automatic" code size analisys/comparison
[lwip-devel] Re: [lwip-users] "automatic" code size analisys/comparison tools
Fri, 23 Nov 2007 19:45:08 +0100
On 11/23/07, address@hidden <address@hidden> wrote:
> I know this is kind of off-topic, but maybe I get some good answers here...
> I try to visualize the code size of lwIP (e.g. to see if 1.3.0 made it
> better or worse). Until now, I have took a loop at the map files and
> used a calculator for small regions but that does not really work nice
> if I want to compare the whole stack + different options on PC and ARM.
> What I'm looking for is a tool that can read map files (GCC/elf and
> win32/PE) and generate a report out of that, ideally including a graphic
> representation. Since I can't be the first person trying to do this,
> there must exist some utilities for that. Only google didn't want to
> show me any...
> I'd be so happy if anyone could point me somewhere...
I had the same problem, and threw together a sed/python-script that
parses the entire code base for function definitions, and scans the
ELF disassembly for function sizes. Output is as follows: [view with
/lwip : 62841
/lwip/src : 62841
/lwip/src/basic_signal.c : 1074
/lwip/src/basic_signal.c#signal_connected : 173
/lwip/src/basic_signal.c#signal_err : 126
/lwip/src/basic_signal.c#signal_send : 545
/lwip/src/basic_signal.c#signal_sent : 230
/lwip/src/core : 52245
/lwip/src/core/dhcp.c : 12364
/lwip/src/core/dhcp.c#dhcp_arp_reply : 336
/lwip/src/core/dhcp.c#dhcp_bind : 848
/lwip/src/core/dhcp.c#dhcp_check : 214
/lwip/src/core/dhcp.c#dhcp_coarse_tmr : 170
/lwip/src/core/dhcp.c#dhcp_create_request : 684
/lwip/src/core/dhcp.c#dhcp_decline : 482
/lwip/src/core/dhcp.c#dhcp_delete_request : 167
/lwip/src/core/dhcp.c#dhcp_discover : 686
/lwip/src/core/dhcp.c#dhcp_fine_tmr : 136
/lwip/src/core/dhcp.c#dhcp_free_reply : 109
and so on.. Sizes are summed going up in the tree. This is an
unoptimized 386 Linux build shown here. A problem is that the
low_level_input function is found in multiple files, and all of these
add to the total sum.
The sed script doesnt find the multi-line functions in lwip, so I have
hard-coded them to get the sum right.
I could post the scripts here if you like.