Commit Graph

2544 Commits

Author SHA1 Message Date
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
Doug Thayer
ef2740f793 Bug 1728653 - Allow a silent start mode r=bytesized,nalexander,application-update-reviewers,mossop
This will allow starting Firefox in the background, and on Windows will allow
closing the last browser window without killing the main process. There is no
plan for actually using this by default in Firefox proper, but it's needed for
some explorations.

There's more to this work that we'll need - this is just the first step. For
instance, we'll need a real way to actually kill firefox on Windows other than
through the task manager (we'll be putting something in the system tray to
allow this.)

The patch wasn't particularly large, so I didn't split out the rename of
MOZ_APP_SILENT_START to MOZ_APP_SILENT_RESTART - let me know if you'd like me
to do that though and I can.

Differential Revision: https://phabricator.services.mozilla.com/D124249
2021-09-09 18:09:25 +00:00
Byron Campen
f48b2388ae Bug 1683417: Remove tsan suppression and fix race. r=ng,decoder
Also add a thread assertion.

Differential Revision: https://phabricator.services.mozilla.com/D124993
2021-09-09 17:13:36 +00:00
Narcis Beleuzu
d1008ea8e7 Backed out 2 changesets (bug 1663382) for bc failures on browser_test_marker_network_serviceworker_synthetized_response.js . CLOSED TREE
Backed out changeset f3a453eb5700 (bug 1663382)
Backed out changeset 2fd6d02ad407 (bug 1663382)
2021-09-07 03:28:41 +03:00
Gerald Squelart
dceb658042 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-06 22:18:03 +00:00
Gerald Squelart
6076a5b8de 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-06 22:18:02 +00:00
Iulian Moraru
c701e5f6e9 Backed out 2 changesets (bug 1663382) for causing multiple mochitest crashes. CLOSED TREE
Backed out changeset bac8ae20a8af (bug 1663382)
Backed out changeset 0b3495e23e77 (bug 1663382)
2021-09-06 06:50:02 +03:00
Gerald Squelart
108a906e53 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.

Differential Revision: https://phabricator.services.mozilla.com/D124430
2021-09-06 02:40:08 +00:00
Gerald Squelart
af8c9a770f 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-06 02:40:08 +00:00
Nazım Can Altınova
0f657df07f Bug 1728544 - Make the MarkerSchema::Searchable enum class values CamelCased r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D124242
2021-09-03 14:30:10 +00:00
Nazım Can Altınova
a38b25b295 Bug 1728544 - Make the MarkerSchema::Format enum class values CamelCased r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D124241
2021-09-03 14:30:10 +00:00
Nazım Can Altınova
ddae0f7cd6 Bug 1728544 - Make the MarkerSchema::Location enum class values CamelCased r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D124240
2021-09-03 14:30:09 +00:00
Botond Ballo
78ddb2abb6 Bug 1723170 - Remove sAsyncPanZoomControllerCount. r=tnikkel,decoder
All the code that uses it was conditioned on ShouldUseProgressivePaint(),
which was changed to always return false in the previous commit.

This also fixes a racy access to this static variable.

Depends on D123712

Differential Revision: https://phabricator.services.mozilla.com/D123713
2021-09-01 19:36:35 +00:00
Botond Ballo
bfe08d4f96 Bug 1723142 - Acquire the APZC lock in SetTestAsyncZoom(). r=tnikkel,decoder
Differential Revision: https://phabricator.services.mozilla.com/D123706
2021-09-01 19:30:22 +00:00
Botond Ballo
2ff758e8ee Bug 1723176 - Protect access to AsyncPanZoomController::mZoomAnimationId with the APZC lock. r=tnikkel,decoder
Differential Revision: https://phabricator.services.mozilla.com/D123710
2021-09-01 19:11:21 +00:00
Christopher Winter
7acf6d224b Bug 1604914 - Make ShouldProfileThread more efficient r=gerald
When starting the profiler, also make a copy of the filter strings
converted to lower-case. This allows caseless comparisons to be made
against thread names without repeatedly converting the filters to
lower-case for each thread.

Differential Revision: https://phabricator.services.mozilla.com/D123302
2021-08-26 01:31:25 +00:00
Andi-Bogdan Postelnicu
2fc4f70e9b Bug 1725145 - Preparation for the hybrid build env. r=necko-reviewers,firefox-build-system-reviewers,valentin,glandium
Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
when the module governed by the build config file is not buildable outside on the unified environment.

This needs to be done in order to have a hybrid build system that adds the possibility of combing
unified build components with ones that are built outside of the unified eco system.

Differential Revision: https://phabricator.services.mozilla.com/D122345
2021-08-25 10:46:17 +00:00
Gerald Squelart
7f3c9eb118 Bug 1727036 - SpliceableJSONWriter::Time... functions output milliseconds with nanosecond precision - r=mstange
Instead of blindly outputting floating-point numbers of milliseconds, which leads to things like 363.03499999999997, times in ms are now converted to integer number of nanoseconds, stringified, and then manually adjusted to milliseconds again, so we get smaller and friendlier outputs like 363.035.

Eventually, bug 1726675 may change all times to integer number of nanoseconds anyway, but this patch is already helpful in reducing the output, and paves the way by separating the time-output functions from other number outputs.

Differential Revision: https://phabricator.services.mozilla.com/D123329
2021-08-24 21:33:05 +00:00
Gerald Squelart
1cf3bc392a Bug 1726657 - Only record sampling overheads if MOZ_PROFILER_RECORD_OVERHEADS is set - r=florian
Sampling overheads are very rarely useful, but they occupy some space during profiling, but also a lot of space in the final JSON profile.
So now they will only be recorded if the environment variable "MOZ_PROFILER_RECORD_OVERHEADS" is set to any non-empty value.

Differential Revision: https://phabricator.services.mozilla.com/D123303
2021-08-23 22:23:34 +00:00
Julien Wajsberg
2a42e8a50e Bug 1697901 - [network markers] Bump the profile version to 24 r=gerald
This ensures our users will use the latest version of the frontend when
capturing 'cancel' network markers.

Depends on D123254

Differential Revision: https://phabricator.services.mozilla.com/D123255
2021-08-23 08:56:53 +00:00
Gerald Squelart
9c1ed025c1 Bug 1633572 - New small buffer entry to indicate an indentical sample instead of a copy - r=canaltinova
Instead of copying the full stack from the previous sample when identical, the new ProfileBufferEntryKind::TimeBeforeSameSample + SameSample entry pair indicates that this is an identical sample. Later when producing the final JSON profile, we can just re-use the same sample identifier as before.

This effectively lowers the size of this kind of entry from hundreds of bytes, down to 20-30 bytes, which should help with capturing more samples in the same buffer size. And it also uses less CPU resources, since we don't need to find the previous stack and copy it.

We still need to perform a full copy at the start of a buffer chunk, to make sure there is always a full stack available in case older previous chunks have been destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D122679
2021-08-18 01:47:41 +00:00
Gerald Squelart
aaee7d55b0 Bug 1633572 - ProfileChunkedBuffer::IsIndexInCurrentChunk - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D122678
2021-08-18 01:47:41 +00:00
Gerald Squelart
2be7cfed4b Bug 1633572 - Fix PROFILER_RUNTIME_STATS - r=canaltinova
PROFILER_RUNTIME_STATS was broken recently. It's only used during development (mostly to benchmark new code), so it's not critical and no tests are needed.

Differential Revision: https://phabricator.services.mozilla.com/D122677
2021-08-18 01:47:40 +00:00
Aaron Klotz
ac6454a0ed Bug 1724749: Consolidate all dllservices code; r=tkikuchi
Per the discussion on governance, the new DLL services module will live in
`toolkit/xre/dllservices`.

Mozglue code will live in `toolkit/xre/dllservices/mozglue` and will be linked
in with `mozglue.dll`.

Differential Revision: https://phabricator.services.mozilla.com/D122384
2021-08-12 20:57:12 +00:00
Gerald Squelart
adfaf6a929 Bug 1725089 - Add support for WASI in ProfilerUtils - r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D122313
2021-08-12 12:27:25 +00:00
Alexandru Michis
15f1bc73d2 Backed out changeset b81da25293ad (bug 1724749) for causing bustages due to UntrustedModulesData.h not being found.
CLOSED TREE
2021-08-12 02:49:40 +03:00
Aaron Klotz
cdc3b69555 Bug 1724749: Consolidate all dllservices code; r=tkikuchi
Per the discussion on governance, the new DLL services module will live in
`toolkit/xre/dllservices`.

Mozglue code will live in `toolkit/xre/dllservices/mozglue` and will be linked
in with `mozglue.dll`.

Differential Revision: https://phabricator.services.mozilla.com/D122384
2021-08-11 23:08:52 +00:00
Gerald Squelart
056d185383 Bug 1721569 - Use std::this_thread::get_id() on other platforms - r=florian
Now `profiler_current_thread_id()` is available on all platforms, at all tier levels.

