Commit Graph

9417 Commits

Author SHA1 Message Date
Iulian Moraru
897bb9d353 Backed out 2 changesets (bug 1707591) for causing python mozlint failures on test_yaml.py. CLOSED TREE
Backed out changeset a730ab2d0dbe (bug 1707591)
Backed out changeset 0269849fd7ef (bug 1707591)
2021-11-12 18:44:36 +02:00
Sylvestre Ledru
372b8d509f Bug 1707591 - Update to black 21.10b0 r=gerard-majax
Differential Revision: https://phabricator.services.mozilla.com/D130964
2021-11-12 15:06:55 +00:00
Neel Chauhan
f11cb7b33f Bug 1643637: Make MOZ_PROFILER_STARTUP_ENTRIES understand sizes with units r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D131022
2021-11-12 11:38:12 +00:00
Gerald Squelart
5d87c8cbb8 Bug 1736616 - Discard CPU utilization due to suspending threads - r=canaltinova
Suspending threads on some platforms may actually add CPU times to the target threads, artificially making it look like that thread did some work since the last CPU sampling.
This is especially visible on Linux, where suspending is done by sending a signal to the target thread, where the signal handler does quite a bit of work. On Windows there seems to be CPU work happening, possibly when the OS is checking whether a thread needs to be woken up.

To help with this, this patch effectively removes the CPU running times that happen during sampling:
* Thread sampling actions before: record-CPU stack ... record-CPU stack ...
The difference between two "record-CPU" is the amount of work done, which includes "stack" sampling.
* After: record-CPU stack reset-CPU ... record-CPU stack reset-CPU ...
Now thanks to the "reset-CPU" happening after "stack", the next "record-CPU" will only include the work done outside of the stack sampling.
This "reset-CPU" action is done in the new platform-specific function `DiscardSuspendedThreadRunningTimes`.

Note that there is a small window (just before and after the actual stack sampling) where some real CPU work may be discarded as well, but it should be negligible compared to all the work that happens between sampling loops.

Differential Revision: https://phabricator.services.mozilla.com/D130444
2021-11-09 20:56:09 +00:00
Nika Layzell
d73755617d Bug 1732343 - Part 2: Migrate all uses of base::FileDescriptor to UniqueFileHandle, r=handyman
This is useful for the following parts, as UniqueFileHandle is a cross-platform
type which can also be used to support transferring HANDLEs between processes.

This change requires fairly sweeping changes to existing callsites, which
previously did not require owning access to the handle types when transferring.
For the most part these changes were straightforward, but manual.

Differential Revision: https://phabricator.services.mozilla.com/D126564
2021-11-09 14:17:32 +00:00
Mark Banner
b2e123ddca Bug 1739708 - Turn off ESLint rule mozilla/reject-importGlobalProperties for sjs files. r=Gijs,webdriver-reviewers,whimboo
sjs files have a separate sandbox, and require Cu.importGlobalProperties for now.

Differential Revision: https://phabricator.services.mozilla.com/D130693
2021-11-09 08:38:16 +00:00
Gerald Squelart
cacfb45508 Bug 1738627 - MOZ_PROFILER_STARTUP_FEATURES {cpu,stacks,markers}allthreads - r=canaltinova
New features cpuallthreads, stacksallthreads, and markersallthreads now allow the user to selectively profile non-selected threads for more information.

The gtest GeckoProfiler.FeatureCombinations is modified to test combinations of up to 3 of a set of features, to lower its cost, which allows adding the new features.

Differential Revision: https://phabricator.services.mozilla.com/D130011
2021-11-08 23:59:37 +00:00
Gerald Squelart
b3ef8bb344 Bug 1738627 - Better Synchronize profiler features lists - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D130563
2021-11-08 23:59:36 +00:00
Gerald Squelart
2a8eb1038b Bug 1738627 - profiler_thread_is_being_profiled's ThreadProfilingFeatures is now compulsory - r=canaltinova
Now that most calls to `profiler_thread_is_being_profiled` have been updated, the `ThreadProfilingFeatures` can be made compulsory, to force callers to think about what they really want to know about the current profiling state.

Differential Revision: https://phabricator.services.mozilla.com/D130010
2021-11-08 23:59:36 +00:00
Gerald Squelart
5399574d8b Bug 1738627 - profiler_thread_is_being_profiled_for_markers - r=canaltinova
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.

