Граф коммитов

2237 Коммитов

Автор SHA1 Сообщение Дата
Alexis Beingessner d652e4c378 Bug 1614697 - Remove supression for fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D99307
2020-12-14 17:26:32 +00:00
Ted Campbell c90491dbe9 Bug 1601632 - Cleanup ScriptPreloader Runnable behaviour. r=kmag,Gankro,decoder
Add `mWaitingForDecode` to indicate that main-thread is blocked on the
Monitor and should be woken. This avoids generating some of the unused
Runnables. Also ensure `mFinishDecodeRunnablePending` is only accessed while
holding the lock.

Depends on D99403

Differential Revision: https://phabricator.services.mozilla.com/D99404
2020-12-14 15:23:56 +00:00
Ted Campbell d8e3670c2f Bug 1601632 - Make ScriptPreloader::mToken updates Atomic. r=kmag,Gankro,decoder
The `mToken` is used across threads without full locking so it must be marked
as atomic. At the same time, we can use `exchange` operations to read or
write outside of the mMonitor lock.

Depends on D99402

Differential Revision: https://phabricator.services.mozilla.com/D99403
2020-12-14 15:23:48 +00:00
Ted Campbell 70f361ffe6 Bug 1608462 - Simplify locking for ScriptPreloader::MaybeFinishOffThreadDecode. r=kmag,Gankro,decoder
Be consistent about always calling `MaybeFinishOffThreadDecode` without
holding the lock to simplify code. This lets us remove a TSAN deadlock
exception.

Differential Revision: https://phabricator.services.mozilla.com/D99402
2020-12-14 15:23:34 +00:00
Andrew McCreight 215e494a20 Bug 1640445 - Avoid a race between the GC and WriteCache() with an extra field. r=kmag,decoder
See the comment on ScriptHolder for an explanation.

Differential Revision: https://phabricator.services.mozilla.com/D78711
2020-12-11 23:25:27 +00:00
Emma Malysz 3f3b02f520 Bug 1677185, update margins in skeleton UI if menubar is shown r=dthayer
The menubar is permanently shown if autohide is false. If that is the case, we
insert space above the tab and ensure the tab does not have a left margin.
It's height can change, so we store the height in our registry.

Differential Revision: https://phabricator.services.mozilla.com/D97195
2020-12-10 20:29:03 +00:00
Alexis Beingessner 680ebac7e0 Bug 1619162 - Remove supression for fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D98949
2020-12-10 07:34:01 +00:00
Doug Thayer 0411080eef Bug 1680258 - Ensure we properly clamp values to draw region r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D99110
2020-12-10 03:38:29 +00:00
Doug Thayer e5fb1240db Bug 1680258 - Don't try to draw rects with 0 width or height r=emalysz
This prevents an assertion from tripping below.

Differential Revision: https://phabricator.services.mozilla.com/D98476
2020-12-10 03:38:07 +00:00
Doug Thayer e2a2d43d90 Bug 1680258 - Check for problematic env vars for skeleton UI r=Gijs
Some env vars have effects similar to command line arguments which present
problems for the skeleton UI, and we want to treat these env vars similarly.

Differential Revision: https://phabricator.services.mozilla.com/D98475
2020-12-10 03:37:59 +00:00
Doug Thayer f0e16e432e Bug 1680258 - Improve skeleton UI arg checking for marionette r=Gijs
Previously, we implemented arg checking with `marionette` just carrying a free
pass, so we could let the arguments which typically come when running tests.
However, some marionette tests do like to play with arguments which we do not
want to get a free pass, such as -safe-mode. These changes allow just the
-profile argument through, as that is necessary for running tests.

Differential Revision: https://phabricator.services.mozilla.com/D98474
2020-12-10 03:37:52 +00:00
Mihai Alexandru Michis 822e8ce413 Backed out 7 changesets (bug 1680258) for causing osx mochitest timeouts.
CLOSED TREE

Backed out changeset 4b885b40c787 (bug 1680258)
Backed out changeset 8eb4ebbd13d0 (bug 1680258)
Backed out changeset 403d7441eb0c (bug 1680258)
Backed out changeset a253801a3155 (bug 1680258)
Backed out changeset 183d89827d4b (bug 1680258)
Backed out changeset 268d2aac128e (bug 1680258)
Backed out changeset e9b9f97caa6c (bug 1680258)
2020-12-09 23:03:09 +02:00
Doug Thayer 0cd0e25f37 Bug 1680258 - Ensure we properly clamp values to draw region r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D99110
2020-12-08 22:35:27 +00:00
Doug Thayer c5df59793d Bug 1680258 - Don't try to draw rects with 0 width or height r=emalysz
This prevents an assertion from tripping below.

Differential Revision: https://phabricator.services.mozilla.com/D98476
2020-12-08 22:35:26 +00:00
Doug Thayer ad7c418754 Bug 1680258 - Check for problematic env vars for skeleton UI r=Gijs
Some env vars have effects similar to command line arguments which present
problems for the skeleton UI, and we want to treat these env vars similarly.

Differential Revision: https://phabricator.services.mozilla.com/D98475
2020-12-08 22:35:25 +00:00
Doug Thayer 227ae0c840 Bug 1680258 - Improve skeleton UI arg checking for marionette r=Gijs
Previously, we implemented arg checking with `marionette` just carrying a free
pass, so we could let the arguments which typically come when running tests.
However, some marionette tests do like to play with arguments which we do not
want to get a free pass, such as -safe-mode. These changes allow just the
-profile argument through, as that is necessary for running tests.

Differential Revision: https://phabricator.services.mozilla.com/D98474
2020-12-08 22:35:25 +00:00
Alessio Placitelli fc6d79e330 Bug 1680474 - Remove Glean's dispatcher TSAN suppression. r=decoder
Even though the Glean dispatcher was shutting down, the SDK was not
properly joining on the thread, triggering a TSAN error. This has been
addressed in a new version of the Glean SDK.

Differential Revision: https://phabricator.services.mozilla.com/D98889
2020-12-07 11:02:42 +00:00
Doug Thayer 1772475d1b Bug 1672789 - Only allow one skeleton UI per instance of an install r=mhowell,cmartin
We don't want to show the skeleton UI if there is already an instance of
Firefox running for that install. Accordingly, we implement something
similar to the profile lock, acquiring exclusive access to
~/AppData/Local/Mozilla/Firefox/SkeletonUILock-<installHash>. If we do not do
this, then when a user clicks firefox.exe while an existing instance is
running, under default conditions we will open the skeleton UI, then
almost immediately terminate and send a message to the existing instance to
open a new window.

Differential Revision: https://phabricator.services.mozilla.com/D98525
2020-12-08 19:23:10 +00:00
Alexis Beingessner 3a6630ec51 Bug 1606803 - revert d4953114117e, still happens rarely. r=decoder
Specifically an instance was being blocked by our nsHostResolver suppression.

Differential Revision: https://phabricator.services.mozilla.com/D99112
2020-12-08 16:56:00 +00:00
Alexis Beingessner 137f4e977f Bug 1670982 - Make the bitflags in CacheStorageService actually atomic. r=decoder,necko-reviewers,dragana,valentin
TSan found races on these flags that are ostensibly benign but this way there's no UB.

This code is a bit weird. These bitfields are seemingly pointless as
they're squeezed between a uint64_t and an Atomic<bool>. There's plenty
of space for 2 more bools there.

Also the Atomic<bool> could theoretically be merged into the flags. For
now, here's the version of this patch that preserves the semantics of
this code as closely as possible, for review by the code owners.

Differential Revision: https://phabricator.services.mozilla.com/D93416
2020-12-08 16:56:23 +00:00
Alexis Beingessner f0c5b52027 Bug 1670982 - Make the bitfields in nsHostResolver atomic. r=decoder,necko-reviewers,dragana,valentin
TSan found races between mResolveAgain and mGetTtl. This makes them non-UB.

The code is a bit weird. Although the values are typed as uint16_t's, they're
used as bools (even assigned true/false). In addition, the atomic bool mTRRUsed
could be folded into these fields, as there is a spare bit. I decided not to
change these things, as network code can have weird representation requirements
that I'd prefer the owners of the code chime in on first.

Differential Revision: https://phabricator.services.mozilla.com/D93417
2020-12-08 16:39:42 +00:00
Bogdan Tara f121ad11ea Backed out 2 changesets (bug 1670982) for tsan xpc shell failures CLOSED TREE
Backed out changeset 3ce1e8c65cbc (bug 1670982)
Backed out changeset e7211a44d968 (bug 1670982)
2020-12-08 01:59:32 +02:00
Alexis Beingessner d9f9c2427e Bug 1670982 - Make the bitflags in CacheStorageService actually atomic. r=decoder,necko-reviewers,dragana,valentin
TSan found races on these flags that are ostensibly benign but this way there's no UB.

This code is a bit weird. These bitfields are seemingly pointless as
they're squeezed between a uint64_t and an Atomic<bool>. There's plenty
of space for 2 more bools there.

Also the Atomic<bool> could theoretically be merged into the flags. For
now, here's the version of this patch that preserves the semantics of
this code as closely as possible, for review by the code owners.

Differential Revision: https://phabricator.services.mozilla.com/D93416
2020-12-07 18:32:51 +00:00
Alexis Beingessner 68b4c43ed6 Bug 1670982 - Make the bitfields in nsHostResolver atomic. r=decoder,necko-reviewers,dragana,valentin
TSan found races between mResolveAgain and mGetTtl. This makes them non-UB.