Differential Revision: https://phabricator.services.mozilla.com/D121053
2021-08-11 03:27:52 +00:00
Gerald Squelart
032f23b189 Bug 1721569 - Change id native types to reflect what each platform really provides - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D121052
2021-08-11 03:27:51 +00:00
Gerald Squelart
1f76b47543 Bug 1721569 - Move main-thread id functions to cpp files - r=florian
This hides the scProfilerMainThreadId detail, and makes for a safer API.
Also, ::profiler_init_main_thread_id() calls ::mozilla::baseprofiler::profiler_init_main_thread_id().
And in non-MOZ_GECKO_PROFILER builds, AUTO_PROFILER_INIT calls profiler_init_main_thread_id(), which makes other main-thread functions usable there (assuming profiler_current_thread_id works).

Differential Revision: https://phabricator.services.mozilla.com/D121695
2021-08-11 03:27:51 +00:00
Gerald Squelart
84d1ba4229 Bug 1721569 - Moved implementations of {,Base}ProfilerUtils.h declarations to ProfilerUtils.cpp - r=florian
This patch only shuffles source code around, so that all declarations in {,Base}ProfilerUtils.h are now implemented only in ProfilerUtils.cpp (instead of the different platform-*.cpp), the final generated code should be the same in MOZ_GECKO_PROFILER builds (the default on all our supported platforms).
This simplifies the headers and makes further changes easier.

In non-MOZ_GECKO_PROFILER builds: On supported platforms these functions are now fully defined; Unsupported platforms should all had `getpid()`, but thread ids are null.
So now `profiler_current_process_id()` is available on all platforms, at all tier levels.

Differential Revision: https://phabricator.services.mozilla.com/D121051
2021-08-11 03:27:50 +00:00
Gerald Squelart
5d1937d55a Bug 1721569 - Handle different sizes of Profiler{Process,Thread}Id - r=florian
Since ProfilerProcessId and ProfilerThreadId (and their NumberTypes) will potentially grow to 64 bits on some platforms (in a later patch), all code that uses them must be able to handle bigger types.

Differential Revision: https://phabricator.services.mozilla.com/D121049
2021-08-11 03:27:50 +00:00
Gerald Squelart
c469a8f0be Bug 1721569 - Add gtest checks comparing Base and Gecko profiler process/thread APIs - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D121048
2021-08-11 03:27:49 +00:00
Toshihito Kikuchi
07dfbc6b36 Bug 1723868 - Skip msvp9dec_store.dll in GetInfoForSelf(). r=gerald
When mfplat.dll loads msvp9dec_store.dll, it posts a task
to unload the module to the work queue even if msvp9dec_store.dll
is already loaded and mfplat.dll skips LoadLibrary.  Therefore,
we cannot safely lock msvp9dec_store.dll by loading it as data.

The proposed fix is to skip processing the module.

Differential Revision: https://phabricator.services.mozilla.com/D121777
2021-08-05 02:36:27 +00:00
Harry Twyford
2d4da45cce Bug 1698814 - Part 1 - Consolidate toolbar-field background color variables. r=desktop-theme-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D117028
2021-08-04 18:01:09 +00:00
Kris Wright
abdb25382e Bug 1723730 - Add temporary TSan suppression. r=mccr8,decoder
Differential Revision: https://phabricator.services.mozilla.com/D121664
2021-08-03 20:39:06 +00:00
Kris Wright
58839f2d2e Bug 1723176 - Add temporary TSan suppression. r=decoder,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D121549
2021-08-03 20:39:05 +00:00
Kris Wright
53b36691dc Bug 1723170 - Add temporary TSan suppression. r=decoder,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D121548
2021-08-03 20:39:05 +00:00
Kris Wright
dd75f68ef7 Bug 1723142 - Add temporary TSan suppression. r=decoder,mccr8
This call appears in the top frames of 2 different stacks (Bug 1723351 and Bug 1723142) so from my understanding it will suppress both test fails. I included both bug numbers for reference.

Differential Revision: https://phabricator.services.mozilla.com/D121546
2021-08-03 20:39:05 +00:00
Kris Wright
7b5275067f Bug 1723321 - Add temporary TSan suppression. r=decoder,mccr8
This commit also adds a newline to the entry directly above the new suppression, since it was missing one.

Differential Revision: https://phabricator.services.mozilla.com/D121545
2021-08-03 20:39:04 +00:00
Doug Thayer
5667e3b2a9 Bug 1722515 - Only build ActivationContext.cpp in mozglue if a11y r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D121547
2021-08-03 14:40:38 +00:00
Mike Hommey
c4d65ab921 Bug 1723016 - Update builders to rustc 1.54. r=firefox-build-system-reviewers,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D121247
2021-08-03 02:03:32 +00:00
Nazım Can Altınova
4302cd6058 Bug 1652560 - Autogenerate profiling_categories.rs with profiling_categories.yaml r=gerald,emilio
Generate the user friendly Rust enums and their impls for profiling categories.

Differential Revision: https://phabricator.services.mozilla.com/D120792
2021-07-30 21:49:21 +00:00
Nazım Can Altınova
0b9f9eb6a9 Bug 1652560 - Autogenerate ProfilingCategoryList.h with profiling_categories.yaml r=emilio,gerald
Previously ProfilingCategoryList.h was a central place for profiling
categories. But with this patch, profiling_categories.yaml becomes the
canonical place for it and the macro header file is being generated
automatically. This is needed to make the profiling categories in sync with
Rust and C++.

Differential Revision: https://phabricator.services.mozilla.com/D120791
2021-07-30 21:49:21 +00:00
Brindusan Cristian
7e15fd89b7 Backed out 3 changesets (bug 1723016) for causing valgrind bustages. CLOSED TREE
Backed out changeset 1b03bb0c42e4 (bug 1723016)
Backed out changeset 66ea8fed0c30 (bug 1723016)
Backed out changeset d43d97354163 (bug 1723016)
2021-07-30 17:54:40 +03:00
Andrew Osmond
6f3d06c7cb Bug 1722726 - Move Linux tsan tests to WebRender. r=jmaher
autoland

--- target_task_set@32af9322f9bf
+++ target_task_set@ao_ci_linux_tsan
-test-linux1804-64-tsan/opt-crashtest-e10s
-test-linux1804-64-tsan/opt-mochitest-a11y-1proc
-test-linux1804-64-tsan/opt-mochitest-browser-chrome-e10s
-test-linux1804-64-tsan/opt-mochitest-media-e10s
-test-linux1804-64-tsan/opt-mochitest-media-fis-e10s
-test-linux1804-64-tsan/opt-mochitest-media-fis-gli-e10s
-test-linux1804-64-tsan/opt-mochitest-media-gli-e10s
-test-linux1804-64-tsan/opt-mochitest-media-spi-e10s
-test-linux1804-64-tsan/opt-mochitest-plain-e10s
-test-linux1804-64-tsan/opt-mochitest-plain-fis-e10s
-test-linux1804-64-tsan/opt-reftest-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-fis-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-reftest-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-reftest-fis-e10s
-test-linux1804-64-tsan/opt-xpcshell-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-noqr-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-swr-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-a11y-1proc
+test-linux1804-64-tsan-qr/opt-mochitest-browser-chrome-swr-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-fis-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-fis-gli-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-gli-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-spi-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-plain-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-plain-fis-e10s
+test-linux1804-64-tsan-qr/opt-reftest-e10s
+test-linux1804-64-tsan-qr/opt-reftest-noqr-e10s
+test-linux1804-64-tsan-qr/opt-reftest-swr-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-fis-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-reftest-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-reftest-fis-e10s
+test-linux1804-64-tsan-qr/opt-xpcshell-e10s

mozilla-central

--- target_task_set@32af9322f9bf
+++ target_task_set@ao_ci_linux_tsan
-test-linux1804-64-tsan/opt-crashtest-e10s
-test-linux1804-64-tsan/opt-mochitest-a11y-1proc
-test-linux1804-64-tsan/opt-mochitest-browser-chrome-e10s
-test-linux1804-64-tsan/opt-mochitest-media-e10s
-test-linux1804-64-tsan/opt-mochitest-media-fis-e10s
-test-linux1804-64-tsan/opt-mochitest-media-fis-gli-e10s
-test-linux1804-64-tsan/opt-mochitest-media-gli-e10s
-test-linux1804-64-tsan/opt-mochitest-media-spi-e10s
-test-linux1804-64-tsan/opt-mochitest-plain-e10s
-test-linux1804-64-tsan/opt-mochitest-plain-fis-e10s
-test-linux1804-64-tsan/opt-reftest-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-fis-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-reftest-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-reftest-fis-e10s
-test-linux1804-64-tsan/opt-xpcshell-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-noqr-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-swr-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-a11y-1proc
+test-linux1804-64-tsan-qr/opt-mochitest-browser-chrome-swr-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-fis-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-fis-gli-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-gli-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-spi-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-plain-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-plain-fis-e10s
+test-linux1804-64-tsan-qr/opt-reftest-e10s
+test-linux1804-64-tsan-qr/opt-reftest-noqr-e10s
+test-linux1804-64-tsan-qr/opt-reftest-swr-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-fis-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-reftest-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-reftest-fis-e10s
+test-linux1804-64-tsan-qr/opt-xpcshell-e10s