Differential Revision: https://phabricator.services.mozilla.com/D130009
2021-11-08 23:59:35 +00:00
Gerald Squelart
ec05d2c747 Bug 1738627 - Store distinct profiling features of individual threads - r=canaltinova
This replaces the simple boolean ThreadRegistrationData::mIsBeingProfiled and its directly-dependent functions.

profiler_thread_is_being_profiled now takes an extra (currently optional) argument, to check if any of the given ThreadProfilingFeatures is currently live.

This is used to control:
- Periodic sampling of CPU utilization.
- Periodic sampling of stacks.
- Markers.

This patch doesn't change the observed behavior yet (i.e., instead of IsBeingProfiled being true or false, all thread profiling features are either all or nothing), but will be used for finer-grained control in later patches.

Differential Revision: https://phabricator.services.mozilla.com/D130008
2021-11-08 23:59:35 +00:00
Gerald Squelart
c01c33dff6 Bug 1739937 - "FileIO" markers may be missing the "filename" property - r=canaltinova
If the IOInterposer cannot retrieve a filename, the "filename" property is not even written in the marker "data" payload. So its presence should be checked before trying to use JS string functions on it.

Differential Revision: https://phabricator.services.mozilla.com/D130607
2021-11-08 10:14:24 +00:00
ssummar
7458659848 Bug 1739313 - Replaces mozilla::Tuple with std::tuple in tools/ r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D130335
2021-11-06 18:14:29 +00:00
Gregory Mierzwinski
688dc18433 Bug 1739426 - Add a diff feature to perfdocs verification. r=perftest-reviewers,AlexandruIonescu
This patch adds some code to produce a diff of the files that are problematic.

Differential Revision: https://phabricator.services.mozilla.com/D130380
2021-11-05 13:25:13 +00:00
Cristian Tuns
cbd178830f Backed out 10 changesets (bug 1732343) for causing coverage build bustages (Bug 1739590).
Backed out changeset bba94c79f3e1 (bug 1732343)
Backed out changeset d30fa1e1f605 (bug 1732343)
Backed out changeset ed0b4f757c4b (bug 1732343)
Backed out changeset a272da134c34 (bug 1732343)
Backed out changeset ccb259d73843 (bug 1732343)
Backed out changeset a292990b62de (bug 1732343)
Backed out changeset 7d1854782ca8 (bug 1732343)
Backed out changeset 29eaabd9ffb3 (bug 1732343)
Backed out changeset 1aa26657a7a6 (bug 1732343)
Backed out changeset 7a6708dc620a (bug 1732343)
2021-11-05 07:21:04 -04:00
Cristian Tuns
1aeac93d23 Backed out 5 changesets (bug 1738627) for causing xpcshell failures on test_ext_geckoProfiler_schema.js CLOSED TREE
Backed out changeset 42d385d7da97 (bug 1738627)
Backed out changeset edeb3a338954 (bug 1738627)
Backed out changeset 98f02e35134d (bug 1738627)
Backed out changeset 711daa6dd24b (bug 1738627)
Backed out changeset 49e12753a40c (bug 1738627)
2021-11-05 05:12:28 -04:00
Gerald Squelart
ea92e5ea81 Bug 1738627 - MOZ_PROFILER_STARTUP_FEATURES {cpu,stacks,markers}allthreads - r=canaltinova
New features cpuallthreads, stacksallthreads, and markersallthreads now allow the user to selectively profile non-selected threads for more information.

The gtest GeckoProfiler.FeatureCombinations is modified to test combinations of up to 3 of a set of features, to lower its cost, which allows adding the new features.

Differential Revision: https://phabricator.services.mozilla.com/D130011
2021-11-05 05:52:29 +00:00
Gerald Squelart
ffc00218c3 Bug 1738627 - profiler_thread_is_being_profiled's ThreadProfilingFeatures is now compulsory - r=canaltinova
Now that most calls to `profiler_thread_is_being_profiled` have been updated, the `ThreadProfilingFeatures` can be made compulsory, to force callers to think about what they really want to know about the current profiling state.

Differential Revision: https://phabricator.services.mozilla.com/D130010
2021-11-05 05:52:29 +00:00
Gerald Squelart
7fa084ae7c Bug 1738627 - profiler_thread_is_being_profiled_for_markers - r=canaltinova
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.

