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

2398 Коммитов

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