Commit Graph

8276 Commits

Author SHA1 Message Date
Gerald Squelart
95eb9ec051 Bug 1646266 - NoPayload default type, with specialized empty helper - r=gregtatum
`NoPayload` will be mostly used internally when adding markers without payload data.
It has an empty specialization of the MarkerTypeHelper (mainly to catch misuses), and the add-marker code will need to have different compile-time paths to handle it.

Differential Revision: https://phabricator.services.mozilla.com/D87252
2020-08-31 23:33:07 +00:00
Gerald Squelart
71abce20e5 Bug 1646266 - Rework backtrace-capture functions - r=gregtatum
`profiler_capture_backtrace(ProfileChunkedBuffer&)` renamed to `profiler_capture_backtrace_into(ProfileChunkedBuffer&)` (notice "_into"), which is clearer.

New function `profiler_capture_backtrace()` creates a buffer, uses `profiler_capture_backtrace_into()`, and returns a `UniquePtr<ProfileChunkedBuffer>`, which can later be given to `MarkerStack::TakeBacktrace`.

`profiler_get_backtrace()` (returning a `UniqueProfilerBacktrace`) now uses `profiler_capture_backtrace()`.

This patch reduces most duplicate code between these functions.

Differential Revision: https://phabricator.services.mozilla.com/D88280
2020-08-31 23:30:53 +00:00
Gerald Squelart
8670e62694 Bug 1646266 - Marker option: MarkerTiming - r=gregtatum
This moves the existing MarkerTiming class introduced in bug 1640969 to the BaseProfilerMarkersPrerequesites.h header, and can be used as a marker option.

Some minor clarifying changes:
- `Instant()` is split into two functions: `InstantNow()` and `InstantAt(TimeStamp)`.
- `Interval(TimeStamp, TimeStamp)` must be given both start and end, otherwise `IntervalUntilNowFrom(TimeStamp)` takes the start only and ends "now".

Also the default construction is now reserved for internal marker usage, the private member function `IsUnspecified()` will be used by the add-marker code will replace it with `InstantNow()`.

The serialization contains the phase, and only one or two timestamps as needed, to save space for non-interval timings.

Differential Revision: https://phabricator.services.mozilla.com/D87245
2020-08-31 23:30:17 +00:00
Gerald Squelart
8ff41618d2 Bug 1646266 - CorePS buffer access - r=gregtatum
The upcoming profiler-specific add-marker function will need to know which `ProfileChunkedBuffer` to serialize to, `profiler_get_core_buffer()` give access to the profiler's buffer, and `CachedCoreBuffer()` keeps it stored in a function-static object.

Differential Revision: https://phabricator.services.mozilla.com/D87256
2020-08-31 23:28:56 +00:00
Gerald Squelart
4e9b0b4d1f Bug 1646266 - ProfilerString{,8,16}View - r=gregtatum
These string views are similar to `std::string_view`, but they are optimized to be serialized in the profiler buffer, and later deserialized and streamed to JSON.
They accept literal strings, and keep them as unowned raw pointers and sizes.
They also accept any substring reference, assuming that they will only be used as parameters during function calls, and therefore the dependent string will live during that call where these `StringView`'s are used.

Internally, they also allow optional string ownership, which is only used during deserialization and streaming.
This is hidden, so that users are not tempted to use potentially expensive string allocations during profiling; it's only used *after* profiling, so it's less of an impact to allocate strings then. (But it could still be optimized later on, as part of bug 1577656.)

Differential Revision: https://phabricator.services.mozilla.com/D87242
2020-08-31 23:28:22 +00:00
Gerald Squelart
3cb4ee0995 Bug 1646266 - ProfilerMarkers skeleton files - r=gregtatum
This patch introduces all new files that contain the new markers C++ API and implementation.
They are mostly empty at this time, only including each other as eventually needed, and with `#ifdef MOZ_GECKO_PROFILER` guards.