Differential Revision: https://phabricator.services.mozilla.com/D130009
2021-11-05 05:52:28 +00:00
Gerald Squelart
5448bc6c6e Bug 1738627 - Store distinct profiling features of individual threads - r=canaltinova
This replaces the simple boolean ThreadRegistrationData::mIsBeingProfiled and its directly-dependent functions.

profiler_thread_is_being_profiled now takes an extra (currently optional) argument, to check if any of the given ThreadProfilingFeatures is currently live.

This is used to control:
- Periodic sampling of CPU utilization.
- Periodic sampling of stacks.
- Markers.

This patch doesn't change the observed behavior yet (i.e., instead of IsBeingProfiled being true or false, all thread profiling features are either all or nothing), but will be used for finer-grained control in later patches.

Differential Revision: https://phabricator.services.mozilla.com/D130008
2021-11-05 05:52:28 +00:00
Nika Layzell
b8279164db Bug 1732343 - Part 2: Migrate all uses of base::FileDescriptor to UniqueFileHandle, r=handyman
This is useful for the following parts, as UniqueFileHandle is a cross-platform
type which can also be used to support transferring HANDLEs between processes.

This change requires fairly sweeping changes to existing callsites, which
previously did not require owning access to the handle types when transferring.
For the most part these changes were straightforward, but manual.

Differential Revision: https://phabricator.services.mozilla.com/D126564
2021-11-04 19:20:17 +00:00
andrej
144e97d457 Bug 1737152 - Review and update Raptor test owners r=perftest-reviewers,sparky
Depends on D128528

Differential Revision: https://phabricator.services.mozilla.com/D129293
2021-11-03 22:18:36 +00:00
Myeongjun Go
a2e121e262 Bug 1674220 - [perfdocs] Enumerate Talos tests using PerfDocs r=sparky,perftest-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D128037
2021-11-02 19:11:06 +00:00
Heitor Neiva
8760285b99 Bug 527670 - Fix download failure handling on UV async downloader r=aki DONTBUILD
Removing the unlinking shouldn't be a problem, only possible side effect would be removing the partially downloaded file

Differential Revision: https://phabricator.services.mozilla.com/D130132
2021-11-02 15:45:11 +00:00
Sebastian Hengst
d21e359bd2 Merge autoland to mozilla-central. a=merge 2021-11-01 22:58:34 +01:00
OnuohaOluebube
5ff974a055 Bug 1460100 - Added ESLint rule to prevent use of nsIScriptableUnicodeConverter r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D129668
2021-11-01 16:56:25 +00:00
Andi-Bogdan Postelnicu
80fddabd67 Bug 1738598 - sunset Coverity in Firefox.
Differential Revision: https://phabricator.services.mozilla.com/D129779
2021-10-31 17:18:02 +00:00
Riya
c45c0f507e Bug 1730126 - Enable ESLint rule no-loss-of-precision. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D129336
2021-10-29 08:29:26 +00:00
Florian Quèze
1c3f80fe51 Bug 1738285 - move AUTO_PROFILE_FOLLOWING_RUNNABLE to its own header, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D129825
2021-10-28 20:35:06 +00:00
Gerald Squelart
3cbc9abc45 Bug 1736513 - Repeat thread-CPU-measurement at most once - r=canaltinova
`GetRunningTimesWithTightTimestamp` was running the native get-running-times functions in a loop until it could run it within a "fast enough" time (based on an initial quick benchmark); This was to associate a timestamp with CPU measurements as close as possible, to get a more reliable CPU utilization graph at the end.
But this loop condition meant that if the system was under high stress, the loop could potentially re-run many times, wasting way more resources than the resulting "tightness" warrants.

So instead of repeating until "fast enough", we repeat at most once, and take the best of both measurements.
In the worst case, CPU measurements and timestamps may be a bit far apart, but it just means that a spike of activity may be reported in the next time slice instead, but the cumulative amount of work will be correct overall.

Differential Revision: https://phabricator.services.mozilla.com/D129773
2021-10-28 09:55:34 +00:00
Heitor Neiva
7aae3ff478 Bug 527670: Add documentation to update-verify clear_cache() r=aki
Added documentation to methods, missed from last PR

