Skip to content

make: comprehensive list of the boards' filesizes#1033

Merged
OlegHahm merged 3 commits intoRIOT-OS:masterfrom
Kijewski:buildsizes
Apr 29, 2014
Merged

make: comprehensive list of the boards' filesizes#1033
OlegHahm merged 3 commits intoRIOT-OS:masterfrom
Kijewski:buildsizes

Conversation

@Kijewski
Copy link
Copy Markdown
Contributor

Ever wondered if your change sucks for some board?

This PR adds a maketarget that prints a comprehensive list of the sizes for all boards:

tests/test_vtimer_msg$ make buildsizes
   text    data     bss     dec     hex board
  30590     564   68392   99546   184da native
  57340    1532   96769  155641   25ff9 avsextrem
  11812     160    1618   13590    3516 chronos
  43804    3577   28988   76369   12a51 mbed_lpc1768
  10914      80    1580   12574    311e msb-430
  10792      80    1580   12452    30a4 msb-430h
  57036    1532   96769  155337   25ec9 msba2
  57548    1532   96769  155849   260c9 pttu
  59988    1568   13216   74772   12414 redbee-econotag
  10856      76    1580   12512    30e0 telosb
  10942      80    1580   12602    313a wsn430-v1_3b
  10942      80    1580   12602    313a wsn430-v1_4

Use make buildtest beforehand.

Makefile.include Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C+P mishap, fixed.

@Kijewski
Copy link
Copy Markdown
Contributor Author

I added another target make objsize SORTROW=[text|data|bss]:

tests/test_vtimer_msg$ make objsize SORTROW=bss
   text    data     bss     dec     hex filename
    534       8   24608   25150    623e kernel_init.o (ex core.a)
   4378       0    1288    5666    1622 irq_cpu.o (ex cpu.a)
   1825       4     116    1945     799 hwtimer_cpu.o (ex cpu.a)
   2431       4      80    2515     9d3 vtimer.o (ex vtimer.a)
   1190       0      52    1242     4da hwtimer.o (ex core.a)
    815       8       8     831     33f sched.o (ex core.a)
    620       0       4     624     270 lpm_cpu.o (ex cpu.a)
    251       0       4     255      ff crash.o (ex cpu.a)
    927     108       0    1035     40b main.o (ex test_vtimer_msg.a)
     88       0       0      88      58 reboot.o (ex core.a)
    746       0       0     746     2ea mutex.o (ex core.a)
     74       0       0      74      4a auto_init.o (ex auto_init.a)
    725       0       0     725     2d5 timex.o (ex timex.a)
    576       0       0     576     240 chardev_thread.o (ex sys.a)
    552       0       0     552     228 queue.o (ex core.a)
     55       0       0      55      37 tramp.o (ex cpu.a)
    519       4       0     523     20b native-ltc4150.o (ex native_base.a)
    418       0       0     418     1a2 native-led.o (ex native_base.a)
    336       0       0     336     150 cib.o (ex core.a)
    321       0       0     321     141 oneway_malloc.o (ex core.a)
    318       0       0     318     13e lifo.o (ex core.a)
    278       0       0     278     116 clist.o (ex core.a)
   2579       0       0    2579     a13 syscalls.o (ex cpu.a)
   2502       0       0    2502     9c6 native-uart0.o (ex native_base.a)
   2419       4       0    2423     977 startup.o (ex cpu.a)
    228       0       0     228      e4 bitarithm.o (ex core.a)
    224       0       0     224      e0 board_config.o (ex native_base.a)
   1820       0       0    1820     71c msg.o (ex core.a)
   1634       0       0    1634     662 native_cpu.o (ex cpu.a)
   1199       0       0    1199     4af thread.o (ex core.a)
    117       0       0     117      75 board_init.o (ex native_base.a)
    102       0       0     102      66 atomic_cpu.o (ex cpu.a)

@LudwigKnuepfer
Copy link
Copy Markdown
Member

Nice, now add corresponding *diff commands ;)

@Kijewski
Copy link
Copy Markdown
Contributor Author

That was much more complicated than I have expected.

Anyways, I introduced a new Makefile variable BINDIRBASE, which defaults to $(CURDIR)/bin.
Using this variable you can override where to put to generated files.

You can use it like that:

$ cd RIOT/test/test_something

$ git checkout master
$ make buildtest BINDIRBASE=master-bin

$ git checkout my-branch
$ make buildtest BINDIRBASE=my-branch-bin

$ make buildsizes-diff OLDBIN=master-bin NEWBIN=my-branch-bin
text    data    bss     dec     BOARD/BINDIRBASE

0       0       0       0       avsextrem    **← this line contains the diff**
57356   1532    96769   155657  master-bin
57356   1532    96769   155657  my-branch-bin

...

make buildsizes-diff needs bash 4, so your system must not be older than 20-Feb-2009 …

Check it out, the output contains colors. ;)

@LudwigKnuepfer
Copy link
Copy Markdown
Member

