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

2529 Коммитов

Автор SHA1 Сообщение Дата
Mike Hommey 5999e70213 Bug 1751331 - Remove MOZ_DIST. r=firefox-build-system-reviewers,mhentges
As mentioned in bug 1747354, the location of the dist directory is
relied to be $topobjdir/dist, so just use that consistently rather
than getting it from a separate variable for rust build scripts.

Differential Revision: https://phabricator.services.mozilla.com/D136556
2022-01-25 09:03:01 +00:00
Jon Coppeard 9463e6b80e Bug 1664535 - Remove TSAN suppression now write barriers are not triggered on background threads r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D100139
2022-01-24 16:32:57 +00:00
Sam Foster d60fc9a269 Bug 1747429 - Replace preprocessor urlbar* variables with CSS vars. r=dao
* Define urlbarMarginInline and urlbarSearchButtonWidth as CSS rather than preprocessor variables
* Replace the urlbarViewPadding, urlbarViewFaviconWidth and urlbarViewIconMarginEnd preprocessor variables with CSS vars.
* Remove %ifdefs around the license comment in these 2 files
* Update ambiguous/out-of-date comment in the skeleton UI code

Differential Revision: https://phabricator.services.mozilla.com/D135962
2022-01-20 22:46:29 +00:00
Alexandru Michis c5d4f89a03 Backed out changeset 338f8b736b41 (bug 1747429) as requested by sfoster. 2022-01-20 20:58:34 +02:00
Sam Foster d292d48758 Bug 1747429 - Replace preprocessor urlbar* variables with CSS vars. r=dao
* Define urlbarMarginInline and urlbarSearchButtonWidth as CSS rather than preprocessor variables
* Replace the urlbarViewPadding, urlbarViewFaviconWidth and urlbarViewIconMarginEnd preprocessor variables with CSS vars.
* Remove %ifdefs around the license comment in these 2 files
* Update ambiguous/out-of-date comment in the skeleton UI code

Differential Revision: https://phabricator.services.mozilla.com/D135962
2022-01-20 00:48:42 +00:00
Gerald Squelart 6ad9abfa16 Bug 1750452 - Replace mutex-locked sampling pause during exec() with atomic variable - r=emilio,mstange
Note: The atomic variable is named `gSkipSampling`, not mentioning forks because it could later be used in other situations, so it's best to describe it by the effect it has.

Differential Revision: https://phabricator.services.mozilla.com/D136205
2022-01-19 03:05:44 +00:00
Gerald Squelart 18d4946ed0 Bug 1744670 - New feature: "Process CPU Utilization" aka "processcpu" - r=florian,canaltinova
The actual implementation is in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D133599
2022-01-17 23:01:29 +00:00
Mike Hommey baf00f49c1 Bug 1750084 - Update builders to rustc 1.58. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D135933
2022-01-14 00:37:03 +00:00
Emilio Cobos Álvarez b09928db79 Bug 1685752 - Add crossbeam_deque's steal to the tsan suppressions. r=Gankra,decoder
Differential Revision: https://phabricator.services.mozilla.com/D135910
2022-01-13 23:42:28 +00:00
Csoregi Natalia 4bb70cbbbc Backed out changeset b745ade60c2c (bug 1750084) for causing gecko decision failure. CLOSED TREE 2022-01-14 01:14:19 +02:00
Mike Hommey b617ba4e96 Bug 1750084 - Update builders to rustc 1.58. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D135933
2022-01-13 22:18:26 +00:00
Gerald Squelart 67edebb322 Bug 1749498 - PrintUsage doesn't exit anymore, exits are done explicitly - r=canaltinova
`PrintUsageThenExit(code)` was supposed to exit when `code` was not zero, but:
- The name didn't reflect that, so it was confusing that `PrintUsageThenExit(0)` would *not* exit.
- The implementation in the Base Profiler exited anyway! This caused issues with some legacy code that still used the now-removed "threads" feature.

This patch renames the function to just `PrintUsage()` and never exits, leaving the caller to invoke `exit(code)` as needed -- with the added benefit that it's possible to exit with a zero code, useful in cases where an exit is not actually an error.

Differential Revision: https://phabricator.services.mozilla.com/D135666
2022-01-12 12:16:59 +00:00
Cristian Tuns dea3b789a7 Backed out 2 changesets (bug 1617369, bug 1519636) for causing lint failures on multiple files. CLOSED TREE
Backed out changeset 6726892a0012 (bug 1617369)
Backed out changeset c08caa5f8504 (bug 1519636)
2022-01-11 04:38:34 -05:00
Andi-Bogdan Postelnicu 91c41ec2e4 Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio
Updated with rustfmt 1.4.37-stable (f1edd04 2021-11-29)