mozilla-release

--- target_task_set@32af9322f9bf
+++ target_task_set@ao_ci_linux_tsan
-test-linux1804-64-tsan/opt-crashtest-e10s
-test-linux1804-64-tsan/opt-reftest-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-noqr-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-swr-e10s
+test-linux1804-64-tsan-qr/opt-reftest-e10s
+test-linux1804-64-tsan-qr/opt-reftest-noqr-e10s
+test-linux1804-64-tsan-qr/opt-reftest-swr-e10s

Differential Revision: https://phabricator.services.mozilla.com/D121099
2021-07-30 12:23:36 +00:00
Mike Hommey
2a73240e1f Bug 1723016 - Update builders to rustc 1.54. r=firefox-build-system-reviewers,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D121247
2021-07-30 11:11:28 +00:00
Mike Hommey
023ce9967d Bug 1582382 - Move rust malloc and oom hook to mozglue. r=firefox-build-system-reviewers,andi
This is similar to what was done in bug 1594998 for the panic hook.

Differential Revision: https://phabricator.services.mozilla.com/D121032
2021-07-28 20:33:08 +00:00
Toshihito Kikuchi
2fafdd4a72 Bug 1722566 - Add null checks in PEHeaders::FindResourceLeaf. r=mhowell
We had crashes in `PEHeaders::FindResourceLeaf` where `idDir` was nullptr.  This can
happen when the resource table is modified by a third-party application and an entry
in the table points to somewhere outside the executable.

Differential Revision: https://phabricator.services.mozilla.com/D121093
2021-07-28 19:11:43 +00:00
Andrew Osmond
1ec8367419 Bug 1722721 - Suppress new TSAN failures for WebRender. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D121090
2021-07-28 14:33:11 +00:00
Mike Hommey
2979d0b082 Bug 1635327 - Disable __tls_get_addr interception in sanitizer builds. r=firefox-build-system-reviewers,emilio,andi
Sanitizers try to intercept __tls_get_addr to find DTLS blocks. In some
cases, they fail miserably with a crash. And in the cases they don't
crash, they don't seem to actually work properly anyways.

This affects both build time when running host programs compiled with
sanitizer flags (this only actually affects rust build
scripts/procedural macros on non-cross builds, not C/C++ host programs),
and execution time, e.g. when running tests.

Differential Revision: https://phabricator.services.mozilla.com/D120574
2021-07-22 22:00:59 +00:00
Gerald Squelart
e7e9ae90ae Bug 1721110 - profiler_current_thread_id() now returns ProfilerThreadId - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D120225
2021-07-21 04:16:59 +00:00
Gerald Squelart
7bc3116790 Bug 1721110 - baseprofiler::profiler_current_thread_id() now returns BaseProfilerThreadId - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D120224
2021-07-21 04:16:59 +00:00
Gerald Squelart
723be2ec1e Bug 1721110 - baseprofiler::profiler_current_process_id() now returns BaseProfilerProcessId - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D120222
2021-07-21 04:16:58 +00:00
Gerald Squelart
72f0855bfa Bug 1721110 - Introduce BaseProfilerProcessId and BaseProfilerThreadId - r=florian
These classes should replace the `int` type that is currently used to store process and thread ids. The next patches will start using them. Advantages:
- Prevent type mismatches, e.g., giving a process id (or other number) to a function expecting a thread id.
- Prevent nonsensical arithmetic operations.
- Make the unspecified id more abstract, so it's more obvious and portable.
- Make conversions to/from numbers (for display or storage) more visible.
- Allow future changes of APIs using them less risky.
- Allow future changes of the ids themselves (e.g., to be able to use bigger underlying types on some platforms, or even the opaque std:🧵:id type.)

Differential Revision: https://phabricator.services.mozilla.com/D120221
2021-07-21 04:16:57 +00:00
Gerald Squelart
a966352bcd Bug 1721110 - {,Base}ProfilerUtils.h with process&thread functions taken from {,Base}ProfilerState.h - r=florian
This new header isolates the process and thread functions that should be available in all builds, and in most other profiler headers.
Non-MOZ_GECKO_PROFILER implementations return ids 0 (unspecified process/thread). `profiler_is_main_thread()` returns false, it's arbitrary but consistent with `0` (it makes little sense to use it there anyway.)

Differential Revision: https://phabricator.services.mozilla.com/D120220
2021-07-21 04:16:57 +00:00
Gerald Squelart
171c2eed5f Bug 1721110 - {,Base}ProfilerState.h improvements: Sprinkle nodiscard's and more - r=florian
The next patch will extract parts of these headers into a separate file, so it's best to do this clean-up now, to best preserve history.
- Add [[nodiscard]] to all functions that return something. (There are no cases where that returned value could really be ignored.)
- Hide scProfilerMainThreadId in a "detail" namespace, to emphasize that it's an implementation detail that the user shouldn't access directly.
- Combine tightly-nested namespaces start/end into single lines, it's more readable.

Differential Revision: https://phabricator.services.mozilla.com/D120219
2021-07-21 04:16:56 +00:00
Gerald Squelart
02a156fe92 Bug 1720846 - Fix non-unified build by adding missing #includes - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D120301
2021-07-20 09:31:17 +00:00
Florian Quèze
292c1a1f60 Bug 1720368 - Remove MOZ_GECKO_PROFILER ifdefs around profiler_init and profiler_shutdown calls, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D119809
2021-07-15 22:04:23 +00:00
Mike Kaply
4ed207b4a1 Bug 1717676 - Unblock McAfee DLP > 11.6.300.2 r=tkikuchi
Differential Revision: https://phabricator.services.mozilla.com/D118515
2021-07-15 19:27:24 +00:00
Tom Ritter
1b9b6b72db Bug 1666222: Cut over a ton of NowUnfuzzed calls -> Now 4/5 r=smaug,extension-reviewers,zombie
With Fuzzyfox removed, Now() does what NowUnfuzzed() did.

Differential Revision: https://phabricator.services.mozilla.com/D119639
2021-07-14 18:18:17 +00:00
Tom Ritter
42c0ec86b4 Bug 1666222: Rip fuzzyfox out of the timestamp classes 2/5 r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D119637
2021-07-14 18:18:16 +00:00
Doug Thayer
2571ca6323 Bug 1719849 - Include ProcessRuntime.cpp and friends if not SM build r=aklotz
Originally these includes were wrapped in an ACCESSIBILITY define because the
bug that manifested only affected screen readers. However, theoretically
speaking other things *could* cause us to initialize COM early and run into
troubles, so this is not *strictly* an a11y issue from that perspective. It
wasn't wrapped around ACCESSIBILITY defines inside PreXULSkeletonUI.cpp for
this reason, but there was still lingering inconsistency inside the moz.build
file. This corrects that.

Differential Revision: https://phabricator.services.mozilla.com/D119541
2021-07-14 18:09:32 +00:00
Kris Wright
3dc0547cf8 Bug 1671574 - Add perma TSan suppression to StartupCache r=decoder
It looks like this suppression was removed downstream, but StartupCache's behavior still exists so it most likely stopped causing failures because of some other suppression interacting with it. I decided the best course of action was to put it back as a perma suppression in gecko in case we run into it again.

Differential Revision: https://phabricator.services.mozilla.com/D119783
2021-07-13 21:13:28 +00:00
Gerald Squelart
9b0d666eda Bug 1719240 - Rework PSMutex into PSAutoLock - r=canaltinova
This prevents unwanted direct access to the mutex, and removes duplicated code.

And make the Base Profiler mutex&lock consistent.

Differential Revision: https://phabricator.services.mozilla.com/D119147
2021-07-13 12:20:49 +00:00
Markus Stange
e440698c82 Bug 1673755 - Strip pointer authentication hashes during stack walking on macOS arm64. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D117168
2021-07-09 17:41:46 +00:00
Doug Thayer
b5f7314e3e Bug 1714212 - Ensure COM initialized prior to showing skeleton UI r=Jamie,aklotz,tkikuchi
This implements Jamie's suggested fixes for a screenreader issue when the
skeleton UI is enabled. Most of the work here is just pulling out pieces from the
files we needed to include in mozglue so that any references to, say, nsString
or other pieces from libxul either no longer exist or are only included when
building libxul. In a few cases this meant creating whole files to house single
functions, which isn't so pretty, but it was the best I could come up with to
get the job done.

