Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Startup Tracing with MemoryInfra | 1 # Startup Tracing with MemoryInfra |
| 2 | 2 |
| 3 [MemoryInfra](memory_infra.md) supports startup tracing. | 3 [MemoryInfra](memory_infra.md) supports startup tracing. |
| 4 | 4 |
| 5 ## The Simple Way | 5 ## The Simple Way |
| 6 | 6 |
| 7 Start Chrome as follows: | 7 Start Chrome as follows: |
| 8 | 8 |
| 9 $ chrome --no-sandbox \ | 9 $ chrome --no-sandbox \ |
| 10 --trace-startup=-*,disabled-by-default-memory-infra \ | 10 --trace-startup=-*,disabled-by-default-memory-infra \ |
| 11 --trace-startup-file=/tmp/trace.json \ | 11 --trace-startup-file=/tmp/trace.json \ |
| 12 --trace-startup-duration=7 | 12 --trace-startup-duration=7 |
| 13 | 13 |
| 14 On Android, enable startup tracing and start Chrome as follows: | |
| 15 | |
| 16 $ build/android/adb_chrome_public_command_line \ | |
| 17 --no-sandbox \ | |
|
Primiano Tucci (use gerrit)
2016/02/11 12:04:55
no need of --no-sandbox on Android.
Let's keep the
petrcermak
2016/02/11 12:20:49
Done.
| |
| 18 --trace-startup=-*,disabled-by-default-memory-infra \ | |
| 19 --trace-startup-file=/storage/emulated/legacy/Download/trace.json \ | |
| 20 --trace-startup-duration=7 | |
| 21 | |
| 22 $ build/android/adb_run_chrome_public # Public. | |
| 23 $ clank/bin/adb_run_chrome # Googlers only. | |
|
Primiano Tucci (use gerrit)
2016/02/11 12:04:55
hmm remove this, I imagine internal folks know how
| |
| 24 | |
| 25 $ adb pull /storage/emulated/legacy/Download/trace.json # After tracing. | |
|
Primiano Tucci (use gerrit)
2016/02/11 12:04:55
I think that this should be aliased also via /sdca
petrcermak
2016/02/11 12:20:49
Done (I wanted to mirror https://www.chromium.org/
| |
| 26 | |
| 14 This will use the default configuration: one memory dump every 250 ms with a | 27 This will use the default configuration: one memory dump every 250 ms with a |
| 15 detailed dump ever two seconds. | 28 detailed dump ever two seconds. |
| 16 | 29 |
| 17 ## The Advanced Way | 30 ## The Advanced Way |
| 18 | 31 |
| 19 If you need more control over the granularity of the memory dumps, you can | 32 If you need more control over the granularity of the memory dumps, you can |
| 20 specify a custom trace config file as follows: | 33 specify a custom trace config file as follows: |
| 21 | 34 |
| 22 $ cat > /tmp/trace.config | 35 $ cat > /tmp/trace.config |
| 23 { | 36 { |
| 24 "startup_duration": 4, | 37 "startup_duration": 4, |
| 25 "result_file": "/tmp/trace.json", | 38 "result_file": "/tmp/trace.json", |
| 26 "trace_config": { | 39 "trace_config": { |
| 27 "included_categories": ["disabled-by-default-memory-infra"], | 40 "included_categories": ["disabled-by-default-memory-infra"], |
| 28 "excluded_categories": ["*"], | 41 "excluded_categories": ["*"], |
| 29 "memory_dump_config": { | 42 "memory_dump_config": { |
| 30 "triggers": [ | 43 "triggers": [ |
| 31 { "mode": "light", "periodic_interval_ms": 50 }, | 44 { "mode": "light", "periodic_interval_ms": 50 }, |
| 32 { "mode": "detailed", "periodic_interval_ms": 1000 } | 45 { "mode": "detailed", "periodic_interval_ms": 1000 } |
| 33 ] | 46 ] |
| 34 } | 47 } |
| 35 } | 48 } |
| 36 } | 49 } |
| 37 | 50 |
| 38 $ chrome --no-sandbox --trace-config-file=/tmp/trace.config | 51 $ chrome --no-sandbox --trace-config-file=/tmp/trace.config |
| 39 | 52 |
| 53 On Android, the config file has to be pushed to a fixed file location: | |
| 54 | |
| 55 $ adb root | |
| 56 $ adb push /tmp/trace.config /data/local/chrome-trace-config.json | |
| 57 | |
| 58 $ build/android/adb_chrome_public_command_line --no-sandbox | |
|
Primiano Tucci (use gerrit)
2016/02/11 12:04:55
no need of --no-sandbox
petrcermak
2016/02/11 12:20:49
Done.
| |
| 59 | |
| 60 $ build/android/adb_run_chrome_public # Public. | |
| 61 $ clank/bin/adb_run_chrome # Googlers only. | |
|
Primiano Tucci (use gerrit)
2016/02/11 12:04:55
ditto
petrcermak
2016/02/11 12:20:49
Done (ditto).
| |
| 62 | |
| 63 $ adb pull /storage/emulated/legacy/Download/trace.json # After tracing. | |
| 64 | |
| 65 Make sure that the "result_file" location is writable by the Chrome process on | |
| 66 Android (e.g. "/storage/emulated/legacy/Download/trace.json"). Note that startup | |
|
Primiano Tucci (use gerrit)
2016/02/11 12:04:55
/sdcard
petrcermak
2016/02/11 12:20:49
Done.
| |
| 67 tracing will be enabled upon every Chrome launch until you delete the config | |
| 68 file: | |
| 69 | |
| 70 $ adb shell rm /data/local/chrome-trace-config.json | |
| 71 | |
| 40 ## Related Pages | 72 ## Related Pages |
| 41 | 73 |
| 42 * [General information about startup tracing](https://sites.google.com/a/chromi um.org/dev/developers/how-tos/trace-event-profiling-tool/recording-tracing-runs) | 74 * [General information about startup tracing](https://sites.google.com/a/chromi um.org/dev/developers/how-tos/trace-event-profiling-tool/recording-tracing-runs) |
| 43 * [Memory tracing with MemoryInfra](memory_infra.md) | 75 * [Memory tracing with MemoryInfra](memory_infra.md) |
| OLD | NEW |