The code is a bit weird. Although the values are typed as uint16_t's, they're
used as bools (even assigned true/false). In addition, the atomic bool mTRRUsed
could be folded into these fields, as there is a spare bit. I decided not to
change these things, as network code can have weird representation requirements
that I'd prefer the owners of the code chime in on first.

Differential Revision: https://phabricator.services.mozilla.com/D93417
2020-12-07 18:32:33 +00:00
David Major c0208a72b1 Bug 1681123 - Bump mingw-w64 revision to fix _aligned_malloc in clang 12 r=tjr
clang 12 (specifically https://reviews.llvm.org/D91379) made some refactorings to libc++ that exposed a problem in the MinGW headers. That has now been fixed upstream.

In the meantime the headers also gained definitions for ProcessPayloadRestrictionPolicy, so we can remove our workaround for that.

Differential Revision: https://phabricator.services.mozilla.com/D98945
2020-12-07 17:55:27 +00:00
Simon Giesecke 1c53236b70 Bug 1679272 - Include ScopeExit.h exactly where used. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D98888
2020-12-07 14:25:59 +00:00
Kevin Jacobs 1269e1524e Bug 1680655 - Extend TSAN false-positive suppression to EncryptedClientHelloServer. r=decoder
No idea why this didn't show up in earlier try runs, but this is a known false-positive that we need to suppress in the newly-added EncryptedClientHelloServer.

Differential Revision: https://phabricator.services.mozilla.com/D98771
2020-12-04 15:42:25 +00:00
Simon Giesecke 91331998d6 Bug 1679763 - Explicitly instantiate often-used profiler templates. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D98187
2020-12-04 14:21:57 +00:00
Razvan Maries c3c2eaa18e Backed out changeset 975163dad54f (bug 1680402) for causing leaks. CLOSED TREE 2020-12-04 07:06:30 +02:00
Jeff Muizelaar 62e7969d1a Bug 1680402. Use stderr in printf_stderr instead of reopening fd 2. r=glandium
Currently, printf_stderr doesn't show up when running with ./mach run.
This is because we run with -attach-console and that redirects stderr
to a different file descriptor using freopen in UseParentConsole.

The change from just using stderr directly happened in bug 340443 and was done
to avoid some linking issues. That problem doesn't seem to apply anymore so we
should be able to go back to the straightforward implemention that works even
if stderr has been redirected. The mozglue implementation was cargo culted from
xpcom, and there wasn't a reason other than that for the fdopen(dup()) there.

Differential Revision: https://phabricator.services.mozilla.com/D98550
2020-12-04 02:46:57 +00:00
Alexis Beingessner 7dc4ce8177 Bug 1606864 - Add more supressions for new variants. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D98643
2020-12-03 20:57:09 +00:00
Alessio Placitelli b0c6d152de Bug 1662868 - Add a TSAN suppression for the Glean dispatcher. r=decoder
We will investigate the root cause of the TSAN problem in bug
1680474, but we need to land this massive stack first.

Differential Revision: https://phabricator.services.mozilla.com/D98579
2020-12-03 12:01:41 +00:00
Bogdan Tara 24ca702e18 Backed out changeset fdd4de984fd3 (bug 1679763) for profiler related bustage CLOSED TREE 2020-12-02 21:10:06 +02:00
Simon Giesecke e74ea6985a Bug 1679763 - Explicitly instantiate often-used profiler templates. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D98187
2020-12-02 17:00:06 +00:00
Alexis Beingessner 9b93f68a1f Bug 1677049 - disable more flakey tests and add a supression for mochitest-bc. r=malexandru
Differential Revision: https://phabricator.services.mozilla.com/D98485
2020-12-02 16:33:52 +00:00
Geoff Brown 58cf701644 Bug 1607446 - Fix tsan-detected data race in nsJARChannel; r=valentin,decoder
Simply use Atomic to avoid a data race.

Differential Revision: https://phabricator.services.mozilla.com/D98276
2020-12-02 07:36:56 +00:00
Gerald Squelart 2893c11987 Bug 1676079 - For consistency and clarity, add Marker suffix to all marker types - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D98123
2020-11-30 22:52:44 +00:00
Gerald Squelart b9191bb2ce Bug 1646613 - Rename profiler overhead variables to include their true unit - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D97993
2020-11-30 10:44:13 +00:00
Simon Giesecke 8fc9b0ee7c Bug 1677284 - Fix Windows AARch64 bustage. a=bustage-fix
CLOSED TREE

Differential Revision: https://phabricator.services.mozilla.com/D97884
2020-11-23 16:54:12 +00:00
Florian Quèze 0d164d3a9f Bug 1674476 - ChromeUtils.addProfilerMarker should support capturing a stack or setting the category, r=gerald,gregtatum.
Differential Revision: https://phabricator.services.mozilla.com/D95406
2020-11-20 15:41:16 +00:00
Gerald Squelart a56d00ddb7 Bug 1678159 - Move WritePropertyTime to SpliceableJSONWriter::TimeProperty - r=gregtatum
TimeStamps in markers must now be streamed through `SpliceableJSONWriter::TimeProperty(name, timestamp)`.
This is consistent with all other JSON-writing functions being in `SpliceableJSONWriter` (and base class `JSONWriter`).

Depends on D97556

Differential Revision: https://phabricator.services.mozilla.com/D97557
2020-11-20 02:23:08 +00:00
Gerald Squelart 7c60972925 Bug 1678181 - Output chartLabel and tableLabel in marker schema - r=gregtatum
Depends on D97555

Differential Revision: https://phabricator.services.mozilla.com/D97556
2020-11-20 02:19:57 +00:00
Alexis Beingessner 40d9acf18f Bug 1677682 - use a wildcard for generics to avoid accidental regex syntax. r=decoder
Didn't want to mess around with double-escaping slashes

Differential Revision: https://phabricator.services.mozilla.com/D97645
2020-11-19 19:12:32 +00:00
Csoregi Natalia baf3102105 Backed out changeset 88f6cae1d63f (bug 1674770) for causing build bustages. CLOSED TREE 2020-11-19 19:06:26 +02:00
Alexis Beingessner fa2a407bd0 Bug 1674770 - Update parking_lot to get RwLock fix. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D97608
2020-11-19 16:47:35 +00:00
Gerald Squelart d225beb0eb Bug 1671403 - Also prevent re-entrant operations when the ProfilerChild mutex is locked on the current thread - r=canaltinova
Expand `profiler_is_locked_on_current_thread()` to also return true if the ProfilerChild mutex is locked on the current thread.
This will prevent some profiler-re-entrant operations (like native allocation markers) from running.

In particular, this removes the potential deadlock found in bug 1671403:
- SamplerThread: In the sampling loop, lock the main profiler mutex, run a ProfilerChild update, which attempts to lock the ProfilerChild mutex.
- ProfilerChild thread: While processing an IPC message with an update, lock the ProfilerChild mutex, then resolve the update, which records a native allocation with a backtrace that attempts to lock the main profiler mutex.
With this patch, the native allocation won't record a marker while the ProfilerChild mutex is locked.

Differential Revision: https://phabricator.services.mozilla.com/D96969
2020-11-19 11:47:46 +00:00
Gerald Squelart b3314a1582 Bug 1675409 - Removed now-unused ProfilerMarkerPayload and all dependencies - r=gregtatum,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96054
2020-11-18 21:56:57 +00:00
Gerald Squelart a10f7166db Bug 1675409 - Migrated TracingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96053
2020-11-18 21:55:51 +00:00
Gerald Squelart 8ed348d0c7 Bug 1675409 - Migrated UserTimingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96051
2020-11-18 21:53:09 +00:00
Gerald Squelart 72195228c9 Bug 1675409 - Fix ProfilerString16View::WrapNullTerminatedString and Span converter - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96047
2020-11-18 21:51:06 +00:00
Gerald Squelart c3d6e979a5 Bug 1675409 - Migrated MediaSampleMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96043
2020-11-18 21:49:52 +00:00
Gerald Squelart fea07678c1 Bug 1675409 - Migrated ContentBuildPayload and ContentFullPaintPayload to Markers 2.0 API - r=gregtatum
In this case, the same marker type "CONTENT_FULL_PAINT_TIME" is used in separate places, so it makes sense to put the marker type definition in a common location.

Differential Revision: https://phabricator.services.mozilla.com/D96042
2020-11-18 21:49:50 +00:00
Gerald Squelart 4d9cfb4113 Bug 1675409 - Migrated LogMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96039
2020-11-18 21:47:24 +00:00
Gerald Squelart 46fed8e10f Bug 1675409 - Migrated LongTaskMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96038
2020-11-18 21:46:56 +00:00
Gerald Squelart 237baa429c Bug 1675409 - Migrated HangMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96036
2020-11-18 21:45:54 +00:00
Gerald Squelart a8f0aede3a Bug 1675409 - Make ProfileBufferRawPointer usable in StreamJSONMarkerData functions - r=gregtatum
To be able to deserialize raw pointers (when streaming markers), `ProfileBufferRawPointer` must be used (to prevent uncontrolled raw pointers), but with the new API implementation the deserializer must accept references to `ProfilerBufferRawPointer` instead of just a raw pointer.

Differential Revision: https://phabricator.services.mozilla.com/D96032
2020-11-18 21:44:35 +00:00
Razvan Maries b7eeb731df Backed out 23 changesets (bug 1675409) for build bustages on Preferences.cpp. CLOSED TREE
Backed out changeset c1a131a55767 (bug 1675409)
Backed out changeset 47d210802a5d (bug 1675409)
Backed out changeset e8ebb1c58d30 (bug 1675409)
Backed out changeset 69a1e9aeff2a (bug 1675409)
Backed out changeset 68f330b387a8 (bug 1675409)
Backed out changeset e4750d9ef5a1 (bug 1675409)
Backed out changeset bb6bb71e5ab3 (bug 1675409)
Backed out changeset 988d7f4716df (bug 1675409)
Backed out changeset ca41382e891c (bug 1675409)
Backed out changeset 90f3fbbbbeda (bug 1675409)
Backed out changeset 9b109d61a6f6 (bug 1675409)
Backed out changeset 3dd66abfdaa2 (bug 1675409)
Backed out changeset 44181df5f0db (bug 1675409)
Backed out changeset bb2603d947fc (bug 1675409)
Backed out changeset 97055cf20a56 (bug 1675409)
Backed out changeset f88fcf09de0d (bug 1675409)
Backed out changeset 7963e1c49786 (bug 1675409)
Backed out changeset 4c379c1061c3 (bug 1675409)
Backed out changeset b8be8ae7da63 (bug 1675409)
Backed out changeset 0b90aa89421e (bug 1675409)
Backed out changeset c10fb46467c9 (bug 1675409)
Backed out changeset 894ac233b290 (bug 1675409)
Backed out changeset 075d1d8e34c2 (bug 1675409)
2020-11-18 20:06:28 +02:00
Sylvestre Ledru bebb9f9181 Bug 1519636 - Reformat with clang-format-11 to the Google coding style r=andi,sg,geckoview-reviewers,snorp
It is bringing some minor changes

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D90795
2020-11-18 09:05:59 +00:00
Kevin Jacobs a27b76b246 Bug 1677849 - Remove TSAN suppressions for certificate functions. r=Gankro
Differential Revision: https://phabricator.services.mozilla.com/D97371
2020-11-17 23:58:10 +00:00
Gerald Squelart ced008cc9f Bug 1675409 - Removed now-unused ProfilerMarkerPayload and all dependencies - r=gregtatum,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96054
2020-11-17 22:26:20 +00:00
Gerald Squelart 9506ea6302 Bug 1675409 - Migrated TracingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96053
2020-11-17 22:25:06 +00:00
Gerald Squelart 2ab89b23a6 Bug 1675409 - Migrated UserTimingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96051
2020-11-17 22:22:34 +00:00
Gerald Squelart 3db19002bf Bug 1675409 - Fix ProfilerString16View::WrapNullTerminatedString and Span converter - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96047
2020-11-17 22:20:24 +00:00
Gerald Squelart 6462c5154d Bug 1675409 - Migrated MediaSampleMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96043
2020-11-17 22:19:06 +00:00
Gerald Squelart 586ccbf033 Bug 1675409 - Migrated ContentBuildPayload and ContentFullPaintPayload to Markers 2.0 API - r=gregtatum
In this case, the same marker type "CONTENT_FULL_PAINT_TIME" is used in separate places, so it makes sense to put the marker type definition in a common location.

Differential Revision: https://phabricator.services.mozilla.com/D96042
2020-11-17 22:18:58 +00:00
Gerald Squelart c76eb1b69b Bug 1675409 - Migrated LogMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96039
2020-11-17 22:16:49 +00:00
Gerald Squelart 067cad5579 Bug 1675409 - Migrated LongTaskMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96038
2020-11-17 22:16:16 +00:00
Gerald Squelart 986eaf5787 Bug 1675409 - Migrated HangMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96036
2020-11-17 22:15:10 +00:00
Gerald Squelart 4eddaa6c69 Bug 1675409 - Make ProfileBufferRawPointer usable in StreamJSONMarkerData functions - r=gregtatum
To be able to deserialize raw pointers (when streaming markers), `ProfileBufferRawPointer` must be used (to prevent uncontrolled raw pointers), but with the new API implementation the deserializer must accept references to `ProfilerBufferRawPointer` instead of just a raw pointer.

Differential Revision: https://phabricator.services.mozilla.com/D96032
2020-11-17 22:13:48 +00:00
Mihai Alexandru Michis c0d25b01b2 Backed out 24 changesets (bug 1666566, bug 1675409) for causing hazard failures in profiler/core/platform.cpp
CLOSED TREE

Backed out changeset 4d8af8533fd4 (bug 1666566)
Backed out changeset f031a3a8a20f (bug 1675409)
Backed out changeset 2b7e1a031921 (bug 1675409)
Backed out changeset bda5a24b2d0a (bug 1675409)
Backed out changeset 4282e2284314 (bug 1675409)
Backed out changeset 0637f1b26e9f (bug 1675409)
Backed out changeset 67ae04c8f607 (bug 1675409)
Backed out changeset 6c7b3f3618ef (bug 1675409)
Backed out changeset 2f325c22d169 (bug 1675409)
Backed out changeset 1e48ff70ad8f (bug 1675409)
Backed out changeset 1dfc32d6871d (bug 1675409)
Backed out changeset 4f1f218a777b (bug 1675409)
Backed out changeset e6ac8722b38e (bug 1675409)
Backed out changeset cf132e15fb57 (bug 1675409)
Backed out changeset a126e6b00ba9 (bug 1675409)
Backed out changeset fbc7fbb04f33 (bug 1675409)
Backed out changeset 554c69681474 (bug 1675409)
Backed out changeset 44d0521c701f (bug 1675409)
Backed out changeset 04653dfe4720 (bug 1675409)
Backed out changeset 41ca2c043a00 (bug 1675409)
Backed out changeset 264ae4c805d4 (bug 1675409)
Backed out changeset 5f3bbdac0d52 (bug 1675409)
Backed out changeset 11311c11a6e8 (bug 1675409)
Backed out changeset 0355fbc44baf (bug 1675409)
2020-11-17 19:31:28 +02:00
Gerald Squelart f8c24dd6a4 Bug 1675409 - Removed now-unused ProfilerMarkerPayload and all dependencies - r=gregtatum,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96054
2020-11-17 11:40:46 +00:00
Gerald Squelart e89990aa2c Bug 1675409 - Migrated TracingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96053
2020-11-17 11:39:42 +00:00
Gerald Squelart c152b9befc Bug 1675409 - Migrated UserTimingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96051
2020-11-17 11:37:08 +00:00
Gerald Squelart 06ed2337ba Bug 1675409 - Fix ProfilerString16View::WrapNullTerminatedString and Span converter - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96047
2020-11-17 12:05:53 +00:00
Gerald Squelart 4075cd5ed6 Bug 1675409 - Migrated MediaSampleMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96043
2020-11-17 11:33:48 +00:00
Gerald Squelart 8846b82e18 Bug 1675409 - Migrated ContentBuildPayload and ContentFullPaintPayload to Markers 2.0 API - r=gregtatum
In this case, the same marker type "CONTENT_FULL_PAINT_TIME" is used in separate places, so it makes sense to put the marker type definition in a common location.

Differential Revision: https://phabricator.services.mozilla.com/D96042
2020-11-17 11:33:31 +00:00
Gerald Squelart 374448fe41 Bug 1675409 - Migrated LogMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96039
2020-11-17 11:31:37 +00:00
Gerald Squelart ee94544ace Bug 1675409 - Migrated LongTaskMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96038
2020-11-17 11:31:04 +00:00
Gerald Squelart 4a50146cab Bug 1675409 - Migrated HangMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96036
2020-11-17 11:30:03 +00:00
Gerald Squelart 50c0d4ca4f Bug 1675409 - Make ProfileBufferRawPointer usable in StreamJSONMarkerData functions - r=gregtatum
To be able to deserialize raw pointers (when streaming markers), `ProfileBufferRawPointer` must be used (to prevent uncontrolled raw pointers), but with the new API implementation the deserializer must accept references to `ProfilerBufferRawPointer` instead of just a raw pointer.

Differential Revision: https://phabricator.services.mozilla.com/D96032
2020-11-17 11:28:35 +00:00
Alexis Beingessner 9a0f581986 Bug 1671691 - Enable Rust stdlib instrumentation. r=decoder
* Bumps the tsan toolchain to rust-nightly-2020-11-14 that has my patches to make -Zbuild-std work in vendored environments:
  * https://github.com/rust-lang/cargo/pull/8834
  * https://github.com/rust-lang/rust/pull/78790

* Passes -Zbuild-std to cargo when MOZ_TSAN is defined (mk_add_options --enable-thread-sanitizer)

* Removes generic Rust supressions and adds much more specific ones
    * One presumed upstream false positive from tsan not understanding the code
    * One actual upstream bug tsan found (yay!)
    * One new real issue uncovered
    * One issue that probably already existed intermittently but I happened to hit

Differential Revision: https://phabricator.services.mozilla.com/D97165
2020-11-16 18:36:41 +00:00
Christian Holler 1e211d70ab Bug 1623541 - Add temporary suppression. r=Gankro
Differential Revision: https://phabricator.services.mozilla.com/D96982
2020-11-16 14:37:06 +00:00
Doug Thayer 78cca3abfe Bug 1674389 - Implement rounded borders on Skeleton UI rects r=mstange,jrmuizel
I'm hoping that the comments in the code are sufficient documentation of this,
but here is a quick overview. The mockup we got from design has rounded rects
in it, and bordered rounded rects in it, so we need to support drawing those.
Initially we tried using the RoundRect function in GDI. However, 1) GDI doesn't
support anti-aliasing, which is unfortunately noticeable, 2) we were
observing strange issues with only some of the corners being rounded with
RoundRect at higher radii / stroke widths. 3) drawing on top of things drawn
with RoundRect would be complicated and inefficient unless we switched
everything over to GDI calls.