Differential Revision: https://phabricator.services.mozilla.com/D117663
2021-07-07 22:37:14 +00:00
Narcis Beleuzu
1ff027d763 Backed out changeset acf2d74efbbc (bug 1714212) for SM bustages on NativeNt.h 2021-07-07 23:13:42 +03:00
Doug Thayer
dc9c284076 Bug 1714212 - Ensure COM initialized prior to showing skeleton UI r=Jamie,aklotz,tkikuchi
This implements Jamie's suggested fixes for a screenreader issue when the
skeleton UI is enabled. Most of the work here is just pulling out pieces from the
files we needed to include in mozglue so that any references to, say, nsString
or other pieces from libxul either no longer exist or are only included when
building libxul. In a few cases this meant creating whole files to house single
functions, which isn't so pretty, but it was the best I could come up with to
get the job done.

Differential Revision: https://phabricator.services.mozilla.com/D117663
2021-07-07 18:17:36 +00:00
Dorel Luca
bc6f2486e2 Backed out changeset 11d1710e481f (bug 1714212) for Browser-chrome failures in toolkit/xre/test/browser_checkdllblockliststate.js. CLOSED TREE 2021-06-26 09:45:29 +03:00
Doug Thayer
c3702a9447 Bug 1714212 - Ensure COM initialized prior to showing skeleton UI r=Jamie,aklotz,tkikuchi
This implements Jamie's suggested fixes for a screenreader issue when the
skeleton UI is enabled. Most of the work here is just pulling out pieces from the
files we needed to include in mozglue so that any references to, say, nsString
or other pieces from libxul either no longer exist or are only included when
building libxul. In a few cases this meant creating whole files to house single
functions, which isn't so pretty, but it was the best I could come up with to
get the job done.

Differential Revision: https://phabricator.services.mozilla.com/D117663
2021-06-26 04:10:50 +00:00
Mike Hommey
4ca3fd9016 Bug 1718131 - Add LSan suppressions for intentional leaks that somehow LSan didn't catch before. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D118828
2021-06-25 13:28:27 +00:00
Florian Quèze
cd399a71a2 Bug 1717991 - Remove ifdefs around code that adds profiler markers with custom marker schemas, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D118680
2021-06-25 13:28:01 +00:00
Florian Quèze
c87b4eb7b7 Bug 1717991 - Profiler headers should declare all the marker related functions even when MOZ_GECKO_PROFILER is not defined, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D118679
2021-06-25 13:28:01 +00:00
Chris Martin
38d538c966 Bug 1701770 - Defer Windows DPI Awareness from load time to run time r=bobowen,aklotz
Currently, we set DPI awareness in the manifest files for firefox.exe.

Unfortunately, that causes DPI-related Win32k calls when user32.dll
is loaded.

This changes things to wait until we are sure we're not running in a
Win32k Lockdown Content Process before we attempt to initialize DPI scaling.

Differential Revision: https://phabricator.services.mozilla.com/D116433
2021-06-21 13:50:31 +00:00
Gerald Squelart
c83e6a0508 Bug 1715922 - Windows timer resolution is enhanced by default, except if notimerresolutionchange feature is set - r=canaltinova
This reverses bug 1703410: By default the profiler now changes the timer resolution (normally 64Hz) when the requested sampling interval is lower than 10ms, to allow fast-enough sampling for most uses.

But since this can influence other timers in Firefox, it makes debugging some types of issues more difficult. To help with this, there is now a "No Timer Resolution change" on Windows, which prevents the profiler from changing the timer resolution, at a risk of slowing down sampling in some processes.

Differential Revision: https://phabricator.services.mozilla.com/D117626
2021-06-21 11:48:23 +00:00
Narcis Beleuzu
192a45a34e Backed out 2 changesets (bug 1701770) for causing tp5n crashes.
Backed out changeset 2351f158ef88 (bug 1701770)
Backed out changeset 4af044ed9208 (bug 1701770)
2021-06-19 07:06:41 +03:00
Chris Martin
59f6230bef Bug 1701770 - Defer Windows DPI Awareness from load time to run time r=bobowen,aklotz
Currently, we set DPI awareness in the manifest files for firefox.exe.

Unfortunately, that causes DPI-related Win32k calls when user32.dll
is loaded.

This changes things to wait until we are sure we're not running in a
Win32k Lockdown Content Process before we attempt to initialize DPI scaling.

Differential Revision: https://phabricator.services.mozilla.com/D116433
2021-06-17 15:53:23 +00:00
Kris Wright
d669e4ca82 Bug 1683404 - Remove tsan suppressions for nsTimerImpl. r=Gankra
Try push shows that the issue is fixed with the above patch in the stack: https://treeherder.mozilla.org/jobs?repo=try&revision=a9e9135464b2750a8b6fd2a19408e3537b39dbe2

Differential Revision: https://phabricator.services.mozilla.com/D115776
2021-06-17 15:36:00 +00:00
Florian Quèze
dfeb53e219 Bug 1715257 - Remove Task Tracer code from the profiler, r=gerald,necko-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D117996
2021-06-17 09:33:00 +00:00
Iulian Moraru
b02492de66 Backed out changeset 617a466d0cce (bug 1715257) for causing build bustages. CLOSED TREE 2021-06-17 10:58:16 +03:00
Florian Quèze
7b4906a6bd Bug 1715257 - Remove Task Tracer code from the profiler, r=gerald,necko-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D117996
2021-06-17 06:12:10 +00:00
Noemi Erli
6fcc995a0a Backed out 2 changesets (bug 1701770) for causing failures in browser_checkdllblockliststate.js CLOSED TREE
Backed out changeset a6f46b0a30e9 (bug 1701770)
Backed out changeset 263591537722 (bug 1701770)
2021-06-15 04:09:49 +03:00
Chris Martin
d909ca765f Bug 1701770 - Defer Windows DPI Awareness from load time to run time r=bobowen,aklotz
Currently, we set DPI awareness in the manifest files for firefox.exe.

Unfortunately, that causes DPI-related Win32k calls when user32.dll
is loaded.

This changes things to wait until we are sure we're not running in a
Win32k Lockdown Content Process before we attempt to initialize DPI scaling.

Differential Revision: https://phabricator.services.mozilla.com/D116433
2021-06-14 20:55:33 +00:00
Toshihito Kikuchi
a0c3a4c847 Bug 1702717 - Skip blocklisting if the mappad region is not executable. r=mhowell
When a module is loaded with `LOAD_LIBRARY_AS_IMAGE_RESOURCE`, the mapped region
is `MEM_IMAGE`, but it's not executable.  We don't have to check the blocklist
in such a case.

Differential Revision: https://phabricator.services.mozilla.com/D117573
2021-06-11 22:45:46 +00:00
surajeet310
76bf30f3f0 Bug 1714688 - Removed 'if PY2' logic from mozglue r=mhentges
mozglue is no longer used with Python 2

Differential Revision: https://phabricator.services.mozilla.com/D117510
2021-06-11 20:37:44 +00:00
Alexandru Michis
c152381556 Backed out changeset 49f8a4acd649 (bug 1712674) for stack walking crashes on older Windows versions (bug 1715633).
CLOSED TREE
2021-06-10 11:39:30 +03:00
Gerald Squelart
ec93a05700 Bug 1712674 -- If RtlLookupFunctionEntry fails, attempt to unwind from BP - r=glandium
BP may contain the stack address where the caller's BP was pushed after the function call, in which case it's possible to carefully unwind from it.

This can get past JIT code, so there is no need to give up in this case.

mozglue was already linked with ntdll, but now that we use it directly (for `NtQueryInformationThread`), ntdll needed to be added to some other users of MozStackWalkThread.

Differential Revision: https://phabricator.services.mozilla.com/D115962
2021-06-09 00:28:03 +00:00
Gijs Kruitbosch
feb380e741 Bug 1711519 - remove tabbrowser non-proton code and gProton global browser window property, r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D116632
2021-06-03 11:41:55 +00:00
Dmitry Bezhetskov
3218df0314 Bug 1710358 - Fix compilation warnings for WASI. r=jandem.
kNsPerUs is unused and fputwc return's type is wint_t.

Differential Revision: https://phabricator.services.mozilla.com/D116578
2021-06-03 05:08:33 +00:00
Toshihito Kikuchi
f77b225313 Bug 1695817 - Part 1: Make nt::GetLeafName accept nsAString r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D109302
2021-05-28 22:35:57 +00:00
Alexandru Michis
8fbcd44dc4 Backed out 9 changesets (bug 1695817) for causing bc failures in content/aboutThirdParty.js
CLOSED TREE