Differential Revision: https://phabricator.services.mozilla.com/D135527
2022-01-11 09:16:57 +00:00
Mike Hommey cca868ba68 Bug 1730004 - Add a crate with diagnostic / nightly asserts. r=nika,emilio
Original patch by emilio.

Differential Revision: https://phabricator.services.mozilla.com/D125190
2022-01-07 21:24:45 +00:00
Andreas Pehrson 2ff8332d74 Bug 1748280 - Gecko Profiler: Fix std::tuple deserialization. r=gerald
I'm gonna guess there was no existing use of the tuple
serialization/deserialization code, because `Bytes` doesn't exist in the
deserializer, and cannot possibly function properly on tuple members that
serialize to a non-constant size, since it's called on a default-constructed
tuple.

This patch took inspiration in the deserializer for Variant and seems to work
fine.

Differential Revision: https://phabricator.services.mozilla.com/D135028
2022-01-05 15:26:24 +00:00
Butkovits Atila 64c8533f75 Backed out 7 changesets (bug 1746361, bug 1748280, bug 1746347) for causing failures at browser_interaction-between-interfaces.js. CLOSED TREE
Backed out changeset eccba94506f0 (bug 1748280)
Backed out changeset baf39ae53772 (bug 1748280)
Backed out changeset 775843562f7e (bug 1748280)
Backed out changeset 0987c68e9683 (bug 1748280)
Backed out changeset 58dd008520da (bug 1746361)
Backed out changeset 6f9e800877a6 (bug 1746347)
Backed out changeset f78e794a9c2f (bug 1746347)
2022-01-05 13:53:57 +02:00
Andreas Pehrson 48daffe4ff Bug 1748280 - Gecko Profiler: Fix std::tuple deserialization. r=gerald
I'm gonna guess there was no existing use of the tuple
serialization/deserialization code, because `Bytes` doesn't exist in the
deserializer, and cannot possibly function properly on tuple members that
serialize to a non-constant size, since it's called on a default-constructed
tuple.

This patch took inspiration in the deserializer for Variant and seems to work
fine.

Differential Revision: https://phabricator.services.mozilla.com/D135028
2022-01-05 10:54:21 +00:00
Jonathan Watt 20736c98d6 Bug 1747952 - Include discovered/network printers in the CUPS list, with a timeout. r=emilio,decoder
The timeout is configurable via the pref print.cups.enum_dests_timeout_ms.