As it stands this drawing code is platform agnostic, assuming we have a way of
blitting a raw bitmap to the screen on a given platform, which is a nice trait
to have and makes me think twice about switching all of the drawing over to
direct GDI calls.

Differential Revision: https://phabricator.services.mozilla.com/D95317
2020-11-13 20:39:10 +00:00
Mihai Alexandru Michis 8bead54135 Backed out changeset 1482b642c46a (bug 1674389) for causing spidermonkey failures in PreXULSkeletonUI.cpp
CLOSED TREE
2020-11-13 22:17:26 +02:00
Doug Thayer c6153cac38 Bug 1674389 - Implement rounded borders on Skeleton UI rects r=mstange,jrmuizel
I'm hoping that the comments in the code are sufficient documentation of this,
but here is a quick overview. The mockup we got from design has rounded rects
in it, and bordered rounded rects in it, so we need to support drawing those.
Initially we tried using the RoundRect function in GDI. However, 1) GDI doesn't
support anti-aliasing, which is unfortunately noticeable, 2) we were
observing strange issues with only some of the corners being rounded with
RoundRect at higher radii / stroke widths. 3) drawing on top of things drawn
with RoundRect would be complicated and inefficient unless we switched
everything over to GDI calls.

As it stands this drawing code is platform agnostic, assuming we have a way of
blitting a raw bitmap to the screen on a given platform, which is a nice trait
to have and makes me think twice about switching all of the drawing over to
direct GDI calls.

