nm --print-size
and addr2line
to extract size informationninja -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
is_official_build = true # There's not much point in measuring size without this flag :).
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.
Prints a delta of two “nm”-formatted outputs from run_binary_size_analysis.py
.
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
Use Monorail label Tools-BinarySize.