Rough inclusion diagram: (header <-- includer)

    BaseProfilerMarkerPrerequesites.h <-- ProfilerMarkerPrerequesites.h  (Useful types: Input string view, marker options)
                  ^                                    ^
       BaseProfilerMarkerDetail.h     <--    ProfilerMarkerDetail.h      (Implementation details)
                  ^                                    ^
         BaseProfilerMarkers.h        <--      ProfilerMarkers.h         (Main API)
                  ^      ^---------                    ^   ^---------
       BaseProfilerMarkerTypes.h  |   <--    ProfilerMarkerTypes.h   |   (Common marker types)
                  ^         BaseProfiler.h        <--         GeckoProfiler.h  (Existing main profiler headers)

Differential Revision: https://phabricator.services.mozilla.com/D87241
2020-08-31 23:27:54 +00:00
Narcis Beleuzu
a7cd806311 Backed out 2 changesets (bug 1659530, bug 1657476) for bustages on check.svg. CLOSED TREE
Backed out changeset 761a09f4d153 (bug 1659530)
Backed out changeset c8afdd9434bb (bug 1657476)
2020-09-01 02:30:36 +03:00
Shane Caraveo
6f359e0bea Bug 1659530 skip 3rd party panel when installing recommended addons r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D87326
2020-08-31 21:38:13 +00:00
Mihai Alexandru Michis
6bf176bfa5 Backed out changeset d634c912adcd (bug 1655750) for causing Bug 1662030.
CLOSED TREE
2020-08-31 16:35:11 +03:00
Sylvestre Ledru
0063306864 Bug 1661434 - Add tring to the codespell exclude list
In the doc, we have an example of a regex called
[s]tring
it is confusing for codespell

Differential Revision: https://phabricator.services.mozilla.com/D88806
2020-08-31 12:23:24 +00:00
Sylvestre Ledru
9c192aa9ca Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 09:23:02 +00:00
Mihai Alexandru Michis
261d01524b Backed out changeset d0f173a90792 (bug 1519636) for causing bustages.
CLOSED TREE
2020-08-31 10:14:58 +03:00
Sylvestre Ledru
939dd426e6 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 06:51:21 +00:00
Andrew Halberstadt
36bafe8efd Bug 1655750 - [tryselect] Handle --list/edit-presets even on selectors that don't support presets, r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D88645
2020-08-30 17:44:20 +00:00
Ricky Stewart
89acae267e Bug 1661783 - Disable test_rst.py on Linux r=ahal
This test begins to fail due to a `pip` installation issue after bug 1660351. It's already disabled on macOS (also due to what the comment says is a `pip` installation issue), so it's very possible the custom `requirements.txt` that this test installs is deficient in some way that surfaces in certain `virtualenv`s under certain circumstances. I can't diagnose the failure, but what I have seen is that bug 1659539 will fix that problem entirely with no extra intervention required, so we should be able to re-enable this for Linux (and maybe macOS as well?) when that patch lands.

Differential Revision: https://phabricator.services.mozilla.com/D88653
2020-08-28 18:57:20 +00:00
Nick Thomas
ffceb1c957 Bug 1653476 - import partner repack script into tree and convert to py3, r=aki
Differential Revision: https://phabricator.services.mozilla.com/D88374
2020-08-27 22:19:32 +00:00
Butkovits Atila
b8629b8d1e Backed out 9 changesets (bug 1630809, bug 1653476) for Gecko Decision failures. CLOSED TREE
Backed out changeset 02a27bfc76dd (bug 1653476)
Backed out changeset afb5df61943a (bug 1630809)
Backed out changeset 04628c1f98e9 (bug 1630809)
Backed out changeset 4b4d50e0b1bf (bug 1630809)
Backed out changeset 2fa2deb5c993 (bug 1630809)
Backed out changeset d6652114cac3 (bug 1630809)
Backed out changeset ad5e4caa3291 (bug 1630809)
Backed out changeset d3d841cd14f3 (bug 1630809)
Backed out changeset b3746502e227 (bug 1630809)
2020-08-28 01:15:03 +03:00
Nick Thomas
9c0467f88b Bug 1653476 - import partner repack script into tree and convert to py3, r=aki
Differential Revision: https://phabricator.services.mozilla.com/D88374
2020-08-27 14:56:47 +00:00
Emil Farisan
76574f22bf Bug 1657121 - exclude uuid from s3_delete_missing. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D88282
2020-08-27 20:02:59 +00:00
Gerald Squelart
3cbc9b5572 Bug 1659404 - Fix non-MOZ_GECKO_PROFILER build - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D88375
2020-08-27 14:41:46 +00:00
Keefer Rourke
000d8dcc94 Bug 1660015: Add IOUtils to privileged eslint environment configuration r=barret,zombie
This change makes eslint aware of the global IOUtils interface, such that it
may be used without having to access it from the window or otherwise declaring
the global in a special comment on a file-by-file basis.

