profile-viewer 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/dist/029b9e4fd0218d7b09c6.svg +8 -0
  3. data/dist/{136.4ad3301b8aacf759ea70.bundle.js → 136.ad4176dc2a8e5cf33ef3.bundle.js} +2 -2
  4. data/dist/{136.4ad3301b8aacf759ea70.bundle.js.map → 136.ad4176dc2a8e5cf33ef3.bundle.js.map} +1 -1
  5. data/dist/{171.621b9df5978342be5662.bundle.js → 171.37d1e1824587d8df0ae2.bundle.js} +2 -2
  6. data/dist/{171.621b9df5978342be5662.bundle.js.map → 171.37d1e1824587d8df0ae2.bundle.js.map} +1 -1
  7. data/dist/234ed61ab185caff67e3.svg +8 -0
  8. data/dist/280.4edd20bd6228986bbf2e.bundle.js +2 -0
  9. data/dist/280.4edd20bd6228986bbf2e.bundle.js.map +1 -0
  10. data/dist/556.b8d3d4d402ced081615a.bundle.js +2 -0
  11. data/dist/{556.2be67a37a0c61fdc2485.bundle.js.map → 556.b8d3d4d402ced081615a.bundle.js.map} +1 -1
  12. data/dist/874.7cb94ee0732c5a2ca826.bundle.js +2 -0
  13. data/dist/874.7cb94ee0732c5a2ca826.bundle.js.map +1 -0
  14. data/dist/957.2f40be4cef3037bc352b.bundle.js +3 -0
  15. data/dist/957.2f40be4cef3037bc352b.bundle.js.LICENSE.txt +19 -0
  16. data/dist/957.2f40be4cef3037bc352b.bundle.js.map +1 -0
  17. data/dist/999.a1119c25d77e1883c1e1.bundle.js +2 -0
  18. data/dist/999.a1119c25d77e1883c1e1.bundle.js.map +1 -0
  19. data/dist/docs/_navbar.md +3 -3
  20. data/dist/docs/_sidebar.md +28 -28
  21. data/dist/docs/advanced-topics.md +5 -5
  22. data/dist/docs/async-posix-signal-control.md +5 -6
  23. data/dist/docs/bunny-2.md +3 -2
  24. data/dist/docs/bunny.md +29 -26
  25. data/dist/docs/gitpod.md +5 -10
  26. data/dist/docs/guide-android-profiling.md +18 -2
  27. data/dist/docs/guide-filtering-call-trees.md +11 -11
  28. data/dist/docs/guide-getting-started.md +4 -5
  29. data/dist/docs/guide-perf-profiling.md +8 -8
  30. data/dist/docs/guide-profiling-android-directly-on-device.md +14 -13
  31. data/dist/docs/guide-profiling-firefox-android.md +2 -3
  32. data/dist/docs/guide-remote-profiling.md +24 -23
  33. data/dist/docs/guide-removing-profiler.md +1 -0
  34. data/dist/docs/guide-stack-samples-and-call-trees.md +2 -0
  35. data/dist/docs/guide-startup-shutdown.md +14 -9
  36. data/dist/docs/guide-ui-tour-panels.md +4 -3
  37. data/dist/docs/guide-ui-tour-timeline.md +3 -0
  38. data/dist/docs/index.html +21 -18
  39. data/dist/docs/ipc-messages.md +6 -6
  40. data/dist/docs/js/docsify_v4.12.2+.min.js +1 -1
  41. data/dist/docs/memory-allocations.md +4 -4
  42. data/dist/docs/videos.md +10 -10
  43. data/dist/index.html +1 -1
  44. data/dist/locales/be/app.ftl +108 -0
  45. data/dist/locales/de/app.ftl +9 -0
  46. data/dist/locales/el/app.ftl +34 -11
  47. data/dist/locales/en-CA/app.ftl +23 -5
  48. data/dist/locales/en-GB/app.ftl +14 -5
  49. data/dist/locales/en-US/app.ftl +13 -4
  50. data/dist/locales/es-CL/app.ftl +17 -2
  51. data/dist/locales/fr/app.ftl +15 -0
  52. data/dist/locales/fur/app.ftl +16 -0
  53. data/dist/locales/fy-NL/app.ftl +9 -0
  54. data/dist/locales/ia/app.ftl +12 -0
  55. data/dist/locales/it/app.ftl +9 -0
  56. data/dist/locales/kab/app.ftl +12 -0
  57. data/dist/locales/nl/app.ftl +9 -0
  58. data/dist/locales/pt-BR/app.ftl +9 -0
  59. data/dist/locales/ru/app.ftl +9 -0
  60. data/dist/locales/sv-SE/app.ftl +18 -0
  61. data/dist/locales/tr/app.ftl +14 -0
  62. data/dist/locales/uk/app.ftl +18 -0
  63. data/dist/locales/zh-CN/app.ftl +14 -4
  64. data/dist/locales/zh-TW/app.ftl +10 -1
  65. data/dist/main.6cdc9308b67c00785584.bundle.js +198 -0
  66. data/dist/{main.89ba95fadf0fbee4977a.bundle.js.LICENSE.txt → main.6cdc9308b67c00785584.bundle.js.LICENSE.txt} +2 -2
  67. data/dist/main.6cdc9308b67c00785584.bundle.js.map +1 -0
  68. data/dist/photon/index.html +1 -1
  69. data/dist/photon/main.e1d25e5ea6d5812b127b.bundle.js +2 -0
  70. data/dist/photon/main.e1d25e5ea6d5812b127b.bundle.js.map +1 -0
  71. data/dist/sw.js +1 -1
  72. data/dist/sw.js.map +1 -1
  73. data/ruby-bin/profile-viewer +10 -1
  74. data/ruby-bin/profile-viewer-version.rb +1 -1
  75. metadata +24 -17
  76. data/dist/280.b4210a48e650408000c3.bundle.js +0 -2
  77. data/dist/280.b4210a48e650408000c3.bundle.js.map +0 -1
  78. data/dist/556.2be67a37a0c61fdc2485.bundle.js +0 -2
  79. data/dist/874.ca7a11f56438ad874b9d.bundle.js +0 -2
  80. data/dist/874.ca7a11f56438ad874b9d.bundle.js.map +0 -1
  81. data/dist/main.89ba95fadf0fbee4977a.bundle.js +0 -201
  82. data/dist/main.89ba95fadf0fbee4977a.bundle.js.map +0 -1
  83. data/dist/photon/main.fa2aec5d6b214ac1cdb3.bundle.js +0 -2
  84. data/dist/photon/main.fa2aec5d6b214ac1cdb3.bundle.js.map +0 -1