Differential Revision: https://phabricator.services.mozilla.com/D134844
2022-01-03 17:20:03 +00:00
Mike Hommey 1acc37c7a6 Bug 1747756 - Move Windows system libraries from LIBS to moz.build. r=firefox-build-system-reviewers,mhentges
While mingw builds don't require user32 and advapi32 explicitly, it doesn't
hurt for them to be there (and they're required for clang-cl build).
Likewise, while clang-builds don't require uuid and userenv explicitly
because they're pulled in via #pragmas in the source code, mingw doesn't
support those #pragmas and needs them explicitly, which doesn't hurt the
clang-cl builds.

Differential Revision: https://phabricator.services.mozilla.com/D134737
2021-12-30 20:56:43 +00:00
Iulian Moraru b469802d84 Backed out changeset 7f9b4b6191ad (bug 1747756) for causing multiple failures. CLOSED TREE 2021-12-30 01:59:26 +02:00
Mike Hommey cb50a5444f Bug 1747756 - Move Windows system libraries from LIBS to moz.build. r=firefox-build-system-reviewers,mhentges
While mingw builds don't require user32 and advapi32 explicitly, it doesn't
hurt for them to be there (and they're required for clang-cl build).
Likewise, while clang-builds don't require uuid and userenv explicitly
because they're pulled in via #pragmas in the source code, mingw doesn't
support those #pragmas and needs them explicitly, which doesn't hurt the
clang-cl builds.

Differential Revision: https://phabricator.services.mozilla.com/D134737
2021-12-29 22:18:52 +00:00
Gerald Squelart 1144535227 Bug 1729815 - Remove unnecessary profiler feature "threads" - r=julienw,perftest-reviewers,AlexandruIonescu
This feature doesn't have any effect anymore.

Differential Revision: https://phabricator.services.mozilla.com/D133860
2021-12-20 21:03:09 +00:00
Gerald Squelart 7b40fa572e Bug 1729815 - Allow empty feature list, or bitset=0 - r=julienw
This is necessary, because the next patch will remove the "threads" feature, and some tests only add that one feature so now they will have an empty feature list, equivalent to a feature bitset of 0 (zero).

Differential Revision: https://phabricator.services.mozilla.com/D134136
2021-12-20 21:03:09 +00:00
Markus Stange 875a34857d Bug 1362277 - Add an entry for dyld to the shared library list on macOS. r=gerald
This patch was r+ed before by Ted, but it never landed because I initially intended
to address Ted's review comment (about making it work on 10.11 and below), and
because it needed to be rebased around bug 1374888.
The rebase turned out to be really simple, and Ted's review comment no longer applies
because Firefox no longer runs on 10.11 and below.

Profile with fix: https://share.firefox.dev/3oYzvO6

Differential Revision: https://phabricator.services.mozilla.com/D134008
2021-12-17 11:54:28 +00:00
Gerald Squelart 4199f5065e Bug 1734867 - Use single static buffer when capturing stacks for main-thread markers - r=florian
The main thread is the busiest, so it benefits the most from having its own chunked buffer. This removes one allocation when capturing a marker stack on the main thread of each process.
That buffer is allocated when the first profiler starts, and is destroyed when the last profiler stops.

Note: Further improvements are possible (e.g.: Pool of pre-allocated buffers, attempting to use a stack-based buffer, etc.), but they are more complex and will require more work in future bugs.

Differential Revision: https://phabricator.services.mozilla.com/D133725
2021-12-17 05:27:06 +00:00
Gerald Squelart 0b5f1f299e Bug 1734867 - Refactor stack-capturing path in AddMarkerToBuffer - r=florian
The resulting code should be the same. The factored lambda will be called in the next patch with a different chunked buffer.

Differential Revision: https://phabricator.services.mozilla.com/D133724
2021-12-17 05:27:06 +00:00
Gerald Squelart 212a940977 Bug 1734867 - Allocate ProfilerBuffer's worker ChunkManager only when first needed - r=florian
Some ProfileBuffers are temporary and don't actually need this allocation.

Differential Revision: https://phabricator.services.mozilla.com/D133723
2021-12-17 05:27:05 +00:00
Cristian Tuns 348796281f Backed out changeset f90cb649f371 (bug 1729815) for causing mochitest failures on Mutex_posix.cpp CLOSED TREE 2021-12-16 19:45:55 -05:00
Gerald Squelart c40dcd12b5 Bug 1729815 - Remove unnecessary profiler feature "threads" - r=julienw,perftest-reviewers,AlexandruIonescu
This feature doesn't have any effect anymore.

Differential Revision: https://phabricator.services.mozilla.com/D133860
2021-12-16 23:46:18 +00:00
Butkovits Atila dc70e7f9d2 Backed out 3 changesets (bug 1734867) for causing assertion failures at ProfilerMarkers.cpp. CLOSED TREE
Backed out changeset bcddb167725c (bug 1734867)
Backed out changeset 7e01973ce58a (bug 1734867)
Backed out changeset 8b3b1ab8d743 (bug 1734867)
2021-12-16 18:02:35 +02:00
Gerald Squelart 1b1645bfdb Bug 1734867 - Use single static buffer when capturing stacks for main-thread markers - r=florian
The main thread is the busiest, so it benefits the most from having its own chunked buffer. This removes one allocation when capturing a marker stack on the main thread of each process.
That buffer is allocated when the first profiler starts, and is destroyed when the last profiler stops.

Note: Further improvements are possible (e.g.: Pool of pre-allocated buffers, attempting to use a stack-based buffer, etc.), but they are more complex and will require more work in future bugs.

Differential Revision: https://phabricator.services.mozilla.com/D133725
2021-12-16 11:06:29 +00:00
Gerald Squelart 754ed07803 Bug 1734867 - Refactor stack-capturing path in AddMarkerToBuffer - r=florian
The resulting code should be the same. The factored lambda will be called in the next patch with a different chunked buffer.

Differential Revision: https://phabricator.services.mozilla.com/D133724
2021-12-16 11:06:29 +00:00
Gerald Squelart 2b3ce6d818 Bug 1734867 - Allocate ProfilerBuffer's worker ChunkManager only when first needed - r=florian
Some ProfileBuffers are temporary and don't actually need this allocation.

Differential Revision: https://phabricator.services.mozilla.com/D133723
2021-12-16 11:06:28 +00:00
Mike Hommey 20bcb3ecfe Bug 1745344 - Unconditionally use va_copy. r=nika
Historically, va_copy was not supported everywhere (notably, MSVC didn't
have it). That's not true anymore. We already have code such as
xpcom/base/Logging.cpp that uses it unconditionally.

Differential Revision: https://phabricator.services.mozilla.com/D133458
2021-12-16 06:26:42 +00:00
Mike Hommey 57566b8ca4 Bug 1415595 - Remove unnecessary mode when opening ASHMEM_NAME_DEF. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D133857
2021-12-15 23:56:33 +00:00
Cristian Tuns b046625e06 Backed out 3 changesets (bug 1734867) for causing xpcshell failures on ProfileBufferChunkManager.h
Backed out changeset 63b2fd522aa8 (bug 1734867)
Backed out changeset 17219f7b60f5 (bug 1734867)
Backed out changeset 46bfc82686ac (bug 1734867)
2021-12-15 05:27:31 -05:00
Gerald Squelart 87084a5f4b Bug 1734867 - Use single static buffer when capturing stacks for main-thread markers - r=florian
The main thread is the busiest, so it benefits the most from having its own chunked buffer. This removes all but one allocation when capturing a marker stack on the main thread of each process.

Note: Further improvements are possible (e.g.: Pool of pre-allocated buffers, attempting to use a stack-based buffer, etc.), but they are more complex and will require more work in future bugs.

Depends on D133724

Differential Revision: https://phabricator.services.mozilla.com/D133725
2021-12-15 09:37:17 +00:00
Gerald Squelart 484d533cbc Bug 1734867 - Refactor stack-capturing path in AddMarkerToBuffer - r=florian
The resulting code should be the same. The factored lambda will be called in the next patch with a different chunked buffer.

Depends on D133723

Differential Revision: https://phabricator.services.mozilla.com/D133724
2021-12-15 09:37:17 +00:00
Gerald Squelart 060f1bb331 Bug 1734867 - Allocate ProfilerBuffer's worker ChunkManager only when first needed - r=florian
Some ProfileBuffers are temporary and don't actually need this allocation.

Differential Revision: https://phabricator.services.mozilla.com/D133723
2021-12-15 09:37:17 +00:00
Gerald Squelart 0aab2ce513 Bug 1745071 - Add IPCMessages to StartupExtraDefaultFeatures() - r=florian
Depends on D133301

Differential Revision: https://phabricator.services.mozilla.com/D133302
2021-12-09 11:48:22 +00:00
Gerald Squelart 9fef9b8f00 Bug 1745071 - Make DefaultFeatures() and StartupExtraDefaultFeatures() constexpr - r=florian
Small optimization.

Note that unfortunately AvailableFeatures() cannot be made constexpr because it uses getenv().

Differential Revision: https://phabricator.services.mozilla.com/D133301
2021-12-09 11:48:22 +00:00
Kershaw Chang 6bc0b53d81 Bug 1744996 - Remove tsan suppression, r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D133207
2021-12-08 19:47:12 +00:00
Mike Hommey b1a0e8915c Bug 1742749 - Update builders to rustc 1.57. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D132534
2021-12-02 21:07:37 +00:00
Gerald Squelart a1bb77b57e Bug 1742522 - New profiler feature to discover unregistered threads and capture some data - r=florian
The profiler uses GetProcInfoSync to discover unregistered threads, and record their CPU utilization. This data is captured in markers on the main thread track.
On Windows, because this work takes much longer than the usual sampling interval, it is done on its own thread.

Differential Revision: https://phabricator.services.mozilla.com/D132213
2021-12-02 08:52:40 +00:00
Gerald Squelart 7d2479ce99 Bug 1742522 - Pass full feature set to SamplerThread instead of individual features bools - r=florian
When constructing the SamplerThread object, individual features were extracted from the feature set (a uint32_t), and passed as bools. This could be error-prone, wasteful, and a maintenance burden when more features are needed in some/all platform implementations (like the next patch adding a new feature with a Windows-specific impact).
So now the full feature set is given to the SamplerThread, which can then extract the features it requires on each platform.

Differential Revision: https://phabricator.services.mozilla.com/D132523
2021-12-02 08:52:40 +00:00
Toshihito Kikuchi bdceca20fa Bug 1742692 - Add some modules to mozglue's delayload list. r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D131968
2021-12-02 04:31:14 +00:00
Chris Peterson f6fdbf028a Bug 1738401 - Remove -Wno-shadow warning suppressions. r=firefox-build-system-reviewers,glandium
-Wshadow warnings are not enabled globally, so these -Wno-shadow suppressions have no effect. I had intended to enable -Wshadow globally along with these suppressions in some directories (in bug 1272513), but that was blocked by other issues.

There are too many -Wshadow warnings (now over 2000) to realistically fix them all. We should remove all these unnecessary -Wno-shadow flags cluttering many moz.build files.

Differential Revision: https://phabricator.services.mozilla.com/D132289
2021-12-01 06:40:04 +00:00
Mike Hommey 43fbd70541 Bug 1743550 - Remove outdated use of -bind_at_load. r=firefox-build-system-reviewers,mhentges
-bind_at_load was added in bug 1139036 because of a dead-lock on startup
in jemalloc3 when a) we used jemalloc3 by default on nightly b) macOS
10.10.3 was released.