Differential Revision: https://phabricator.services.mozilla.com/D129667
2021-10-27 15:46:46 +00:00
Tooru Fujisawa
60b9eebf5b Bug 1736617 - Use firefox binary in objdir in newtab tests. r=Mardak
Let ./mach npm set FIREFOX_BIN environment variable, for karma-firefox-launcher.

Differential Revision: https://phabricator.services.mozilla.com/D129342
2021-10-27 11:07:53 +00:00
Heitor Neiva
9963047f51 Bug 527670: Async download/cache UpdateVerify files and improve logs r=aki
Changed wget output log granularity from 📣 to :giga: (only used in case the python library didn't cover all usecases)
Added python methods to async cache/download all required files for update verify
Modified Dockerfile requirements to include aiohttp python lib

Differential Revision: https://phabricator.services.mozilla.com/D129429
2021-10-26 22:53:30 +00:00
Gerald Squelart
0ff5eeaa62 Bug 1737376 - StreamMarkersToJSON should accept all markers if aThreadId is unspecified - r=julienw
Before bug 1577658, StreamMarkersToJSON directly called DeserializeAfterKindAndStream [1], which accepted an unspecified ProfilerThreadId [2], in which case it would output any marker [3].
This is used in particular when streaming markers from the Java thread, which is done with fake thread information including an unspecified thread id [4].

Bug 1577658 modified StreamMarkersToJSON to use an updated DeserializeAfterKindAndStream, and didn't account for unspecified thread ids.
This patch adds the missing check, so that all markers found in the given buffer will be output.

[1] https://searchfox.org/mozilla-central/rev/8dc9602bebd48a94a12aaeb18a65a02d9aed4de3/tools/profiler/core/ProfileBufferEntry.cpp#1286-1287
[2] https://searchfox.org/mozilla-central/rev/8dc9602bebd48a94a12aaeb18a65a02d9aed4de3/mozglue/baseprofiler/public/BaseProfilerMarkersDetail.h#302
[3] https://searchfox.org/mozilla-central/rev/8dc9602bebd48a94a12aaeb18a65a02d9aed4de3/mozglue/baseprofiler/public/BaseProfilerMarkersDetail.h#313-317
[4] https://searchfox.org/mozilla-central/rev/8dc9602bebd48a94a12aaeb18a65a02d9aed4de3/tools/profiler/core/platform.cpp#2997,3006

Differential Revision: https://phabricator.services.mozilla.com/D129450
2021-10-26 21:00:50 +00:00
Botond Ballo
12fcf18ec0 Bug 1737686 - Include Fission tests in the fpush-linux-android Try preset. r=tnikkel,ahal
Differential Revision: https://phabricator.services.mozilla.com/D129442
2021-10-26 18:30:45 +00:00
Renovate Bot
c54d5f420d no bug - Update dependency docutils to v0.18 r=linter-reviewers,marco DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D129513
2021-10-26 15:04:01 +00:00
Jan Odvarko
eca2f3ae2a Bug 1737572 - [devtools] Move documentation for contributors to a subfolder r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D129389
2021-10-26 09:41:51 +00:00
Evgenia Kotovich
228e38a58c Bug 1576768 [eslint] Turn on JavaScript linting and formatting rules for .sjs files. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D128483
2021-10-25 11:12:41 +00:00
Riya
ac2ad7e7f2 Bug 1737032 - Removed traces of "remote XUL". r=Gijs,fluent-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D129255
2021-10-25 11:00:47 +00:00
Renovate Bot
8ec610cce9 no bug - Update dependency autopep8 to v1.6.0 r=linter-reviewers,marco DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D129355
2021-10-24 21:33:48 +00:00
criss
152f71d4d3 Backed out changeset b60f98f26664 (bug 1576768) for causing mochitest failures. CLOSED TREE 2021-10-22 15:55:50 +03:00
Evgenia Kotovich
e29e29aa5a Bug 1576768 [eslint] Turn on JavaScript linting and formatting rules for .sjs files. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D128483
2021-10-22 11:39:46 +00:00
Gerald Squelart
8ff93952a4 Bug 1737058 - Empty MOZ_PROFILER_SHUTDOWN in child processes, so they don't needlessly and dangerously write their profile to the same file - r=canaltinova
The user shouldn't set MOZ_PROFILER_SHUTDOWN to an empty string, it wouldn't work anyway.
So now there is an extra check for that, to avoid even attempting to write a profile when there is no actual filename.

Thanks to this, the parent process can now just re-set MOZ_PROFILER_SHUTDOWN to "" in its children, so that they won't try to output their own profile into the same file. (This used to mostly work, because the parent process was the last to write its profile; but anecdotal data shows this may not alwaybe be true.)

As a bonus optimization, this means that child processes don't waste time needlessly saving their profile to disk.

Differential Revision: https://phabricator.services.mozilla.com/D129237
2021-10-22 08:41:27 +00:00
Frederik Braun
07077e4449 Bug 1736781 - Update eslint-plugin-no-unsanitized to version 3.2.0 r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D128988
2021-10-21 13:08:11 +00:00
Gerald Squelart
1af62d829d Bug 1577658 - Read samples&markers from all threads at once - r=canaltinova
Finally it all comes together!
Factored-out functions from previous patches are now used by the new functions, which work with streaming contexts, in order to prepare stacks are other things first, then read the profile buffer just once to extract all samples and markers, and finally output this data in the expected JSON format.

One trick, is that when working on "legacy" entries (mostly related to samples), we need to handle "modern" marker entries as we encounter them; this happens in EntryGetter, and also when reading compact stacks and same-samples.

Differential Revision: https://phabricator.services.mozilla.com/D128444
2021-10-21 05:47:25 +00:00
Gerald Squelart
1538b47534 Bug 1577658 - Factor DoStreamSamplesToJSON out of ProfileBuffer::StreamSamplesToJSON - r=canaltinova
This refactoring is a bit more complex (to prepare for the next patch).

The body of StreamSamplesToJSON was moved to a function that takes a lambda, which will provide streaming parameters relevant to the thread id of each read sample.
For now, it's only used by StreamSamplesToJSON, so in this case the lambda only checks if the entry thread id is the expected one, and it provides the JSON writer and other things needed to write these samples.

One extra complexity is that the `ProfileSample sample` that was outside the loop is now removed -- because in later patches this code will handle samples from different threads, so they cannot all share this one sample object. Instead the information that must be carried over is in the streaming parameters (mPreviousStackState and mPreviousStack), so that they correspond to one thread each. But the overall logic is the same, apart from where this out-of-the-loop information lives.

And another difference is that old samples (before `aSinceTime`) are fully processed, and then discarded just before being output, because we need their information to be in the thread's UniqueStacks, in case it's used by a later same-as-before sample.

Differential Revision: https://phabricator.services.mozilla.com/D128443
2021-10-21 05:47:25 +00:00
Gerald Squelart
8bca70e031 Bug 1577658 - Add classes containing process and thread streaming contexts - r=canaltinova
ThreadStreamingContext contains all the information needed to output samples and markers relevant to one thread.

ProcessStreamingContext contains a list of ThreadStreamingContext's for all profiled threads. This way, when reading the profile buffer, it will be possible to send each sample&marker to the relevant JSON writer.

Differential Revision: https://phabricator.services.mozilla.com/D128442
2021-10-21 05:47:24 +00:00
Gerald Squelart
211590ad5a Bug 1577658 - Factor StreamTablesAndTraceLogger out of ProfiledThreadData::StreamJSON - r=canaltinova
This new function will be used a second time in a later patch.

Differential Revision: https://phabricator.services.mozilla.com/D128441
2021-10-21 05:47:24 +00:00
Gerald Squelart
e65f8f7ae1 Bug 1577658 - Make ProfiledThreadData::StreamTraceLoggerJSON a static non-member function - r=canaltinova
StreamTraceLoggerJSON doesn't rely on ProfiledThreadData, so it can just be a file-static function.
The code hasn't changed at all, the function needed to be moved up the file, before its first use.

Differential Revision: https://phabricator.services.mozilla.com/D128440
2021-10-21 05:47:23 +00:00
Gerald Squelart
4280107150 Bug 1577658 - Factor out DoStreamSamplesAndMarkers to abstract sample and marker data output - r=canaltinova
The body of StreamSamplesAndMarkers has been factored out into a templated function, with some lambdas to cover the buffer-reading and streaming of samples and markers.
In a later patch, DoStreamSamplesAndMarkers will be used to also stream already-processed samples and markers.

Differential Revision: https://phabricator.services.mozilla.com/D128439
2021-10-21 05:47:23 +00:00