OLD | NEW |
(Empty) | |
| 1 # Introduction |
| 2 |
| 3 V8's CPU & Heap profilers are trivial to use from V8's shells (see V8Profiler),
but it may appear confusing how to use them with Chromium. This page should help
you with it. |
| 4 |
| 5 # Instructions |
| 6 |
| 7 ## Why using V8's profilers with Chromium is different from using them with V8 s
hells? |
| 8 |
| 9 Chromium is a complex application, unlike V8 shells. Below is the list of Chromi
um features that affect profiler usage: |
| 10 |
| 11 * each renderer is a separate process (OK, not actually each, but let's omit t
his detail), so they can't share the same log file; |
| 12 * sandbox built around renderer process prevents it from writing to a disk; |
| 13 * Developer Tools configure profilers for their own purposes; |
| 14 * V8's logging code contains some optimizations to simplify logging state chec
ks. |
| 15 |
| 16 ## So, how to run Chromium to get a CPU profile? |
| 17 |
| 18 Here is how to run Chromium in order to get a CPU profile from the start of the
process: |
| 19 ``` |
| 20 ./Chromium --no-sandbox --js-flags="--logfile=%t.log --prof" |
| 21 ``` |
| 22 |
| 23 Please note that you wouldn't see profiles in Developer Tools, because all the d
ata is being logged to a file, not to Developer Tools. |
| 24 |
| 25 ### Flags description |
| 26 |
| 27 * **--no-sandbox** - turns off the renderer sandbox, obviously must have; |
| 28 * **--js-flags** - this is the containers for flags passed to V8: |
| 29 * **--logfile=%t.log** - specifies a name pattern for log files; **%t** gets
expanded into current time in milliseconds, so each process gets its own log fi
le; you can use prefixes and suffixes if you want, like this: **prefix-%t-suffix
.log**; |
| 30 * **--prof** - tells V8 to write statistical profiling information into the
log file. |
| 31 |
| 32 ## Notes |
| 33 |
| 34 Under Windows, be sure to turn on .MAP file creation for **chrome.dll**, but not
for **chrome.exe**. |
OLD | NEW |