Since then we upgraded to jemalloc 4, and eventually ... removed
jemalloc 4 in bug 1363992, which makes the -bind_at_load flag leftover
from this removal.

Differential Revision: https://phabricator.services.mozilla.com/D132453
2021-11-30 21:52:49 +00:00
Marian-Vasile Laza bf27ab5fab Backed out changeset 1ff449af979d (bug 1742692) for causing cppunit test failures. CLOSED TREE 2021-11-30 22:19:47 +02:00
Toshihito Kikuchi 18c35bbe88 Bug 1742692 - Add some modules to mozglue's delayload list. r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D131968
2021-11-30 16:40:45 +00:00
Florian Queze 5373598e93 Bug 1742472 - Use QueryProcessCycleTime on Windows to report total CPU time spent when the CPU has a constant TSC, r=gerald,jrmuizel.
Differential Revision: https://phabricator.services.mozilla.com/D131834
2021-11-24 10:46:45 +00:00
Florian Queze a2e85fcc9f Bug 1742472 - fix the clang implementation of has_cpuid_bits for the levels in the 0x80000000 range, r=jrmuizel.
Differential Revision: https://phabricator.services.mozilla.com/D131946
2021-11-24 10:46:44 +00:00
Butkovits Atila ee77dc4fe8 Backed out changeset 8c47ea741114 (bug 1742111) for causing Bug 1742237. a=backout 2021-11-21 12:15:20 +02:00
Dão Gottwald 5e8698ee04 Bug 1742111 - Rename internal accentcolor and textcolor properties to be more consistent with the webext theme API. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D131634
2021-11-19 20:00:07 +00:00
Neel Chauhan f11cb7b33f Bug 1643637: Make MOZ_PROFILER_STARTUP_ENTRIES understand sizes with units r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D131022
2021-11-12 11:38:12 +00:00
Gerald Squelart cacfb45508 Bug 1738627 - MOZ_PROFILER_STARTUP_FEATURES {cpu,stacks,markers}allthreads - r=canaltinova
New features cpuallthreads, stacksallthreads, and markersallthreads now allow the user to selectively profile non-selected threads for more information.

