OLD | NEW |
1 ================================================================================ | 1 ================================================================================ |
2 __________ .__ | 2 __________ .__ |
3 \______ \ |__| ____ _____ _______ ___.__. | 3 \______ \ |__| ____ _____ _______ ___.__. |
4 | | _/ | | / \ \__ \ \_ __ \ < | | | 4 | | _/ | | / \ \__ \ \_ __ \ < | | |
5 | | \ | | | | \ / __ \_ | | \/ \___ | | 5 | | \ | | | | \ / __ \_ | | \/ \___ | |
6 |______ / |__| |___| / (____ / |__| / ____| | 6 |______ / |__| |___| / (____ / |__| / ____| |
7 \/ \/ \/ \/ | 7 \/ \/ \/ \/ |
8 _________ .__ ___________ .__ | 8 _________ .__ ___________ .__ |
9 / _____/ |__| ________ ____ \__ ___/ ____ ____ | | | 9 / _____/ |__| ________ ____ \__ ___/ ____ ____ | | |
10 \_____ \ | | \___ / _/ __ \ | | / _ \ / _ \ | | | 10 \_____ \ | | \___ / _/ __ \ | | / _ \ / _ \ | | |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 Running the tool is fairly simple. For the sake of this example we will | 52 Running the tool is fairly simple. For the sake of this example we will |
53 pretend that you are building the Content Shell APK for Android. | 53 pretend that you are building the Content Shell APK for Android. |
54 | 54 |
55 1. Build your product as you normally would*, e.g.: | 55 1. Build your product as you normally would*, e.g.: |
56 ninja -C out/Release -j 100 content_shell_apk | 56 ninja -C out/Release -j 100 content_shell_apk |
57 | 57 |
58 * For results that are as spatially accurate as possible, you should always | 58 * For results that are as spatially accurate as possible, you should always |
59 build with a Release configuration so that the end product is as close to | 59 build with a Release configuration so that the end product is as close to |
60 the real thing as possible. However, it can sometimes be useful to improve | 60 the real thing as possible. However, it can sometimes be useful to improve |
61 consistency and accuracy of symbol lookup even if it perturbs the overall | 61 consistency and accuracy of symbol lookup even if it perturbs the overall |
62 accuracy of the tool. Consider adding these defines (e.g., via GYP_DEFINES | 62 accuracy of the tool. Consider adding these GN args: |
63 or GN build arguments): | 63 is_clang = true |
64 clang=1 | |
65 Anecdotally produces more stable symbol names over time. | 64 Anecdotally produces more stable symbol names over time. |
66 profiling=1 | 65 enable_profiling = true |
67 Anecdotally makes symbol lookup more accurate (note that profiling=1 | 66 Anecdotally makes symbol lookup more accurate (note that it |
68 doesn't work with clang on ARM/Android builds, see | 67 doesn't work with clang on ARM/Android builds, see |
69 https://crbug.com/417323 for more information. | 68 https://crbug.com/417323 for more information. |
70 profiling_full_stack_frames=1 | 69 enable_full_stack_frames_for_profiling = true |
71 With profiling=1, should further improve symbol lookup accuracy but | 70 With enable_profiling, further improves symbol lookup accuracy but |
72 will completely disable inlining, further decreasing spatial accuracy. | 71 will completely disable inlining, decreasing spatial accuracy. |
73 | 72 |
74 2. Run the tool specifying the library and the output report directory. | 73 2. Run the tool specifying the library and the output report directory. |
75 This command will run the analysis on the Content Shell native library for | 74 This command will run the analysis on the Content Shell native library for |
76 Android, producing an HTML report in /tmp/report and saving the NM output | 75 Android, producing an HTML report in /tmp/report and saving the NM output |
77 (useful for re-running the tool or analyzing deltas between two builds) | 76 (useful for re-running the tool or analyzing deltas between two builds) |
78 under /tmp/report/nm.out: | 77 under /tmp/report/nm.out: |
79 tools/binary_size/run_binary_size_analysis.py \ | 78 tools/binary_size/run_binary_size_analysis.py \ |
80 --library out/Release/lib/libcontent_shell_content_view.so \ | 79 --library out/Release/lib.unstripped/libcontent_shell_content_view.so \ |
81 --destdir /tmp/report | 80 --destdir /tmp/report |
82 | 81 |
83 Of course, there are additional options that you can see by running the tool | 82 Of course, there are additional options that you can see by running the tool |
84 with "--help". | 83 with "--help". |
85 | 84 |
86 This whole process takes about an hour on a modern (circa 2014) machine. If you | 85 This whole process takes about an hour on a modern (circa 2014) machine. If you |
87 have LOTS of RAM, you can use the "--jobs" argument to add more addr2line | 86 have LOTS of RAM, you can use the "--jobs" argument to add more addr2line |
88 workers; doing so will *greatly* reduce the processing time but will devour | 87 workers; doing so will *greatly* reduce the processing time but will devour |
89 system memory. If you've got the horsepower, 10 workers can thrash through the | 88 system memory. If you've got the horsepower, 10 workers can thrash through the |
90 binary in about 5 minutes at a cost of around 60 GB of RAM. The default number | 89 binary in about 5 minutes at a cost of around 60 GB of RAM. The default number |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 143 |
145 -------------------------------------------------------------------------------- | 144 -------------------------------------------------------------------------------- |
146 Feature Requests and Bug Reports | 145 Feature Requests and Bug Reports |
147 -------------------------------------------------------------------------------- | 146 -------------------------------------------------------------------------------- |
148 Please file bugs and feature requests here, making sure to use the label | 147 Please file bugs and feature requests here, making sure to use the label |
149 "Tools-BinarySize": | 148 "Tools-BinarySize": |
150 https://code.google.com/p/chromium/issues/entry?labels=Tools-BinarySize | 149 https://code.google.com/p/chromium/issues/entry?labels=Tools-BinarySize |
151 | 150 |
152 View all open issues here: | 151 View all open issues here: |
153 https://code.google.com/p/chromium/issues/list?can=2&q=label:Tools-BinarySize | 152 https://code.google.com/p/chromium/issues/list?can=2&q=label:Tools-BinarySize |
OLD | NEW |