Backed out changeset 6b7f451e911e (bug 1695817)
Backed out changeset ad3ea67b3d70 (bug 1695817)
Backed out changeset b4f971059f3f (bug 1695817)
Backed out changeset 9c9a928d4a70 (bug 1695817)
Backed out changeset 4a9bcb38fddf (bug 1695817)
Backed out changeset 48c0eed38628 (bug 1695817)
Backed out changeset 7583675dccb1 (bug 1695817)
Backed out changeset e3f2bed63c33 (bug 1695817)
Backed out changeset 1c45ba4fba61 (bug 1695817)
2021-05-28 21:53:41 +03:00
Toshihito Kikuchi
9672ed9057 Bug 1695817 - Part 1: Make nt::GetLeafName accept nsAString r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D109302
2021-05-28 15:32:29 +00:00
Butkovits Atila
3735a33d14 Backed out 9 changesets (bug 1695817) for causing build bustages. CLOSED TREE
Backed out changeset 49be1caf6501 (bug 1695817)
Backed out changeset 30f1382d6058 (bug 1695817)
Backed out changeset ab9fa7f3b633 (bug 1695817)
Backed out changeset b03b122438cc (bug 1695817)
Backed out changeset 812a6bbfbe0e (bug 1695817)
Backed out changeset 3551230a7522 (bug 1695817)
Backed out changeset c7354b48fbee (bug 1695817)
Backed out changeset 4860450c2e23 (bug 1695817)
Backed out changeset 29dee289f866 (bug 1695817)
2021-05-28 07:52:30 +03:00
Toshihito Kikuchi
ccf62d7b68 Bug 1695817 - Part 1: Make nt::GetLeafName accept nsAString r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D109302
2021-05-28 04:19:05 +00:00
Butkovits Atila
711401ea39 Backed out 9 changesets (bug 1695817) for causing failures at browser_all_files_referenced.js. CLOSED TREE
Backed out changeset df4086427aaf (bug 1695817)
Backed out changeset 119a24f8be08 (bug 1695817)
Backed out changeset fd277ae2a7b8 (bug 1695817)
Backed out changeset a2c86a645fa8 (bug 1695817)
Backed out changeset c73705233fc4 (bug 1695817)
Backed out changeset 0a80eea3c0fa (bug 1695817)
Backed out changeset 9af42c7a3ca7 (bug 1695817)
Backed out changeset a2d11a0849d5 (bug 1695817)
Backed out changeset ba3ddcc28cbf (bug 1695817)
2021-05-28 03:05:09 +03:00
Toshihito Kikuchi
82431c81c9 Bug 1695817 - Part 1: Make nt::GetLeafName accept nsAString r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D109302
2021-05-27 21:14:12 +00:00
Joel Maher
3ad9f06697 Bug 1710923 - migrate windows 7x32 debug tests to windows 10x32. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D115017
2021-05-24 20:06:43 +00:00
Agi Sferro
5e28045dd6 Bug 1701269 - Remove unused MinidumpAnalyzer. r=owlish
Differential Revision: https://phabricator.services.mozilla.com/D109919
2021-05-20 22:03:03 +00:00
Gerald Squelart
098790a8eb Bug 1703410 - Only change Windows timer resolution if PROFILER_ADJUST_TIMER_RESOLUTION is set - r=florian
On Windows, the profiler changes the timer resolution when the sampling interval is less than 10ms.
However this change affects all of Firefox, which can change other behaviors, sometimes causing confusion when refresh-rate issues magically disappear when the profiler is running.

So now by default the profiler will not change the timer resolution. This should rarely affect the profiler's effective sampling rate, unless all threads in a process are in a waiting state, in which case there is nothing new to sample anyway! The front-end is investigating ways to make sampling gaps more obvious, see https://github.com/firefox-devtools/profiler/issues/2962

If some power users really need the added sampling precision in some profiling sessions, the timer resolution change may be requested before running Firefox, by setting the environment variable "PROFILER_ADJUST_TIMER_RESOLUTION" to any value.

Differential Revision: https://phabricator.services.mozilla.com/D115451
2021-05-19 22:29:17 +00:00
Mike Hommey
e5c65130a4 Bug 1711838 - Avoid GCC warning about %s argument possibly being null. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D115450
2021-05-19 22:19:03 +00:00
Toshihito Kikuchi
d8fe2ac176 Bug 1702086 - Part4: Use PEHeaders::GetBounds instead of GetModuleInformation. r=gerald
`SharedLibraryInfo::GetInfoForSelf()` can use `PEHeaders::GetBounds` instead of
`GetModuleInformation` to get the start/end address of a module's mapped region
in the local process.  It's roughly 100x faster because `GetModuleInformation`
invokes two system calls `NtQueryInformationProcess` and `NtReadVirtualMemory`
while `nt::PEHeaders` does not.

Depends on D115254

Differential Revision: https://phabricator.services.mozilla.com/D115255
2021-05-19 18:01:49 +00:00
Toshihito Kikuchi
2755a48956 Bug 1702086 - Part3: Use PEHeaders::GetVersionInfo. r=gerald
This patch replaces two versions of `GetVersion` in Gecko profiler and
baseprofiler with `PEHeaders::GetVersionInfo`.

Depends on D115253

Differential Revision: https://phabricator.services.mozilla.com/D115254
2021-05-19 18:01:48 +00:00
Toshihito Kikuchi
4e1b4037be Bug 1702086 - Part2: Get PDB information from the new handle. r=gerald
This patch is the actual fix for Bug 1702086.  The problem of Bug 1702086 is that
`LoadLibraryExW` loaded the module onto an address different from the original
mapped addresss because it was unloaded after we started enumeration.  Calling
`GetPdbInfo` with the original address `module.lpBaseOfDll` caused a crash.

The proposed fix consists of three parts.

The first part is to get PDB information from `handleLock`, which is always valid
even if the original address was unloaded.  With this, we don't need a check
of `VirtualQuery`.

The second part is to add `LOAD_LIBRARY_AS_IMAGE_RESOURCE` along with
`LOAD_LIBRARY_AS_DATAFILE` to the call to `LoadLibraryEx`.  This is needed
to read information from the sections outside the PE headers because
RVA (= relative virtual address) is an address after relocation.
Without `LOAD_LIBRARY_AS_IMAGE_RESOURCE`, a module is mapped without relocation,
so `GetPdbInfo()` accesses wrong memory resulting in a crash.

The third part is to introduce `PEHeaders::GetPdbInfo`, replacing two versions
of `GetPdbInfo` in Gecko profiler and baseprofiler.

Depends on D115252

Differential Revision: https://phabricator.services.mozilla.com/D115253
2021-05-19 18:01:48 +00:00
Toshihito Kikuchi
d64610fed5 Bug 1702086 - Part1: Introduce EnumerateProcessModules. r=gerald
This patch introduces `EnumerateProcessModules` to enumerate all loaded modules
in the local process so that Gecko profiler and baseprofiler can use it.

Differential Revision: https://phabricator.services.mozilla.com/D115252
2021-05-19 18:01:47 +00:00
Gerald Squelart
8b96edfb80 Bug 1710757 - Fix baseprofiler native-frame output - r=florian
SprintfLiteral doesn't support "%#llx" anymore.
So this patch switches to an explicit "0x%llx" to output addresses as the symbolicator expects.

Differential Revision: https://phabricator.services.mozilla.com/D114914
2021-05-12 10:22:55 +00:00
Andi-Bogdan Postelnicu
eab549fd19 Bug 1519636 - Initial reformat of C/C++ code with clang-format version 12.0.0. r=sylvestre
clang-format version 12.0.0 (taskcluster-KEgO7qdgQ8uaewA6NkRnRA)

Differential Revision: https://phabricator.services.mozilla.com/D114211
2021-05-10 07:15:07 +00:00
Toshihito Kikuchi
3abb99c8e2 Bug 1706041 - Reset gDllServices when DllServices is destroyed. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D113524
2021-05-07 19:11:48 +00:00
Florian Quèze
7a8983cc88 Bug 1705318 - substract the memory used by the profiler buffer when sampling the memory counter, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D114397
2021-05-07 09:32:11 +00:00
Gerald Squelart
e2d8ae5a08 Bug 1708350 - profiler_suspend_and_sample_thread can now sample the current thread - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D114115
2021-05-06 23:23:40 +00:00
Paul Adenot
c59e733060 Bug 1685503 - Use AwakeTimeStamp to count time for media telemetry. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D112797
2021-05-05 09:24:51 +00:00
Florian Quèze
3e63d9143b Bug 1635442 - Only initialize LUL when the StackWalk feature is requested on Linux, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D113693
2021-04-29 15:27:26 +00:00
Cosmin Sabou
799b5200ae Backed out changeset bc141a334421 (bug 1685503) for windows browser chrome failures on browser_tab_visibility_and_play_time.js CLOSED TREE 2021-04-29 18:35:43 +03:00
Paul Adenot
2f3c1253f9 Bug 1685503 - Use AwakeTimeStamp to count time for media telemetry. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D112797
2021-04-29 11:45:42 +00:00
Alexandru Michis
335b6f5f96 Backed out changeset 6bd7baadb78c (bug 1702086) for causing Bug 1607574.
CLOSED TREE
2021-04-28 23:23:01 +03:00
Mike Hommey
8bf0782758 Bug 1707834 - Avoid libmozgtk not being linked to libxul. r=firefox-build-system-reviewers,mhentges
When the linker defaults to --as-needed, libmozgtk ends up not linked
to libxul because libxul doesn't use anything from it.
We solve the problem by adding a symbol to mozgtk and have libxul use
it.