The gtest GeckoProfiler.FeatureCombinations is modified to test combinations of up to 3 of a set of features, to lower its cost, which allows adding the new features.

Differential Revision: https://phabricator.services.mozilla.com/D130011
2021-11-08 23:59:37 +00:00
Gerald Squelart b3ef8bb344 Bug 1738627 - Better Synchronize profiler features lists - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D130563
2021-11-08 23:59:36 +00:00
Cristian Tuns 1aeac93d23 Backed out 5 changesets (bug 1738627) for causing xpcshell failures on test_ext_geckoProfiler_schema.js CLOSED TREE
Backed out changeset 42d385d7da97 (bug 1738627)
Backed out changeset edeb3a338954 (bug 1738627)
Backed out changeset 98f02e35134d (bug 1738627)
Backed out changeset 711daa6dd24b (bug 1738627)
Backed out changeset 49e12753a40c (bug 1738627)
2021-11-05 05:12:28 -04:00
Gerald Squelart ea92e5ea81 Bug 1738627 - MOZ_PROFILER_STARTUP_FEATURES {cpu,stacks,markers}allthreads - r=canaltinova
New features cpuallthreads, stacksallthreads, and markersallthreads now allow the user to selectively profile non-selected threads for more information.

The gtest GeckoProfiler.FeatureCombinations is modified to test combinations of up to 3 of a set of features, to lower its cost, which allows adding the new features.