Differential Revision: https://phabricator.services.mozilla.com/D87612
2020-08-26 15:31:24 +00:00
Bruno Bartolomasi
3f561dcc33 Bug 1648027 - Add toolkit/components/telemetry/ in the include list of tools/lint/pylint.yml r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D83858
2020-08-26 14:14:47 +00:00
Gerald Squelart
1628f9ba8d Bug 1660177 - Replace SpliceableJSONWriter::Splice(const char*) with better calls where possible - r=canaltinova
In most calls to `SpliceableJSONWriter::Splice(const char*)`:
- The data comes from a `ChunkedJSONWriteFunc` and is copied to a new buffer, which is then copied again through `Write()`. Instead we can copy the data directly from the `ChunkedJSONWriteFunc`; and this is a nice complement to `TakeAndSplice()` below.
- Or the length is already known, so we can pass it to a new `Splice(const char*, size_t)`, which forwards it to `Write(const char*, size_t)`, saving one `strlen` call.

Differential Revision: https://phabricator.services.mozilla.com/D87703
2020-08-26 08:03:20 +00:00
Gerald Squelart
af0143531b Bug 1660177 - Clarify accesses to SpliceableChunkedJSONWriter's WriteFunc - r=canaltinova
`SpliceableChunkedJSONWriter::ChunkedWriteFunc` returns a `ChunkedJSONWriteFunc*`, which is never null and is either used to:
1. Copy data.
2. Or take ownership of the chunks.

In the first case, `ChunkedWriteFunc()` now returns a `const ChunkedJSONWriteFunc&` (notice "const &"), so only const members may be used to copy the data.

In the second case, a new function `TakeChunkedWriteFunc()` returns `ChunkedJSONWriteFunc&&` (notice "&&"), so it's clear that its chunks can be taken away. Some `DEBUG` assertions help ensure that it's not used anymore after that.
`TakeAndSplice()` now takes a `ChunkedJSONWriteFunc&&`.

All callers have been updated to the more appropriate functions.

Differential Revision: https://phabricator.services.mozilla.com/D87702
2020-08-26 08:03:17 +00:00
Razvan Maries
ff54551a34 Backed out 12 changesets (bug 1660328, bug 1660015, bug 1649595, bug 1649596, bug 1649593, bug 1659176, bug 1659839, bug 1659838, bug 1657663, bug 1657647, bug 1655460) for xpcshell perma failures. CLOSED TREE
Backed out changeset ff95badf90e3 (bug 1660328)
Backed out changeset a92f8525ab6f (bug 1659176)
Backed out changeset 8ca05470a0d5 (bug 1659839)
Backed out changeset 5de389b735d3 (bug 1649596)
Backed out changeset 73bdddd96664 (bug 1649595)
Backed out changeset 59800d609b55 (bug 1659838)
Backed out changeset 8aca41723313 (bug 1649593)
Backed out changeset dc0d90b3e135 (bug 1657647)
Backed out changeset e3dd5b6b4fbd (bug 1657663)
Backed out changeset f9c823fa14ba (bug 1657663)
Backed out changeset a5aecc7a6469 (bug 1655460)
Backed out changeset 21b64ef30e12 (bug 1660015)
2020-08-26 06:35:20 +03:00
Keefer Rourke
de9f6fdad8 Bug 1660015: Add IOUtils to privileged eslint environment configuration r=barret,zombie
This change makes eslint aware of the global IOUtils interface, such that it
may be used without having to access it from the window or otherwise declaring
the global in a special comment on a file-by-file basis.