Differential Revision: https://phabricator.services.mozilla.com/D95317
2020-11-13 19:36:50 +00:00
Emma Malysz bf453ef8eb Bug 1665461: reflect the correct colors for default themes in the skeleton UI. r=dthayer
This patch supports a skeleton UI for default, light, and dark themes.
It is not enabled for apenglow or any custom themes.

This also takes into account the system theme. If the user has the default
theme selected and is in dark mode, we override the theme and present the
dark theme skeleton UI.

Differential Revision: https://phabricator.services.mozilla.com/D96230
2020-11-12 23:56:44 +00:00
Bogdan Tara e63d1b0d21 Backed out changeset 9c13c984601a (bug 1665461) for browser_preXULSkeletonUIRegistry.js failures CLOSED TREE 2020-11-12 20:49:21 +02:00
Emma Malysz 3e7bd6c9f4 Bug 1665461: reflect the correct colors for default themes in the skeleton UI. r=dthayer
This patch supports a skeleton UI for default, light, and dark themes.
It is not enabled for apenglow or any custom themes.

This also takes into account the system theme. If the user has the default
theme selected and is in dark mode, we override the theme and present the
dark theme skeleton UI.

Differential Revision: https://phabricator.services.mozilla.com/D96230
2020-11-12 16:05:47 +00:00
Toshihito Kikuchi dacc9d3479 Bug 1659438 - Part3: Add an array of the dependent modules paths to SharedSection. r=mhowell
This patch adds a list of the executable's dependent module's path to SharedSection
as an array of the offset to a string and a string buffer.  A following patch will
use this data from the browser process and the sandboxed processes.

Depends on D96283

Differential Revision: https://phabricator.services.mozilla.com/D96284
2020-11-10 20:52:00 +00:00
Toshihito Kikuchi 187d19452d Bug 1659438 - Part2: Transfer Kernel32ExportsSolver as a shared memory. r=mhowell
We transfer several ntdll's function addresses to a child process directly via
`WriteProcessMemory`.  This patch changes the way to transfer data to using
a section object as Chromium sandbox does, so that we can transfer more data
with the same cost as transferring a single handle value.

Depends on D96282

Differential Revision: https://phabricator.services.mozilla.com/D96283
2020-11-10 20:51:00 +00:00
Emma Malysz 21991a311d Bug 1670957, add placeholder rectangles for toolbarbuttons and display in skeleton UI r=dthayer,smaug,Gijs
If a searchbar is present, draw that similar to a urlbar.
This also changes how we store the urlbar, as we know will use our custom struct
to cleanly store the width and height.

Differential Revision: https://phabricator.services.mozilla.com/D95029
2020-11-10 16:48:10 +00:00
Toshihito Kikuchi 925e53c4f3 Bug 1672367 - Block Digital Guardian's module older than 7.6. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D96434
2020-11-10 13:21:18 +00:00
Doug Thayer 67c1c99d93 Bug 1666653 - Set sPreXULSkeletonUIEnabled correctly r=agashlin
Differential Revision: https://phabricator.services.mozilla.com/D95576
2020-11-06 20:58:46 +00:00
Doug Thayer 7d126d9916 Bug 1666653 - Only draw the skeleton UI when cmdline args are approved r=agashlin
Differential Revision: https://phabricator.services.mozilla.com/D95575
2020-11-06 20:58:43 +00:00
Doug Thayer 26315aa98c Bug 1674221 - Prefix Skeleton UI reg names with exe path r=agashlin
Differential Revision: https://phabricator.services.mozilla.com/D95541
2020-11-06 19:35:20 +00:00
Gerald Squelart e7313b8f47 Bug 1674737 - Use SpliceableJSONWriter::UniqueStringElement in DeserializeAfterKindAndStream - r=gregtatum
Unique strings are used to encode all markers' 'name' field, SpliceableJSONWriter::UniqueStringElement can be used for that (instead of a caller-provided callback, which was necessary before UniqueJSONStrings was de-duplicated).

Differential Revision: https://phabricator.services.mozilla.com/D95513
2020-11-06 11:29:11 +00:00
Gerald Squelart 7e48b598df Bug 1674737 - Make SpliceableJSONWriter optionally point at a UniqueJSONStrings, with pass-through functions - r=gregtatum
Some markers (e.g., Screenshot) use unique strings in their data.

The UniqueJSONStrings used during streaming is attached to the SpliceableJSONWriter, and StreamJSONMarkerData can use pass-through functions UniqueStringProperty() and UniqueStringElement().

Differential Revision: https://phabricator.services.mozilla.com/D95512
2020-11-06 11:28:42 +00:00
Gerald Squelart 5f4f178337 Bug 1674737 - Use SpliceableJSONWriter instead of JSONWriter when streaming markers - r=gregtatum
Some markers (e.g., GC major/minor/slice) need to splice JSON strings in their data.
So now, instead of JSONWriter, StreamJSONMarkerData functions will be given a mozilla::baseprofiler::SpliceableJSONWriter.

Differential Revision: https://phabricator.services.mozilla.com/D95511
2020-11-06 11:28:33 +00:00
Gerald Squelart 2fd5e93f78 Bug 1674968 - Fix UniqueJSONStrings copy constructor, to actually copy from the source - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D95833
2020-11-06 01:36:09 +00:00
Gerald Squelart 896ddd992a Bug 1674968 - UniqueJSONStrings unit tests - r=gregtatum
`UniqueJSONStrings` constructors now accept a `JSONWriter::CollectionStyle` to pass to the internal JSON writer.
The default won't change how the unique string list is output (with friendly indented lines), but tests can use `JSONWriter::SingleLineStyle` to make comparison strings more readable and maintainable.

Differential Revision: https://phabricator.services.mozilla.com/D95832
2020-11-06 01:35:36 +00:00
Narcis Beleuzu 0723378bf7 Backed out 2 changesets (bug 1674221) for SM bustages on PreXULSkeletonUI.cpp
Backed out changeset 3d9b951db0f4 (bug 1674221)
Backed out changeset 5092fde1ebe1 (bug 1674221)
2020-11-05 22:54:10 +02:00
Doug Thayer 21230c3f49 Bug 1674221 - Prefix Skeleton UI reg names with exe path r=agashlin
Differential Revision: https://phabricator.services.mozilla.com/D95541
2020-11-05 20:18:16 +00:00
Alexis Beingessner e75e8e5b98 Bug 1608068 - Remove supression for seemingly fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D95128
2020-11-03 01:02:11 +00:00
Florian Quèze 49855a4e40 Bug 1674234 - Add a profiler marker for creating the skeleton UI, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D95219
2020-11-02 19:45:22 +00:00
Bogdan Tara 6b2d214e53 Backed out 2 changesets (bug 1601632, bug 1608068) for ScriptPreloader related tsan failures CLOSED TREE
Backed out changeset 2f14d44bacf2 (bug 1601632)
Backed out changeset ebd82e2edbdc (bug 1608068)
2020-11-03 02:58:08 +02:00
Alexis Beingessner 2507488d07 Bug 1506812 - Wrap all accesses to URLPreloader's mReaderThread in a mutex. r=decoder,nika
The shutdown code of BackgroundReadFiles races with BeginBackgroundRead.
This is paritally obfuscated by the usage of the initialEvent convenience
of NS_NewNamedThread, so this change also removes that in favour of explicit
dispatch. (xpcom devs want to remove the convenience anyway)