Differential Revision: https://phabricator.services.mozilla.com/D130011
2021-11-05 05:52:29 +00:00
Mike Hommey 7fa0a01f14 Bug 1736459 - Update builders to rustc 1.56. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D128808
2021-10-27 22:35:57 +00:00
Norisz Fay 51e8153e60 Backed out 5 changesets (bug 1736459) for causing Windows crashes (bug 1738034) a=backout
Backed out changeset c934eeb21692 (bug 1736459)
Backed out changeset 0b2da7db414c (bug 1736459)
Backed out changeset 798893f69a02 (bug 1736459)
Backed out changeset 2a8f412c4d08 (bug 1736459)
Backed out changeset 59eeaeafdf67 (bug 1736459)
2021-10-27 16:02:24 +03:00
Mike Hommey 8b2faec239 Bug 1736459 - Update builders to rustc 1.56. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D128808
2021-10-26 23:11:40 +00:00
Noemi Erli 34988f27ab Backed out 2 changesets (bug 1736459) for causing SM bustage CLOSED TREE
Backed out changeset 1548d79706bb (bug 1736459)
Backed out changeset cb0bd4552c26 (bug 1736459)
2021-10-23 00:26:49 +03:00
Mike Hommey 0611e1d9e5 Bug 1736459 - Update builders to rustc 1.56. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D128808
2021-10-22 20:33:54 +00:00
Gerald Squelart 8ff93952a4 Bug 1737058 - Empty MOZ_PROFILER_SHUTDOWN in child processes, so they don't needlessly and dangerously write their profile to the same file - r=canaltinova
The user shouldn't set MOZ_PROFILER_SHUTDOWN to an empty string, it wouldn't work anyway.
So now there is an extra check for that, to avoid even attempting to write a profile when there is no actual filename.

Thanks to this, the parent process can now just re-set MOZ_PROFILER_SHUTDOWN to "" in its children, so that they won't try to output their own profile into the same file. (This used to mostly work, because the parent process was the last to write its profile; but anecdotal data shows this may not alwaybe be true.)

As a bonus optimization, this means that child processes don't waste time needlessly saving their profile to disk.

Differential Revision: https://phabricator.services.mozilla.com/D129237
2021-10-22 08:41:27 +00:00
Marian-Vasile Laza 99d489acd7 Backed out changeset 47fdc6711870 (bug 1736459) for causing build bustages. CLOSED TREE 2021-10-22 01:40:07 +03:00
Mike Hommey e4e9aed5d8 Bug 1736459 - Update builders to rustc 1.56. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D128808
2021-10-21 20:46:59 +00:00
Gerald Squelart 302a5711fa Bug 1577658 - DeserializeAfterKindAndStream takes a lambda: (tid) -> writer - r=canaltinova
Previously, DeserializeAfterKindAndStream would take a JSON writer and a thread id, using the thread id (if specified) to only output markers from that thread to the given writer.

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

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

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

Differential Revision: https://phabricator.services.mozilla.com/D126208
2021-10-20 12:03:20 +00:00
Butkovits Atila c56f15eca0 Backed out changeset 7de44eaecb13 (bug 1731582) as requested by Andi. CLOSED TREE 2021-10-19 20:52:08 +03:00
Andi-Bogdan Postelnicu 151c81623a Bug 1731582 - Move to clang-13 r=firefox-build-system-reviewers,mhentges,decoder
Join work with glandium.

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

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

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

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

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

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

Differential Revision: https://phabricator.services.mozilla.com/D128707
2021-10-18 23:11:29 +00:00
Valentin Gosu 01dbf4259f Bug 1606864 - Make mDoNotRetryToConnect atomic r=necko-reviewers,decoder,dragana
Fixes race between nsSocketTransport::Close and
nsSocketTransport::RecoverFromError called from OnSocketDetached.

Depends on D128183

Differential Revision: https://phabricator.services.mozilla.com/D128364
2021-10-18 13:53:16 +00:00
Valentin Gosu db56571b13 Bug 1712671 - Make nsSocketTransport2::m{Input/Output}StreamClosed atomic r=necko-reviewers,kershaw,decoder
Fixes race between nsSocketTransport::OnInputClosed and nsSocketTransport::OpenInputStream.
Same for output streams.

