Chromium Code Reviews| Index: tools/binary_size/README.md |
| diff --git a/tools/binary_size/README.md b/tools/binary_size/README.md |
| index 6bd2c5b6a5ccd21879ceb523b55aff134972407a..110ef9b5c04f553fae4af8f41e6582eb7718212a 100644 |
| --- a/tools/binary_size/README.md |
| +++ b/tools/binary_size/README.md |
| @@ -1,49 +1,56 @@ |
| -# run_binary_size_analysis.py |
| +# analyze.py |
| -## About: |
| - * Uses `nm --print-size` and `addr2line` to extract size information |
| - * nm's correctness can be somewhat suspect at times... |
| - * Produces an html report with bloat grouped by source path. |
| - * Produces an "nm"-formatted dump of symbols with their sources resolved by |
| - addr2line. |
| - * For Chrome, takes ~60 minutes on a z620, but --jobs=10 reduces to ~5 minutes |
| - (**at the cost of 60GB of RAM**). |
| +Parses and processes a linker .map file and outputs the result as a .size file. |
| ## Example Usage: |
| + gn gen out/Release --args='is_official_build=true' |
| ninja -C out/Release -j 1000 libchrome.so |
| - tools/binary_size/run_binary_size_analysis.py \ |
| - --library out/Release/lib.unstripped/libchrome.so \ |
| - --destdir out/Release/binary-size-report \ |
| - --jobs=10 |
| - xdg-open out/Release/binary-size-report/index.html |
| + tools/binary_size/analyze.py out/Release/libchrome.so.map.gz \ |
|
estevenson
2017/03/16 19:49:18
nit: use the actual mapfile location out/Release/l
agrieve
2017/03/20 19:58:08
Done. Added linux example as well.
|
| + --output libchrome.size -v |
| -## Recommanded GN Args: |
| +# create_html_breakdown.py |
| - is_official_build = true |
| - # There's not much point in measuring size without this flag :). |
| +Creates an interactive size breakdown as a stand-alone html report. |
| -## Optional GN Args: |
| +## Example Usage: |
| - is_clang = true |
| - # Anecdotally produces more stable symbol names over time. |
| - enable_profiling = true |
| - # Anecdotally makes symbol lookup more accurate. |
| - enable_full_stack_frames_for_profiling = true |
| - # With enable_profiling, further improves symbol lookup accuracy but |
| - # will completely disable inlining, decreasing spatial accuracy. |
| + tools/binary_size/create_html_breakdown.py out/Release/libchrome.so.map.gz \ |
| + --report-dir out/Release/size-report -v |
| + xdg-open out/Release/size-report/index.html |
| -# explain_binary_size_delta.py |
| +# query.py |
| -Prints a delta of two "nm"-formatted outputs from `run_binary_size_analysis.py`. |
| +Starts a Python interpreter where you can run custom queries. |
| ## Example Usage: |
| - tools/binary_size/explain_binary_size_delta.py \ |
| - --nm1 out/Release/size-report1/nm.out \ |
| - --nm2 out/Release/size-report2/nm.out \ |
| - --showsouces --showsymbols # Optional |
| - |
| -# Open Issues |
| - |
| -Use Monorail label [Tools-BinarySize](https://code.google.com/p/chromium/issues/list?can=2&q=label:Tools-BinarySize). |
| + # Run a single query and exit rather than entering interactive mode: |
| + tools/binary_size/query.py out/Release/libchrome.so.map.gz \ |
| + --query 'all_syms.WhereInSection("d").WhereBiggerThan(100)' |
| + |
| + # Enters a Python REPL: |
| + tools/binary_size/query.py out/Release/libchrome.so.map.gz |
| + |
| +# Roadmap: |
| + |
| + Tracked in https://crbug.com/681694 |
| + |
| + 1. Convert explain_binary_size_delta.py to use new data model. |
| + 1. More query.py features: |
| + * Template Symbols - shows when templates lead to code bloat. |
| + * Duplicate Symbols - shows when statics in headers are an issue. |
| + * Overloaded Symbols - shows when overloads are excessive. |
| + * Per-class / namespace size (no way to distinguish class vs namespace). |
| + * Per-Chrome package (Chrome-specific grouping. e.g. name prefixes). |
| + * An interactive UI (either drop into python or use a web server). |
| + 1. More create_html_breakdown.py features: |
| + * Recreate subpath information for .o files stored within .a files. |
| + * Break down by namespace rather than path. |
| + * Break down by path, then have classes as leafs rather than .o files. |
| + 1. More analysis.py features: |
| + * Find out more about 0xffffffffffffffff addresses, and why such large |
| + gaps exist after them. |
| + 1. Integrate with `resource_sizes.py` so that it tracks size of major |
| + components separately: chrome vs blink vs skia vs v8. |
| + 1. Speed up some steps (like normalizing names) via multiprocessing. |