2537 Commits

Author SHA1 Message Date
Randell Jesup
addf814b52 Bug 1207753 - Base thread-safety attribution support r=nika
Differential Revision: https://phabricator.services.mozilla.com/D130606
2022-03-16 23:01:41 +00:00
Cristian Tuns
43db1804cf Backed out changeset 3b8c7fa73e82 (bug 1207753) for causing build bustages on Monitor.h CLOSED TREE 2022-03-16 16:45:54 -04:00
Randell Jesup
e72ce3cd6c Bug 1207753 - Base thread-safety attribution support r=nika
With additions of MOZ_UNANNOTATED for *Mutex/*Monitor/RWLock classes

Differential Revision: https://phabricator.services.mozilla.com/D130606
2022-03-16 20:10:04 +00:00
Randell Jesup
fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli
2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup
4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila
927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup
7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Mike Hommey
1cd4e4fcce Bug 1758017 - Disable MOZ_FORMAT_PRINTF in TestPrintf on Android. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D140272
2022-03-09 04:32:29 +00:00
Gerald Squelart
111d3090e1 Bug 1757596 - De-duplicate PROFILER_RAII macros - r=florian
The next patch would have added yet another PROFILERxx_RAII macro, so it makes sense to gather them all into a single header file, to be #included where needed.

Differential Revision: https://phabricator.services.mozilla.com/D140169
2022-03-08 10:32:43 +00:00
Gerald Squelart
51a6a42c9a Bug 1755823 - BaseProfilerSharedMutex and exclusive&shared RAII locks - r=canaltinova
This is a profiler-specific shared lock (aka readers-writer lock) implemented on top of RWLockImpl.
Similar to BaseProfilerMutex, it records which thread is currently holding the exclusive lock.

Differential Revision: https://phabricator.services.mozilla.com/D139916
2022-03-04 06:48:11 +00:00
Butkovits Atila
78f77536c7 Backed out 2 changesets (bug 1755823) for causing cpp failures at TestBaseProfiler.cpp. CLOSED TREE
Backed out changeset d758cab0d5cf (bug 1755823)
Backed out changeset 169754a1f337 (bug 1755823)
2022-03-04 05:36:41 +02:00
Gerald Squelart
b204f08834 Bug 1755823 - BaseProfilerSharedMutex and exclusive&shared RAII locks - r=canaltinova
This is a profiler-specific shared lock (aka readers-writer lock) implemented on top of RWLockImpl.
Similar to BaseProfilerMutex, it records which thread is currently holding the exclusive lock.

Differential Revision: https://phabricator.services.mozilla.com/D139916
2022-03-03 23:03:05 +00:00
Gerald Squelart
97bc60386d Bug 1757100 - Move minimal platform-dependent part of RWLock to mozglue/misc/PlatformRWLock.h&cpp - r=glandium,xpcom-reviewers
This is consistent with how xpcom's Mutex has its platform-dependent code in mozglue, and will allow readers-writer locks in mozglue without duplication.

Differential Revision: https://phabricator.services.mozilla.com/D139669
2022-02-27 23:32:55 +00:00
Mike Hommey
545e5d16a9 Bug 1756534 - Update builders to rustc 1.59. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D139353
2022-02-25 08:27:04 +00:00
smolnar
b6b47412cb Backed out changeset 54f67e85078b (bug 1751781) for causing bug 1754972. CLOSED TREE 2022-02-16 07:24:33 +02:00
Alessio Placitelli
85788740ea Bug 1754474 - Add a suppresion for the Glean init thread. r=decoder
The init/shutdown sequence and its threads
are being re-evaluated as part of bug 1755449

Depends on D138466

Differential Revision: https://phabricator.services.mozilla.com/D138767
2022-02-15 13:35:09 +00:00
Gerald Squelart
91645977e5 Bug 1745281 - Record base markers whenever the core buffer is in session - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D137810
2022-02-14 04:17:12 +00:00
Gerald Squelart
e73913b166 Bug 1753192 - Use combined core buffer, and transfer ownership of chunk manager from base to gecko profiler - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D137804
2022-02-13 06:18:29 +00:00
Gerald Squelart
459979eacb Bug 1753192 - ThreadRegistrationInfo reuses the Base Profiler thread registration time if any - r=canaltinova
Once the buffers are combined, some data could be stored in a thread before its registration with the Gecko Profiler.
Without this fix, the front-end would think the thread had not started yet, which could prevent interacting with that early data.

Differential Revision: https://phabricator.services.mozilla.com/D138239
2022-02-13 06:18:29 +00:00
Gerald Squelart
9715dc54ac Bug 1753192 - Fix apparent negative leak of RequestedChunkRefCountedHolder - r=canaltinova
Once the buffers are combined, a RequestedChunkRefCountedHolder could be referenced from the Base Profiler, which is invisible to the leak catcher; then handed over to the Gecko Profiler where it will eventually be dereferenced, which is logged with the leak catcher, resulting in an apparent negative leak.
This is fixed by keeping all (de)references secret.

Differential Revision: https://phabricator.services.mozilla.com/D138238
2022-02-13 06:18:28 +00:00
Gerald Squelart
a9eb4e36d5 Bug 1753192 - Make ActivePS::mProfileBufferChunkManager a UniquePtr, to allow transferring it between profilers - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D137803
2022-02-13 06:18:28 +00:00
Gerald Squelart
56704e0465 Bug 1753192 - Move core ProfileChunkedBuffers to static singletons in profiler_get_core_buffer() - r=canaltinova
Note that they are still separate buffers for now.

Differential Revision: https://phabricator.services.mozilla.com/D137802
2022-02-13 06:18:28 +00:00
Gerald Squelart
a46493fc0f Bug 1753192 - Removed unused ProfileChunkedBuffer::ExtractChunkManager() - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D137801
2022-02-13 06:18:27 +00:00
Gerald Squelart
0db875fdc3 Bug 1753192 - Move InChunkPointer to new header ProfileChunkedBufferDetail.h - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D137800
2022-02-13 06:18:27 +00:00
Marian-Vasile Laza
bb43a35448 Backed out 8 changesets (bug 1753192) for causing Gtest failures on GeckoProfiler.cpp. CLOSED TREE
Backed out changeset 2f0c24b1f049 (bug 1753192)
Backed out changeset 1a71d954b83f (bug 1753192)
Backed out changeset 07a8ffa8d12f (bug 1753192)
Backed out changeset f79cd543e537 (bug 1753192)
Backed out changeset c2f22d8a8fc8 (bug 1753192)
Backed out changeset c8a0d3c41d2f (bug 1753192)
Backed out changeset 1d5d69d92db9 (bug 1753192)
Backed out changeset 5bc8bd033453 (bug 1753192)
2022-02-11 09:39:38 +02:00
Gerald Squelart
9f19f2143b Bug 1753192 - Use combined core buffer, and transfer ownership of chunk manager from base to gecko profiler - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D137804
2022-02-11 03:13:52 +00:00
Gerald Squelart
f811caf3b2 Bug 1753192 - ThreadRegistrationInfo reuses the Base Profiler thread registration time if any - r=canaltinova
Once the buffers are combined, some data could be stored in a thread before its registration with the Gecko Profiler.
Without this fix, the front-end would think the thread had not started yet, which could prevent interacting with that early data.

Differential Revision: https://phabricator.services.mozilla.com/D138239
2022-02-11 03:13:52 +00:00
Gerald Squelart
6906b4d69a Bug 1753192 - Fix apparent negative leak of RequestedChunkRefCountedHolder - r=canaltinova
Once the buffers are combined, a RequestedChunkRefCountedHolder could be referenced from the Base Profiler, which is invisible to the leak catcher; then handed over to the Gecko Profiler where it will eventually be dereferenced, which is logged with the leak catcher, resulting in an apparent negative leak.
This is fixed by keeping all (de)references secret.

Differential Revision: https://phabricator.services.mozilla.com/D138238
2022-02-11 03:13:51 +00:00
Gerald Squelart
adf6de3385 Bug 1753192 - Make ActivePS::mProfileBufferChunkManager a UniquePtr, to allow transferring it between profilers - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D137803
2022-02-11 03:13:51 +00:00
Gerald Squelart
f3c4f65d02 Bug 1753192 - Move core ProfileChunkedBuffers to static singletons in profiler_get_core_buffer() - r=canaltinova
Note that they are still separate buffers for now.

Differential Revision: https://phabricator.services.mozilla.com/D137802
2022-02-11 03:13:51 +00:00
Gerald Squelart
aa44b10600 Bug 1753192 - Removed unused ProfileChunkedBuffer::ExtractChunkManager() - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D137801
2022-02-11 03:13:50 +00:00
Gerald Squelart
9d51c7527c Bug 1753192 - Move InChunkPointer to new header ProfileChunkedBufferDetail.h - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D137800
2022-02-11 03:13:50 +00:00
ahochheiden
c5a6f22e14 Bug 1751781 - Intentionally #undef NAN and redefine it with the value from the STL r=glandium
With the latest Windows 10 SDK (10.0.20348.0), the value of NAN has changed
to differ from the STL. We intentionally #undef the value gotten from the SDK
and replace it with the STL value so that the comparison tests pass regardless
of the Windows SDK version.

Differential Revision: https://phabricator.services.mozilla.com/D137598
2022-02-10 22:47:15 +00:00
Gerald Squelart
c5b8ff3ca4 Bug 1735397 - Don't start profiler in processes excluded by pid - r=florian
When trying to profile only one process, the profiler should not even start in those processes excluded by the filter, so that they don't use any resources (memory and CPU).
To do that, the filter is checked for "pid:" at the multiple locations it may appear:
- In the parent process, when starting the overall profiler, don't send the "Start" IPC to excluded processes.
- When a new process starts and initializes the profiler, don't start the profiler if the filter excludes this process.
- When a new process then registers itself with the parent, don't (re)start the profiler in excluded processes.

Child processes that don't run the profiler may still be asked for a JSON profile at the end of the profiling session. This is handled by sending an empty string, so that the parent process will correctly remove them from the pending-profile list.

Differential Revision: https://phabricator.services.mozilla.com/D135854
2022-02-08 12:47:53 +00:00
Gerald Squelart
ca8a203ae8 Bug 1735397 - mozilla::profiler::detail::FilterHasPid and FiltersExcludePid - r=florian
These will be used to check special thread filter rules around "pid:..." filters.

Differential Revision: https://phabricator.services.mozilla.com/D135853
2022-02-08 12:47:52 +00:00
Gerald Squelart
7e96f5a4d3 Bug 1735397 - Add mozilla/BaseAndGeckoProfilerDetail.h header for shared profiler-only things - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D135852
2022-02-08 12:47:52 +00:00
Kris Wright
51c0acfc7a Bug 1606651 - Remove TSan suppression for nsPluginTag. r=decoder
It looks like this data race might not be hit anymore.

Differential Revision: https://phabricator.services.mozilla.com/D137769
2022-02-08 05:51:10 +00:00
Iulian Moraru
62917bb0d3 Backed out 4 changesets (bug 1735397) for causing spidermonkey build bustages on check_vanilla_allocations.py. CLOSED TREE
Backed out changeset 724e44c19665 (bug 1735397)
Backed out changeset 64546b56bac0 (bug 1735397)
Backed out changeset d55f04c0a444 (bug 1735397)
Backed out changeset 19762488b965 (bug 1735397)
2022-02-08 07:49:20 +02:00
Gerald Squelart
6dca3dab69 Bug 1735397 - Don't start profiler in processes excluded by pid - r=florian
When trying to profile only one process, the profiler should not even start in those processes excluded by the filter, so that they don't use any resources (memory and CPU).
To do that, the filter is checked for "pid:" at the multiple locations it may appear:
- In the parent process, when starting the overall profiler, don't send the "Start" IPC to excluded processes.
- When a new process starts and initializes the profiler, don't start the profiler if the filter excludes this process.
- When a new process then registers itself with the parent, don't (re)start the profiler in excluded processes.

Child processes that don't run the profiler may still be asked for a JSON profile at the end of the profiling session. This is handled by sending an empty string, so that the parent process will correctly remove them from the pending-profile list.

Differential Revision: https://phabricator.services.mozilla.com/D135854
2022-02-08 02:40:50 +00:00
Gerald Squelart
ecc36a6f7e Bug 1735397 - mozilla::profiler::detail::FilterHasPid and FiltersExcludePid - r=florian
These will be used to check special thread filter rules around "pid:..." filters.

Differential Revision: https://phabricator.services.mozilla.com/D135853
2022-02-08 02:40:50 +00:00
Gerald Squelart
3ea972bdd8 Bug 1735397 - Add mozilla/BaseAndGeckoProfilerDetail.h header for shared profiler-only things - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D135852
2022-02-08 02:40:49 +00:00
Markus Stange
740759c4ef Bug 1753272 - On macOS, always enable frame pointer stack walking, even in builds which may not have frame pointers. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D137677
2022-02-03 16:31:05 +00:00
Andi-Bogdan Postelnicu
7858c79fb2 Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio,webdriver-reviewers
Updated with rustfmt 1.4.38-stable (db9d1b2 2022-01-20)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D137148
2022-01-31 17:00:21 +00:00
Gerald Squelart
50995cc271 Bug 1673513 - Use ProgressLogger in Gecko Profiler - r=florian
Add `ProgressLogger` parameter to most JSON-generating functions.
Each function can update the given `ProgressLogger` between 0% and 100%, and create sub-loggers when calling functions.

The main goal of this instrumentation is to notice when any progress is made by child processes (when the parent process is gathering profiles), so it needs to go deep enough so that it is not stuck on a progress value for "too long" -- During development, that meant progress was always happening when observed every 10ms; In later patches, the overall timeout for no-progress-made will be at least 1 second.

Differential Revision: https://phabricator.services.mozilla.com/D135479
2022-01-31 02:22:27 +00:00
Gerald Squelart
57b6cfaee2 Bug 1673513 - ProgressLogger - r=florian
Class used to log the progress of long operations, and simplifying the use through nested function calls and loops.

Differential Revision: https://phabricator.services.mozilla.com/D135478
2022-01-31 02:22:26 +00:00
Gerald Squelart
cb97352555 Bug 1673513 - ProportionValue - r=florian
Class storing a value between 0 and 1, effectively 0% to 100%.

It will be used through a ProgressLogger object to track the progress of JSON profile generation (see following patches).

Differential Revision: https://phabricator.services.mozilla.com/D135477
2022-01-31 02:22:26 +00:00
Gabriele Svelto
971d0cdf38 Bug 1751041 - Compute the process startup timestamp early during startup r=glandium
Previously the process startup timestamp was computed lazily but this caused
some issues with some of our static analysis infra (see bug 1678152). This
moves computing the timestamp early during process startup and makes it happen
unconditionally.

Differential Revision: https://phabricator.services.mozilla.com/D136406
2022-01-26 19:57:41 +00:00
Julien Wajsberg
cc5e07062d Bug 1639716 - [profiler] Bump the format version to ensure our users get the latest version of the frontend when capturing private browsing data r=gerald
Depends on D129819

Differential Revision: https://phabricator.services.mozilla.com/D136756
2022-01-26 17:26:24 +00:00
Julien Wajsberg
c52080ea1a Bug 1639716 - [profiler] Record the private browsing information in registered pages r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D129416
2022-01-26 17:26:20 +00:00