Differential Revision: https://phabricator.services.mozilla.com/D128183
2021-10-18 13:53:15 +00:00
Bobby Holley 041a1558be Bug 1734262 - Suppress thread leak reports for the monitor thread. r=decoder
For the same reasons discussed in the previous commit, it's impractical
to join these threads on shutdown, and so we should suppress thread leak
reports for them.

Differential Revision: https://phabricator.services.mozilla.com/D128651
2021-10-16 16:29:32 +00:00
stransky 427342d2ea Bug 1735539 [Linux\EGL] Don't report mem leaks from libEGL_mesa.so r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D128371
2021-10-13 13:56:50 +00:00
Kris Wright aa245e4e37 Bug 1733908 - Add one more js::wasm::Code suppression to TSan r=decoder
Try pushes are showing one more data race that I didn't catch.

Differential Revision: https://phabricator.services.mozilla.com/D128271
2021-10-13 05:12:48 +00:00
Kris Wright 998548ca0d Bug 1733908 - Add temporary TSan suppressions r=decoder
Looks like there are a couple of impacted sites - these temporary suppressions should clear up the tests until they can be addressed.

Differential Revision: https://phabricator.services.mozilla.com/D128222
2021-10-12 14:43:53 +00:00
Nazım Can Altınova 146befbbdb Bug 1733335 - Add tracing marker type for the Rust side r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D127112
2021-10-11 07:59:09 +00:00
Sandor Molnar ac87f8501e Backed out 4 changesets (bug 1733335) for causing multiple dt failures. CLOSED TREE
Backed out changeset 8c14ac28d042 (bug 1733335)
Backed out changeset 066819ce0e86 (bug 1733335)
Backed out changeset c44e1bb6d9ff (bug 1733335)
Backed out changeset 4cd1efb42295 (bug 1733335)
2021-10-06 17:49:47 +03:00
Nazım Can Altınova 9651c20007 Bug 1733335 - Add tracing marker type for the Rust side r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D127112
2021-10-06 11:35:15 +00:00
Marian-Vasile Laza 6c22452994 Backed out 4 changesets (bug 1733335) for causing build bustages. CLOSED TREE
Backed out changeset 45a3ae02f837 (bug 1733335)
Backed out changeset 41c62acfb5a6 (bug 1733335)
Backed out changeset cf3b6b6cc6c6 (bug 1733335)
Backed out changeset b919d9cfb8e5 (bug 1733335)
2021-10-05 15:07:44 +03:00
Nazım Can Altınova aae1952697 Bug 1733335 - Add tracing marker type for the Rust side r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D127112
2021-10-05 11:34:27 +00:00
Mike Hommey 49ee506e32 Bug 1732208 - Silence the unused-but-set-variable warning in platform-linux-android.cpp. r=gerald
platform-linux-android.cpp:199:9: error: variable 'r' set but not used [-Werror,-Wunused-but-set-variable]
    int r = sem_init(&mMessage2, /* pshared */ 0, 0);
        ^
platform-linux-android.cpp:206:9: error: variable 'r' set but not used [-Werror,-Wunused-but-set-variable]
 not used [-Werror,-Wunused-but-set-variable]
    int r = sem_destroy(&mMessage2);
        ^

Differential Revision: https://phabricator.services.mozilla.com/D126459
2021-09-28 00:02:47 +00:00
Nazım Can Altınova a15be90d61 Bug 1654413 - Deserialize and stream the markers and marker schemas r=emilio,gerald
Now we can deserialize and stream everything to the JSON.

Differential Revision: https://phabricator.services.mozilla.com/D124027
2021-09-21 11:08:12 +00:00
Nazım Can Altınova ca180f8629 Bug 1654413 - Add add_marker Rust profiler API and serialize the marker to the buffer r=emilio,gerald
This only adds the API and then adds the profiler payload to the buffer. The
deserialization and streaming will happen in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D124026
2021-09-21 11:08:11 +00:00
Nazım Can Altınova a5b9cfdadb Bug 1654413 - Add MarkerSchema struct and its enums for marker API r=emilio,gerald
You can see the `mozilla::MarkerSchema` for the C++ counterpart. This Rust
struct simply wraps the C++ object and keeps the reference of it as RAII. This
heap allocates the inner C++ object but it's fine to do it here, because it's
we only create a MarkerSchema object at the end of a profiling session and it
happens once per marker type. It should be very rare.