Differential Revision: https://phabricator.services.mozilla.com/D87612
2020-08-24 16:13:01 +00:00
Sylvestre Ledru
18115d5efd Bug 1660615 - Mach doc: sphinx: pass the -T option by default r=firefox-source-docs-reviewers,championshuttler DONTBUILD
It shows exceptions by default:
https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-T

Differential Revision: https://phabricator.services.mozilla.com/D87969
2020-08-23 14:51:51 +00:00
Sylvestre Ledru
fee0487d60 Bug 1652286 - Firefox doc: Workaround the BlockingIOError error r=firefox-source-docs-reviewers,championshuttler
Seems the same issue as https://github.com/travis-ci/travis-ci/issues/8920

Differential Revision: https://phabricator.services.mozilla.com/D87952
2020-08-23 08:49:48 +00:00
Sylvestre Ledru
da495a5a28 Bug 1660615 - Add a verbose mode for "mach doc" r=firefox-source-docs-reviewers,championshuttler
And show the sphinx arguments

Differential Revision: https://phabricator.services.mozilla.com/D87951
2020-08-23 09:04:26 +00:00
Sylvestre Ledru
dcc2514c21 Bug 1660615 - ride along - reformat moztreedocs with black r=firefox-source-docs-reviewers,championshuttler
Differential Revision: https://phabricator.services.mozilla.com/D87950
2020-08-23 08:49:52 +00:00
Sylvestre Ledru
612c02c213 Bug 1658812 - sphinx/autodoc should also ignore tests directory r#?firefox-source-docs-reviewers r=firefox-source-docs-reviewers,ahal
Differential Revision: https://phabricator.services.mozilla.com/D86854
2020-08-22 14:23:47 +00:00
Kershaw Chang
b86af334f1 Bug 1652655 - P6: Add test_use_httpssvc.js to exclusion list. CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D87902
2020-08-21 19:33:06 +00:00
Simon Giesecke
f77f8fd84c Bug 1659674 - Change BulkWrite to return mozilla::Result. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D87419
2020-08-21 09:54:48 +00:00
DesWurstes
041dc6bfcd Bug 1020254 - PDFParent should set the find clipboard. r=mikedeboer
Differential Revision: https://phabricator.services.mozilla.com/D85140
2020-08-21 07:37:19 +00:00
Razvan Maries
ef96306031 Bug 1660288 - Fixing the lint failure. CLOSED TREE 2020-08-20 23:55:09 +03:00
Gijs Kruitbosch
11288fd257 Bug 1660288 - fix python3 errors in the linter's hooks.py tripped when using python3-based mercurial, r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D87800
2020-08-20 20:35:26 +00:00
Emil Farisan
e5378efe38 Bug 1658505 - updated links and updated some code blocks. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D87443
2020-08-19 16:10:37 +00:00
Emil Farisan
1c3c4674f6 Bug 1658505 - added banner in migrated pages and added table. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D86812
2020-08-19 10:12:39 +00:00
Emil Farisan
bfa8dd8228 Bug 1658505 - fix codespell and rst errors and remove unused reference. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D86810
2020-08-17 12:07:49 +00:00
Emil Farisan
8d75cc29fb Bug 1658505 - added debugging and memory sanitizer pages from MDN to in-tree. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D86705
2020-08-17 12:07:18 +00:00
Duncan Dean
d99484e5ff Bug 1620162 - Upgrade eslint-plugin-jest and fix new lint errors. r=bomsy,Standard8
Currently the `jest/no-standalone-expect` rule needs to be disabled for `jest-in-case` cases blocks as it is not compatible.