Differential Revision: https://phabricator.services.mozilla.com/D94877
2020-11-02 23:26:05 +00:00
Alexis Beingessner 19c8d885b8 Bug 1601632 - Remove supression for seemingly fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D95129
2020-11-02 23:22:22 +00:00
Alexis Beingessner b2c9198c9c Bug 1608068 - Remove supression for seemingly fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D95128
2020-11-02 23:22:13 +00:00
Gerald Squelart 4fedf5eb76 Bug 1674045 - Remove unused ProfilerStringView::String() - r=gregtatum
The previous patch removed the only two uses of ProfilerStringView::String().
Since it can be potentially expensive (creating a `std::string` object, sometimes allocating a buffer, and copying the string contents), it's best to remove it completely.

Differential Revision: https://phabricator.services.mozilla.com/D95116
2020-11-02 13:56:14 +00:00
Gerald Squelart 9acb23c062 Bug 1674045 - UniqueJSONStrings takes string spans instead of pointers - r=gregtatum
For consistency with `JSONWriter` (which UniqueJSONStrings' functions use), and for added safety and some efficiency, UniqueJSONStrings now takes `Span<const char`> arguments instead of raw pointers to null-terminated strings.

Differential Revision: https://phabricator.services.mozilla.com/D95114
2020-11-02 13:55:16 +00:00
Gerald Squelart c68a3c6b21 Bug 1674045 - Add documentation to UniqueJSONStrings, and clean up - r=gregtatum
Document the class and methods.
`GetOrAddIndex` is only used internally, so it can be private.
`SpliceStringTableElements` can now only work on rvalue UniqueJSONStrings, this emphasizes that it shouldn't be used anymore after this call.

Differential Revision: https://phabricator.services.mozilla.com/D95113
2020-11-02 13:54:43 +00:00
Gerald Squelart 7e610c2025 Bug 1674045 - Deduplicate UniqueJSONStrings - r=gregtatum
The two identical copies are `UniqueJSONStrings` are combined and moved almost verbatim to BaseProfilerJSONWriter.h.

Differential Revision: https://phabricator.services.mozilla.com/D95112
2020-11-02 13:54:20 +00:00
Doug Thayer 9fbd3ff6c4 Bug 1674540 - Remove unused prthread.h include r=agashlin
This snuck in after I forgot to delete this upon realizing I couldn't
use nspr stuff in mozglue.

Differential Revision: https://phabricator.services.mozilla.com/D95530
2020-11-02 16:03:04 +00:00
Alexis Beingessner bd3c1f855c Bug 1601286 - Remove supression for seemingly fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D95130
2020-11-02 15:05:56 +00:00
Alexis Beingessner 0d1f97e1a4 Bug 1615265 - Backed out changeset 6e297cea9592 and applied proper change. r=decoder
I accidentally got these two mixed up!!

Differential Revision: https://phabricator.services.mozilla.com/D95132
2020-11-02 15:07:02 +00:00
Narcis Beleuzu 115a0628bb Backed out 2 changesets (bug 1674234) for SM bustages on PreXULSkeletonUI.cpp . CLOSED TREE
Backed out changeset 093306c14ca2 (bug 1674234)
Backed out changeset 2684003a37f9 (bug 1674234)
2020-10-31 01:01:33 +02:00
Alexis Beingessner 05c2cbb42e Bug 1607138 - Backed out changeset fb3f09394f1d. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D95410
2020-10-30 21:10:08 +00:00
Florian Quèze 313e538484 Bug 1674234 - Add a profiler marker for creating the skeleton UI, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D95219
2020-10-30 20:58:14 +00:00
Gabriele Svelto 863c8dfec7 Bug 1665411 - Use first-fit mutexes on macOS r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D93319
2020-10-30 13:10:29 +00:00
Doug Thayer 30478629cf Bug 1666874 - Support maximized windows for skeleton UI r=agashlin
Most of this patch is a dance to avoid size flickering of the skeleton UI
window. We change all Resize/Move/SetSizeMode calls from before the first
nsWindow::Show call. Normally those have no effect, since the window isn't
shown yet, and if the window is not maximized, they typically match the
sizes we've gotten out of the registry anyway. However, if we are maximized,
then they produce a lot of visual noise. We can however achieve the desired
effect by just calling SetWindowPlacement.

Similarly, we switch the window styles of the skeleton UI window to match those
of the toplevel Windows window, and adjust the client rect from our window proc
in a way that matches the adjustments in nsWindow in the WM_NCCALCSIZE handler.
We do this because otherwise we get a flicker as soon as we change the styles
and nonclient margins as the fake chrome pops up and then back down.

Lastly we also change the extended window styles so that they match. We
historically added WS_EX_TOOLWINDOW here to hide the toolbar entry, because it
would otherwise switch out to a new toolbar entry when we changed the window
styles. However since our new styles match, we no longer need to do this. It
was also causing the maximized window to paint over the Windows taskbar.

Differential Revision: https://phabricator.services.mozilla.com/D93534
2020-10-29 19:04:02 +00:00
Doug Thayer 620dfb6899 Bug 1665455 - Animate the Skeleton UI r=agashlin
For a better user experience during slow startups (and to match the design
by Markus Jaritz), we want to animate the placeholder elements (the grey
rectangles which hold the place of text and icons) with a light moving
gradient.

A question may arise regarding whether the performance cost of running this
animation is worth the improved user experience. My claim is yes, hinging
mostly on the observation that the performance cost is small.

On my machine, one frame of the animation takes at most 0.15ms, and runs
every 16.15ms. This means we eat less than 1% CPU time on one core of the
system. It should also be noted that this animation runs primarily during
the window wherein we are prefetching dlls, AKA while we are blocked on IO
and the CPU is more likely to be idle.

On slower systems, one frame may take longer - however, on slower systems
we should also be blocked *more* by IO, making the trade favorable.

For further anecdotal evidence of this being okay, when I run this on slow
reference hardware shortly after OS startup, I do not see any dropped frames,
indicating that this has very little trouble completing, and is thus quite
cheap.

Regarding testing, I will invoke the same logic as for the rest of the
skeleton UI patches - it would involve quite a bit of work to test this in
automation given our existing frameworks. It may be worth it at some point,
but certainly not while this is a feature that we are just experimenting
with and which is not enabled by default.

Differential Revision: https://phabricator.services.mozilla.com/D91453
2020-10-29 19:03:59 +00:00
Toshihito Kikuchi f0d4e3e5eb Bug 1672357 - Do not reserve all regions in the 32bit virtual space. r=mhowell
One of the scenarios in TestMMPolicy.exe is to reserve all regions but one free
region, and then FindRegion can find that free region.  However, it intermittently
failed to find a free region on 32bit.  Probably a different thread invoked by
the system reserved it before the main thread does.  A proposed fix is to limit
the address range to reserve.

Differential Revision: https://phabricator.services.mozilla.com/D95188
2020-10-29 18:35:32 +00:00
Butkovits Atila 304bfab038 Backed out 2 changesets (bug 1666874, bug 1665455) for causing bustage on PreXULSkeletonUI.cpp. CLOSED TREE
Backed out changeset 967c4cf56fd2 (bug 1666874)
Backed out changeset e46238e6aabf (bug 1665455)
2020-10-29 16:57:35 +02:00
Doug Thayer 38c0351ae3 Bug 1666874 - Support maximized windows for skeleton UI r=agashlin
Most of this patch is a dance to avoid size flickering of the skeleton UI
window. We change all Resize/Move/SetSizeMode calls from before the first
nsWindow::Show call. Normally those have no effect, since the window isn't
shown yet, and if the window is not maximized, they typically match the
sizes we've gotten out of the registry anyway. However, if we are maximized,
then they produce a lot of visual noise. We can however achieve the desired
effect by just calling SetWindowPlacement.

Similarly, we switch the window styles of the skeleton UI window to match those
of the toplevel Windows window, and adjust the client rect from our window proc
in a way that matches the adjustments in nsWindow in the WM_NCCALCSIZE handler.
We do this because otherwise we get a flicker as soon as we change the styles
and nonclient margins as the fake chrome pops up and then back down.

Lastly we also change the extended window styles so that they match. We
historically added WS_EX_TOOLWINDOW here to hide the toolbar entry, because it
would otherwise switch out to a new toolbar entry when we changed the window
styles. However since our new styles match, we no longer need to do this. It
was also causing the maximized window to paint over the Windows taskbar.

Differential Revision: https://phabricator.services.mozilla.com/D93534
2020-10-29 14:09:54 +00:00
Doug Thayer 220a9763bb Bug 1665455 - Animate the Skeleton UI r=agashlin
For a better user experience during slow startups (and to match the design
by Markus Jaritz), we want to animate the placeholder elements (the grey
rectangles which hold the place of text and icons) with a light moving
gradient.

A question may arise regarding whether the performance cost of running this
animation is worth the improved user experience. My claim is yes, hinging
mostly on the observation that the performance cost is small.

On my machine, one frame of the animation takes at most 0.15ms, and runs
every 16.15ms. This means we eat less than 1% CPU time on one core of the
system. It should also be noted that this animation runs primarily during
the window wherein we are prefetching dlls, AKA while we are blocked on IO
and the CPU is more likely to be idle.

On slower systems, one frame may take longer - however, on slower systems
we should also be blocked *more* by IO, making the trade favorable.

For further anecdotal evidence of this being okay, when I run this on slow
reference hardware shortly after OS startup, I do not see any dropped frames,
indicating that this has very little trouble completing, and is thus quite
cheap.

Regarding testing, I will invoke the same logic as for the rest of the
skeleton UI patches - it would involve quite a bit of work to test this in
automation given our existing frameworks. It may be worth it at some point,
but certainly not while this is a feature that we are just experimenting
with and which is not enabled by default.

Differential Revision: https://phabricator.services.mozilla.com/D91453
2020-10-28 19:22:54 +00:00
Alexis Beingessner 7399cf2078 Bug 1607449 - Backed out changeset c5d8b4f34c06 r=decoder
Still an issue, just rare.

Differential Revision: https://phabricator.services.mozilla.com/D95084
2020-10-29 11:50:48 +00:00
Alexis Beingessner f045afd928 Bug 1506910 - Initialize the poison page with a static initializer. r=glandium,decoder
Poison was setup at the start of xpcom init when that was assumed to be early enough.
Since then, Poison was added to Maybe, and Maybe has been used everywhere, including in
our channel implementation. As a result, poison was being used before it was initialized.

This basically meant our poison pointers were being replaced with null instead, which
dances into some more UB than accessing a page we have actually allocated. Also, tsan
noticed that accesses to the value were racing with the initializer actually being
called!

A (dynamic) static initializer forces the poison initialization as we can reasonably
hope without getting CallOnce or singleton patterns involved.

Other changes:
  * Cleaned up the outdated documentation for mozWritePoison (the alignment
    restriction was removed in Bug 1414901)
  * Removed the poison supression from TSan

Differential Revision: https://phabricator.services.mozilla.com/D94251
2020-10-28 20:38:42 +00:00
Alexis Beingessner e70a174ef5 Bug 1608357 - Remove supression for seemingly fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D94856
2020-10-28 15:07:24 +00:00
Alexis Beingessner 9e58a2784e Bug 1607706 - Remove supression for seemingly fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D94855
2020-10-28 13:53:55 +00:00
Alexis Beingessner 7701381612 Bug 1607704 - Remove supression for seemingly fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D94854
2020-10-28 13:53:47 +00:00
Alexis Beingessner be4f23fa57 Bug 1607588 - Remove supression for seemingly fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D94853
2020-10-28 13:53:40 +00:00
Alexis Beingessner b91c79179f Bug 1607138 - Remove supression for seemingly fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D94852
2020-10-28 13:53:38 +00:00
Sebastian Hengst ac330b4b09 Backed out changeset 81c5f8fff63e (bug 1665411) for causing deadlock on older OS X versions (e.g. OS X 10.12), see bug 1673826 2020-10-28 13:37:58 +01:00
Byron Campen [:bwc] bbf349e952 Bug 1657739: Remove temporary suppression. r=decoder
Depends on D94155

Differential Revision: https://phabricator.services.mozilla.com/D94478
2020-10-27 16:37:01 +00:00
Alexis Beingessner 64f2dc8c60 Bug 1615265 - Remove supression for seemingly fixed issue. r=decoder
Depends on D94856

Differential Revision: https://phabricator.services.mozilla.com/D94857
2020-10-27 16:15:46 +00:00
Alexis Beingessner 16866ed6a1 Bug 1607449 - Remove supression for seemingly fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D94859
2020-10-27 16:05:40 +00:00
Alexis Beingessner 2d883db13d Bug 1607762 - Remove supression for seemingly fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D94860
2020-10-27 16:09:21 +00:00
Alexis Beingessner 93528f31fb Bug 1606803 - Remove supression for seemingly fixed issue. r=decoder
Depends on D94493

Differential Revision: https://phabricator.services.mozilla.com/D94494
2020-10-27 16:07:17 +00:00
Alexis Beingessner eaa89f3d67 Bug 1600594 - Remove supression for seemingly fixed issue. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D94493
2020-10-27 16:07:34 +00:00
Emma Malysz 7529feec30 Bug 1665460: save urlbar position to registry and display in skeleton UI r=dthayer,smaug
If the urlbar is zoomed (defined by attribute breakout-extend), then we
scale it down to the unfocused coordinate values.

Differential Revision: https://phabricator.services.mozilla.com/D92303
2020-10-27 15:53:38 +00:00
Toshihito Kikuchi 5cabaa29f2 Bug 1671316 - Part2. Pass CrossExecTransferManager to FuncHookCrossProcess and Kernel32ExportsSolver. r=mhowell
The latest launcher process showed one of the top failures was `WriteProcessMemory` in
`CopyStubToChildProcess` failed with `ERROR_INVALID_ADDRESS` or `ERROR_NOACCESS`, that
is to store a trampoline address to the global variable of firefox.exe failed.  Its root
cause should be the same as bug 1662560, the executable was loaded onto a different
address from the browser process.

The fix is to to expand the usage of `CrossExecTransferManager` to `FuncHookCrossProcess`
and `Kernel32ExportsSolver`.

Depends on D94652

Differential Revision: https://phabricator.services.mozilla.com/D94653
2020-10-27 14:08:49 +00:00
Toshihito Kikuchi 83d95e2106 Bug 1671316 - Part1. Introduce CrossExecTransferManager. r=mhowell
This patch introduces a class `CrossExecTransferManager` to manage the data
transfer from the current process to a remote process via `WriteProcessMemory`.
The class also encapsulates a logic to bridge the gap between two executable's
imagebase.

Differential Revision: https://phabricator.services.mozilla.com/D94652
2020-10-27 14:09:00 +00:00
Greg Tatum 6451405048 Bug 1671701 - Migrated FileIO markers to the Markers 2.0 API; r=gerald,julienw
This commit uses the new Markers 2.0 API for FileIO Markers. I had to
create another option for the MarkerStack class in order to conditionally
capture a backtrace inside of the Macro. Otherwise the macro invocation
failed.

Differential Revision: https://phabricator.services.mozilla.com/D93848
2020-10-27 14:04:04 +00:00
Gerald Squelart 204efca960 Bug 1672310 - Output marker backtraces from other threads - r=gregtatum
The new Markers 2.0 code had missed one detail:
Backtraces in markers were serialized as just the `ProfileChunkedBuffer`, which doesn't expose the original thread id like `ProfilerBacktrace` did.
Then when outputting the profile, the marker code would use the marker's thread id (where the marker should be displayed in the frontend, which *could* be different from where the backtrace came) to deserialize and stream the attached marker, and a special check in the streaming code meant that the mismatched id would ignore the stored sample, and the displayed marker would show no stack.

With this patch, when streaming stacks from markers, the given thread id is 0 (an impossible thread id), which indicates that whatever sample is present should be streamed.
`ProfilerBacktrace` doesn't need to store the thread id anymore.
This solves the above problem.

As a bonus, the streaming code now reports the original thread of the sample(s) it found. This could be used in the future, to better show in the frontend that some stacks may come from other threads.

Differential Revision: https://phabricator.services.mozilla.com/D94264
2020-10-27 03:16:12 +00:00
Butkovits Atila f31945adb0 Backed out 3 changesets (bug 1671701) for causing failure at browser_startup_mainthreadio.js. CLOSED TREE
Backed out changeset b4b6ec163792 (bug 1671701)
Backed out changeset a343865ccfe0 (bug 1671701)
Backed out changeset e6f882892fea (bug 1671701)
2020-10-27 02:40:13 +02:00
Greg Tatum 4cc2187968 Bug 1671701 - Migrated FileIO markers to the Markers 2.0 API; r=gerald,julienw
This commit uses the new Markers 2.0 API for FileIO Markers. I had to
create another option for the MarkerStack class in order to conditionally
capture a backtrace inside of the Macro. Otherwise the macro invocation
failed.

Differential Revision: https://phabricator.services.mozilla.com/D93848
2020-10-26 20:12:22 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
sanketh 35cd8eb504 Bug 1655482 - Bump MinGW to fix the STATUS_HEAP_CORRUPTION define r=tjr
- Bump MinGW version
- Add patch to workaround MinGW's dwrite_3.h
- Remove MinGW workaround for STATUS_HEAP_CORRUPTION define
- Remove MinGW workaround in MMPolicies.h.

Differential Revision: https://phabricator.services.mozilla.com/D91157
2020-10-22 15:58:54 +00:00
Gerald Squelart 15d07d6c5b Bug 1672501 - Initialize scProfilerMainThreadId from profiler_init - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D94419
2020-10-22 12:55:13 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Alexis Beingessner d9fb1ffd72 Bug 1587510 - Remove supression for seemingly fixed issue. r=decoder
Doesn't show up in a try run anymore.

Differential Revision: https://phabricator.services.mozilla.com/D94144
2020-10-21 17:01:40 +00:00
Alexis Beingessner ccc093cd6c Bug 1367344 - Remove supression for seemingly fixed issue. r=decoder
Doesn't show up in a try run anymore.

Differential Revision: https://phabricator.services.mozilla.com/D94143
2020-10-21 17:01:29 +00:00
Christian Holler 771a4eac15 Bug 1672230 - Add temporary suppression. r=Gankro
Depends on D94288

Differential Revision: https://phabricator.services.mozilla.com/D94289
2020-10-21 13:41:54 +00:00
Christian Holler 0c5c78e328 Bug 1671601 - Add temporary suppression. r=Gankro
Depends on D94287

Differential Revision: https://phabricator.services.mozilla.com/D94288
2020-10-21 13:42:59 +00:00
Christian Holler c6f46008ad Bug 1671574 - Add temporary suppression for StartupCache thread leak. r=Gankro
Depends on D94286

Differential Revision: https://phabricator.services.mozilla.com/D94287
2020-10-21 13:43:48 +00:00
Christian Holler a45b846848 Bug 1671572 - Add temporary suppression. r=Gankro
Depends on D94285

Differential Revision: https://phabricator.services.mozilla.com/D94286
2020-10-21 14:37:35 +00:00
Toshihito Kikuchi e61c0c2555 Bug 1671314 - Expand the region to be scanned for a trampoline. r=mhowell
The latest launcher process ping showed one of the reasons why we failed to
detour `NtMapViewOfSection` is that `MMPolicyBase::FindRegion` failed to find
a free region.  Inspecting the function carefully, there were three problems.

Firstly, `FindRegion` did not fully scan the given range.  To randomize
the address of a free region we use, we start scanning from a random address
within the given range.  The problem is we scan only addresses bigger than
that random address, without scanning smaller addresses.  Probably this is
the reason why `FindRegion` fails.

Secondly, `FindRegion` may return an address not aligned with the allocation
granularity because `VirtualQueryEx` returns such an address.  If that happens,
the subsequent mapping API fails with the alignment error.

Lastly, when we randomize an address to start scanning from, we divide a random
number by `maxOffset`, but with that, we never start scanning from the last
region.  It does not affect the product's behavior, but to have fair randomization,
a divisor should be `maxOffset + 1`.

This patch fixes all of these three problems along with a new test program.

Differential Revision: https://phabricator.services.mozilla.com/D94110
2020-10-20 22:51:00 +00:00
Alexis Beingessner c40e440aff Bug 1671692 - Organize and properly label things in the TSan supression list. r=decoder
This is going to cause some merge conflicts for everyone working on the
supressions, sorry!

Differential Revision: https://phabricator.services.mozilla.com/D93835
2020-10-20 16:45:00 +00:00
Gabriele Svelto 2352a082d4 Bug 1665411 - Use first-fit mutexes on macOS r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D93319
2020-10-20 12:07:30 +00:00
Narcis Beleuzu 1e7d4b5b37 Backed out changeset b75ab3fd88c9 (bug 1665411) for SM bustages on ProtectedData.h 2020-10-20 01:27:40 +03:00
Gabriele Svelto b74208fdb6 Bug 1665411 - Use first-fit mutexes on macOS r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D93319
2020-10-19 20:52:24 +00:00
Gerald Squelart a37e92d240 Bug 1671536 - Remove BaseProfilerMarkerPayload.h and dependents - r=gregtatum
Everything related to Base Profiler legacy markers can now be removed, only the new API from BaseProfilerMarkers.h should now be used.

Depends on D93737

Differential Revision: https://phabricator.services.mozilla.com/D93738
2020-10-16 22:10:36 +00:00
Gerald Squelart 2c7e587da0 Bug 1671536 - Stop using baseprofiler::TextMarkerPayload - r=gregtatum
TextMarkerPayload is the only legacy marker type that is still used in the Base Profiler. We're converting it to the new BASE_PROFILER_MARKER_TEXT.

Depends on D93736

Differential Revision: https://phabricator.services.mozilla.com/D93737
2020-10-16 14:09:24 +00:00
Gerald Squelart 500ebb3b30 Bug 1670954 - MarkerThreadId::MainThread() - r=gregtatum
Since the main thread is almost always being profiled, this makes it easy to direct important markers there (e.g., FileIO markers from unregistered threads).

Tech note: The `#include "BaseProfiler.h"` line was moved to BaseProfilerMarkersPrerequesites.h so that `MarkerThreadId::MainThread()` there can access `profiler_main_thread_id()`.

Depends on D93735

Differential Revision: https://phabricator.services.mozilla.com/D93736
2020-10-16 22:07:20 +00:00
Gerald Squelart 334aa92a37 Bug 1670954 - profiler_main_thread_id() and profiler_is_main_thread() - r=gregtatum
These functions will be useful to get the main thread id, or check if we're in it, in some public code (e.g., markers).

Differential Revision: https://phabricator.services.mozilla.com/D93735
2020-10-16 22:06:53 +00:00
Christian Holler 251b26aaf0 Bug 1656068 - Add temporary suppression. r=bwc
Depends on D93509

Differential Revision: https://phabricator.services.mozilla.com/D93510
2020-10-15 09:54:11 +00:00
Christian Holler ab8fa5ff8b Bug 1657739 - Add temporary suppression. r=bwc
Depends on D93508

Differential Revision: https://phabricator.services.mozilla.com/D93509
2020-10-15 09:54:21 +00:00
Christian Holler 5ea665d9a7 Bug 1664803 - Add temporary suppression. r=Gankro
Depends on D93507

Differential Revision: https://phabricator.services.mozilla.com/D93508
2020-10-14 19:34:38 +00:00
Christian Holler 962d75d4f2 Bug 1664535 - Temporary suppression for GC race. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D93507
2020-10-15 09:53:23 +00:00
Christian Holler 02d1bd0904 Bug 1600572 - Remove suppression for fixed bug. r=Gankro
Differential Revision: https://phabricator.services.mozilla.com/D93505
2020-10-15 05:05:45 +00:00
Christian Holler 21004d88dc Bug 1606804 - Permanently suppress false positive deadlock in rkv. r=Gankro
Differential Revision: https://phabricator.services.mozilla.com/D93500
2020-10-14 19:39:57 +00:00
Gerald Squelart 871634702e Bug 1665265 - Prevent chunks from being marked done with the same timestamps in quick tests - r=gregtatum
These unit tests were going through chunks very quickly in tight loops, which on some platforms could cause successive chunks to be marked "done" with the same timestamps.
Distinct timestamps are needed to uniquely identify chunks (in each process), and related assertions caught that. In real Firefox code, chunks are much bigger (around 1MB), and fill at a slower rate, so timestamps are always different as expected there.
To fix this artificial issue in our unit tests, delays are introduced before each `MarkDone()`, to ensure that they'll get a different timestamp every time.

Differential Revision: https://phabricator.services.mozilla.com/D93479
2020-10-14 21:23:31 +00:00
Gerald Squelart ddcc13f424 Bug 1640999 - Output meta.markerSchema for all used marker types in the process - r=gregtatum
Using the stored marker functions, stream all marker schema to JSON.

Added tests for all common marker types.

Differential Revision: https://phabricator.services.mozilla.com/D90660
2020-10-14 02:12:29 +00:00
Gerald Squelart d83d5d3c6b Bug 1640999 - Store name and schema functions for each marker type - r=gregtatum
Along with the deserializer, we now also store other marker functions (that output the marker type name and schema).
These will be used in the following patch to output the combined schema list for all used marker types.

Differential Revision: https://phabricator.services.mozilla.com/D90659
2020-10-14 02:11:49 +00:00
Gerald Squelart 2621d4cbf0 Bug 1640999 - Add `MarkerTypeDisplay` to all marker type definitions - r=gregtatum
Add `static mozilla::MarkerSchemaWriter MarkerTypeDisplay()` for each existing marker type.

Because all markers of a given type now must have the same payload and display schema, the DOM event marker has changed from type=tracing with category=DOMEvent, to its own type=DOMEvent, which is now accepted on the front-end.

Based on c9692715f2/src/profile-logic/marker-schema.js

Differential Revision: https://phabricator.services.mozilla.com/D90658
2020-10-14 02:11:25 +00:00
Gerald Squelart 984f996f1b Bug 1640999 - MarkerSchema schema-writer class - r=gregtatum
This class collects all the information necessary to stream the JSON schema that informs the front-end how to display a type of markers.
It will be created and populated in `MarkerTypeDisplay()`, functions in each marker type definition, with Add/Set functions (see following patch).

Based on c9692715f2/src/profile-logic/marker-schema.js

Differential Revision: https://phabricator.services.mozilla.com/D90657
2020-10-14 02:10:50 +00:00
Gerald Squelart e62f237161 Bug 1670547 - Made AutoArraySchemaWriter safer and more efficient - r=canaltinova
`AutoArraySchemaWriter::FreeFormElement()` is never used, we can remove it.

When constructed, `AutoArraySchemaWriter` was optionally taking a `UniqueStrings` reference, which was stored as a pointer.
Then `AutoArraySchemaWriter::StringElement()` would do a dangerous `MOZ_RELEASE_ASSERT(mStrings);`.

The class is now split in two:
- `AutoArraySchemaWriter`, which does not deal with strings at all, so we don't need a pointer to `UniqueStrings`.
- `AutoArraySchemaWithStringsWriter` that can also deal with strings, in which we store a (non-null) `UniqueStrings` reference.

This is both:
- Safer, because it's not possible to instantiate the non-string writer and try to write a string.
- More efficient, because we don't need to pass&store a `UniqueStrings` reference/pointer when we don't deal with strings.

Differential Revision: https://phabricator.services.mozilla.com/D93191
2020-10-12 23:26:10 +00:00
Toshihito Kikuchi 8b206d0aad Bug 1588245 - More values to DetourResultCode. r=mhowell
This is the third attempt to investigate the launcher failure of our detour.
The previous commits d8315e4ed18d and 1b81ea85c43d added the assembly bytes
of a detour target and a special error code `DetourResultCode` to the launcher
failure ping.

In the latest telemetry data, however, the most common value of `hresult`
is still `ERROR_UNIDENTIFIED_ERROR`, meaning the previous commit missed to
set an error code in the common fallible codepath we wanted to know.
Besides `ERROR_UNIDENTIFIED_ERROR`, we're seeing `DETOUR_PATCHER_DO_RESERVE_ERROR`
in the telemetry, but having that code is not enough to pinpoint a falling
operation.

For further investigation, this patch adds ten more values to `DetourResultCode`.
`FUNCHOOKCROSSPROCESS_COPYSTUB_ERROR` is the last codepath we forgot to cover
in the previous commit.  The values of `MMPOLICY_RESERVE_*` are to investigate
`DETOUR_PATCHER_DO_RESERVE_ERROR` in the MMPolicy level.  In both cases, we add
the last Windows error code to `DetourError::mOrigBytes`.

Differential Revision: https://phabricator.services.mozilla.com/D92974
2020-10-12 18:25:47 +00:00
Andreea Pavel e921b46c56 Backed out changeset 0a114b5e07eb (bug 1588245) on suspicion of crashing Firefox on startup (bug 1670546 etc.) a=backout 2020-10-12 14:31:40 +03:00
Toshihito Kikuchi 09dbd09134 Bug 1468250 - Block all versions of database.dll to stop the crash. r=aklotz
We blocked the older versions of database.dll as Bug 1566109 in 2019,
but the same crash is still happening with the newer versions.
We decided to block all versions because crashing in the middle of printing
or file uploading is not acceptable.

Differential Revision: https://phabricator.services.mozilla.com/D92988
2020-10-09 20:39:58 +00:00
Gerald Squelart db3689ee3d Bug 1670046 - If NoPayload marker has a stack and/or inner window id, convert to NoPayloadUserData - r=gregtatum
It is possible to add options to a NoPayload marker, but stack and inner window ids would be lost because they are normally stored in the payload 'data' JSON object, which doesn't exist for NoPayload markers.
So in this case, we automatically change the marker to a new (internal) "NoPayloadUserData" type, which has a payload in which we can store options.

This is temporary, until bug 1646714 moves these options into the top-level marker JSON object.

Differential Revision: https://phabricator.services.mozilla.com/D93059
2020-10-09 13:00:48 +00:00
Toshihito Kikuchi 481aa7905b Bug 1588245 - More values to DetourResultCode. r=mhowell
This is the third attempt to investigate the launcher failure of our detour.
The previous commits d8315e4ed18d and 1b81ea85c43d added the assembly bytes
of a detour target and a special error code `DetourResultCode` to the launcher
failure ping.

In the latest telemetry data, however, the most common value of `hresult`
is still `ERROR_UNIDENTIFIED_ERROR`, meaning the previous commit missed to
set an error code in the common fallible codepath we wanted to know.
Besides `ERROR_UNIDENTIFIED_ERROR`, we're seeing `DETOUR_PATCHER_DO_RESERVE_ERROR`
in the telemetry, but having that code is not enough to pinpoint a falling
operation.

For further investigation, this patch adds ten more values to `DetourResultCode`.
`FUNCHOOKCROSSPROCESS_COPYSTUB_ERROR` is the last codepath we forgot to cover
in the previous commit.  The values of `MMPOLICY_RESERVE_*` are to investigate
`DETOUR_PATCHER_DO_RESERVE_ERROR` in the MMPolicy level.  In both cases, we add
the last Windows error code to `DetourError::mOrigBytes`.

Differential Revision: https://phabricator.services.mozilla.com/D92974
2020-10-08 19:00:22 +00:00
David Parks c6ffb4b0a9 Bug 1668057: Allow DLL interceptor to patch 64-bit immediate MOVs r=tkikuchi
The latest Windows Insider Preview (version 20226.1000) changes the machine code for BaseThreadInitThunk to have a preamble like the following:

00007FFDBF244C40 48 83 EC 28          sub         rsp,28h
00007FFDBF244C44 85 C9                test        ecx,ecx
00007FFDBF244C46 75 25                jne         00007FFDBF244C6D
00007FFDBF244C48 49 BA 70 A2 DC 12 6A 97 99 B0 mov         r10,0B099976A12DCA270h

This patch adds "MOV r64, imm64" capability to the DLL interceptor so that we can hook this.

Differential Revision: https://phabricator.services.mozilla.com/D92146
2020-10-05 22:25:44 +00:00
Florian Quèze 01d197240a Bug 1524625 - DLL loads during early startup should show profiler markers, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D92340
2020-10-05 13:47:27 +00:00
Alexis Beingessner ab37cbed76 Bug 1601980 - use MOZ_ATOMIC_BITFIELDS in imagelib to avoid races on flags. r=aosmond,decoder
Differential Revision: https://phabricator.services.mozilla.com/D91633
2020-10-01 13:22:49 +00:00
Gerald Squelart 79c0e0c0ef Bug 1667915 - Marker type is now given as a reified empty argument instead of a template argument - r=gregtatum
This makes it clearer where marker-type-specific payload arguments start, just after the marker type object.

Also improved the main API documentation.

Differential Revision: https://phabricator.services.mozilla.com/D91681
2020-10-01 11:02:54 +00:00
Gerald Squelart ee701f64d7 Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 11:02:23 +00:00
Bogdan Tara ababae891b Backed out 2 changesets (bug 1667915) for platform related bustage CLOSED TREE
Backed out changeset e7a0788a1741 (bug 1667915)
Backed out changeset d34505b2d81b (bug 1667915)
2020-10-01 12:34:39 +03:00
Gerald Squelart 58ca6739aa Bug 1667915 - Marker type is now given as a reified empty argument instead of a template argument - r=gregtatum
This makes it clearer where marker-type-specific payload arguments start, just after the marker type object.

Also improved the main API documentation.

Differential Revision: https://phabricator.services.mozilla.com/D91681
2020-10-01 01:45:20 +00:00
Gerald Squelart e07ae06a1d Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 01:44:47 +00:00
Toshihito Kikuchi 7034355c29 Bug 1588245 - Introduce an extra errorcode inside WindowsDllInterceptor. r=mhowell
The previous commit d8315e4ed18d introduced a new telemetry field
in the launcher process ping to collect the assembly pattern of
a target function on detour failure, but most of the crash instances
do not have a value in the field.  This means the failure happens
before or after `CreateTrampoline`.

To narrow down the root cause, this patch puts a fine-grained error value
in the "hresult" field instead of the hardcoded ERROR_UNIDENTIFIED_ERROR.

This patch also adds `IsPageAccessible` check before fetching data from
a different process because fetching data from an invalid address hits
`MOZ_RELEASE_ASSERT` in `EnsureLimit`, resulting in crash without sending
the launcher process failure.

Differential Revision: https://phabricator.services.mozilla.com/D91881
2020-09-30 20:09:22 +00:00
Florian Quèze 9c87b313a1 Bug 1668056 - Bailout profiler markers should be text markers. r=jandem,gerald
Differential Revision: https://phabricator.services.mozilla.com/D91775
2020-09-30 12:19:54 +00:00
Toshihito Kikuchi abfd030f16 Bug 1666571 - Part 2. Support CALL [disp32] for Avast. r=handyman
The last Avast Antivirus's hook function contains `CALL [disp32]` instruction.
Our detour needs to be able to handle that pattern.

Differential Revision: https://phabricator.services.mozilla.com/D91155
2020-09-25 23:18:02 +00:00
Toshihito Kikuchi 05e886ea80 Bug 1666571 - Part 1. Support more patterns of OpCode 0xFF. r=handyman
This patch optimizes our detour's code handling Opcode 0xFF, expanding
its coverage to INC and DEC reg64 as well as PUSH and CALL.
Testcases for these scenarios are of course included.

Differential Revision: https://phabricator.services.mozilla.com/D91154
2020-09-25 23:18:15 +00:00
Markus Stange f366fca45a Bug 1666617 - Allow creating MarkerInnerWindowId with a Maybe<uint64_t>. r=gerald
Depends on D91078

Differential Revision: https://phabricator.services.mozilla.com/D91079
2020-09-23 00:04:17 +00:00
Doug Thayer c0eae2f201 Bug 1665453 - Poll for native events in between prefetching early dlls r=agashlin
In the initial patches for bug 1656526, mhowell noticed that for startups which
take a very long time, if the user interacts with the skeleton UI window, the OS
will flag us as not responsive, which could be a poorer user experience than
seeing nothing. Since our UI is designed to look non-interactive anyway, we
assume that a better experience would be to simply squash the not responsive
response from the OS by trivially processing native events. It's not perfect in,
say, the event that startup is hung for some reason, but it's arguably preferable
to our old model of startup being hung, which was just nothing being displayed at
all.

Differential Revision: https://phabricator.services.mozilla.com/D91005
2020-09-24 23:51:42 +00:00
Doug Thayer 53dd0a0de2 Bug 1666030 - Fix floor missing on some builds r=dmajor
Depends on D91004

Differential Revision: https://phabricator.services.mozilla.com/D91284
2020-09-24 14:43:55 +00:00