LNT should track and display code size improvements and regressions
| Bugzilla Link | 14450 |
| Resolution | FIXED |
| Resolved on | Jul 28, 2016 17:23 |
| Version | unspecified |
| OS | All |
| CC | @cmatthew,@gottesmm |
Extended Description
I just wrote a terrible pile of shell to extract the change in binary size between two runs of LNT:
export BEFORE=/path/to/before/run/of/lnt export AFTER=/path/to/after/run/of/lnt find $BEFORE -type f -executable | egrep '(Multi|Single)Source' | grep -v '.sh$' | cut -d/ -f7- >/tmp/lnt_binaries.txt for b in $(< /tmp/lnt_binaries.txt ); do BEFORE_SIZE=$(size -A $BEFORE/$b | awk '/.text/ {print $2}'); AFTER_SIZE=$(size -A $AFTER/$b | awk '/.text/ {print $2}'); if [[ $BEFORE_SIZE != $AFTER_SIZE ]]; then echo "$b, $BEFORE_SIZE, $AFTER_SIZE, $(( (AFTER_SIZE - BEFORE_SIZE - 0.0) / BEFORE_SIZE ))"; fi; done
This works, but YUCK! It would be so much nicer if LNT just tracked this and did the really nice bucketing of run-over-run and run-over-baseline for these stats.
The three size buckets I would personally like to see tracked in LNT:
- size of .text section (code size)
- size of the sum of all .debug_* sections (debug info)
- size of the binary itself (to capture ro.data and other artifacts)
On Linux at least, these can be extracted as follows:
- % size -A $binary | awk '/^.text/ {print $2}'
- % size -A $binary | awk '/^.debug_/ {sum += $2} END {print sum}'
- % size -A $binary | awk '/^Total/ {print $2}'
In r276039, I added code size to the LNT database, and in r276219 I changed the LNT client to only collect text size.
I have been using this internally for a few weeks and it works great for us.
The public server will have to be updated before it will work there.
Mattias added this to the new cmake test-suite; however, it looks like LNT is not passing the value through to the server.
assigned to @cmatthew