@@ -1,4 +1,3 @@
1
-
2
1
  # Profiler control using POSIX signals
3
2
 
4
3
  The Firefox profiler supports the use of asynchronous POSIX signals for a
@@ -72,21 +71,21 @@ needing to directly load the profile.
72
71
  The current implementation of POSIX signal support has a number of important
73
72
  limitations that potential users need to be aware of:
74
73
 
75
- * The profiler currently uses a set of "default"
74
+ - The profiler currently uses a set of "default"
76
75
  [values](https://searchfox.org/mozilla-central/rev/7a8904165618818f73ab7fc692ace4a57ecd38c9/tools/profiler/core/platform.cpp#633)
77
76
  when started using signals. There are currently plans to support configuration
78
77
  (see [Bug 1866007](https://bugzilla.mozilla.org/show_bug.cgi?id=1866007) for
79
78
  further information).
80
- * Async signal handling is currently only supported and tested on POSIX native
79
+ - Async signal handling is currently only supported and tested on POSIX native
81
80
  platforms, i.e. Linux and MacOS. Support for Windows is planned, but not yet
82
81
  implemented (see [Bug
83
82
  1867328](https://bugzilla.mozilla.org/show_bug.cgi?id=1867328) for further
84
83
  information).
85
- * The "stop" signal must be sent to Firefox's "main" process. This is due to
84
+ - The "stop" signal must be sent to Firefox's "main" process. This is due to
86
85
  Firefox's sandboxing rules, which disallow non-main processes (in general)
87
86
  from opening file handles. Because of this, individual processes cannot dump
88
87
  their own data to disk, so cannot individually handle the stop signal.
89
- * Signal support in the Firefox profiler is incompatible with Firefox's [code
88
+ - Signal support in the Firefox profiler is incompatible with Firefox's [code
90
89
  coverage](https://firefox-source-docs.mozilla.org/tools/code-coverage/index.html)
91
90
  tooling, as both rely on the same POSIX signals (`SIGUSR1` and `SIGUSR2`). In
92
91
  an ideal world we could use Linux's
@@ -95,7 +94,7 @@ limitations that potential users need to be aware of:
95
94
  not clash with the signals used by the code coverage tool. Unfortunately,
96
95
  MacOS does not support these signals, so we are limited to the smaller set of
97
96
  signals in order to support a wider set of platforms.
98
- * Although signals are used to start/stop the profiler, the aggregation of
97
+ - Although signals are used to start/stop the profiler, the aggregation of
99
98
  content-process profiles is still done using "traditional" Firefox IPC calls.
100
99
  If, therefore, you are using signals to diagnose issues with a "stuck" main
101
100
  thread in the main process, Firefox may not be able to aggregate child content
data/dist/docs/bunny-2.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Case Study
2
+
2
3
  ## Harnessing parallelism
3
4
 
4
5
  Consider the [previous case study](bunny.md). The amount of work being done was reduced by some performance fixes, allowing for a much faster frame rate. However, there is still a problem with this code. It's not taking advantage of the parallelism of having a worker thread.
@@ -14,7 +15,7 @@ Looking at a zoomed-in view of the thread stack graph shows how the content proc
14
15
  In a simplified code example, the iframe that is drawing using the [`CanvasRenderingContext2D`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D API) runs code that looks something like this:
15
16
 
16
17
  ```js
17
- worker.addEventListener('message', message => {
18
+ worker.addEventListener('message', (message) => {
18
19
  if (message.data.type === 'draw') {
19
20
  requestAnimationFrame(() => {
20
21
  // Draw the current set of rectangles.
@@ -29,7 +30,7 @@ worker.addEventListener('message', message => {
29
30
  In this example, the iframe draws to the canvas, and once it's done, it posts a message to the worker asking it to generate a new list of the draw calls. While this works, it's not harnessing the fact that the worker can run code in parallel. The fix luckily is clear. Swap the order of the `drawRect` and `worker.postMessage` calls.
30
31
 
31
32
  ```js
32
- worker.addEventListener('message', message => {
33
+ worker.addEventListener('message', (message) => {
33
34
  if (message.data.type === 'draw') {
34
35
  requestAnimationFrame(() => {
35
36
  // Ask the worker to generate the new draw calls for the NEXT frame.
data/dist/docs/bunny.md CHANGED
@@ -1,14 +1,15 @@
1
1
  # Case Study
2
+
2
3
  ## 2D canvas and worker messaging
3
4
 
4
5
  The following article is a case study in using the profiler to identify performance issues. The fixes made the code run four times faster and changed the frame rate from a fairly slow 15fps to a smooth 60fps. The process for this analysis follows a common pattern:
5
6
 
6
- * Profile the code
7
- * Identify slow areas
8
- * Form a hypothesis as to why it's slow
9
- * Act upon the hypothesis and change the code
10
- * Profile the code to measure the difference
11
- * Evaluate the effectiveness of the code change
7
+ - Profile the code
8
+ - Identify slow areas
9
+ - Form a hypothesis as to why it's slow
10
+ - Act upon the hypothesis and change the code
11
+ - Profile the code to measure the difference
12
+ - Evaluate the effectiveness of the code change
12
13
 
13
14
  ## The project description
14
15
 
@@ -41,7 +42,7 @@ self.postMessage({
41
42
  Then the iframe would draw the code using:
42
43
 
43
44
  ```js
44
- worker.addEventListener('message', message => {
45
+ worker.addEventListener('message', (message) => {
45
46
  const { data } = message;
46
47
  for (let i = 0; i < data.color.length; i++) {
47
48
  ctx.fillStyle = data.color[i];
@@ -58,16 +59,16 @@ Baseline profile: https://perfht.ml/2IxTwqi
58
59
 
59
60
  This code ended up not scaling well for large sets of rectangles being drawn to the screen. There were lots of stutters and a slow frame rate. The user's impact for fixing this problem would be to have a smoother frame rate, plus the ability to draw many more rectangles to the screen without slowing things down. In order to validate fixes, the following steps were used to reproduce the issue.
60
61
 
61
- * Load the page with the bunny visualization.
62
- * Hit Ctrl Shift 1 to turn on the Gecko Profiler.
63
- * Wait around 5 seconds.
64
- * Hit Ctrl Shift 2 to capture the profile.
65
- * Set the range to 3.0 seconds of relatively stable frames that don't have stutters or GC pauses.
66
- * Hide idle stacks by right clicking `__psync_cvwait` and `mach_msg_trap` in the Flame Graph, and choosing **"Drop samples with this function"**.
67
- * Filter the threads to:
68
- * The relevant content process
69
- * The relevant DOM Worker
70
- * The compositor
62
+ - Load the page with the bunny visualization.
63
+ - Hit Ctrl Shift 1 to turn on the Gecko Profiler.
64
+ - Wait around 5 seconds.
65
+ - Hit Ctrl Shift 2 to capture the profile.
66
+ - Set the range to 3.0 seconds of relatively stable frames that don't have stutters or GC pauses.
67
+ - Hide idle stacks by right clicking `__psync_cvwait` and `mach_msg_trap` in the Flame Graph, and choosing **"Drop samples with this function"**.
68
+ - Filter the threads to:
69
+ - The relevant content process
70
+ - The relevant DOM Worker
71
+ - The compositor
71
72
 
72
73
  ### Getting oriented
73
74
 
@@ -124,10 +125,10 @@ The repeated calls to `set fillStyle` are unnecessary for the bunny, as there ar
124
125
  The fix for this would be of only setting the color when it's been changed.
125
126
 
126
127
  ```js
127
- worker.addEventListener('message', message => {
128
+ worker.addEventListener('message', (message) => {
128
129
  const { data } = message;
129
130
  for (let i = 0; i < data.color.length; i++) {
130
- const nextColor = data.color[i]
131
+ const nextColor = data.color[i];
131
132
  if (prevColor !== nextColor) {
132
133
  // Only update the color if it's changed.
133
134
  ctx.fillStyle = nextColor;
@@ -240,9 +241,11 @@ self.postMessage({
240
241
  h: hArray._array,
241
242
  w: wArray._array,
242
243
  length: colorArray.length,
243
- })
244
+ });
244
245
  ```
246
+
245
247
  <!--alex ignore simple-->
248
+
246
249
  This makes the code much more complex and hard to maintain, but it could be the key to better performance. This is a common trade-off with fast code and simple code. It's important that any additional complexities are backed by an analysis that it actually affects user-perceived performance.
247
250
 
248
251
  ### The resulting structured clone profile:
@@ -273,9 +276,9 @@ In the analysis, only the functions that were taking the most time were consider
273
276
 
274
277
  A good follow-up would be to do more analysis on a variety of different test cases to ensure that these changes didn't regress performance on a different example.
275
278
 
276
- | Metric | Baseline | Fix 1 | Fix 2 | Magnitude Change |
277
- | --- | --- | --- | --- | --- |
278
- | Time per frame | ~65ms | ~40ms | ~16ms | 4x (faster) |
279
- | Frames per second | ~15fps | ~25fps | ~60fps | 4x (faster) |
280
- | non-idle time in `(root)` on the content process | 2107ms | 1613ms | 725ms | 2.9x (faster) |
281
- | non-idle time in `(root)` on the worker | 666ms | 814ms | 725ms | 0.9x (slower) |
279
+ | Metric | Baseline | Fix 1 | Fix 2 | Magnitude Change |
280
+ | ------------------------------------------------ | -------- | ------ | ------ | ---------------- |
281
+ | Time per frame | ~65ms | ~40ms | ~16ms | 4x (faster) |
282
+ | Frames per second | ~15fps | ~25fps | ~60fps | 4x (faster) |
283
+ | non-idle time in `(root)` on the content process | 2107ms | 1613ms | 725ms | 2.9x (faster) |
284
+ | non-idle time in `(root)` on the worker | 666ms | 814ms | 725ms | 0.9x (slower) |
data/dist/docs/gitpod.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Setting up profiler on gitpod
2
2
 
3
- Instead of configuring a local setup, you can also use [gitpod](https://www.gitpod.io/), an online continuous development environment with minimum setup.
3
+ Instead of configuring a local setup, you can also use [gitpod](https://www.gitpod.io/), an online continuous development environment with minimum setup.
4
4
  Click the link below. An automatic workspace will be created.
5
5
 
6
6
  [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/firefox-devtools/profiler)
@@ -9,7 +9,7 @@ Click the link below. An automatic workspace will be created.
9
9
 
10
10
  If you are using gitpod for the first time, you will have to authorize access to your GitHub account.This is necessary so you can access your data from within Gitpod.
11
11
 
12
- To authorize access, click your avatar/profile picture at the top right hand section of the setup. A dropdown menu will be displayed. In the dropdown menu, click `Open Access Control`. It will open Access Control page from where you can check the checkboxes and click update.
12
+ To authorize access, click your avatar/profile picture at the top right hand section of the setup. A dropdown menu will be displayed. In the dropdown menu, click `Open Access Control`. It will open Access Control page from where you can check the checkboxes and click update.
13
13
 
14
14
  ## Open the profiler UI in your web browser
15
15
 
@@ -23,17 +23,12 @@ If you want to load profiles for development, you can follow the steps described
23
23
 
24
24
  As an alternative to following the link above, you can also login using your gitHub account and then follow the sets below.
25
25
 
26
- - Change the URL of your browser to the respository, pull request or issue you want to open on gitpod e.g. for the [profiler project](https://github.com/firefox-devtools/profiler), URL of the upstream repository is `https://github.com/firefox-devtools/profiler`. You can also use the forked repository if you wish to start contributing to the project.
26
+ - Change the URL of your browser to the respository, pull request or issue you want to open on gitpod e.g. for the [profiler project](https://github.com/firefox-devtools/profiler), URL of the upstream repository is `https://github.com/firefox-devtools/profiler`. You can also use the forked repository if you wish to start contributing to the project.
27
27
  - Prefix the URL in the address bar of your browser with `gitpod.io/#` e.g. `https://github.com/firefox-devtools/profiler` becomes `https://gitpod.io/#https://github.com/firefox-devtools/profiler`.
28
- - Gitpod will then launch a workspace for you and clone the repository, branch, commit or pull request depending on the URL in the first step.
28
+ - Gitpod will then launch a workspace for you and clone the repository, branch, commit or pull request depending on the URL in the first step.
29
29
 
30
30
  ## Using the gitpod browser extension (optional)
31
31
 
32
32
  You can also install the [gitpod browser extension](https://addons.mozilla.org/en-GB/firefox/addon/gitpod/) if you wish instead of prefixing the URL of your browser with `gitpod.io/#` as described in the first step of **Advanced usage** section.
33
33
 
34
- The browser extension, if you choose to install, will add a button on each repository on Github. Clicking the button will trigger creation of an automatic gitpod setup.
35
-
36
-
37
-
38
-
39
-
34
+ The browser extension, if you choose to install, will add a button on each repository on Github. Clicking the button will trigger creation of an automatic gitpod setup.
@@ -1,6 +1,8 @@
1
1
  # Perf Profiling on Android
2
2
 
3
- Android has an application [`simpleperf`](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/README.md) which can profile any Android process. Simpleperf is mostly a drop-in replacement for the Linux `perf` tool.
3
+ Firefox profiler can visualize the CPU profiles exported from [Android Studio CPU Profiler](https://developer.android.com/studio/profile/cpu-profiler) as `*.trace` files. Load the exported file into [profiler.firefox.com](https://profiler.firefox.com), using drag-and-drop or "Load a profile from file".
4
+
5
+ Alternatively, Android ndk provides [`simpleperf`](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/README.md) which can profile any Android process. Simpleperf is mostly a drop-in replacement for the Linux `perf` tool. Android Studio CPU profiler also uses `simpleperf` internally.
4
6
 
5
7
  Firefox Profiler can visualise these `simpleperf` profiles, augmenting the viewers that ship with `simpleperf` (e.g. [`report_html.py`](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/scripts_reference.md#report_html_py)).
6
8
 
@@ -29,6 +31,20 @@ This records the profile into a `perf.data` file, and pulls it to your host.
29
31
 
30
32
  ### Step 2: Convert the profile
31
33
 
34
+ You can convert the `perf.data` file to one of the format supported by Firefox Profiler.
35
+
36
+ #### Option 1: Simpleperf trace file
37
+
38
+ Convert `perf.data` to the Simpleperf trace file format. You can also modify this command to provide proguard mapping file or unstripped SOs to symbolicate.
39
+
40
+ ```bash
41
+ # Convert perf.data to perf.trace
42
+ # If on Mac/Windows, use simpleperf host executable for those platforms instead.
43
+ ./bin/linux/x86_64/simpleperf report-sample --show-callchain --protobuf -i perf.data -o perf.trace
44
+ ```
45
+
46
+ #### Option 2: Using gecko_profile_generator.py
47
+
32
48
  Then convert to a Gecko Profile (Firefox Profiler) format, using [`gecko_profile_generator.py`](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/scripts_reference.md#gecko_profile_generator_py):
33
49
 
34
50
  ```bash
@@ -39,7 +55,7 @@ Then convert to a Gecko Profile (Firefox Profiler) format, using [`gecko_profile
39
55
 
40
56
  ### Step 3: View the profile in profiler.firefox.com
41
57
 
42
- Load `profile.json.gz` into [profiler.firefox.com](https://profiler.firefox.com), using drag-and-drop or "Load a profile from file".
58
+ Load the `perf.trace` or `profile.json.gz` created in previous step into [profiler.firefox.com](https://profiler.firefox.com), using drag-and-drop or "Load a profile from file".
43
59
 
44
60
  ## See also
45
61
 
@@ -4,12 +4,12 @@ Call trees can grow to be quite large, especially when profiling a browser engin
4
4
 
5
5
  The following are the different types of filtering operations that are supported.
6
6
 
7
- | Filter type | Description |
8
- | ----------- | ----------- |
9
- | Search filter | Drop samples that do not match a text string. |
10
- | Implementation filter | Restrict stacks to an implementation—native (C++) stacks, or to JavaScript stacks. |
11
- | Invert call stack | Flip the sample's stacks upside down and build a new call tree. |
12
- | Transforms | Modify the shape of the call tree according to some operation. Typically, this only modifies the stacks. |
7
+ | Filter type | Description |
8
+ | --------------------- | -------------------------------------------------------------------------------------------------------- |
9
+ | Search filter | Drop samples that do not match a text string. |
10
+ | Implementation filter | Restrict stacks to an implementation—native (C++) stacks, or to JavaScript stacks. |
11
+ | Invert call stack | Flip the sample's stacks upside down and build a new call tree. |
12
+ | Transforms | Modify the shape of the call tree according to some operation. Typically, this only modifies the stacks. |
13
13
 
14
14
  ## Search filter
15
15
 
@@ -21,14 +21,14 @@ Searching will exclude samples that do not match a search string. The search fil
21
21
 
22
22
  The above diagram is reproduced in the profile below:
23
23
 
24
- * Before searching: [https://perfht.ml/2I3SMsR](https://perfht.ml/2I3SMsR)
25
- * After searching: [https://perfht.ml/2rbcj0N](https://perfht.ml/2rbcj0N)
24
+ - Before searching: [https://perfht.ml/2I3SMsR](https://perfht.ml/2I3SMsR)
25
+ - After searching: [https://perfht.ml/2rbcj0N](https://perfht.ml/2rbcj0N)
26
26
 
27
27
  The following are some ideas on how to use search terms:
28
28
 
29
- * `js::` - Filter for a C++ namespace.
30
- * `www.example.com` - Filter for a domain name.
31
- * `www.example.com/assets/scripts.js` - Filter for a single script.
29
+ - `js::` - Filter for a C++ namespace.
30
+ - `www.example.com` - Filter for a domain name.
31
+ - `www.example.com/assets/scripts.js` - Filter for a single script.
32
32
 
33
33
  ## Implementation filter
34
34
 
@@ -76,17 +76,17 @@ UI.
76
76
 
77
77
  The following keyboard shortcuts are available:
78
78
 
79
- * `Ctrl + Shift + 1`: start the profiler, or stop and discard the data if it's already running.
80
- * `Ctrl + Shift + 2`: capture the profile from the currently running session. It
79
+ - `Ctrl + Shift + 1`: start the profiler, or stop and discard the data if it's already running.
80
+ - `Ctrl + Shift + 2`: capture the profile from the currently running session. It
81
81
  has no effect if the profiler isn't running.
82
82
 
83
83
  ## Share a profile
84
84
 
85
85
  ![A screenshot highlighting the toolbar's upload profile button.](images/getting-started-upload.png)
86
86
 
87
- One of the most powerful and useful features of the Firefox Profiler is the ability to upload and share profiles. The first step is to hit the *Upload Local Profile* button. You'll be able to exclude some information before uploading. Then the profile will be uploaded to an online storage. This profile can then be shared in online chat, emails, and bug reports. Note that anybody that has the link will be able to access the uploaded data, as it's not protected otherwise.
87
+ One of the most powerful and useful features of the Firefox Profiler is the ability to upload and share profiles. The first step is to hit the _Upload Local Profile_ button. You'll be able to exclude some information before uploading. Then the profile will be uploaded to an online storage. This profile can then be shared in online chat, emails, and bug reports. Note that anybody that has the link will be able to access the uploaded data, as it's not protected otherwise.
88
88
 
89
- The current view and all of the filters applied to the profile will be encoded into the URL. After initially sharing the profile, a *Permalink* button will be added, that can then be used to provide a handy shortened URL to the current view.
89
+ The current view and all of the filters applied to the profile will be encoded into the URL. After initially sharing the profile, a _Permalink_ button will be added, that can then be used to provide a handy shortened URL to the current view.
90
90
 
91
91
  [A video showing how to upload a profile and how to get the permalink](images/getting-started-upload-permalink.webm ':include :type=video controls')
92
92
 
@@ -112,4 +112,3 @@ you uploaded from the same browser instance.
112
112
  It's possible to name a profile so that it's conveniently findable later by
113
113
  searching in the address bar. The name is part of the URL you'll share to others,
114
114
  but otherwise isn't stored in the profile data.
115
-
@@ -8,9 +8,9 @@ Linux has a native profiler called 'perf' that can profile any application. This
8
8
 
9
9
  There are three major differences between the Gecko profiler and perf:
10
10
 
11
- 1. The Gecko profiler can only profile Gecko. Perf can profile any process on the system.
12
- 2. The Gecko profiler samples at a fixed rate based on wall-clock time. Perf samples based on elapsed CPU time per thread.
13
- 3. The Gecko profiler only samples a small set of threads by default. Perf samples all threads of the given process or process tree.
11
+ 1. The Gecko profiler can only profile Gecko. Perf can profile any process on the system.
12
+ 2. The Gecko profiler samples at a fixed rate based on wall-clock time. Perf samples based on elapsed CPU time per thread.
13
+ 3. The Gecko profiler only samples a small set of threads by default. Perf samples all threads of the given process or process tree.
14
14
 
15
15
  As a consequence of point 2, perf has far lower overhead than the Gecko Profiler when profiling many threads: perf only takes a sample whenever a thread is running, whereas the Gecko profiler will keep sampling all profiled threads at a fixed rate even when those threads are idle.
16
16
 
@@ -20,9 +20,9 @@ As a consequence of point 2, perf has far lower overhead than the Gecko Profiler
20
20
 
21
21
  There are three steps to obtaining a perf profile and loading it in the Firefox Profiler:
22
22
 
23
- 1. Capture a profile with perf.
24
- 2. Convert it into a text form.
25
- 3. Load the text file in [profiler.firefox.com](https://profiler.firefox.com).
23
+ 1. Capture a profile with perf.
24
+ 2. Convert it into a text form.
25
+ 3. Load the text file in [profiler.firefox.com](https://profiler.firefox.com).
26
26
 
27
27
  ### Step 1: Capture the profile
28
28
 
@@ -63,11 +63,11 @@ The `perf script` command takes the `perf.data` file that was written by the `pe
63
63
  ### Step 3: View the profile in profiler.firefox.com
64
64
 
65
65
  You can now load the .perf file into [profiler.firefox.com](https://profiler.firefox.com): tell the Firefox Profiler to open the file and it should be auto-identified and loaded.
66
- Note that there will be no markers and no categories. Many stack frames will say `[unknown]`. There will be no JavaScript stacks, unless you do extra work as described below. Symbols might be mangled.
66
+ Note that there will be no markers and no categories. Many stack frames will say `[unknown]`. There will be no JavaScript stacks, unless you do extra work as described below. Symbols might be mangled.
67
67
 
68
68
  ## Analyzing perf traces and tips
69
69
 
70
- Remember that 'perf' only records a sample if the thread is executing; samples are omitted if the thread is sleeping. This means in many cases there will be gaps between samples, often large ones. You probably want to switch from "Categories" to "Stack height" mode in the top left corner in order to see when samples were taken across the different threads.
70
+ Remember that 'perf' only records a sample if the thread is executing; samples are omitted if the thread is sleeping. This means in many cases there will be gaps between samples, often large ones. You probably want to switch from "Categories" to "Stack height" mode in the top left corner in order to see when samples were taken across the different threads.
71
71
 
72
72
  Perf sometimes has trouble walking the stack, and you'll get mis-rooted subtrees at the top level.
73
73
 
@@ -1,34 +1,35 @@
1
1
  # Profiling Firefox for Android directly on device
2
2
 
3
- The Firefox Profiler can be used without the remote debugging option. It offers a little less flexibility (can't edit the options and the profile is
3
+ The Firefox Profiler can be used without the remote debugging option. It offers a little less flexibility (can't edit the options and the profile is
4
4
  automatically uploaded). However, it does allow you to capture a profile without the need of a PC.
5
5
 
6
6
  ## Setup
7
7
 
8
8
  ### Pick a build to profile
9
+
9
10
  We recommend profiling a Firefox build from any release channel (i.e. not debug), whether downloaded from Google Play, Taskcluster, or built locally.
10
11
 
11
12
  ### Enable secret settings on the mobile device
12
13
 
13
14
  To enable secret settings, follow these steps:
14
15
 
15
- - Click on the [three dot icon next to the URL bar](./images/about-url.png)
16
- - Select the ["Settings" option](./images/settings-menu.png).
17
- - Scroll to the bottom of the settings page and select the "About Firefox"
18
- - Click the "Firefox" logo 5 times. [A toast should appear at the bottom of your screen with the number of click left before unlocking the secret menu](./images/secret-menu-toast.png).
19
- - Go back to the "Settings" screen and scroll to the bottom where you should see the ["Start Profiler" option](./images/start-profiler.png).
16
+ - Click on the [three dot icon next to the URL bar](./images/about-url.png)
17
+ - Select the ["Settings" option](./images/settings-menu.png).
18
+ - Scroll to the bottom of the settings page and select the "About Firefox"
19
+ - Click the "Firefox" logo 5 times. [A toast should appear at the bottom of your screen with the number of click left before unlocking the secret menu](./images/secret-menu-toast.png).
20
+ - Go back to the "Settings" screen and scroll to the bottom where you should see the ["Start Profiler" option](./images/start-profiler.png).
20
21
 
21
22
  ## Usage instructions
22
23
 
23
24
  ### To start the profiler
24
25
 
25
- - Click on "Start Profiler" and you should see a dialogue appear.
26
- - Choose one of the four options that matches the closest to what you're trying to profile.
27
- - Click "Start Profiler" and a toast should appear with the "Profiler started" message.
26
+ - Click on "Start Profiler" and you should see a dialogue appear.
27
+ - Choose one of the four options that matches the closest to what you're trying to profile.
28
+ - Click "Start Profiler" and a toast should appear with the "Profiler started" message.
28
29
 
29
30
  ### To stop the profiler
30
31
 
31
- - Go back to the Settings screen
32
- - Scroll to the bottom and you should see a "Stop profiler" option has replaced the "Start Profiler" one.
33
- - After you click it, you should see a dialogue with a warning regarding the information contained in the profile.
34
- - Once stopped, the URL for the profile that finished recording will be copied to your clipboard which you can then use to share.
32
+ - Go back to the Settings screen
33
+ - Scroll to the bottom and you should see a "Stop profiler" option has replaced the "Start Profiler" one.
34
+ - After you click it, you should see a dialogue with a warning regarding the information contained in the profile.
35
+ - Once stopped, the URL for the profile that finished recording will be copied to your clipboard which you can then use to share.
@@ -2,6 +2,5 @@
2
2
 
3
3
  Two options are possible:
4
4
 
5
- * [Remote Profiling Firefox for Android](./guide-remote-profiling.md) provides the most options but can be cumbersome to set up;
6
- * [Profiling Firefox for Android directly on the device](./guide-profiling-android-directly-on-device.md) has fewer options but should be easier to set up.
7
-
5
+ - [Remote Profiling Firefox for Android](./guide-remote-profiling.md) provides the most options but can be cumbersome to set up;
6
+ - [Profiling Firefox for Android directly on the device](./guide-profiling-android-directly-on-device.md) has fewer options but should be easier to set up.
@@ -9,38 +9,39 @@ In order to do so, you need both your phone with the mobile Gecko-based browser,
9
9
  ## Setup
10
10
 
11
11
  ### Pick a build to profile
12
+
12
13
  We recommend profiling a Firefox build from any release channel (i.e. not debug), whether downloaded from Google Play, Taskcluster, or built locally. Alternatively, you may wish to profile GeckoView-example. For more details, see the [Which mobile browser? section below](#which-mobile-browser).
13
14
 
14
15
  ### Enable remote debugging on the mobile device
15
16
 
16
17
  Your device needs to be connected to your computer before recording. You also need to have your Gecko-based Android app (such as Firefox Preview) running and set up for remote debugging via USB. This usually requires **two** settings:
17
18
 
18
- - Android itself needs to be configured to allow remote debugging over USB. This can be done in the system settings after entering "developer mode", which can be done by tapping on the Android build number repeatedly. See [the Android documentation](https://developer.android.com/studio/debug/dev-options.html) for details.
19
- - The app needs to be configured to allow remote debugging. There's usually a checkbox in the app's settings menu for that.
19
+ - Android itself needs to be configured to allow remote debugging over USB. This can be done in the system settings after entering "developer mode", which can be done by tapping on the Android build number repeatedly. See [the Android documentation](https://developer.android.com/studio/debug/dev-options.html) for details.
20
+ - The app needs to be configured to allow remote debugging. There's usually a checkbox in the app's settings menu for that.
20
21
 
21
22
  ### Prepare `about:debugging`
22
23
 
23
24
  To profile a Gecko Android build, you have to connect it to a Desktop Firefox browser. Please use [Firefox Nightly](https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly) for this.
24
25
 
25
- * Open the `about:debugging` page in Desktop Firefox by typing `about:debugging` in the URL bar, or via Tools > Web Developer > Remote Debugging.
26
- * If necessary, click "Enable USB Devices".
26
+ - Open the `about:debugging` page in Desktop Firefox by typing `about:debugging` in the URL bar, or via Tools > Web Developer > Remote Debugging.
27
+ - If necessary, click "Enable USB Devices".
27
28
 
28
29
  ## Recording
29
30
 
30
31
  On `about:debugging`, find your device/browser in the sidebar on the left and connect to it. If your device is not listed, check the following things:
31
32
 
32
- - Is USB debugging enabled in the Android system preferences?
33
- - Is the browser you want to profile running? Try navigating to a page in order to make sure that Gecko has been initialized.
34
- - Is remote debugging enabled in the browser on the phone? If you've recently pushed a new version of this app to your phone, the settings from the previous version may have been lost, so you may need to enable the pref again.
35
- - Is your phone's screen unlocked?
36
- - Double-check your cable connections.
37
- - If you have `adb` on your Desktop machine, check if `adb devices` sees the phone. If not, try to fix that first.
33
+ - Is USB debugging enabled in the Android system preferences?
34
+ - Is the browser you want to profile running? Try navigating to a page in order to make sure that Gecko has been initialized.
35
+ - Is remote debugging enabled in the browser on the phone? If you've recently pushed a new version of this app to your phone, the settings from the previous version may have been lost, so you may need to enable the pref again.
36
+ - Is your phone's screen unlocked?
37
+ - Double-check your cable connections.
38
+ - If you have `adb` on your Desktop machine, check if `adb devices` sees the phone. If not, try to fix that first.
38
39
 
39
40
  Once you have connected to the phone browser successfully, read on.
40
41
 
41
- Click the sidebar item for your phone / browser. Then, in the main section of the page, click the *Profile Performance* button.
42
+ Click the sidebar item for your phone / browser. Then, in the main section of the page, click the _Profile Performance_ button.
42
43
 
43
- Make any necessary adjustments in the presented options, like threads to sample or profiler features to enable, and then click *Start recording*. Perform the interactions you intend to profile on the Android device and then click *Capture Recording* in the Performance panel. A new tab will open in [https://profiler.firefox.com/](https://profiler.firefox.com/) with the collected profile ready for inspection.
44
+ Make any necessary adjustments in the presented options, like threads to sample or profiler features to enable, and then click _Start recording_. Perform the interactions you intend to profile on the Android device and then click _Capture Recording_ in the Performance panel. A new tab will open in [https://profiler.firefox.com/](https://profiler.firefox.com/) with the collected profile ready for inspection.
44
45
 
45
46
  ![A screenshot of about:debugging after connecting](./images/about-debugging-remote.png)
46
47
  ![A screenshot of about:debugging after clicking Profile Performance](./images/about-debugging-remote-profiling-panel.png)
@@ -49,8 +50,8 @@ Make any necessary adjustments in the presented options, like threads to sample
49
50
 
50
51
  If you've been profiling a browser from the Google Play Store, your profile should contain fully symbolicated C++ call stacks at least for libxul.so. If it doesn't, check the following:
51
52
 
52
- - Are you profiling a "shippable" GeckoView build? A common mistake is to profile a regular "opt" build from treeherder, i.e. one that was not compiled with the "shippable" configuration. Unfortunately, those regular treeherder builds do not upload symbol information to the Mozilla symbol server. Please use a different build in that case.
53
- - Are you profiling a build from the tryserver or a local build? Read on below for how to obtain symbol information in those cases.
53
+ - Are you profiling a "shippable" GeckoView build? A common mistake is to profile a regular "opt" build from treeherder, i.e. one that was not compiled with the "shippable" configuration. Unfortunately, those regular treeherder builds do not upload symbol information to the Mozilla symbol server. Please use a different build in that case.
54
+ - Are you profiling a build from the tryserver or a local build? Read on below for how to obtain symbol information in those cases.
54
55
 
55
56
  ## Which mobile browser?
56
57
 
@@ -73,18 +74,18 @@ additional guide on the dedicated page](./guide-startup-shutdown#firefox-for-and
73
74
 
74
75
  ### Try builds
75
76
 
76
- If you want to profile an Android build that the tryserver created for you, you have to kick off a "Sym" job (run time: about 3 minutes) on treeherder: Using treeherder's *Add new jobs* UI, schedule a "Sym" job for each platform whose "B" job you want symbols for. These jobs gather symbol information from the corresponding build job and upload it to the Mozilla symbol server so that the Firefox Profiler can use it.
77
+ If you want to profile an Android build that the tryserver created for you, you have to kick off a "Sym" job (run time: about 3 minutes) on treeherder: Using treeherder's _Add new jobs_ UI, schedule a "Sym" job for each platform whose "B" job you want symbols for. These jobs gather symbol information from the corresponding build job and upload it to the Mozilla symbol server so that the Firefox Profiler can use it.
77
78
 
78
79
  ### Local builds
79
80
 
80
- If you've compiled an Android Gecko build locally, and want to profile it, you have to jump through one small extra hoop: Before profiling, in the *Profile Performance* panel in `about:debugging`, go to *Settings*, scroll down to the *Local build* section and add your Android build's objdir to the list. Then profile as usual, and you should be getting full symbol information.
81
+ If you've compiled an Android Gecko build locally, and want to profile it, you have to jump through one small extra hoop: Before profiling, in the _Profile Performance_ panel in `about:debugging`, go to _Settings_, scroll down to the _Local build_ section and add your Android build's objdir to the list. Then profile as usual, and you should be getting full symbol information.
81
82
 
82
83
  ## Tips
83
84
 
84
- * Enable the "Screenshots" feature before profiling. Then you can see what's going on on the screen during your profiling run, which can be extremely helpful.
85
- * Limit the duration of the profiling run. This will cut down on the profile size, which will reduce the time you have to wait when you click "Capture Profile". Smaller profiles are also less likely to crash the app due to memory limitations.
86
- * Avoid clicking on any of the open tabs that are listed on the `about:debugging` page. Clicking on a tab will open a toolbox and add overhead by initializing content-side devtools code. For that reason, the profiling panel is separate from the toolbox.
87
- * Choose a more relaxed profiling interval in order to reduce profiling overhead. 2ms to 5ms work well. This will give you less data but more accurate timings.
88
- * To get maximally-realistic timings, consider using the "No Periodic Sampling" feature: This will cut down profiling overhead dramatically, but you won't have any stacks. If your workload is reproducible enough, you can take two profiles: one with stacks and one without. Then you can take your timings from the former and your information from the latter.
89
- * Startup profiling reveals some overhead caused by devtools code that is only run when remote debugging is enabled. In order to see what startup does when remote debugging is turned off, you can deactivate remote debugging before you quit the app, and re-activate it after startup.
90
- * If the recording doesn't start after clicking the start button, or if the button is inactive or in an otherwise confused state, it might be necessary to disconnect and reconnect to the phone to reset some state.
85
+ - Enable the "Screenshots" feature before profiling. Then you can see what's going on on the screen during your profiling run, which can be extremely helpful.
86
+ - Limit the duration of the profiling run. This will cut down on the profile size, which will reduce the time you have to wait when you click "Capture Profile". Smaller profiles are also less likely to crash the app due to memory limitations.
87
+ - Avoid clicking on any of the open tabs that are listed on the `about:debugging` page. Clicking on a tab will open a toolbox and add overhead by initializing content-side devtools code. For that reason, the profiling panel is separate from the toolbox.
88
+ - Choose a more relaxed profiling interval in order to reduce profiling overhead. 2ms to 5ms work well. This will give you less data but more accurate timings.
89
+ - To get maximally-realistic timings, consider using the "No Periodic Sampling" feature: This will cut down profiling overhead dramatically, but you won't have any stacks. If your workload is reproducible enough, you can take two profiles: one with stacks and one without. Then you can take your timings from the former and your information from the latter.
90
+ - Startup profiling reveals some overhead caused by devtools code that is only run when remote debugging is enabled. In order to see what startup does when remote debugging is turned off, you can deactivate remote debugging before you quit the app, and re-activate it after startup.
91
+ - If the recording doesn't start after clicking the start button, or if the button is inactive or in an otherwise confused state, it might be necessary to disconnect and reconnect to the phone to reset some state.
@@ -1,4 +1,5 @@
1
1
  # Removing profiler
2
+
2
3
  To remove the Firefox Profiler from the toolbar, right-click on the Profiler icon and choose "Remove from Toolbar" in the context menu.
3
4
 
4
5
  The Firefox Profiler is built in Firefox. The icon is only a menu button (that you can remove). There is no need and no way to remove the whole Firefox Profiler.
@@ -13,6 +13,7 @@ These examples assume the profiler is configured to collect samples every 1 mill
13
13
  ![This image shows stacks going from left to right. They are at 1 millisecond intervals. Each stack is composed of the function, A, B, C, and doWork. There are 5 samples](./images/simple-stacks.svg)
14
14
 
15
15
  <!--alex ignore simple-->
16
+
16
17
  This example creates a fairly contrived and simple example. `A` calls `B`, which calls `C`, then calls `doWork`. `A`, `B`, `C` are very quick to run, and the profiler never directly samples them. However, `doWork` is sampled 5 times. An aggregation of this profile would smush everything into one graph.
17
18
 
18
19
  ![This graphic demonstrates a call tree. It is a chart of the stacks A, B, C, and doWork, each connected by an arrow going from the root A to the leaf doWork. The running time of all the samples is 5ms. The self time is 0ms, except for doWork, which has a self time of 5ms.](./images/simple-call-tree.svg)
@@ -38,6 +39,7 @@ In summary, self time is where work was actually happening when observed by the
38
39
  > Note: Feel free to follow along with a real call tree that reproduces this structure: [https://perfht.ml/2w45IdC](https://perfht.ml/2w45IdC)
39
40
 
40
41
  <!--alex ignore simple-->
42
+
41
43
  The simple call tree above did not take into account any branching stacks. It only concerned itself with running and self time. This section will dive into how the call tree handles stacks of different shapes.
42
44
 
43
45
  ![This image shows contiguous stacks, and how they are sampled over time. It fades out as it goes left to right to indicate that samples are gathered for long periods of time. The stacks are labeled by 1 millisecond intervals. The stacks are labeled by functions that are single capital letters, ranged A to H.](./images/samples.svg)
@@ -7,15 +7,21 @@ please go to https://profiler.firefox.com to add it first to your Firefox.
7
7
 
8
8
  1. Start your Firefox with the environment variable `MOZ_PROFILER_STARTUP=1` set. This way, the profiler is started as early as possible during startup.
9
9
 
10
+ This can also be done inline when running Firefox [Mach](https://firefox-source-docs.mozilla.org/mach/):
11
+
12
+ ```bash
13
+ $ MOZ_PROFILER_STARTUP=1 ./mach run
14
+ ```
15
+
10
16
  2. Then capture the profile using the popup, as usual.
11
17
 
12
18
  Startup profiling does not use the settings that you configured in the `about:profiling`. It uses settings that can be configured with the environment variables `MOZ_PROFILER_STARTUP_ENTRIES`, `MOZ_PROFILER_STARTUP_INTERVAL`, and more:
13
19
 
14
- * If it looks like the buffer is not large enough, you can tweak the buffer size with the env var `MOZ_PROFILER_STARTUP_ENTRIES`. This defaults to 1000000, which is 9MB. If you want 90MB, use 10000000, and for 180MB, use 20000000, which are good values to debug long startups.
20
+ - If it looks like the buffer is not large enough, you can tweak the buffer size with the env var `MOZ_PROFILER_STARTUP_ENTRIES`. This defaults to 1000000, which is 9MB. If you want 90MB, use 10000000, and for 180MB, use 20000000, which are good values to debug long startups.
15
21
 
16
- * If you'd like a coarser resolution, you can also choose a different interval using `MOZ_PROFILER_STARTUP_INTERVAL`, which defaults to 1 (unit is millisecond). You can't go below 1 ms, but you can use e.g. 10 ms.
22
+ - If you'd like a coarser resolution, you can also choose a different interval using `MOZ_PROFILER_STARTUP_INTERVAL`, which defaults to 1 (unit is millisecond). You can't go below 1 ms, but you can use e.g. 10 ms.
17
23
 
18
- * More environment variables are available to control the profiler settings. They can be listed by setting `MOZ_PROFILER_HELP=1` and running Firefox from a command line inside a terminal; Firefox will exit immediately, and display all accepted variables in the terminal.
24
+ - More environment variables are available to control the profiler settings. They can be listed by setting `MOZ_PROFILER_HELP=1` and running Firefox from a command line inside a terminal; Firefox will exit immediately, and display all accepted variables in the terminal.
19
25
 
20
26
  ## Shutdown
21
27
 
@@ -27,7 +33,6 @@ Startup profiling does not use the settings that you configured in the `about:pr
27
33
 
28
34
  For startup profiling, similar to [startup profiling on Desktop](https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Profiling_with_the_Built-in_Profiler#Profiling_Firefox_Startup), you will need to manually set some `MOZ_PROFILER_STARTUP*` environment variables. The way to do this varies based on the app you want to profile (more details below). Once the app has been started with these environment variables, the profiler will be running. Then you can connect to the app using `about:debugging` as usual, and capture the profile with the regular UI.
29
35
 
30
-
31
36
  ## Firefox for Android
32
37
 
33
38
  First, you'll need to use [the general information about profiling on Android](./guide-remote-profiling.md).
@@ -59,6 +64,7 @@ adb shell am start -n org.mozilla.geckoview_example/.App \
59
64
  Fenix has a [different way](https://firefox-source-docs.mozilla.org/mobile/android/geckoview/consumer/automation.html#reading-configuration-from-a-file) to specify environment variables: it uses a yaml file.
60
65
 
61
66
  The easiest way to set up startup profiling is to run the `<mozilla-central-repo>/mobile/android/fenix/tools/setup-startup-profiling.py` script. For example:
67
+
62
68
  ```bash
63
69
  ./mobile/android/fenix/tools/setup-startup-profiling.py activate nightly # To activate startup profiling on nightly.
64
70
  ./mobile/android/fenix/tools/setup-startup-profiling.py deactivate beta # To deactivate startup profiling on beta.
@@ -72,7 +78,7 @@ If you don't want to check out [mozilla-central](https://hg.mozilla.org/mozilla-
72
78
 
73
79
  The filename of the YAML file mentioned above depends on the bundle ID of your Fenix app. The instructions below assume you want to profile the Fenix Nightly app, with the bundle ID `org.mozilla.fenix`.
74
80
 
75
- 1. Create a file with the name `org.mozilla.fenix-geckoview-config.yaml` on your desktop machine and content of the following form:
81
+ 1. Create a file with the name `org.mozilla.fenix-geckoview-config.yaml` on your desktop machine and content of the following form:
76
82
 
77
83
  ```
78
84
  env:
@@ -81,8 +87,9 @@ The filename of the YAML file mentioned above depends on the bundle ID of your F
81
87
  MOZ_PROFILER_STARTUP_FEATURES: js,stackwalk,screenshots,ipcmessages,java,processcpu,cpu
82
88
  MOZ_PROFILER_STARTUP_FILTERS: GeckoMain,Compositor,Renderer,IPDL Background
83
89
  ```
84
- 2. Push this file to the device with `adb push org.mozilla.fenix-geckoview-config.yaml /data/local/tmp/`.
85
- 3. Run `adb shell am set-debug-app --persistent org.mozilla.fenix` to make sure the file is respected.
90
+
91
+ 2. Push this file to the device with `adb push org.mozilla.fenix-geckoview-config.yaml /data/local/tmp/`.
92
+ 3. Run `adb shell am set-debug-app --persistent org.mozilla.fenix` to make sure the file is respected.
86
93
 
87
94
  From now on, whenever you open the Fenix app, Gecko will be profiling itself automatically from the start, even if remote debugging is turned off. Then you can enable remote debugging, connect to the browser with `about:debugging`, and capture the profiling run.
88
95
 
@@ -104,5 +111,3 @@ adb shell am start-activity -d "https://www.mozilla.org/" \
104
111
  When combined with the startup profiling `.yaml` file as described in the previous section, this allows profiling GeckoView during the App Link startup path. This is the scenario of a user opening a link from a different Android app in the default browser.
105
112
 
106
113
  Startup from App Link is the most important GeckoView startup scenario. In this scenario, GeckoView startup is directly in the critical path between the user action (tapping the link) and the first useful result (the web page being shown on the screen). This is different from the scenario of launching Fenix from the home screen - in that case, Fenix can show meaningful content even before Gecko is initialized, so Gecko's startup time is not as crucial to the experience.
107
-
108
-