Tests that were using `evaluateJSAsync` are updated, either by using the new command,
or by awaiting for the `evaluationResult` event.
A couple chrome tests were moved to devtools/shared/commands/js/tests/ and turned
into browser tests, and some of them were completely removed as we tested the
features in mochitests as well.
Differential Revision: https://phabricator.services.mozilla.com/D116248
Note that we can still use an existing ProfilerParentTracker instance after XPCOMShutdownThreads started (it's necessary, so that e.g., its list can be properly updated when ProfilerParents get destroyed), we just refuse to create a new one past that point.
Differential Revision: https://phabricator.services.mozilla.com/D114709
This could be easily generalized to avoid the updating the virtualenv
more generally, but I think this functionality should be in the
`virtualenv_manager` -- something like `install_pip_binary(...)` -- so
I've just done the most impactful example here.
Differential Revision: https://phabricator.services.mozilla.com/D116148
This is a minor quality of life improvement. Prior to this, one needs to:
1. Type out 'mach try again --list'
2. Find index
3. Type out 'mach try again --index <index>'
With this patch, it becomes:
1. Type out 'mach try again --index'
2. Find index
3. Press up + space + <index>
Yes, it is minor :).
Differential Revision: https://phabricator.services.mozilla.com/D116289
Another step towards avoiding the need for classes in mach commands;
here we are removing constructors either by changing them into helpers
or by simple refactorings.
Differential Revision: https://phabricator.services.mozilla.com/D112434
Another step towards avoiding the need for classes in mach commands;
here we are removing constructors either by changing them into helpers
or by simple refactorings.
Differential Revision: https://phabricator.services.mozilla.com/D112434
In particular, this is useful to show CPU usage graphs in no-periodic-sampling mode.
The GeckoProfiler::CPUUsage gtest was expanded to make sure that we have the same stack in this mode, and different stacks in normal sampling mode.
Differential Revision: https://phabricator.services.mozilla.com/D115892
As a step towards moving mach commands outside of classes, this converts all
properties into methods so that they can later become top-level helper functions.
Differential Revision: https://phabricator.services.mozilla.com/D112196
When `respondWith` isn't called, then we run the "reset interception"
steps, which sets up a new channel and does an internal redirect. We
need a profiler network marker with the "REDIRECT" status to properly
track this.
Differential Revision: https://phabricator.services.mozilla.com/D112216
In cases where a thread is not doing anything, but hasn't been marked as asleep with `AUTO_PROFILER_THREAD_SLEEP`, we can still duplicate the previous sample if we know that zero CPU activity happened.
Differential Revision: https://phabricator.services.mozilla.com/D115454
On Windows, the profiler changes the timer resolution when the sampling interval is less than 10ms.
However this change affects all of Firefox, which can change other behaviors, sometimes causing confusion when refresh-rate issues magically disappear when the profiler is running.
So now by default the profiler will not change the timer resolution. This should rarely affect the profiler's effective sampling rate, unless all threads in a process are in a waiting state, in which case there is nothing new to sample anyway! The front-end is investigating ways to make sampling gaps more obvious, see https://github.com/firefox-devtools/profiler/issues/2962
If some power users really need the added sampling precision in some profiling sessions, the timer resolution change may be requested before running Firefox, by setting the environment variable "PROFILER_ADJUST_TIMER_RESOLUTION" to any value.
Differential Revision: https://phabricator.services.mozilla.com/D115451
If for some reason the input number is a very large double, printing it
can overflow the 16-bytes buffers the function is called with. But
anything above 1000W is very likely invalid.
Differential Revision: https://phabricator.services.mozilla.com/D115446
`SharedLibraryInfo::GetInfoForSelf()` can use `PEHeaders::GetBounds` instead of
`GetModuleInformation` to get the start/end address of a module's mapped region
in the local process. It's roughly 100x faster because `GetModuleInformation`
invokes two system calls `NtQueryInformationProcess` and `NtReadVirtualMemory`
while `nt::PEHeaders` does not.
Depends on D115254
Differential Revision: https://phabricator.services.mozilla.com/D115255
This patch replaces two versions of `GetVersion` in Gecko profiler and
baseprofiler with `PEHeaders::GetVersionInfo`.
Depends on D115253
Differential Revision: https://phabricator.services.mozilla.com/D115254
This patch is the actual fix for Bug 1702086. The problem of Bug 1702086 is that
`LoadLibraryExW` loaded the module onto an address different from the original
mapped addresss because it was unloaded after we started enumeration. Calling
`GetPdbInfo` with the original address `module.lpBaseOfDll` caused a crash.
The proposed fix consists of three parts.
The first part is to get PDB information from `handleLock`, which is always valid
even if the original address was unloaded. With this, we don't need a check
of `VirtualQuery`.
The second part is to add `LOAD_LIBRARY_AS_IMAGE_RESOURCE` along with
`LOAD_LIBRARY_AS_DATAFILE` to the call to `LoadLibraryEx`. This is needed
to read information from the sections outside the PE headers because
RVA (= relative virtual address) is an address after relocation.
Without `LOAD_LIBRARY_AS_IMAGE_RESOURCE`, a module is mapped without relocation,
so `GetPdbInfo()` accesses wrong memory resulting in a crash.
The third part is to introduce `PEHeaders::GetPdbInfo`, replacing two versions
of `GetPdbInfo` in Gecko profiler and baseprofiler.
Depends on D115252
Differential Revision: https://phabricator.services.mozilla.com/D115253
This patch introduces `EnumerateProcessModules` to enumerate all loaded modules
in the local process so that Gecko profiler and baseprofiler can use it.
Differential Revision: https://phabricator.services.mozilla.com/D115252
@babel/transform-flow-strip-types and eslint-plugin-flowtype are no longer required as devtools removed the uses of them in bug 1690742.
Differential Revision: https://phabricator.services.mozilla.com/D115402
* Don't use a separate heading level for the signature-resolution
section, since RST thought it was more important than the others (the
original goal was for it to be a lesser header).
* Clarify that the "damaged" error is caused by the app being
quarantined, and not because of the key used to sign the app.
Differential Revision: https://phabricator.services.mozilla.com/D112249
As an intermediate step to allow mach commands as standalone functions, the MachCommandBase
subclass instance that currently corresponds to self has to be made available as a separate
argument (named command_context).
Differential Revision: https://phabricator.services.mozilla.com/D109650
When not profiling, ShutdownProfilerChild should be quick, so it's safe to run synchronously.
In this case, we don't need to manually shutdown the thread (to wait for the previously-async task).
This removes the risky thread-shutdown with its inner event-handling loop, where all crashes in bug 1613798 happen.
Differential Revision: https://phabricator.services.mozilla.com/D114845