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

1993 Коммитов

Автор SHA1 Сообщение Дата
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