Differential Revision: https://phabricator.services.mozilla.com/D124025
2021-09-21 11:08:11 +00:00
Nazım Can Altınova 02f9877e83 Bug 1654413 - Add add_untyped_marker Rust API r=emilio,gerald
This is the first and simplest API for the markers. There will be two more
APIs in the following patches (add_text_marker and add_marker). You can see the
PROFILER_MARKER_UNTYPED macro for the C++ counterpart.

Differential Revision: https://phabricator.services.mozilla.com/D124022
2021-09-21 11:08:10 +00:00
Nazım Can Altınova 7ec023dfe3 Bug 1654413 - Add a MarkerTiming and MarkerOptions Rust structs for the marker API r=emilio,gerald
These structs are needed for the marker APIs. We also have the same structs as
the C++ classes. See `mozilla::MarkerTiming` and `mozilla::MarkerOptions`.

Differential Revision: https://phabricator.services.mozilla.com/D124020
2021-09-21 11:08:09 +00:00
Bob Owen 972b41f513 Bug 1546154 p3: Explicitly load COM functions from combase.dll to prevent ole32 loading. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D124931
2021-09-20 10:09:01 +00:00
Marian-Vasile Laza 1cf4af94e5 Backed out 7 changesets (bug 1546154) for causing build bustages on ContentProcess.cpp. CLOSED TREE
Backed out changeset 0bd777eee249 (bug 1546154)
Backed out changeset 611812ee62a2 (bug 1546154)
Backed out changeset cef0aa18a3ab (bug 1546154)
Backed out changeset cfda47fb0a46 (bug 1546154)
Backed out changeset f3e005f5fedc (bug 1546154)
Backed out changeset 7f50fca0c2cd (bug 1546154)
Backed out changeset bbb0b25450f5 (bug 1546154)
2021-09-15 14:12:55 +03:00
Bob Owen 8b6ae95727 Bug 1546154 p3: Explicitly load COM functions from combase.dll to prevent ole32 loading. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D124931
2021-09-15 10:21:04 +00:00
Gerald Squelart b3c424f6d7 Bug 1663382 - Optimize Deserializer<ProfilerStringView> to reference in-buffer data when possible - r=canaltinova
Because string contents could be split in two separate chunks, the default ProfilerStringView deserializer needed to concatenate it together in an off-chunk buffer.
But now thanks to ProfileBufferEntryReader::ReadSpans, it is possible to know if the contents are in a single memory area inside one chunk (which should be the vast majority of cases), in which case the ProfilerStringView can just reference it using its internal std::string_view, which saves managing a separate buffer and copying data into it.
However this can only be done safely when the span is correctly aligned for the character type, which may not be the case for char16_t strings that must be even-aligned.

Differential Revision: https://phabricator.services.mozilla.com/D124430
2021-09-10 11:43:48 +00:00
Gerald Squelart 997a0ba46c Bug 1663382 - ProfileBufferEntryReader::{Peek,Read}Spans return pointers to entry bytes - r=canaltinova
Instead of always having to use `ReadBytes` to copy bytes out of the profile buffer into an external buffer, these functions provide one or two spans (pointer+size) pointing at the area, which can be used to look at the data without copying it, especially in the majority of cases where areas are fully inside one chunk and only need one span to address.

Differential Revision: https://phabricator.services.mozilla.com/D124429
2021-09-10 11:43:48 +00:00
Gerald Squelart c4a6f1bac7 Bug 1663382 - Remove dangerous ProfilerStringView::Data() - r=florian
`ProfilerStringView::Data()` would return a pointer to the start of the string, but there may not be a null terminator at the end!
To reduce the likelihood of misuses, that function has now been removed.
Instead, callers must now access the data through `AsSpan` or the `Span` conversion operator (which makes it easy to use with `NS_ConvertUTF16toUTF8` for example).

It was not an issue until now, because deserialized string would always be terminated when copied out of the profile buffer, but a following patch will add optimized code where the non-terminated string inside the buffer will be directly pointed at.

Differential Revision: https://phabricator.services.mozilla.com/D125027
2021-09-10 11:43:47 +00:00
Mike Hommey 9c0f04e547 Bug 1730030 - Replace some assembly with corresponding compiler builtins. r=gerald
This has the side-effect of adding the missing arm64 mac support for PHC.

Differential Revision: https://phabricator.services.mozilla.com/D125139
2021-09-10 00:58:34 +00:00
Mike Hommey 2f75037f7a Bug 1727470 - Update builders to rustc 1.55. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D124735
2021-09-09 21:02:28 +00:00