In bug 1377445, we moved XShmQueryExtension to mozglue. While libxul
currently doesn't use the symbol (it's a workaround for system
libraries), we can move the function back to mozgtk and add a dummy
call.

Differential Revision: https://phabricator.services.mozilla.com/D113487
2021-04-27 21:44:22 +00:00
Andi-Bogdan Postelnicu
2508edc4c5 Bug 1519636 - Reformat recent changes to the Google coding style. r=necko-reviewers,geckoview-reviewers,agi
Updated with clang-format version 11.0.1 (taskcluster-GI8pmG3eQ_OSXfjFfr2yFw)

\# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D113294
2021-04-26 15:52:25 +00:00
Gerald Squelart
075a890c58 Bug 1706554 - Remove aFirstFramePC from no-op FramePointerStackWalk definition - r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D112900
2021-04-22 01:17:10 +00:00
Paul Adenot
61a126ec51 Bug 1685502 - Add a timestamp/duration class pair that only ticks when the computer is awake, on all platforms. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D101036
2021-04-20 17:24:24 +00:00
Mike Hommey
e1c4d88b46 Bug 1705727 - Disable tail call tests in TestStackWalk for code-coverage builds. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D112689
2021-04-20 05:48:08 +00:00
Gerald Squelart
7258cd0454 Bug 1705998 - Remove Windows IA64 support from mozglue/misc/StackWalk.cpp - r=glandium
This was the only explicit mention of IA64 left in mozglue.

Differential Revision: https://phabricator.services.mozilla.com/D112546
2021-04-20 05:14:04 +00:00
Gerald Squelart
fe26e18c45 Bug 1705308 - Remove WalkStackData and clean up MozStackWalkThread - r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D112171
2021-04-20 04:37:05 +00:00
Gerald Squelart
e27676be0d Bug 1705308 - Move WalkStackMain64 code into MozStackWalkThread - r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D112170
2021-04-20 04:37:04 +00:00
Gerald Squelart
e7657403a3 Bug 1705308 - Invoke callback from WalkStackMain64 instead of going through expandable on-stack buffers - r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D112169
2021-04-20 04:37:04 +00:00
Gerald Squelart
4bf34ae6d1 Bug 1705307 - Use CONTEXTGenericAccessors in WalkStackMain64 to access main CONTEXT registers - r=glandium
Instead of lots of #ifdef's inside WalkStackMain64 to access CONTEXT registers with their platform-specific names, these registers are now accessible through generic accessors in the wrapper class.
This also helps with avoiding CONTEXT pointers (and the worry they could be null).

Differential Revision: https://phabricator.services.mozilla.com/D112168
2021-04-20 04:37:03 +00:00
Mike Hommey
79e8df83dd Bug 1377445 - Remove build dependencies on gtk+2. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D111997
2021-04-20 01:57:03 +00:00
Toshihito Kikuchi
ebb9e9f364 Bug 1705278 - Remove DependentModules from UntrustedModulesProcessor.cpp. r=aklotz
Bug 1620118 added a new field `isDependent` in the third-party-module ping
which is calculated in `UntrustedModulesProcessor`.  However, bug 1684532
revealed it was not accurate because some third-party applications revert
the import table to the original state immediately after their module was
loaded.

Now that we have a logic to determine `isDependent` in `NtMapViewOfSection`
to automatically block a module injected through the import table, we can
pass that value to the ping and remove the original logic in `UntrustedModulesProcessor`.

Differential Revision: https://phabricator.services.mozilla.com/D112227
2021-04-16 19:35:55 +00:00
Mike Hommey
6a41d8d7ad Bug 1515229 - Make MozStackWalk/MozWalkTheStack frame skipping more reliable. r=gerald,nika,bobowen,jld
Differential Revision: https://phabricator.services.mozilla.com/D110899
2021-04-16 04:06:02 +00:00
Doug Thayer
23378a0226 Bug 1704853 - Disable skeleton UI on non-default density r=emalysz
This is a little more than we need to disable it, but I figure we'll want to
support different UI densities in the skeleton UI long term.

Differential Revision: https://phabricator.services.mozilla.com/D111906
2021-04-15 22:58:19 +00:00
Csoregi Natalia
1d1158f8b5 Backed out changeset 95865502de4b (bug 1704853) for causing bustage on AppWindow.cpp. CLOSED TREE 2021-04-16 01:47:57 +03:00
Doug Thayer
c632b8a57d Bug 1704853 - Disable skeleton UI on non-default density r=emalysz
This is a little more than we need to disable it, but I figure we'll want to
support different UI densities in the skeleton UI long term.

Differential Revision: https://phabricator.services.mozilla.com/D111906
2021-04-15 22:10:43 +00:00
Doug Thayer
638904c1f1 Bug 1693180 - Ensure we show the skeleton UI when restarting FF r=emalysz
When restarting, we set the XRE_PROFILE_PATH env var. This normally would
prevent us from showing the skeleton UI. This patch just adds another env
var to indicate that we are restarting so the skeleton UI can know it's
safe to display.

Differential Revision: https://phabricator.services.mozilla.com/D111884
2021-04-15 21:31:15 +00:00
Butkovits Atila
8255e3083f Backed out changeset 5c6b15fcea71 (bug 1515229) for causing GTest failures. CLOSED TREE 2021-04-15 13:37:29 +03:00
Doug Thayer
fc1ec9303f Bug 1695674 - Ensure we use RGB macro for FillRect r=emalysz
We specify our colors like 0xrrggbb, but CreateSolidBrush expects a
color created with the RGB macro, which actually arranges it as
0xbbggrr. This change has us use the RGB macro to give a color when
creating the brush.

Differential Revision: https://phabricator.services.mozilla.com/D107945
2021-04-14 22:56:26 +00:00
Doug Thayer
bc713ba00e Bug 1695674 - Update Skeleton UI layout+colors to match Proton r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D107944
2021-04-14 22:56:26 +00:00
Mike Hommey
2eacd46d46 Bug 1515229 - Make MozStackWalk/MozWalkTheStack frame skipping more reliable. r=gerald,nika,bobowen,jld
Differential Revision: https://phabricator.services.mozilla.com/D110899
2021-04-14 22:31:36 +00:00
Toshihito Kikuchi
a8483bcd1c Bug 1705125 - Block PavSHook64.dll on Win7 and older. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D112060
2021-04-14 17:38:07 +00:00
smolnar
22c6eb14ba Backed out changeset f7b0cdc3aeb0 (bug 1515229) for causing xpc failures in test_feature_stackwalking. CLOSED TREE 2021-04-14 12:25:37 +03:00
Mike Hommey
133396cb94 Bug 1515229 - Make MozStackWalk/MozWalkTheStack frame skipping more reliable. r=gerald,nika,bobowen,jld
Differential Revision: https://phabricator.services.mozilla.com/D110899
2021-04-14 04:47:09 +00:00
Toshihito Kikuchi
9bb61c843d Bug 1704276 - Block InfoWatch Device Monitor's module. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D111783
2021-04-13 14:26:20 +00:00
Chris Fallin
605271bd29 Bug 1701620 part 4 - Fix memory support for WASI. r=jandem,sfink
WASI lacks of support many memory stuff like mmap, memory protections and etc, but
it has malloc so we can use it instead. Also, here we are stubbing out all
uses of the missing WASI memory functionality.

Differential Revision: https://phabricator.services.mozilla.com/D110075
2021-04-13 08:25:10 +00:00
Csoregi Natalia
91bd333c25 Backed out changeset f48cb748519b (bug 1701620) for bustage on Memory.cpp. CLOSED TREE 2021-04-13 10:09:41 +03:00
Chris Fallin
4e5ae46c03 Bug 1701620 part 4 - Fix memory support for WASI. r=jandem,sfink
WASI lacks of support many memory stuff like mmap, memory protections and etc, but
it has malloc so we can use it instead. Also, here we are stubbing out all
uses of the missing WASI memory functionality.

Differential Revision: https://phabricator.services.mozilla.com/D110075
2021-04-13 06:50:13 +00:00
Chris Fallin
f062cdc9ba Bug 1701613 part 3 - Add stub thread implementation for WASI. r=jandem,wingo
WASI lacks thread support so the stub implementation for threads has been added.