Whoa!

@LudwigKnuepfer
Copy link
Copy Markdown
Member

Does not cope well with missing stuff..

Building for msb-430h .. failed
Building for redbee-econotag .. success
Building for msba2 .. success
Building for mbed_lpc1768 .. success
Building for telosb .. failed
Building for avsextrem .. success
Building for msb-430 .. failed
Building for native .. success
Building for wsn430-v1_3b .. failed
Building for pttu .. success
Building for wsn430-v1_4 .. failed
Building for chronos .. failed
/home/lo/native/RIOT/examples/default/../../Makefile.include:163: recipe for target 'buildtest' failed
make: *** [buildtest] Error 1
text    data    bss dec BOARD/BINDIRBASE

0   0   0   0   avsextrem
85532   2368    95926   183826  master-bin
85532   2368    95926   183826  maca-bin

bash: line 26: - : syntax error: operand expected (error token is "- ")
0   0   0   0   mbed_lpc1768
43480   4361    28204   76045   master-bin
43480   4361    28204   76045   maca-bin

bash: line 26: - : syntax error: operand expected (error token is "- ")
bash: line 26: - : syntax error: operand expected (error token is "- ")
0   0   0   0   msba2
116856  2728    93841   213425  master-bin
116856  2728    93841   213425  maca-bin

0   0   0   0   native
56058   604 109700  166362  master-bin
56058   604 109700  166362  maca-bin

0   0   0   0   pttu
55700   2312    95985   153997  master-bin
55700   2312    95985   153997  maca-bin

10168   48  8396    18612   redbee-econotag
60768   2344    9712    72824   master-bin
70936   2392    18108   91436   maca-bin

bash: line 26: - : syntax error: operand expected (error token is "- ")
bash: line 26: - : syntax error: operand expected (error token is "- ")
bash: line 26: - : syntax error: operand expected (error token is "- ")

@Kijewski
Copy link
Copy Markdown
Contributor Author

Now a missing .elf file renders:

ERR     ERR     ERR     ERR     native
56058   604     109732  166394  bin
ERR     ERR     ERR     ERR     bin2

@mehlis
Copy link
Copy Markdown
Contributor

mehlis commented Apr 20, 2014

awesome stuff!

rebased on master, run in ccn-lite-client:

$ make buildsizes
   text\t   data\t    bss\t    dec\tboard
  97556    4052  128884  230492 native
 145512    6000   92557  244069 msba2
 154800    6000   92550  253350 avsextrem

those \t are appearing

@mehlis mehlis added this to the Release 2014.04 milestone Apr 20, 2014
@Kijewski
Copy link
Copy Markdown
Contributor Author

Fixed.

@LudwigKnuepfer
Copy link
Copy Markdown
Member

Needs update if #1039 is merged first

@LudwigKnuepfer
Copy link
Copy Markdown
Member

I guess you could squash already...

@Kijewski
Copy link
Copy Markdown
Contributor Author

Squashed

@LudwigKnuepfer LudwigKnuepfer removed this from the Release 2014.05 milestone Apr 28, 2014
@OlegHahm
Copy link
Copy Markdown
Member

Ready to be merged?

@Kijewski
Copy link
Copy Markdown
Contributor Author

I think all error conditions are handled now, and even if not, it won't hurt. So ... ready to merge.

@LudwigKnuepfer
Copy link
Copy Markdown
Member

ACK

OlegHahm added a commit that referenced this pull request Apr 29, 2014
make: comprehensive list of the boards' filesizes
@OlegHahm OlegHahm merged commit e03c8ef into RIOT-OS:master Apr 29, 2014
@Kijewski Kijewski deleted the buildsizes branch April 29, 2014 12:27
@janoskut
Copy link
Copy Markdown

janoskut commented Mar 6, 2015

I'm trying to run make buildtest and make buildsizes, but don't get any result.
If i run make info-buildsizes, i get:

make info-buildsizes                  :(
echo -e "   text\t   data\t    bss\t    dec\tboard"; \
    for BOARD in $(make -s info-boards-supported); do \
        echo "$(env -i HOME=${HOME} PATH=${PATH} BOARD=${BOARD} RIOTBASE=${RIOTBASE} RIOTBOARD=${RIOTBOARD} RIOTCPU=${RIOTCPU} BINDIRBASE=${BINDIRBASE} make info-buildsize 2>/dev/null | tail -n-1 | cut -f-4)" "${BOARD}"; \
    done;
   text    data     bss     dec board

make info-boards-supported gives no output.

Has something changed?

@OlegHahm
Copy link
Copy Markdown
Member

OlegHahm commented Mar 6, 2015

I can reproduce this (non-)behavior. Can you open an issue? I will investigate.

@OlegHahm
Copy link
Copy Markdown
Member

OlegHahm commented Mar 6, 2015 via email

@OlegHahm
Copy link
Copy Markdown
Member

@noshky, should work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: doc Area: Documentation Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants