Commit Graph

9568 Commits

Author SHA1 Message Date
Gerald Squelart
10a1425332 Bug 1673513 - Add tests for slow and too-slow child processes - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D136877
2022-01-31 02:22:30 +00:00
Gerald Squelart
833ccac51b Bug 1673513 - Use ProfilerParent::RequestGatherProfileProgress to wait for slow but responsive processes - r=florian
Instead of waiting a set time guessed from how long the parent process took to do its work, after a short time the parent process requests progress updates from all still-pending child processes, and restarts the timer if any progress was made.
If processes become unresponsive, they will be the last ones pending, and after one timer cycle without any progress anywhere, the parent process won't wait for children anymore, and will output all profiles successfully gathered so far.

Added `MOZ_LOG=prof` logging in nsProfiler.cpp, to monitor profile-gathering. (And removed a spurious 'd' character in the `LOG` macro.)

Differential Revision: https://phabricator.services.mozilla.com/D135488
2022-01-31 02:22:30 +00:00
Gerald Squelart
e230bf232e Bug 1673513 - Factor out and improve nsProfiler::RestartGatheringTimer - r=florian
This code will be used again in the following patch.
Instead of destroying and re-creating a new timer, we can re-initialize the existing one.

Also add the timer name "nsProfilerGatheringTimer" when first creating it.

Differential Revision: https://phabricator.services.mozilla.com/D135487
2022-01-31 02:22:30 +00:00
Gerald Squelart
75fffbdebe Bug 1673513 - ProfilerParent::RequestGatherProfileProgress(aChildPid) - r=florian
This helper function in ProfilerParent sends a progress request to a child process. If successfully sent, the response will resolve the returned promise.

Differential Revision: https://phabricator.services.mozilla.com/D135486
2022-01-31 02:22:29 +00:00
Gerald Squelart
9ffde9c15b Bug 1673513 - GetGatherProfileProgress() IPC - r=florian
A new IPC function allows the parent process to request a progress update from any child process.
If a profile generation is in progress, the shared `ProportionValue` can be atomically read and sent back in response.

Differential Revision: https://phabricator.services.mozilla.com/D135485
2022-01-31 02:22:29 +00:00
Gerald Squelart
c2390f1ea1 Bug 1673513 - Generate profile in new worker thread, and log its progress - r=florian,KrisWright
In order to keep the child process responsive to profile IPCs, the heavy work of generating the profile JSON is now done in a separate thread.
A `ProgressLogger` is used to keep track of the progress of this work, and the progress value is stored in a shared atomic `ProportionValue`.
When the JSON profile is ready, the final shmem allocation (used to send the profile to the parent process) is done on the original "ProfilerChild" IPC thread.

Differential Revision: https://phabricator.services.mozilla.com/D135484
2022-01-31 02:22:29 +00:00
Gerald Squelart
32ed5cbb65 Bug 1673513 - profiler_get_profile_json(SpliceableChunkedJSONWriter&, ...) - r=florian
The main goal is to separate the profile generation (in a JSONWriter) from the final allocation needed to output the profile in one block.
This will be needed in the next patch, where the profile generation will be done in a new worker thread, but the shmem allocation *must* be done on the original "ProfilerChild" thread that handles IPC responses.

Differential Revision: https://phabricator.services.mozilla.com/D135483
2022-01-31 02:22:28 +00:00
Gerald Squelart
bd01dc8480 Bug 1673513 - Maintain list of pending profiles, each with child pid - r=florian
Instead of just waiting for a certain number of profiles, the parent process now waits for profiles from a predetermined list of child process ids.
When receiving a profile, or when something goes wrong with a child process, the corresponding listed id can be removed, until the list is empty.
In a later patch, this list will be used to request progress updates from slow processes.

Differential Revision: https://phabricator.services.mozilla.com/D135482
2022-01-31 02:22:28 +00:00
Gerald Squelart
35257b17ef Bug 1673513 - ProfilerParent::GatherProfiles() also returns the child pid - r=florian
This will be useful to tie profiles to the child process id that generated them. (At the moment, the parent waits for a number of profiles, but doesn't check where received profiles actually come from.)

Differential Revision: https://phabricator.services.mozilla.com/D135481
2022-01-31 02:22:28 +00:00
Gerald Squelart
6c3f739b6e Bug 1673513 - Reserve the array space in advance in ProfilerParent::GatherProfiles - r=florian
A small optimization while working on nearby code, so avoid multiple allocations when we already know how much memory we really need.

Differential Revision: https://phabricator.services.mozilla.com/D135480
2022-01-31 02:22:27 +00:00
Gerald Squelart
50995cc271 Bug 1673513 - Use ProgressLogger in Gecko Profiler - r=florian
Add `ProgressLogger` parameter to most JSON-generating functions.
Each function can update the given `ProgressLogger` between 0% and 100%, and create sub-loggers when calling functions.

The main goal of this instrumentation is to notice when any progress is made by child processes (when the parent process is gathering profiles), so it needs to go deep enough so that it is not stuck on a progress value for "too long" -- During development, that meant progress was always happening when observed every 10ms; In later patches, the overall timeout for no-progress-made will be at least 1 second.

Differential Revision: https://phabricator.services.mozilla.com/D135479
2022-01-31 02:22:27 +00:00
Butkovits Atila
8894619edc Merge mozilla-central to autoland. CLOSED TREE 2022-01-28 07:19:47 +02:00
Mike Hommey
030d0c0e9e Bug 1752252 - Remove leftovers from bug 1741205. r=firefox-build-system-reviewers,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D137096
2022-01-28 00:20:46 +00:00
Andreea Pavel
77276416aa Backed out changeset 976680f20082 (bug 1746414) for causing local bootstrap bustage a=backout 2022-01-28 02:03:53 +02:00
Mark Banner
b9c60e801d Bug 1752347 - ESLint: Handle XPCOMUtils.define* using unary expressions when defining globals. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D137173
2022-01-27 18:10:04 +00:00
Geoff Brown
2a33f5c58d Bug 1748357 - Avoid percentile KeyError in 'mach try'; r=releng-reviewers,aki
Differential Revision: https://phabricator.services.mozilla.com/D137078
2022-01-27 16:26:51 +00:00
Andrew Halberstadt
c2b9d1b50f Bug 1746414 - Use standalone taskgraph's parameters module in Gecko, r=taskgraph-reviewers,jmaher
Rather than defining a distinct `Parameter` class for Gecko, this now uses the
`extend_parameters_schema` utility function (which mobile repos are already
using).

As a consequence, shared parameters are now defined in standalone taskgraph.
And only Gecko-specific parameters are listed in
`gecko_taskgraph/parameters.py`

The only exception is `project` which gets redefined so we can override the
standalone taskgraph default (since it derives `project` from the repo name,
which doesn't work for Gecko).

Differential Revision: https://phabricator.services.mozilla.com/D134515
2022-01-27 14:45:19 +00:00
Agi Sferro
202266fea4 Bug 1750231 - Suggest mach gradle instead of gradlew. r=calu
Differential Revision: https://phabricator.services.mozilla.com/D136386
2022-01-26 20:11:45 +00:00
Julien Wajsberg
cc5e07062d Bug 1639716 - [profiler] Bump the format version to ensure our users get the latest version of the frontend when capturing private browsing data r=gerald
Depends on D129819

Differential Revision: https://phabricator.services.mozilla.com/D136756
2022-01-26 17:26:24 +00:00
Julien Wajsberg
e1f9445a89 Bug 1639716 - [profiler, network markers] Add information about private browsing in network markers r=valentin,gerald,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D129819
2022-01-26 17:26:24 +00:00
Julien Wajsberg
b037b450bc Bug 1639716 - [profiler] Extract origin attributes out of the eTLD+1 and output them as thread properties r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D129818
2022-01-26 17:26:23 +00:00
Julien Wajsberg
ff988ebecd Bug 1639716 - [profiler] Remove the profiler disabling by private browsing r=jdescottes,gerald,devtools-backward-compat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D129417
2022-01-26 17:26:21 +00:00
Julien Wajsberg
c52080ea1a Bug 1639716 - [profiler] Record the private browsing information in registered pages r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D129416
2022-01-26 17:26:20 +00:00
Mike Hommey
b82810b455 Bug 1751331 - Use the mozbuild crate in gecko-profiler. r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D136566
2022-01-25 21:29:53 +00:00
Mike Hommey
e7c54fc571 Bug 1751331 - Remove MOZ_DIST. r=firefox-build-system-reviewers,mhentges
As mentioned in bug 1747354, the location of the dist directory is
relied to be $topobjdir/dist, so just use that consistently rather
than getting it from a separate variable for rust build scripts.

Differential Revision: https://phabricator.services.mozilla.com/D136556
2022-01-25 21:29:49 +00:00
Valentin Gosu
f2ce1bed77 Bug 1743022 - Rename network.trr.blacklist-duration to network.trr.temp_blocklist_durations_sec r=necko-reviewers,kershaw
Also turns it into a static pref r=#necko

Differential Revision: https://phabricator.services.mozilla.com/D136530
2022-01-25 15:57:03 +00:00
criss
592389ca2d Backed out 10 changesets (bug 1751331) for causing bustages. CLOSED TREE
Backed out changeset 5ce212465a26 (bug 1751331)
Backed out changeset 14d62b8ffa5a (bug 1751331)
Backed out changeset 76f46bd9afa1 (bug 1751331)
Backed out changeset 147faaad046f (bug 1751331)
Backed out changeset f85b049d12f9 (bug 1751331)
Backed out changeset 16d8d3f8378b (bug 1751331)
Backed out changeset 1cd9386a3927 (bug 1751331)
Backed out changeset 20faacba6db6 (bug 1751331)
Backed out changeset 7d17f75bcb38 (bug 1751331)
Backed out changeset 28b9aab1f174 (bug 1751331)
2022-01-25 13:00:25 +02:00
Mike Hommey
4db4c572b5 Bug 1751331 - Use the mozbuild crate in gecko-profiler. r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D136566
2022-01-25 09:03:05 +00:00
Mike Hommey
5999e70213 Bug 1751331 - Remove MOZ_DIST. r=firefox-build-system-reviewers,mhentges
As mentioned in bug 1747354, the location of the dist directory is
relied to be $topobjdir/dist, so just use that consistently rather
than getting it from a separate variable for rust build scripts.

Differential Revision: https://phabricator.services.mozilla.com/D136556
2022-01-25 09:03:01 +00:00
Gerald Squelart
c94231024d Bug 1749978 - Instead of crashing, leak ThreadRegistration if profiling stack is not empty on destruction - r=florian
In rare cases, a label may be left dangling, or would be removed too late (after the thread unregisters itself).
The most common cause is from Windows DLL load labels, which contain important information that we want to keep, so it's worth letting the registration data leak in this case.
Later bugs will soon fix the issue in a better way, and remove this leak.

Differential Revision: https://phabricator.services.mozilla.com/D136700
2022-01-24 12:11:26 +00:00
stransky
7b0c28a7d1 Bug 1750663 [Linux] Move mozva library and va headers to media directory r=alwu,media-playback-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D136596
2022-01-24 10:19:51 +00:00
Sandor Molnar
9341f771cd Backed out 2 changesets (bug 1743022) for causing xpc failures in test_trr_blocklist. CLOSED TREE
Backed out changeset 1acf0c8e8663 (bug 1743022)
Backed out changeset e8822e38828f (bug 1743022)
2022-01-21 22:23:59 +02:00
Valentin Gosu
e382a176b2 Bug 1743022 - Rename network.trr.blacklist-duration to network.trr.temp_blocklist_durations_sec r=necko-reviewers,kershaw
Also turns it into a static pref r=#necko

Differential Revision: https://phabricator.services.mozilla.com/D136530
2022-01-21 18:54:28 +00:00
Mitchell Hentges
a37e7812d4 Bug 1748737: Bump attrs to be compatible with mochitest r=ahal
A bunch of modern packages (`pytest`, `twisted`, `automat`) all need
`attrs==19.2.0` (or newer).
We _could_ bump `attrs` all the way to the modern `21.4.0` version, but
I'd like to defer that upgrade risk, since there's a
lot of backwards-incompatible changes and deprecations. So, lightly bump
it to `19.2.0`.

As part of bumping it, `pytest` is no longer compatible.
The earliest candidate that seems to be compatible is `pytest` 4.6.6,
which boasts in its release notes that it's resolved some deprecation
warnings against `attrs>=19.2.0`.

Once `pytest` was bumped, it needed a newer version of `pluggy`, which
itself has dependencies.
Since we're using hashes in `tox_requirements.txt`, all dependencies
needed to be hashed as well.

Differential Revision: https://phabricator.services.mozilla.com/D135178
2022-01-21 18:21:56 +00:00
Mark Banner
4f4dd2fbae Bug 1750974 - Extend our ESLint import-globals-from function to support absolute directories. r=Gijs,mossop
Differential Revision: https://phabricator.services.mozilla.com/D136368
2022-01-20 14:15:34 +00:00
Gerald Squelart
6ad9abfa16 Bug 1750452 - Replace mutex-locked sampling pause during exec() with atomic variable - r=emilio,mstange
Note: The atomic variable is named `gSkipSampling`, not mentioning forks because it could later be used in other situations, so it's best to describe it by the effect it has.

Differential Revision: https://phabricator.services.mozilla.com/D136205
2022-01-19 03:05:44 +00:00
Alexandre Lissy
f1d6617d61 Bug 1749385 - Generate CrashManager.jsm from template r=gsvelto,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D136109
2022-01-18 20:32:03 +00:00
Andrew Halberstadt
1e1b1683bc Bug 1749772 - [tryselect] Normalize 'manifest_relpath' in filter_tasks_by_paths, r=Gijs
Ideally 'manifest' and 'manifest_relpath' should be normalized to forward
slashes upstream in the TestResolver class. But normalizing them there could
potentially break other uses in-tree, and I don't have bandwidth to do a proper
audit to be confident I'm not breaking something elsewhere.

Differential Revision: https://phabricator.services.mozilla.com/D136183
2022-01-18 14:43:50 +00:00
Andrew Halberstadt
c3b4f0fb57 Bug 1749772 - [tryselect] Convert test_resolve_tests_by_suite to use parameterization, r=releng-reviewers,gbrown
Differential Revision: https://phabricator.services.mozilla.com/D136182
2022-01-18 14:43:49 +00:00
Gerald Squelart
8b4d852418 Bug 1744670 - Collect process CPU utilization - r=canaltinova
Process running times are stored in a new counter that only exists while the profiler is running.

Differential Revision: https://phabricator.services.mozilla.com/D133173
2022-01-17 23:01:30 +00:00
Gerald Squelart
18d4946ed0 Bug 1744670 - New feature: "Process CPU Utilization" aka "processcpu" - r=florian,canaltinova
The actual implementation is in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D133599
2022-01-17 23:01:29 +00:00
Gerald Squelart
ebfafdcf18 Bug 1744670 - ProfiledThreadData can take a ThreadRegistrationInfo by rvalue reference - r=canaltinova
This helps when dealing with threads that are not registered, e.g.: the Java thread, and the upcoming whole-process thread. And it removes some object copies.

Differential Revision: https://phabricator.services.mozilla.com/D133172
2022-01-17 23:01:29 +00:00
Gerald Squelart
374831dc94 Bug 1744670 - ProfiledThreadData doesn't need nsIEventTarget - r=canaltinova
The nsIEventTarget* parameter was not actually used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D133171
2022-01-17 23:01:29 +00:00
Jesse Schwartzentruber
69a30b6cc7 Bug 1742857 - Add Grizzly fuzzing framework smoke test. r=tsmith,ahal
Differential Revision: https://phabricator.services.mozilla.com/D132279
2022-01-13 14:23:11 +00:00
Gerald Squelart
67edebb322 Bug 1749498 - PrintUsage doesn't exit anymore, exits are done explicitly - r=canaltinova
`PrintUsageThenExit(code)` was supposed to exit when `code` was not zero, but:
- The name didn't reflect that, so it was confusing that `PrintUsageThenExit(0)` would *not* exit.
- The implementation in the Base Profiler exited anyway! This caused issues with some legacy code that still used the now-removed "threads" feature.

This patch renames the function to just `PrintUsage()` and never exits, leaving the caller to invoke `exit(code)` as needed -- with the added benefit that it's possible to exit with a zero code, useful in cases where an exit is not actually an error.

Differential Revision: https://phabricator.services.mozilla.com/D135666
2022-01-12 12:16:59 +00:00
Neil Deakin
5f1ff58926 Bug 371900, remove more now-unneeded empty oncommand attributes, r=bgrins,preferences-reviewers,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135243
2022-01-11 20:02:30 +00:00
Agi Sferro
024994e801 Bug 1724480 - Upgrade JDK to Java 17. r=glandium,ahal,calu
Differential Revision: https://phabricator.services.mozilla.com/D131972
2022-01-11 19:16:01 +00:00
James Graham
eacdb834af Bug 1749463 - Add a mach docs show-targets command, r=firefox-source-docs-reviewers,ahal
This generates a list of all known targets in an existing build of the
docs. That makes it easier/possible to figure out what references
exist and can be used.

Differential Revision: https://phabricator.services.mozilla.com/D135596
2022-01-11 16:32:56 +00:00
James Graham
f76ad255a6 Bug 1748845 - Add a custom mechanism to make some docs warnings fatal, r=ahal,firefox-source-docs-reviewers,sylvestre
The idea is to capture the warnings in a temporary file, and then
apply a set of regex to find any that should be treated as fatal.

This allows us to fix warnings one type at a time, and prevents us
regressing the warnings that are already fixed.

The "reference target not count" warning is added to the initial
forbidden list, so we can ensure we don't end up with internal links
pointing to nowhere.

Differential Revision: https://phabricator.services.mozilla.com/D135389
2022-01-11 10:48:23 +00:00
Kershaw Chang
f159addb13 Bug 1741425 - Enable more xpcshell tests with socket process, r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D134484
2022-01-11 09:50:14 +00:00