9388 Commits

Author SHA1 Message Date
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
Gerald Squelart
edc791b35d Bug 1577658 - EntryGetter::RestartAfter - r=canaltinova
While processing the profile buffer, the EntryGetter's iterator is used to read some "modern" entries, but then the EntryGetter is left to skip these entries again until the next "legacy" entry (with `e.Next()`).

Now, after reading modern entries, the EntryGetter's iterator is updated to directly skip the already-read modern entries.
And in a later patch this will be in fact necessary, otherwise we would process this modern data twice!

Differential Revision: https://phabricator.services.mozilla.com/D128438
2021-10-21 05:47:22 +00:00
Gerald Squelart
678e287e4d Bug 1577658 - Factor PrepareUniqueStacks out of ProfiledThreadData::StreamJSON - r=canaltinova
The start of StreamJSON is about setting up the UniqueStacks, it can be factored out.
In a later patch, this will be used to prepare the UniqueStacks for each thread in one loop, before processing the profile buffer.

Differential Revision: https://phabricator.services.mozilla.com/D128437
2021-10-21 05:47:22 +00:00
Gerald Squelart
153c2bb05e Bug 1577658 - UniqueStacks constructor can accept a ProfilerCodeAddressService - r=canaltinova
When it's constructed, UniqueStacks can now take a ProfilerCodeAddressService pointer, instead of having to add it separately.
It will be even more useful in a later patch, when constructing it as a struct member in one shot.

Differential Revision: https://phabricator.services.mozilla.com/D128434
2021-10-21 05:47:21 +00:00
Gerald Squelart
302a5711fa Bug 1577658 - DeserializeAfterKindAndStream takes a lambda: (tid) -> writer - r=canaltinova
Previously, DeserializeAfterKindAndStream would take a JSON writer and a thread id, using the thread id (if specified) to only output markers from that thread to the given writer.

Now, DeserializeAfterKindAndStream takes a lambda, which will be called with the thread id found in the marker, that lambda can either return null (nothing to output) or a pointer to a writer, in which case the marker is read and output to the given writer.
This makes DeserializeAfterKindAndStream more flexible, and will allow handling markers from different threads, each possibly being output to different writers.

Also, for simplicity the entry is now always fully read, so there is no need for the caller to do anything. The return bool is therefore unnecessary, and has been removed.

Differential Revision: https://phabricator.services.mozilla.com/D128433
2021-10-21 05:47:21 +00:00
Andi-Bogdan Postelnicu
0d12e234b2 Bug 1731582 - Move to clang-13 r=firefox-build-system-reviewers,mhentges,decoder
Join work with glandium.

Differential Revision: https://phabricator.services.mozilla.com/D126208
2021-10-20 12:03:20 +00:00
Gerald Squelart
6c62474dd7 Bug 1736489 - Always output the last counter sample before each change - r=florian
The makes the graphs much more correct:
If there were multiple skipped samples, the front-end would graph a long diagonal line between the samples before and after the skipped ones, making it look like the value gradually changed during that time.
Instead, by forcing the output of values before a change, this shows a better graph, with a horizontal line while the value didn't change, and a more abrupt diagonal line between the last two sample times when the change actually happened.

Also always output the very last sample, to clarify the final value (in case it was the same as previous ones.)

Differential Revision: https://phabricator.services.mozilla.com/D128841
2021-10-20 02:24:08 +00:00
Gerald Squelart
79a0e2a2fd Bug 1736489 - Add gtests for counters in JSON profiles - r=florian
This patch adds generic checks in all JSON profiles, that "counters" look valid.
And in GeckoProfiler.Counters, there are new checks for manually-added counters.

WaitForSamplingState had to be moved up. It's more efficient and reliable than an arbitraty `PR_Sleep` to wait for samples to be taken.

Differential Revision: https://phabricator.services.mozilla.com/D128840
2021-10-20 02:24:08 +00:00
Andrew Halberstadt
cf4e5e6294 Bug 1736559 - [lint] Ignore all 'package-lock.json' files in codespell linter, r=linter-reviewers,sylvestre
Depends on D128885