Differential Revision: https://phabricator.services.mozilla.com/D110073
2021-04-08 08:02:16 +00:00
Tyson Smith
ab8b997e30 Bug 1688716 - Suppress TSan failure calling into graphics drivers. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D111206
2021-04-08 06:33:03 +00:00
Paul Adenot
030f28a6fb Bug 1686405 - Fix tier-3 build. r=glandium DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D109492
2021-04-02 08:56:24 +00:00
Brindusan Cristian
6ba223af02 Backed out changeset 943e1e811d75 (bug 1686405) for causing build bustages in Uptime.cpp. CLOSED TREE 2021-04-01 17:01:25 +03:00
Paul Adenot
28401075fc Bug 1686405 - Fix tier-3 build. r=glandium DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D109492
2021-04-01 13:23:23 +00:00
Toshihito Kikuchi
0d9e48e427 Bug 1702086 - Make sure LoadLibraryEx really locks the mapped address. r=mstange
Before `SharedLibraryInfo::GetInfoForSelf` calls `GetPdbInfo` to parse a module's
PE header, it calls `LoadLibraryEx` to prevent the module from being unloaded
during `GetPdbInfo`.  If the module was already unloaded before `LoadLibraryEx`,
however, `LoadLibraryEx` maps the module onto an address different from the original
mapped address, so that `module.lpBaseOfDll` becomes invalid.

This patch is to call `LoadLibraryEx` before `GetModuleInformation` to make sure
`LoadLibraryEx` increments the module's refcount and does not map the module onto
a new address.  With this, `module.lpBaseOfDll` is always valid, thus we don't have
to call `VirtualQuery`.

Differential Revision: https://phabricator.services.mozilla.com/D110421
2021-04-01 00:35:01 +00:00
Mike Hommey
85e065c14d Bug 1700885 - Add a runtime way to disable MozWalkTheStack. r=Gankra
WalkTheStack* is the function that is being called to print stacks to
the user on e.g. MOZ_CRASH on debug builds. Until bug 1699375, some
cases weren't covered, which now cause unwanted side-effects with e.g.
fuzzing. At least as a stop-gap, allow to runtime-disable the behavior
via an environment variable.

Other uses of the stack-walker, like the profiler's, are not affected
when setting the environment variable.

Differential Revision: https://phabricator.services.mozilla.com/D110199
2021-03-31 00:47:58 +00:00
Toshihito Kikuchi
573d612334 Bug 1700281 - Block Webroot SecureAnywhere's module. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D109695
2021-03-29 14:26:43 +00:00
Nazım Can Altınova
7039884fe6 Bug 1698129 - Rename the profiler browsingContextID outputs to tabID and bump the profile version r=gerald
Lastly, we are changing the parts that requires a version bump and bumping the
profiler version in the end. This will require a PR in the front-end for a
version upgrader and changes related to the renaming.

Differential Revision: https://phabricator.services.mozilla.com/D109282
2021-03-25 12:52:11 +00:00
Nazım Can Altınova
f8b414e1c2 Bug 1698129 - Rename browsingContextID to tabID inside the profiler codebase r=julienw,gerald,devtools-backward-compat-reviewers
This patch is only  about renaming the internals of the profiler codebase and
it doesn't touch any parts that requires a backwards compatibility or version
bump.

Differential Revision: https://phabricator.services.mozilla.com/D109280
2021-03-25 12:52:10 +00:00
Simon Giesecke
760cc7e936 Bug 1679522 - Fix include directives and forward declarations. r=andi,necko-reviewers,jgilbert
- Add missing include directives and forward declarations.
- Remove some extra include directives.
- Add missing namespace qualifications.
- Move include directives out of namespace in toolkit/xre/GlobalSemaphore.h

Differential Revision: https://phabricator.services.mozilla.com/D98894
2021-03-25 10:19:44 +00:00
Agi Sferro
34624a6abf Bug 1567341 - Allow geckoview.test to run xpcshell. r=esawin
This commit adds a new command line option |-xpcshell| that, when passed, will
run an xpcshell instead of launching a full Gecko instance.

This command line option is restricted to org.mozilla.geckoview.test for now,
as it's really hard to use and not really a usecase outside mozilla. We can
revisit this if there's interest.

Differential Revision: https://phabricator.services.mozilla.com/D106211
2021-03-24 21:49:38 +00:00
Alexandru Michis
497409d76e Backed out 24 changesets (bug 1567341) for causing xpcshell failures in test_telemetry.js
CLOSED TREE

Backed out changeset deb795c7d0ed (bug 1567341)
Backed out changeset 62d24a3e5e33 (bug 1567341)
Backed out changeset 1185cabd94e0 (bug 1567341)
Backed out changeset 73a4ae419261 (bug 1567341)
Backed out changeset b6eb111329f3 (bug 1567341)
Backed out changeset 0dc0bfedc042 (bug 1567341)
Backed out changeset 9dca635e41d7 (bug 1567341)
Backed out changeset c34928580933 (bug 1567341)
Backed out changeset f9ba384bb407 (bug 1567341)
Backed out changeset ec25c2df380e (bug 1567341)
Backed out changeset 9e8ea542b51e (bug 1567341)
Backed out changeset 3dc62863a028 (bug 1567341)
Backed out changeset 6c104f865540 (bug 1567341)
Backed out changeset c422ca4207ea (bug 1567341)
Backed out changeset e3df748ed62f (bug 1567341)
Backed out changeset 9d1f27796a97 (bug 1567341)
Backed out changeset 1d93ba23f809 (bug 1567341)
Backed out changeset 55652f6af6ed (bug 1567341)
Backed out changeset 9fb892955a88 (bug 1567341)
Backed out changeset 1cdd95c43416 (bug 1567341)
Backed out changeset 5a839d5e3e33 (bug 1567341)
Backed out changeset ea84b5749a27 (bug 1567341)
Backed out changeset dcb1ae146475 (bug 1567341)
Backed out changeset d72accc274ac (bug 1567341)
2021-03-24 23:37:43 +02:00
Agi Sferro
5256b36255 Bug 1567341 - Allow geckoview.test to run xpcshell. r=esawin
This commit adds a new command line option |-xpcshell| that, when passed, will
run an xpcshell instead of launching a full Gecko instance.

This command line option is restricted to org.mozilla.geckoview.test for now,
as it's really hard to use and not really a usecase outside mozilla. We can
revisit this if there's interest.

Differential Revision: https://phabricator.services.mozilla.com/D106211
2021-03-24 20:20:01 +00:00
Jeff Muizelaar
9290181962 Bug 1700113 - Use the builtin gettid() on Android. r=glandium
Syscalls can be pretty slow on Android and this lets us use the
gettid() cache that bionic has:
d7c52625f2/libc/bionic/gettid.cpp

Differential Revision: https://phabricator.services.mozilla.com/D109353
2021-03-23 00:41:12 +00:00
Mike Hommey
4d8e18962b Bug 1699375 - Move WalkTheStack to mozglue. r=nika
A long standing issue is that MOZ_ASSERT and related don't print stack
traces in debug builds when they're directly or indirectly emitted from
non-libxul code. Moving WalkTheStack to mozglue alleviates the problem.

