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

381 Коммитов

Автор SHA1 Сообщение Дата
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
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
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
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 aaee7d55b0 Bug 1633572 - ProfileChunkedBuffer::IsIndexInCurrentChunk - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D122678
2021-08-18 01:47:41 +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
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 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
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
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
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
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
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
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
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
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
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
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
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
Butkovits Atila 8255e3083f Backed out changeset 5c6b15fcea71 (bug 1515229) for causing GTest failures. CLOSED TREE 2021-04-15 13:37:29 +03: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
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