Differential Revision: https://phabricator.services.mozilla.com/D128886
2021-10-19 19:11:09 +00:00
Andrew Halberstadt
4dd650366c Bug 1736559 - [lint] Fix codespell silently fixing files, r=linter-reviewers,sylvestre
We have a check in the 'CodespellProcess' class to ignore errors that are
fixing single letter camelCase errors (since these tend to be used frequently.

Unfortunately, when using '--fix', these errors are fixed regardless as the
fixing happens with the codespell process. Since we increment the 'fix'
variable after the check happens, we don't even report that anything was
'fixed'.

Ideally we would find a way to prevent these types of errors from being fixed,
but for now this at will at least ensure that the user is notified that
something was modified.

Differential Revision: https://phabricator.services.mozilla.com/D128885
2021-10-19 19:11:09 +00:00
Heitor Neiva
1b6ed32435 Bug 527670 - Refactor Update Verify readme, r=aki
Added instructions to run update-verify locally

Differential Revision: https://phabricator.services.mozilla.com/D128796
2021-10-19 13:43:51 +00:00
Gerald Squelart
df50ece611 Bug 1735697 - Remove profiler_can_accept_markers(), use profiler_thread_is_being_profiled() instead - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D128577
2021-10-18 23:11:30 +00:00
Gerald Squelart
424aac2b72 Bug 1735697 - Only record markers from actually-profiled threads - r=florian
`profiler_add_marker()` now checks if the marker's target thread is actively being profiled. This is to prevent adding markers that would be discarded anyway, from taking CPU time to process, and from using space in the profile buffer.

This means that `profiler_thread_is_being_profiled(ProfilerThreadId)` must be used when a marker is intended for another thread, i.e., when it uses the MarkerThreadId option.

(Note: since baseprofiler::profiler_thread_is_being_profiled(ProfilerThreadId) is not available, baseprofiler::AddMarker cannot prevent markers targetted at non-profiled thread; There are none yet anyway.)

Differential Revision: https://phabricator.services.mozilla.com/D128576
2021-10-18 23:11:30 +00:00
Gerald Squelart
8bf5fd4b34 Bug 1735697 - profiler_is_being_profiled checks for pauses, and can check another thread - r=florian
If the profiler is paused, then really, threads are not *being* profiled.

profiler_is_active_and_unpaused() was added, to help with non-MOZ_GECKO_PROFILER builds.

(Note: baseprofiler::profiler_thread_is_being_profiled(ProfilerThreadId) is not possible to implement, but it's not needed anyway.)

Differential Revision: https://phabricator.services.mozilla.com/D128707
2021-10-18 23:11:29 +00:00
Gerald Squelart
a685378366 Bug 1735697 - ProfilerThreadRegistry::WithOffThreadRefOr - r=florian
ProfilerThreadRegistry::WithOffThreadRefOr is to ProfilerThreadRegistry::WithOffThreadRef as
ProfilerThreadRegistration::WithOnThreadRefOr is to ProfilerThreadRegistration::WithOnThreadRef.

So it is similar to ProfilerThreadRegistry::WithOffThreadRef, but it returns whatever the callback returns if the thread id was found, otherwise it returns a fallback value.

Differential Revision: https://phabricator.services.mozilla.com/D128575
2021-10-18 23:11:29 +00:00
Nika Layzell
40de6947f1 Bug 1734700 - Use the IO event queue for IOUtils background tasks, r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D128311
2021-10-18 19:34:59 +00:00
Mark Banner
5e856096fc Bug 1736022 - For ESLint, mark 'handleRequest' as a used variable for sjs files. r=Gijs
Depends on D128594

Differential Revision: https://phabricator.services.mozilla.com/D128595
2021-10-18 14:28:26 +00:00
Mark Banner
660f501442 Bug 1736022 - Speed up ESLint rule no-arbitrary-setTimeout.js. r=Gijs
This moves the more expensive check for testing the file type until after we've found an instance of setTimeout.
This is quicker as the initial checks are for simple comparisons.

Differential Revision: https://phabricator.services.mozilla.com/D128594
2021-10-18 14:28:25 +00:00
Evgenia Kotovich
0d0980ee0d Bug 1576768 - Automatically format .sjs files using prettier. r=Standard8,agi,zombie,extension-reviewers
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D128482
2021-10-18 09:26:33 +00:00
Daisuke Akatsuka
4e72afc41d Bug 1678607: Implement a mechanism to fire bookmark-tags-changed event. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D128326
2021-10-18 04:43:44 +00:00
Alexandru Michis
5b0d89d8d6 Backed out 3 changesets (bug 1678607) for causing bc failures in browser_bookmark_add_tags.js
Backed out changeset bf20be578758 (bug 1678607)
Backed out changeset fd3fbf15e95d (bug 1678607)
Backed out changeset 2688fa3d2bc2 (bug 1678607)
2021-10-18 03:10:58 +03:00
Daisuke Akatsuka
ef8ed2e02d Bug 1678607: Implement a mechanism to fire bookmark-tags-changed event. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D128326
2021-10-17 22:47:36 +00:00
Noemi Erli
2bba3cec69 Backed out changeset 2ab6bb03dcc1 (bug 1576768) for causing failures in test_double_submit.html CLOSED TREE 2021-10-18 02:05:57 +03:00
Evgenia Kotovich
3e3dff109c Bug 1576768 - Automatically format .sjs files using prettier. r=Standard8,agi,zombie,extension-reviewers
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D128482
2021-10-17 14:59:14 +00:00
Alexandru Michis
dac6815201 Backed out changeset 7c08aa027893 (bug 1576768) for causing multiple failures.
CLOSED TREE
2021-10-15 16:52:43 +03:00
Evgenia Kotovich
a8b32926fa Bug 1576768 - Automatically format .sjs files using prettier. r=Standard8,agi,zombie,extension-reviewers
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D128482
2021-10-15 12:58:11 +00:00
Kimberly Sereduck
bf944ccf36 Bug 1735540: Update ImageMagick url for Windows browsertime requirements r=perftest-reviewers,AlexandruIonescu
Differential Revision: https://phabricator.services.mozilla.com/D128383
2021-10-14 15:03:02 +00:00
Mathew Hodson
05af5b9c98 Bug 1735681 - Add colorama to pylint_requirements.in. r=ahal
This makes sure colorama stays in pylint_requirements.txt next
time someone regenerates it on a non-Windows machine. Since
colorama is only required by pylint on Windows.

Differential Revision: https://phabricator.services.mozilla.com/D128426
2021-10-14 13:14:02 +00:00