summaryrefslogtreecommitdiffstats
path: root/toolkit/components/extensions/schemas/geckoProfiler.json
blob: f2c6bec4cdc5b0f409985b6b679205652fcf433c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
[
  {
    "namespace": "manifest",
    "types": [
      {
        "$extend": "PermissionNoPrompt",
        "choices": [
          {
            "type": "string",
            "enum": ["geckoProfiler"]
          }
        ]
      }
    ]
  },
  {
    "namespace": "geckoProfiler",
    "description": "Exposes the browser's profiler.",

    "permissions": ["geckoProfiler"],
    "types": [
      {
        "id": "ProfilerFeature",
        "type": "string",
        "enum": [
          "java",
          "js",
          "mainthreadio",
          "fileio",
          "fileioall",
          "nomarkerstacks",
          "screenshots",
          "seqstyle",
          "stackwalk",
          "jsallocations",
          "nostacksampling",
          "nativeallocations",
          "ipcmessages",
          "audiocallbacktracing",
          "cpu",
          "notimerresolutionchange",
          "cpuallthreads",
          "samplingallthreads",
          "markersallthreads",
          "unregisteredthreads",
          "processcpu",
          "power",
          "responsiveness",
          "cpufreq",
          "bandwidth"
        ]
      },
      {
        "id": "supports",
        "type": "string",
        "enum": ["windowLength"]
      }
    ],
    "functions": [
      {
        "name": "start",
        "type": "function",
        "description": "Starts the profiler with the specified settings.",
        "async": true,
        "parameters": [
          {
            "name": "settings",
            "type": "object",
            "properties": {
              "bufferSize": {
                "type": "integer",
                "minimum": 0,
                "description": "The maximum size in bytes of the buffer used to store profiling data. A larger value allows capturing a profile that covers a greater amount of time."
              },
              "windowLength": {
                "type": "number",
                "optional": true,
                "description": "The length of the window of time that's kept in the buffer. Any collected samples are discarded as soon as they are older than the number of seconds specified in this setting. Zero means no duration restriction."
              },
              "interval": {
                "type": "number",
                "description": "Interval in milliseconds between samples of profiling data. A smaller value will increase the detail of the profiles captured."
              },
              "features": {
                "type": "array",
                "description": "A list of active features for the profiler.",
                "items": {
                  "$ref": "ProfilerFeature"
                }
              },
              "threads": {
                "type": "array",
                "description": "A list of thread names for which to capture profiles.",
                "optional": true,
                "items": {
                  "type": "string"
                }
              }
            }
          }
        ]
      },
      {
        "name": "stop",
        "type": "function",
        "description": "Stops the profiler and discards any captured profile data.",
        "async": true,
        "parameters": []
      },
      {
        "name": "pause",
        "type": "function",
        "description": "Pauses the profiler, keeping any profile data that is already written.",
        "async": true,
        "parameters": []
      },
      {
        "name": "resume",
        "type": "function",
        "description": "Resumes the profiler with the settings that were initially used to start it.",
        "async": true,
        "parameters": []
      },
      {
        "name": "dumpProfileToFile",
        "type": "function",
        "description": "Gathers the profile data from the current profiling session, and writes it to disk. The returned promise resolves to a path that locates the created file.",
        "async": true,
        "parameters": [
          {
            "type": "string",
            "name": "fileName",
            "description": "The name of the file inside the profile/profiler directory"
          }
        ]
      },
      {
        "name": "getProfile",
        "type": "function",
        "description": "Gathers the profile data from the current profiling session.",
        "async": true,
        "parameters": []
      },
      {
        "name": "getProfileAsArrayBuffer",
        "type": "function",
        "description": "Gathers the profile data from the current profiling session. The returned promise resolves to an array buffer that contains a JSON string.",
        "async": true,
        "parameters": []
      },
      {
        "name": "getProfileAsGzippedArrayBuffer",
        "type": "function",
        "description": "Gathers the profile data from the current profiling session. The returned promise resolves to an array buffer that contains a gzipped JSON string.",
        "async": true,
        "parameters": []
      },
      {
        "name": "getSymbols",
        "type": "function",
        "description": "Gets the debug symbols for a particular library.",
        "async": true,
        "parameters": [
          {
            "type": "string",
            "name": "debugName",
            "description": "The name of the library's debug file. For example, 'xul.pdb"
          },
          {
            "type": "string",
            "name": "breakpadId",
            "description": "The Breakpad ID of the library"
          }
        ]
      }
    ],
    "events": [
      {
        "name": "onRunning",
        "type": "function",
        "description": "Fires when the profiler starts/stops running.",
        "parameters": [
          {
            "name": "isRunning",
            "type": "boolean",
            "description": "Whether the profiler is running or not. Pausing the profiler will not affect this value."
          }
        ]
      }
    ]
  }
]