It's also not printing stack traces when emitted from C code (and for
some C third party libraries, we do redirect assert to MOZ_ASSERT),
which we solve by making the corresponding API available without C++
(which WalkTheStack being a static method of the nsTraceRefCnt class
didn't allow, or the use of a closure on Android).

This requires some adjustements to headers that indirectly assume that
Assertions.h includes ErrorList.h through nsError.h through nscore.h
through nsTraceRefcnt.h.

We also remove TestStackCrawl.cpp because it hasn't been built since
bug 158528, 19 years ago.

Differential Revision: https://phabricator.services.mozilla.com/D108913
2021-03-22 21:25:30 +00:00
Mike Hommey
9f69fef1e9 Bug 1699375 - Make MozFormatCodeAddress* return the printed size, and use that instead of strlen. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D108912
2021-03-22 21:25:30 +00:00
Mike Hommey
6cb10c45a4 Bug 1699375 - Add {Vs,S}printLiteral-like functions for buffers of arbitrary size. r=nika
and use them in MozFormatCodeAddress.

Differential Revision: https://phabricator.services.mozilla.com/D108911
2021-03-22 21:25:30 +00:00
Mike Hommey
86270cdf01 Bug 1699375 - Move MozStackWalkThread to a separate header. r=gerald
It requires including <windows.h>, preventing the inclusion of StackWalk.h
from some places (and upcoming changes will make StackWalk.h included in
more places).

Differential Revision: https://phabricator.services.mozilla.com/D108910
2021-03-22 21:25:29 +00:00
Florian Quèze
8ad1e5d0aa Bug 1699742 - Remove MOZ_GECKO_PROFILER ifdefs that are no longer needed, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D109078
2021-03-22 16:29:52 +00:00
Mike Hommey
ec7f538e0c Bug 1698719 - Remove aSkipFrames argument to both FramePointerStackWalk and MozStackWalkThread. r=gsvelto,gerald
In the case of FramePointerStackwalk, the caller gives a pointer to the
top-most frame to walk from. There isn't really a reason to give a
number of frames to skip, as the right frame pointer could be given in
the first place if that was really necessary. And in practice, it's
hasn't been used so far.

In the case of MozStackWalkThread, the caller presumably doesn't know
what the thread the stack is being walked for is doing, and it would be
a guesswork to pass a valid number of frames to skip. In practice, it's
also not used.

The aSkipFrames is already a footgun on MozStackWalk (and we're going to
change that in bug 1515229), we don't need to keep a footgun on these
other stack walking methods.

Differential Revision: https://phabricator.services.mozilla.com/D108563
2021-03-17 00:21:39 +00:00
Jeff Muizelaar
702bd6eeec 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 you'd
expect we'd be able to go back to the straightforward implemention that works even
if stderr has been redirected. Unfortunately, Windows takes not buffering
stderr very seriously and fprintf will write out the results character
by character. This can cause log output lines to be intermixed which
breaks log parsing in CI. We keep using fdopen to create a new FILE*
that's buffered but instead of hard coding fd 2, we get the actual fd
that corresponds to stderr using fileno.

The mozglue implementation was cargo culted from xpcom, so we update it
as well.

Differential Revision: https://phabricator.services.mozilla.com/D98550
2021-03-16 20:45:21 +00:00
Gerald Squelart
f193604f7c Bug 1687631 - Enable CPU Utilization by default in the profilers - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D107598
2021-03-15 11:54:43 +00:00
Toshihito Kikuchi
2279f22a3f Bug 1697282 - Make the repo buildable without MOZ_LAUNCHER_PROCESS. r=aklotz
This patch makes sure the repo can be built without `MOZ_LAUNCHER_PROCESS`.

- Compile WinTokenUtils.cpp under winlaucher regardless of `MOZ_LAUNCHER_PROCESS`
  because we still need `IsAdminWithoutUac`.
- Skip TestDllBlocklist.NoOpEntryPoint GTest because the `RedirectToNoOpEntryPoint`
  feature is only available with the new blocklist with the launcher process.

Differential Revision: https://phabricator.services.mozilla.com/D108142
2021-03-12 23:38:01 +00:00
Toshihito Kikuchi
5e3192a80e Bug 1694489 - Block more versions of K7 Total Security. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D107959
2021-03-11 22:54:03 +00:00
Mike Hommey
9c0fcac97c Bug 1690167 - Change VsprintfLiteral/SprintfLiteral to rely on PrintfTarget. r=nika,Gankra,firefox-build-system-reviewers,mhentges
Instead of snprintf.

Because some standalone code uses those functions directly or indirectly,
and PrintfTarget lives in mozglue, they now need to depend on mozglue
instead of mfbt. Except logalloc/replay, which cherry-picks what it
uses, and the updater, for which we keep using vsnprintf.

Differential Revision: https://phabricator.services.mozilla.com/D103730
2021-03-10 23:52:40 +00:00
Mike Hommey
e47bda795b Bug 1690167 - Add support for the hh length modifier in Printf.cpp. r=nika,Gankra
Test cases from TestIntegerPrintfMacros will cover this in the next commit.

Differential Revision: https://phabricator.services.mozilla.com/D103729
2021-03-10 23:52:40 +00:00
Mike Hommey
c7936d817c Bug 1690167 - Add support for the j length modifier in Printf.cpp. r=Gankra
Test cases from TestIntegerPrintfMacros will cover this in an upcoming commit.

Differential Revision: https://phabricator.services.mozilla.com/D105080
2021-03-10 23:52:39 +00:00
Mike Hommey
3e40e0ce40 Bug 1690167 - Move Sprintf.h and IntegerPrintfMacros.h next to Printf.h. r=jwalden
Which means they move from MFBT to mozglue.

Differential Revision: https://phabricator.services.mozilla.com/D103728
2021-03-10 23:52:39 +00:00
Agi Sferro
9ec0facdaa Bug 1694481 - Remove unused methods in GeckoLoader. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D106181
2021-03-10 22:43:08 +00:00
Agi Sferro
71dbca3068 Bug 1694481 - Remove unused NativeZip. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D106180
2021-03-10 22:43:07 +00:00
Agi Sferro
b39485034a Bug 1694481 - Remove unused DirectBufferAllocator. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D106179
2021-03-10 22:43:07 +00:00
Doug Thayer
6a24f1709b Bug 1696556 - Always run earlyBlankFirstPaint if we showed skele UI r=emalysz
This code is important for transitioning between the skeleton UI code and the
full-featured browser window code. Additionally, the original logic of disabling
when not on the default theme no longer applies, because it was intended to
eliminate white flashes in dark mode. However, with the skeleton UI, those
white flashes no longer occur.

Differential Revision: https://phabricator.services.mozilla.com/D107293
2021-03-09 18:37:53 +00:00
Bob Owen
86def8279e Bug 1546156: Don't forcibly load user32 when win32k lockdown is enabled. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D107498
2021-03-09 08:35:07 +00:00
Doug Thayer
e2fa1effe1 Bug 1696568 - Ensure skeleton UI window is always consumed if created r=emalysz
If we error out in, say, DrawSkeletonUI, the window we created will be orphaned
and left to sit there indefinitely. This patch fixes that by separating the
error from the consume result.

Differential Revision: https://phabricator.services.mozilla.com/D107301
2021-03-08 21:26:06 +00:00
Toshihito Kikuchi
f5928c8e7c Bug 1692908 - Block AVerMedia's virtual camera module. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D106636
2021-02-26 22:06:19 +00:00
Aaron Klotz
004362bf3e Bug 1690384: Propagate error information up through XPCOMGlueLoad and GetBootstrap; r=glandium
We know that some GV installations (particularly but not exlcusively Focus) are
failing to load `libxul.so` during early Gecko bootstrapping. Unfortunately
a boolean pass/fail result is not giving us sufficient information to be able to
properly troubleshoot this problem.

This patch adds `mozilla::Result`-based return values to `XPCOMGlueLoad` and
`GetBootstrap` in an effort to produce more actionable information about these
failures.

We include either a `nsresult` or, if the failure is rooted in a dynamic linker
failure, appropriate platform-specific error information:

* On Unix-based platforms, a `UniqueFreePtr<char>` containing the string from `dlerror(3)`;
* On Windows, the Win32 `DWORD` error code from `GetLastError()`.

For non-Android platforms, I updated them to handle the new return type, but
otherwise did not make any further changes.

For Android, we include the error information in the message string that we pass
into the Java `Exception` that is subsequently thrown.

Differential Revision: https://phabricator.services.mozilla.com/D104263
2021-02-23 23:25:22 +00:00
Gerald Squelart
96f3fabfcb Bug 1693037 - Fix non-MOZ_GECKO_PROFILER builds - r=florian
No code changes.

Build issues were found by renaming `MOZ_GECKO_PROFILER` to something else in toolkit/moz.configure, in both unified and non-unified builds, on all supported platforms.

Also updated some profiler-related comments.

Differential Revision: https://phabricator.services.mozilla.com/D105375
2021-02-17 22:36:28 +00:00
Andreea Pavel
64289058b6 Backed out 5 changesets (bug 1690167) for failing xpcshell at bootstrapSvc.js on a CLOSED TREE
Backed out changeset d28c0f11743f (bug 1690167)
Backed out changeset 3b2bebed9128 (bug 1690167)
Backed out changeset 7e925e90a251 (bug 1690167)
Backed out changeset f85934a2b7ad (bug 1690167)
Backed out changeset 6d83474e81bb (bug 1690167)
2021-02-17 07:10:58 +02:00
Mike Hommey
622b111f9e Bug 1690167 - Change VsprintfLiteral/SprintfLiteral to rely on PrintfTarget. r=nika,Gankra,firefox-build-system-reviewers,mhentges
Instead of snprintf.

Because some standalone code uses those functions directly or indirectly,
and PrintfTarget lives in mozglue, they now need to depend on mozglue
instead of mfbt. Except logalloc/replay, which cherry-picks what it
uses.

Differential Revision: https://phabricator.services.mozilla.com/D103730
2021-02-16 21:20:04 +00:00
Mike Hommey
34cf11e754 Bug 1690167 - Add support for the hh length modifier in Printf.cpp. r=nika,Gankra
Test cases from TestIntegerPrintfMacros will cover this in the next commit.

Differential Revision: https://phabricator.services.mozilla.com/D103729
2021-02-16 21:20:04 +00:00
Mike Hommey
7912f64d75 Bug 1690167 - Add support for the j length modifier in Printf.cpp. r=Gankra
Test cases from TestIntegerPrintfMacros will cover this in an upcoming commit.

Differential Revision: https://phabricator.services.mozilla.com/D105080
2021-02-16 21:20:04 +00:00
Mike Hommey
900d63959b Bug 1690167 - Move Sprintf.h and IntegerPrintfMacros.h next to Printf.h. r=jwalden
Which means they move from MFBT to mozglue.

Differential Revision: https://phabricator.services.mozilla.com/D103728
2021-02-16 21:20:03 +00:00