Differential Revision: https://phabricator.services.mozilla.com/D87184
2020-08-20 08:52:42 +00:00
Bogdan Tara
a904137456 Backed out changeset 0327b662a05f (bug 1659674) for nsStorageStream related central bustage CLOSED TREE 2020-08-20 02:58:41 +03:00
Gerald Squelart
5601ec576f Bug 1659901 - Rework profiler's TLS accesses - r=mstange
To ensure correct usage of TLSs in the profiler, they are now better encapsulated so that:
- init() is called once and its result is cached. (TLSREGISTEREDThread::Init() doesn't need proof of the PSLock, because it's using thread-safe function-static initializers.)
- get() and set() always init() as needed, or in some particular cases strongly assert that init() was successful.

Also, a null-check was missing in profiler_init_threadmanager().

Depends on D87588

Differential Revision: https://phabricator.services.mozilla.com/D87589
2020-08-19 18:26:32 +00:00
Gerald Squelart
2a9a115783 Bug 1657174 - Added more (un)registration TLS assertions - r=mstange
Assertions are also clarified with messages, to better distinguish the same tests in different locations.

Assertions should now cover all cases:
- NEW: After registering a thread in the profiler with `CorePS::AppendRegisteredThread`, the TLS should be set to that thread.
- NEW: If `profiler_register_thread` is called again, the TLS should still be set to that thread.
- When `profiler_unregister_thread` is first called, the TLS should still be set to that thread (that's the assertion currently trigering this bug 1657174),
- NEW: When `profiler_unregister_thread` is first called and after we remove the thread with `CorePS::RemoveRegisteredThread`, the TLS should now be null.
- If `profiler_unregister_thread` is called again (or with a never-registered thread), the TLS should be null.

This is a further exploratory patch for bug 1657174, this will not prevent crashes, but hopefully it should give a bit more information, at least a smaller range in which the possible presumed registration/TLS race happens.

Differential Revision: https://phabricator.services.mozilla.com/D87588
2020-08-19 17:49:12 +00:00
Simon Giesecke
9352526320 Bug 1659674 - Change BulkWrite to return mozilla::Result. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D87419
2020-08-19 14:39:03 +00:00
Florian Quèze
918620c7cc Bug 1659771 - Remove obsolete nsIProfiler.AddMarker API, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D87470
2020-08-18 22:52:55 +00:00
Sonia Singla
5f5c9fd7f2 Bug 1659267 - Remove usages of -moz-user-select across the Firefox codebase. r=emilio,marionette-reviewers,geckoview-reviewers,preferences-reviewers,whimboo,agi
Differential Revision: https://phabricator.services.mozilla.com/D87499
2020-08-18 23:37:51 +00:00
Ricky Stewart
1218762d08 Bug 1659575 - Delete mach python-safety r=ahal
There are zero uses of this `mach` command over the past 90 days according to our telemetry. There are no external references to `mach python-safety` in-tree, and indeed if you track the history of the originating bug 1468394, it appears that once the `mach` command was created, none of the follow-up work that was discussed (i.e. running this in CI and triaging failures to appropriate owners) was done over the following 2 years.

If this ever does appear to be useful in the future, we can just resurrect this code from source control.

Differential Revision: https://phabricator.services.mozilla.com/D87351
2020-08-18 14:18:24 +00:00
Nazım Can Altınova
8fbf2fb2ca Bug 1659103 - Start JVM profiler before loading of libxul and mozglue r=geckoview-reviewers,julienw,snorp
Before this patch, we were always waiting for libxul to load because we were
starting the JVM from libxul. But we needed to start this a lot earlier. Also
thinking that JVM profiler can actually run without the gecko side, we can
start this a lot earlier than we currently start. We need to check the
environmnet variables to be able to start the profiler. It looks like the best
place to do it is inside the GeckoThread.run method.

We have also a similar code for Java debugger, with maybeWaitForJavaDebugger
name. This fucntion does similar things in terms of enviromnent variable
handling.

Differential Revision: https://phabricator.services.mozilla.com/D87069
2020-08-18 12:57:22 +00:00
Andrew Halberstadt
456d9a582f Bug 1655107 - [moztreedocs] Use pip-tools rather than pipenv to manage doc dependencies r=championshuttler,sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D85048
2020-08-17 17:46:23 +00:00