diff options
author | Joachim Fenkes <fenkes@de.ibm.com> | 2018-11-16 15:57:39 +0100 |
---|---|---|
committer | RAJA DAS <rajadas2@in.ibm.com> | 2019-02-19 04:30:50 -0600 |
commit | 4529a95e14de37b40ece0c1c0b3894a5bdbf6f58 (patch) | |
tree | 4f2f7ac26c76fec6333d53dbce6b84f6f4f2d76d /src/tools/utils/sbe-size/README | |
parent | 8a09d58df7aa0dedfbd6a3cfbac3b93f5f29e01c (diff) | |
download | talos-sbe-4529a95e14de37b40ece0c1c0b3894a5bdbf6f58.tar.gz talos-sbe-4529a95e14de37b40ece0c1c0b3894a5bdbf6f58.zip |
Add tools to help measure and compare SBE image size
- Break SBE image size contributions down by module
- Measure code, data and stack usage
- Compare sizes before and after a change to measure change impact
- Compare object section sizes, stack usage, disassembly, map file
Change-Id: Id873ba86cff7b8ecffdd37c028a57091535ea06d
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69407
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Diffstat (limited to 'src/tools/utils/sbe-size/README')
-rw-r--r-- | src/tools/utils/sbe-size/README | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/tools/utils/sbe-size/README b/src/tools/utils/sbe-size/README new file mode 100644 index 00000000..e38dcbdb --- /dev/null +++ b/src/tools/utils/sbe-size/README @@ -0,0 +1,52 @@ +These tools aim to answer two questions: + 1. How do the individual modules of SBE contribute to code/data size? + 2. How does my code change affect the size across modules? + 3. Which symbols ended up increasing/decreasing in size? + +They do so by collecting code/data size per object file and allowing +you to plot them in a stacked bar graph, or to compare two such statistics +in a similar graph. + +The graphs use the object file name on the X axis, sorted alphabetically +so that each object file is at the same X location every time you generate +the graph. This should help compare similar graphs. + +The tools are currently special-cased to look at a DD2 build only. This can +easily be changed by modifying collect-section-sizes. + +Usage: + 0. Add the scripts to your PATH: + export PATH=$PATH:$PWD/tools/utils/sbe-size + 1. Fully build your reference commit once + 2. mkdir ref; cp -av images obj ref + Copy the reference build artifacts somewhere safe + 3. SBEROOT=$PWD/ref collect-section-sizes > ref/sizes.txt + This will collect the code/data sizes for all reference object files + into a file 'sizes.txt'. It's an ASCII file, happy viewing. + 4. Hack away at the code, rebuild. + If you changed common header files, do a "make clean" before you build + since the build system doesn't reliably rebuild all dependent files. + 5. collect-section-sizes > sizes.txt + This will collect the code/data sizes for your changed build. + 6. view-section-sizes sizes.txt + This will plot the sizes from sizes.txt using gnuplot. If your gnuplot + supports zooming, you can zoom around the plot to examine it. When + you're done, exit gnuplot by hitting Ctrl-D at the 'gnuplot>' prompt. + 7. compare-section-sizes ref/sizes.txt sizes.txt + Compare two sizes files against one another. The plot will show size + reductions as bars below the zero line, size increases as bars above. + 8. compare-section-breakdown images/sbe_seeprom_DD2.map + Compare maps for ref/images/sbe_seeprom_DD2.map and + images/sbe_seeprom_DD2.map, replacing addresses by a constant value + so only the sizes are compared. + 9. compare-section-breakdown obj/power/fapi2/target.o + Compare section sizes for ref/obj/power/fapi2/target.o and + obj/power/fapi2/target.o - or any other object file of course. + This will filter the C++ mangled names too. + 10. compare-section-breakdown obj/power/fapi2/target.su + compare-section-breakdown obj/power/fapi2/target.dis + compare-section-breakdown obj/power/fapi2/target.diss + The same for stack usage, disassembly (with addresses normalized for + better diffing) and assembly with source. + +If you have questions, ask fenkes@de.ibm.com. |