lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] "automatic" code size analisys/comparison tools


From: Jonathan Larmour
Subject: Re: [lwip-users] "automatic" code size analisys/comparison tools
Date: Mon, 26 Nov 2007 22:53:21 +0000
User-agent: Mozilla Thunderbird 1.0.8-1.1.fc3.4.legacy (X11/20060515)

address@hidden wrote:
I'll see what I can do. Didn't come that far yet: cygwin 'size' doesn't count static data in (or was it global-non-static? I don't remember). Anyway, code size is quite OK but I'll have to figure it out... Once I have something I'll post it.

It does. Although do you really mean cygwin? You should only use that for applications that run on cygwin. For tools built with e.g. arm-elf-gcc, you should use arm-elf-size.

Anyway, in the output of 'size', text is the size of code, data is the size of static/global initialised data, and bss is the size of static/global data with no specific initialiser (i.e. initialised to 0).

Here's an example of something I wanted to fit in 64K RAM (obviously I can go much smaller but that wasn't the point here). Note that Flash use will be text+data, and RAM use will be data+bss (for me, heap is included here too).

~/builds/ecos/arm/at91sam7xek/[blahblah]$ arm-elf-size tcprecv
   text    data     bss     dec     hex filename
  95716    1052   62925  159693   26fcd tcprecv

Jifl

Grubb, Jared schrieb:

If you do get something that produces a good-looking report of code
size, I'd love for you to forward it to me for the Wiki.

Jared

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Erik Ekman
Sent: Friday, November 23, 2007 10:45
To: Mailing list for lwIP users
Cc: lwip-devel
Subject: Re: [lwip-users] "automatic" code size analisys/comparison
tools

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...

Thanks,
Simon




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
monospace font]

/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.

/Erik


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users






_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users



--
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------      Opinions==mine




reply via email to

[Prev in Thread] Current Thread [Next in Thread]