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

1431 Коммитов

Автор SHA1 Сообщение Дата
Gerald Squelart b13eeec2e9 Bug 1552063 - Use PowerOfTwo and PowerOfTwoMask in profilers - r=gregtatum
PowerOfTwo makes for a cleaner and more expressive interface, showing that the
profiler will use a power-of-2 storage size.

Using PowerOfTwoMask in ProfilerBuffer also makes it more obvious that we want
cheap modulo operations.
And we don't need to keep the original capacity, as it's only used once and can
easily be recomputed from the mask.

Differential Revision: https://phabricator.services.mozilla.com/D36027

--HG--
extra : moz-landing-system : lando
2019-06-28 07:12:57 +00:00
Gerald Squelart bd540dabc4 Bug 1552063 - PowerOfTwo, PowerOfTwoMask - r=gregtatum
PowerOfTwo stores a power of 2 value, i.e., 2^N.
PowerOfTwoMask stores a mask corresponding to a power of 2, i.e., 2^N-1.

These should be used in places where a power of 2 (or its mask) is stored or
expected.
`% PowerOfTwo{,Mask}` and `& PowerOfTwoMask` operations are optimal.

MakePowerOfTwo{,Mask}<T, Value>() may be used to create statically-checked
constants.

{,Make}PowerOfTwo{,Mask}{32,64} shortcuts for common 32- and 64-bit types.

Differential Revision: https://phabricator.services.mozilla.com/D36026

--HG--
extra : moz-landing-system : lando
2019-06-28 07:12:54 +00:00
Andreea Pavel 4d16b0896b Backed out 2 changesets (bug 1552063) for mingw build bustages on a CLOSED TREE
Backed out changeset 2975f3f76576 (bug 1552063)
Backed out changeset 6284bcd7304e (bug 1552063)
2019-06-28 02:09:41 +03:00
Gerald Squelart 475dbeee0a Bug 1552063 - Use PowerOfTwo and PowerOfTwoMask in profilers - r=gregtatum
PowerOfTwo makes for a cleaner and more expressive interface, showing that the
profiler will use a power-of-2 storage size.

Using PowerOfTwoMask in ProfilerBuffer also makes it more obvious that we want
cheap modulo operations.
And we don't need to keep the original capacity, as it's only used once and can
easily be recomputed from the mask.

Differential Revision: https://phabricator.services.mozilla.com/D36027

--HG--
extra : moz-landing-system : lando
2019-06-27 14:23:17 +00:00
Gerald Squelart 94e534c933 Bug 1552063 - PowerOfTwo, PowerOfTwoMask - r=gregtatum
PowerOfTwo stores a power of 2 value, i.e., 2^N.
PowerOfTwoMask stores a mask corresponding to a power of 2, i.e., 2^N-1.

These should be used in places where a power of 2 (or its mask) is stored or
expected.
`% PowerOfTwo{,Mask}` and `& PowerOfTwoMask` operations are optimal.

MakePowerOfTwo{,Mask}<T, Value>() may be used to create statically-checked
constants.

{,Make}PowerOfTwo{,Mask}{32,64} shortcuts for common 32- and 64-bit types.

Differential Revision: https://phabricator.services.mozilla.com/D36026

--HG--
extra : moz-landing-system : lando
2019-06-27 22:33:29 +00:00
Ciure Andrei 217ab9d060 Backed out 4 changesets (bug 1545582) for causing spidermonkey bustages CLOSED TREE
Backed out changeset c53f9e22d5f7 (bug 1545582)
Backed out changeset 6640b7f3d7e0 (bug 1545582)
Backed out changeset c65de5ec10da (bug 1545582)
Backed out changeset 3224107774b1 (bug 1545582)
2019-06-20 19:39:54 +03:00
Greg Tatum 8bc06cf8cd Bug 1545582 - Integrate JavaScript memory allocation tracking to the profiler; r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D34543

--HG--
extra : moz-landing-system : lando
2019-06-19 21:30:48 +00:00
Jory A. Pratt 9c57855404 Bug 1358214 - gettid wrapper is not provided by any libc in linux r=njn
BIONIC is only platform that actually supports gettid. Easiest
    solution is to check for linux and disable for BIONIC platform. This
    includes the change requested by Gerald to keep the two profilers  sync'd.

Differential Revision: https://phabricator.services.mozilla.com/D34919

--HG--
extra : moz-landing-system : lando
2019-06-14 07:16:31 +00:00
Mihai Alexandru Michis cff1990963 Backed out 4 changesets (bug 1545582) for causing build bustages in SavedStacks.cpp CLOSED TREE
Backed out changeset a47c4a44bae0 (bug 1545582)
Backed out changeset c05a5d68d9a8 (bug 1545582)
Backed out changeset 699de45940b1 (bug 1545582)
Backed out changeset 285673afaa99 (bug 1545582)
2019-06-15 02:19:08 +03:00
Greg Tatum bf2db1bc5e Bug 1545582 - Integrate JavaScript memory allocation tracking to the profiler; r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D34543

--HG--
extra : moz-landing-system : lando
2019-06-13 20:57:11 +00:00
Aaron Klotz fc89fe9925 Bug 1532470: Part 5 - Update TestDllInterceptor to test new ARM64 capabilities; r=handyman
Update the tests for ARM64 to include additional functions that are now
supported via 4 byte patching.

We also convert the TEST macros to accept the DLL names as strings, as this
works better with clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D32209

--HG--
extra : moz-landing-system : lando
2019-06-12 01:11:37 +00:00
Aaron Klotz e311b07d92 Bug 1532470: Part 4 - Add 4-byte patching to ARM64 interceptor; r=handyman
This patch modifies arm64 so that detours are peformed via two passes:
1. The first pass uses a null trampoline to count how many bytes are available
   for patching the original function.
2. If we have >= 16 bytes to patch, we reuse existing trampoline space. If we
   have less than 16 bytes to patch, we reserve trampoline space within 128MB
   of the function, allowing for a 4 byte patch.
3. Then we recurse, this time using a real trampoline.

Note that we still do a single-pass on x86(-64).

Differential Revision: https://phabricator.services.mozilla.com/D32193

--HG--
extra : moz-landing-system : lando
2019-06-12 01:11:36 +00:00
Aaron Klotz 4460a190f9 Bug 1532470: Part 3 - Modify trampolines to support trampoline pools and null trampolines; r=handyman
A null trampoline is just a trampoline that is not backed by a VM reservation.
These are used for tracking the number of bytes that are needed to make a patch.

This patch also contains the changes needed to work with TrampolinePool.

Differential Revision: https://phabricator.services.mozilla.com/D32192

--HG--
extra : moz-landing-system : lando
2019-06-12 01:11:36 +00:00
Aaron Klotz 74b57fa236 Bug 1532470: Part 2 - Modify VM sharing policies to use trampoline pools and support the ability to specify a desired memory range when reserving address space; r=handyman
VMSharingPolicyShared needs to become much smarter. This patch modifies that
policy to track different VM reservations and reuse them whenever possible.

We add TrampolinePools to abstract away the differences between VM policies
with respect to the caller who is making the reservation.

Differential Revision: https://phabricator.services.mozilla.com/D32191

--HG--
extra : moz-landing-system : lando
2019-06-12 01:11:36 +00:00
Aaron Klotz 2c8e5e76b3 Bug 1532470: Part 1 - Add ability to specify desired memory range when reserving memory; r=handyman
In order to support 4-byte patches on ARM64, we need to be able to reserve
trampoline space within +/- 128 MB of the beginning of a function.

These changes allow us to make such reservations using OS APIs when
available.

Differential Revision: https://phabricator.services.mozilla.com/D32190

--HG--
extra : moz-landing-system : lando
2019-06-12 17:27:16 +00:00
Bogdan Tara b072357603 Backed out 2 changesets (bug 1532470) on aklotz's request
Backed out changeset 3693ec4875d8 (bug 1532470)
Backed out changeset 54a7bf8f3092 (bug 1532470)
2019-06-12 04:08:39 +03:00
Aaron Klotz 3b5b7427c5 Bug 1532470: Part 2 - Modify VM sharing policies to use trampoline pools and support the ability to specify a desired memory range when reserving address space; r=handyman
VMSharingPolicyShared needs to become much smarter. This patch modifies that
policy to track different VM reservations and reuse them whenever possible.

We add TrampolinePools to abstract away the differences between VM policies
with respect to the caller who is making the reservation.

Differential Revision: https://phabricator.services.mozilla.com/D32191

--HG--
extra : moz-landing-system : lando
2019-06-11 23:09:57 +00:00
Aaron Klotz cd4141632b Bug 1532470: Part 1 - Add ability to specify desired memory range when reserving memory; r=handyman
In order to support 4-byte patches on ARM64, we need to be able to reserve
trampoline space within +/- 128 MB of the beginning of a function.

These changes allow us to make such reservations using OS APIs when
available.

Differential Revision: https://phabricator.services.mozilla.com/D32190

--HG--
extra : moz-landing-system : lando
2019-06-11 20:31:56 +00:00
Aaron Klotz 087af67af1 Bug 1549797: Remove loader hooks for TestDllBlocklist from mozglue; r=mhowell
We remove the debugging hooks that were added to check to see whether a DLL
was loaded, as we can just as easily check that by querying the loader itself.
Plus, we shouldn't be exporting a bunch of test-only loader hooks from mozglue
in our release builds, which is what we are currently doing.

We also remove Injector, InjectorDLL, and TestDLLEject, as these tests can
just as easily be done from within TestDllBlocklist by creating a thread with
LoadLibrary* as the entry point. The CreateRemoteThread stuff, while a more
accurate simulation, has no material effect on whether or not the thread
blocking code works.

Differential Revision: https://phabricator.services.mozilla.com/D34444

--HG--
extra : moz-landing-system : lando
2019-06-11 17:15:20 +00:00
Aaron Klotz fc8369c57d Bug 1558350: Add TestNativeNt to cppunittest.ini; r=mhowell
We also s/mincore/version/ in OS_LIBS because the former breaks the test on
Windows 7.

Differential Revision: https://phabricator.services.mozilla.com/D34437

--HG--
extra : moz-landing-system : lando
2019-06-11 00:11:58 +00:00
Denis Palmeiro c32ed0ea49 Bug 1551355 - Use TimeStamp::NowUnfuzzed() instead of TimeStamp::Now() during gecko profiling r=mstange
The profiler will require non-fuzzed timers for accuracy.  Making the switch early will avoid surprises when FuzzyFox is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D31010

--HG--
extra : moz-landing-system : lando
2019-06-10 17:35:42 +00:00
Gerald Squelart 2d395c494d Bug 1557841 - Using renamed GetDebugPath in EHABIStackWalk.cpp - r=njn
Differential Revision: https://phabricator.services.mozilla.com/D34252

--HG--
extra : moz-landing-system : lando
2019-06-08 04:06:21 +00:00
Gerald Squelart a4bc77d6c6 Bug 1492121 - Use BaseProfiler in nsBrowserApp.cpp's main() - r=njn
Start using BaseProfiler in Firefox main(), before&after XPCOM runs.

Also added a BaseProfiler label around Gecko Profiler init/shutdown (so that
samples may be ignored if user is only interested in non-XPCOM profiling).

Main process name changed to "Main Thread (Base Profiler)", so as not to confuse
the front-end, and show where this thread comes from.

Differential Revision: https://phabricator.services.mozilla.com/D31933

--HG--
extra : moz-landing-system : lando
2019-06-06 06:20:32 +00:00
Gerald Squelart 06fdb64502 Bug 1492121 - Gecko Profiler integrates BaseProfiler startup profiled threads - r=njn
If MOZ_BASE_PROFILER_STARTUP and MOZ_PROFILER_STARTUP are set, this will integrate
a pre-XPCOM startup profile into the main profile.
It is stored as separate threads (in a single JSON string that is moved around),
which will appear as a new track under the main process.

Only adding threads from BaseProfiler means a better integration with Gecko
Profiler profiles, and is more efficient: Less code, and a smaller memory
footprint.

Differential Revision: https://phabricator.services.mozilla.com/D31932

--HG--
extra : moz-landing-system : lando
2019-06-06 06:20:14 +00:00
Gerald Squelart a54d246a96 Bug 1492121 - Run BaseProfiler's InitializeWin64ProfilerHooks once from either profiler - r=njn
Running identical (but separate) InitializeWin64ProfilerHooks in both profilers
confuses the DLL interceptor and the 2nd one crashes because of unexpected
opcodes introduced by the 1st one.
If MOZ_BASE_PROFILER is defined, Gecko Profiler will use that implementation of
InitializeWin64ProfilerHooks instead of its own; and that code also has a guard
so that it effectively only run once even if called from both profilers.

Differential Revision: https://phabricator.services.mozilla.com/D31931

--HG--
extra : moz-landing-system : lando
2019-06-06 06:20:07 +00:00
Gerald Squelart 511b46dfbe Bug 1492121 - Enclosing BaseProfiler in namespace mozilla::baseprofiler - r=njn
This prevents potential name clashes between the two profilers.

Differential Revision: https://phabricator.services.mozilla.com/D31930

--HG--
extra : moz-landing-system : lando
2019-06-06 06:20:03 +00:00
Gerald Squelart c6c33614e2 Bug 1492121 - Added "BASE" to all public macros - r=njn
E.g., AUTO_PROFILER_INIT -> AUTO_BASE_PROFILER_INIT.
This will allow #including BaseProfiler.h anywhere as needed, without clashing
with Gecko Profiler macros.

Differential Revision: https://phabricator.services.mozilla.com/D31929

--HG--
extra : moz-landing-system : lando
2019-06-06 06:19:01 +00:00
Gerald Squelart 11d60b8f63 Bug 1492121 - Rename env-vars MOZ_PROFILER_* to MOZ_BASE_PROFILER_* - r=njn
Notice the extra 'BASE' in the env-var names.
This is to control BaseProfiler separately from the Gecko Profiler.

Differential Revision: https://phabricator.services.mozilla.com/D31928

--HG--
extra : moz-landing-system : lando
2019-06-06 06:18:47 +00:00
Gerald Squelart 061c135876 Bug 1492121 - Enable Base Profiler by default on Linux and Mac - r=njn
Android not implemented yet.
Windows not working yet when packaged, so disabled by default, but may be
enabled locally by uncommenting `#define MOZ_BASE_PROFILER` where indicated in
BaseProfiler.h.

Differential Revision: https://phabricator.services.mozilla.com/D31927

--HG--
extra : moz-landing-system : lando
2019-06-06 06:18:28 +00:00
Gerald Squelart 63fa790be8 Bug 1492121 - TestBaseProfiler - r=njn
Simple test program that exercises the most important APIs of BaseProfiler.
(Including checking that macros work even when BaseProfiler is not enabled.)

Differential Revision: https://phabricator.services.mozilla.com/D31926

--HG--
extra : moz-landing-system : lando
2019-06-06 06:18:09 +00:00
Gerald Squelart 22230f96d5 Bug 1492121 - All necessary changes to make baseprofiler build - r=njn
Almost-mechanical changes include:
- Removed unneeded/incompatible #includes and functions (any JS- or XPCOM-
  dependent).
- Use std::string for strings and nsIDs.
- Use thin wrappers around mozilla::detail::MutexImpl for mutexes.
- Use hand-rolled AddRef&Release's for ref-counted classes -- could not use
  mfbt/RefCounted.h because of bug 1536656.
- Added some platform-specific polyfills, e.g.: MicrosecondsSince1970().
- Only record the main thread by default.
- Logging controlled by env-vars MOZ_BASE_PROFILER_{,DEBUG_,VERBOSE_}LOGGING.

This now builds (with --enable-base-profiler), but is not usable yet.

Differential Revision: https://phabricator.services.mozilla.com/D31924

--HG--
extra : moz-landing-system : lando
2019-06-06 06:17:49 +00:00
Gerald Squelart a2a8ceaf64 Bug 1492121 - MOZ_BASE_PROFILER may be defined in BaseProfiler.h to enable Base Profiler - r=njn
Added baseprofiler to mozglue/moz.build, so it will be built.
However all cpp files are dependent on `MOZ_BASE_PROFILER`, which is currently
not #defined by default (in public/BaseProfiler.h).

Added mozglue/mozprofiler to js/src/make-source-package.sh, because
mozglue/moz.build now refers to it.

Differential Revision: https://phabricator.services.mozilla.com/D33258

--HG--
extra : moz-landing-system : lando
2019-06-06 06:17:30 +00:00
Gerald Squelart 19b516360a Bug 1492121 - Copy most of Gecko Profiler code to mozglue/baseprofiler - r=njn
Almost-straight copy of a subset of files from tools/profiler to
mozglue/baseprofiler.
Some minor changes first:
- Reduced moz.build to only mention actually-copied files.
- Headers in 'public' prefixed with "Base" (to distinguish them from their
  originals, in case they later get #included from the same units).
- Also copied profiling categories from js/src/vm/GeckoProfiler.cpp to
  ProfilingCategory.cpp, and copied js/src/vm/ProfilingStack.cpp, and their
  respective headers -- as they are needed for a significant part of
  the profiler API, and are not strictly js-specific.

baseprofiler not yet added to parent mozglue/moz.build, so it won't be built yet.

Differential Revision: https://phabricator.services.mozilla.com/D31923

--HG--
rename : tools/profiler/core/EHABIStackWalk.cpp => mozglue/baseprofiler/core/EHABIStackWalk.cpp
rename : tools/profiler/core/EHABIStackWalk.h => mozglue/baseprofiler/core/EHABIStackWalk.h
rename : tools/profiler/core/PageInformation.cpp => mozglue/baseprofiler/core/PageInformation.cpp
rename : tools/profiler/core/PageInformation.h => mozglue/baseprofiler/core/PageInformation.h
rename : tools/profiler/core/PlatformMacros.h => mozglue/baseprofiler/core/PlatformMacros.h
rename : tools/profiler/core/ProfileBuffer.cpp => mozglue/baseprofiler/core/ProfileBuffer.cpp
rename : tools/profiler/core/ProfileBuffer.h => mozglue/baseprofiler/core/ProfileBuffer.h
rename : tools/profiler/core/ProfileBufferEntry.cpp => mozglue/baseprofiler/core/ProfileBufferEntry.cpp
rename : tools/profiler/core/ProfileBufferEntry.h => mozglue/baseprofiler/core/ProfileBufferEntry.h
rename : tools/profiler/core/ProfileJSONWriter.cpp => mozglue/baseprofiler/core/ProfileJSONWriter.cpp
rename : tools/profiler/core/ProfiledThreadData.cpp => mozglue/baseprofiler/core/ProfiledThreadData.cpp
rename : tools/profiler/core/ProfiledThreadData.h => mozglue/baseprofiler/core/ProfiledThreadData.h
rename : tools/profiler/core/ProfilerBacktrace.cpp => mozglue/baseprofiler/core/ProfilerBacktrace.cpp
rename : tools/profiler/core/ProfilerBacktrace.h => mozglue/baseprofiler/core/ProfilerBacktrace.h
rename : tools/profiler/core/ProfilerMarker.h => mozglue/baseprofiler/core/ProfilerMarker.h
rename : tools/profiler/core/ProfilerMarkerPayload.cpp => mozglue/baseprofiler/core/ProfilerMarkerPayload.cpp
rename : js/src/vm/GeckoProfiler.cpp => mozglue/baseprofiler/core/ProfilingCategory.cpp
rename : js/src/vm/ProfilingStack.cpp => mozglue/baseprofiler/core/ProfilingStack.cpp
rename : tools/profiler/core/RegisteredThread.cpp => mozglue/baseprofiler/core/RegisteredThread.cpp
rename : tools/profiler/core/RegisteredThread.h => mozglue/baseprofiler/core/RegisteredThread.h
rename : tools/profiler/core/ThreadInfo.h => mozglue/baseprofiler/core/ThreadInfo.h
rename : tools/profiler/core/VTuneProfiler.cpp => mozglue/baseprofiler/core/VTuneProfiler.cpp
rename : tools/profiler/core/VTuneProfiler.h => mozglue/baseprofiler/core/VTuneProfiler.h
rename : tools/profiler/core/platform-linux-android.cpp => mozglue/baseprofiler/core/platform-linux-android.cpp
rename : tools/profiler/core/platform-macos.cpp => mozglue/baseprofiler/core/platform-macos.cpp
rename : tools/profiler/core/platform-win32.cpp => mozglue/baseprofiler/core/platform-win32.cpp
rename : tools/profiler/core/platform.cpp => mozglue/baseprofiler/core/platform.cpp
rename : tools/profiler/core/platform.h => mozglue/baseprofiler/core/platform.h
rename : tools/profiler/core/shared-libraries-linux.cc => mozglue/baseprofiler/core/shared-libraries-linux.cc
rename : tools/profiler/core/shared-libraries-macos.cc => mozglue/baseprofiler/core/shared-libraries-macos.cc
rename : tools/profiler/core/shared-libraries-win32.cc => mozglue/baseprofiler/core/shared-libraries-win32.cc
rename : tools/profiler/core/vtune/ittnotify.h => mozglue/baseprofiler/core/vtune/ittnotify.h
rename : tools/profiler/lul/AutoObjectMapper.cpp => mozglue/baseprofiler/lul/AutoObjectMapper.cpp
rename : tools/profiler/lul/AutoObjectMapper.h => mozglue/baseprofiler/lul/AutoObjectMapper.h
rename : tools/profiler/lul/LulCommon.cpp => mozglue/baseprofiler/lul/LulCommon.cpp
rename : tools/profiler/lul/LulCommonExt.h => mozglue/baseprofiler/lul/LulCommonExt.h
rename : tools/profiler/lul/LulDwarf.cpp => mozglue/baseprofiler/lul/LulDwarf.cpp
rename : tools/profiler/lul/LulDwarfExt.h => mozglue/baseprofiler/lul/LulDwarfExt.h
rename : tools/profiler/lul/LulDwarfInt.h => mozglue/baseprofiler/lul/LulDwarfInt.h
rename : tools/profiler/lul/LulDwarfSummariser.cpp => mozglue/baseprofiler/lul/LulDwarfSummariser.cpp
rename : tools/profiler/lul/LulDwarfSummariser.h => mozglue/baseprofiler/lul/LulDwarfSummariser.h
rename : tools/profiler/lul/LulElf.cpp => mozglue/baseprofiler/lul/LulElf.cpp
rename : tools/profiler/lul/LulElfExt.h => mozglue/baseprofiler/lul/LulElfExt.h
rename : tools/profiler/lul/LulElfInt.h => mozglue/baseprofiler/lul/LulElfInt.h
rename : tools/profiler/lul/LulMain.cpp => mozglue/baseprofiler/lul/LulMain.cpp
rename : tools/profiler/lul/LulMain.h => mozglue/baseprofiler/lul/LulMain.h
rename : tools/profiler/lul/LulMainInt.h => mozglue/baseprofiler/lul/LulMainInt.h
rename : tools/profiler/lul/platform-linux-lul.cpp => mozglue/baseprofiler/lul/platform-linux-lul.cpp
rename : tools/profiler/lul/platform-linux-lul.h => mozglue/baseprofiler/lul/platform-linux-lul.h
rename : tools/profiler/moz.build => mozglue/baseprofiler/moz.build
rename : tools/profiler/public/ProfileJSONWriter.h => mozglue/baseprofiler/public/BaseProfileJSONWriter.h
rename : tools/profiler/public/GeckoProfiler.h => mozglue/baseprofiler/public/BaseProfiler.h
rename : tools/profiler/public/ProfilerCounts.h => mozglue/baseprofiler/public/BaseProfilerCounts.h
rename : tools/profiler/public/ProfilerMarkerPayload.h => mozglue/baseprofiler/public/BaseProfilerMarkerPayload.h
rename : tools/profiler/public/shared-libraries.h => mozglue/baseprofiler/public/BaseProfilerSharedLibraries.h
rename : js/public/ProfilingCategory.h => mozglue/baseprofiler/public/BaseProfilingCategory.h
rename : js/public/ProfilingStack.h => mozglue/baseprofiler/public/BaseProfilingStack.h
extra : moz-landing-system : lando
2019-06-06 06:16:57 +00:00
Noemi Erli 31c85bd5fe Backed out 13 changesets (bug 1492121) for valgrind bustage
Backed out changeset e707f1890820 (bug 1492121)
Backed out changeset 90aeaad4a4de (bug 1492121)
Backed out changeset 2ffb6ccca437 (bug 1492121)
Backed out changeset 4215fefb6ef3 (bug 1492121)
Backed out changeset b54b813c4c6c (bug 1492121)
Backed out changeset 46f57504c087 (bug 1492121)
Backed out changeset a3fe26927b31 (bug 1492121)
Backed out changeset 39c486afacec (bug 1492121)
Backed out changeset bf1731627e07 (bug 1492121)
Backed out changeset 77e7b13c6237 (bug 1492121)
Backed out changeset 1f10b50f758f (bug 1492121)
Backed out changeset db1506f94d0d (bug 1492121)
Backed out changeset 72c4026e9455 (bug 1492121)
2019-06-06 04:01:24 +03:00
Gerald Squelart 5cc6e9331f Bug 1492121 - Use BaseProfiler in nsBrowserApp.cpp's main() - r=njn
Start using BaseProfiler in Firefox main(), before&after XPCOM runs.

Also added a BaseProfiler label around Gecko Profiler init/shutdown (so that
samples may be ignored if user is only interested in non-XPCOM profiling).

Main process name changed to "Main Thread (Base Profiler)", so as not to confuse
the front-end, and show where this thread comes from.

Differential Revision: https://phabricator.services.mozilla.com/D31933

--HG--
extra : moz-landing-system : lando
2019-06-05 23:42:59 +00:00
Gerald Squelart ed30216728 Bug 1492121 - Gecko Profiler integrates BaseProfiler startup profiled threads - r=njn
If MOZ_BASE_PROFILER_STARTUP and MOZ_PROFILER_STARTUP are set, this will integrate
a pre-XPCOM startup profile into the main profile.
It is stored as separate threads (in a single JSON string that is moved around),
which will appear as a new track under the main process.

Only adding threads from BaseProfiler means a better integration with Gecko
Profiler profiles, and is more efficient: Less code, and a smaller memory
footprint.

Differential Revision: https://phabricator.services.mozilla.com/D31932

--HG--
extra : moz-landing-system : lando
2019-06-05 23:42:01 +00:00
Gerald Squelart 249f53552f Bug 1492121 - Run BaseProfiler's InitializeWin64ProfilerHooks once from either profiler - r=njn
Running identical (but separate) InitializeWin64ProfilerHooks in both profilers
confuses the DLL interceptor and the 2nd one crashes because of unexpected
opcodes introduced by the 1st one.
If MOZ_BASE_PROFILER is defined, Gecko Profiler will use that implementation of
InitializeWin64ProfilerHooks instead of its own; and that code also has a guard
so that it effectively only run once even if called from both profilers.

Differential Revision: https://phabricator.services.mozilla.com/D31931

--HG--
extra : moz-landing-system : lando
2019-06-05 23:41:40 +00:00
Gerald Squelart f14c01769a Bug 1492121 - Enclosing BaseProfiler in namespace mozilla::baseprofiler - r=njn
This prevents potential name clashes between the two profilers.

Differential Revision: https://phabricator.services.mozilla.com/D31930

--HG--
extra : moz-landing-system : lando
2019-06-05 23:41:26 +00:00
Gerald Squelart bdd55c576d Bug 1492121 - Added "BASE" to all public macros - r=njn
E.g., AUTO_PROFILER_INIT -> AUTO_BASE_PROFILER_INIT.
This will allow #including BaseProfiler.h anywhere as needed, without clashing
with Gecko Profiler macros.

Differential Revision: https://phabricator.services.mozilla.com/D31929

--HG--
extra : moz-landing-system : lando
2019-06-05 23:41:01 +00:00
Gerald Squelart bf5eeb02e8 Bug 1492121 - Rename env-vars MOZ_PROFILER_* to MOZ_BASE_PROFILER_* - r=njn
Notice the extra 'BASE' in the env-var names.
This is to control BaseProfiler separately from the Gecko Profiler.

Differential Revision: https://phabricator.services.mozilla.com/D31928

--HG--
extra : moz-landing-system : lando
2019-06-05 23:40:47 +00:00
Gerald Squelart 2e2c8ebdeb Bug 1492121 - Enable Base Profiler by default on Linux and Mac - r=njn
Android not implemented yet.
Windows not working yet when packaged, so disabled by default, but may be
enabled locally by uncommenting `#define MOZ_BASE_PROFILER` where indicated in
BaseProfiler.h.

Differential Revision: https://phabricator.services.mozilla.com/D31927

--HG--
extra : moz-landing-system : lando
2019-06-05 23:40:28 +00:00
Gerald Squelart 7635e5d9da Bug 1492121 - TestBaseProfiler - r=njn
Simple test program that exercises the most important APIs of BaseProfiler.
(Including checking that macros work even when BaseProfiler is not enabled.)

Differential Revision: https://phabricator.services.mozilla.com/D31926

--HG--
extra : moz-landing-system : lando
2019-06-05 23:40:09 +00:00
Gerald Squelart 2470155fd2 Bug 1492121 - All necessary changes to make baseprofiler build - r=njn
Almost-mechanical changes include:
- Removed unneeded/incompatible #includes and functions (any JS- or XPCOM-
  dependent).
- Use std::string for strings and nsIDs.
- Use thin wrappers around mozilla::detail::MutexImpl for mutexes.
- Use hand-rolled AddRef&Release's for ref-counted classes -- could not use
  mfbt/RefCounted.h because of bug 1536656.
- Added some platform-specific polyfills, e.g.: MicrosecondsSince1970().
- Only record the main thread by default.
- Logging controlled by env-vars MOZ_BASE_PROFILER_{,DEBUG_,VERBOSE_}LOGGING.

This now builds (with --enable-base-profiler), but is not usable yet.

Differential Revision: https://phabricator.services.mozilla.com/D31924

--HG--
extra : moz-landing-system : lando
2019-06-05 23:39:53 +00:00
Gerald Squelart e1051b2e3e Bug 1492121 - MOZ_BASE_PROFILER may be defined in BaseProfiler.h to enable Base Profiler - r=njn
Added baseprofiler to mozglue/moz.build, so it will be built.
However all cpp files are dependent on `MOZ_BASE_PROFILER`, which is currently
not #defined by default (in public/BaseProfiler.h).

Added mozglue/mozprofiler to js/src/make-source-package.sh, because
mozglue/moz.build now refers to it.

Differential Revision: https://phabricator.services.mozilla.com/D33258

--HG--
extra : moz-landing-system : lando
2019-06-05 23:39:28 +00:00
Gerald Squelart c70423dc73 Bug 1492121 - Copy most of Gecko Profiler code to mozglue/baseprofiler - r=njn
Almost-straight copy of a subset of files from tools/profiler to
mozglue/baseprofiler.
Some minor changes first:
- Reduced moz.build to only mention actually-copied files.
- Headers in 'public' prefixed with "Base" (to distinguish them from their
  originals, in case they later get #included from the same units).
- Also copied profiling categories from js/src/vm/GeckoProfiler.cpp to
  ProfilingCategory.cpp, and copied js/src/vm/ProfilingStack.cpp, and their
  respective headers -- as they are needed for a significant part of
  the profiler API, and are not strictly js-specific.

baseprofiler not yet added to parent mozglue/moz.build, so it won't be built yet.

Differential Revision: https://phabricator.services.mozilla.com/D31923

--HG--
rename : tools/profiler/core/EHABIStackWalk.cpp => mozglue/baseprofiler/core/EHABIStackWalk.cpp
rename : tools/profiler/core/EHABIStackWalk.h => mozglue/baseprofiler/core/EHABIStackWalk.h
rename : tools/profiler/core/PageInformation.cpp => mozglue/baseprofiler/core/PageInformation.cpp
rename : tools/profiler/core/PageInformation.h => mozglue/baseprofiler/core/PageInformation.h
rename : tools/profiler/core/PlatformMacros.h => mozglue/baseprofiler/core/PlatformMacros.h
rename : tools/profiler/core/ProfileBuffer.cpp => mozglue/baseprofiler/core/ProfileBuffer.cpp
rename : tools/profiler/core/ProfileBuffer.h => mozglue/baseprofiler/core/ProfileBuffer.h
rename : tools/profiler/core/ProfileBufferEntry.cpp => mozglue/baseprofiler/core/ProfileBufferEntry.cpp
rename : tools/profiler/core/ProfileBufferEntry.h => mozglue/baseprofiler/core/ProfileBufferEntry.h
rename : tools/profiler/core/ProfileJSONWriter.cpp => mozglue/baseprofiler/core/ProfileJSONWriter.cpp
rename : tools/profiler/core/ProfiledThreadData.cpp => mozglue/baseprofiler/core/ProfiledThreadData.cpp
rename : tools/profiler/core/ProfiledThreadData.h => mozglue/baseprofiler/core/ProfiledThreadData.h
rename : tools/profiler/core/ProfilerBacktrace.cpp => mozglue/baseprofiler/core/ProfilerBacktrace.cpp
rename : tools/profiler/core/ProfilerBacktrace.h => mozglue/baseprofiler/core/ProfilerBacktrace.h
rename : tools/profiler/core/ProfilerMarker.h => mozglue/baseprofiler/core/ProfilerMarker.h
rename : tools/profiler/core/ProfilerMarkerPayload.cpp => mozglue/baseprofiler/core/ProfilerMarkerPayload.cpp
rename : js/src/vm/GeckoProfiler.cpp => mozglue/baseprofiler/core/ProfilingCategory.cpp
rename : js/src/vm/ProfilingStack.cpp => mozglue/baseprofiler/core/ProfilingStack.cpp
rename : tools/profiler/core/RegisteredThread.cpp => mozglue/baseprofiler/core/RegisteredThread.cpp
rename : tools/profiler/core/RegisteredThread.h => mozglue/baseprofiler/core/RegisteredThread.h
rename : tools/profiler/core/ThreadInfo.h => mozglue/baseprofiler/core/ThreadInfo.h
rename : tools/profiler/core/VTuneProfiler.cpp => mozglue/baseprofiler/core/VTuneProfiler.cpp
rename : tools/profiler/core/VTuneProfiler.h => mozglue/baseprofiler/core/VTuneProfiler.h
rename : tools/profiler/core/platform-linux-android.cpp => mozglue/baseprofiler/core/platform-linux-android.cpp
rename : tools/profiler/core/platform-macos.cpp => mozglue/baseprofiler/core/platform-macos.cpp
rename : tools/profiler/core/platform-win32.cpp => mozglue/baseprofiler/core/platform-win32.cpp
rename : tools/profiler/core/platform.cpp => mozglue/baseprofiler/core/platform.cpp
rename : tools/profiler/core/platform.h => mozglue/baseprofiler/core/platform.h
rename : tools/profiler/core/shared-libraries-linux.cc => mozglue/baseprofiler/core/shared-libraries-linux.cc
rename : tools/profiler/core/shared-libraries-macos.cc => mozglue/baseprofiler/core/shared-libraries-macos.cc
rename : tools/profiler/core/shared-libraries-win32.cc => mozglue/baseprofiler/core/shared-libraries-win32.cc
rename : tools/profiler/core/vtune/ittnotify.h => mozglue/baseprofiler/core/vtune/ittnotify.h
rename : tools/profiler/lul/AutoObjectMapper.cpp => mozglue/baseprofiler/lul/AutoObjectMapper.cpp
rename : tools/profiler/lul/AutoObjectMapper.h => mozglue/baseprofiler/lul/AutoObjectMapper.h
rename : tools/profiler/lul/LulCommon.cpp => mozglue/baseprofiler/lul/LulCommon.cpp
rename : tools/profiler/lul/LulCommonExt.h => mozglue/baseprofiler/lul/LulCommonExt.h
rename : tools/profiler/lul/LulDwarf.cpp => mozglue/baseprofiler/lul/LulDwarf.cpp
rename : tools/profiler/lul/LulDwarfExt.h => mozglue/baseprofiler/lul/LulDwarfExt.h
rename : tools/profiler/lul/LulDwarfInt.h => mozglue/baseprofiler/lul/LulDwarfInt.h
rename : tools/profiler/lul/LulDwarfSummariser.cpp => mozglue/baseprofiler/lul/LulDwarfSummariser.cpp
rename : tools/profiler/lul/LulDwarfSummariser.h => mozglue/baseprofiler/lul/LulDwarfSummariser.h
rename : tools/profiler/lul/LulElf.cpp => mozglue/baseprofiler/lul/LulElf.cpp
rename : tools/profiler/lul/LulElfExt.h => mozglue/baseprofiler/lul/LulElfExt.h
rename : tools/profiler/lul/LulElfInt.h => mozglue/baseprofiler/lul/LulElfInt.h
rename : tools/profiler/lul/LulMain.cpp => mozglue/baseprofiler/lul/LulMain.cpp
rename : tools/profiler/lul/LulMain.h => mozglue/baseprofiler/lul/LulMain.h
rename : tools/profiler/lul/LulMainInt.h => mozglue/baseprofiler/lul/LulMainInt.h
rename : tools/profiler/lul/platform-linux-lul.cpp => mozglue/baseprofiler/lul/platform-linux-lul.cpp
rename : tools/profiler/lul/platform-linux-lul.h => mozglue/baseprofiler/lul/platform-linux-lul.h
rename : tools/profiler/moz.build => mozglue/baseprofiler/moz.build
rename : tools/profiler/public/ProfileJSONWriter.h => mozglue/baseprofiler/public/BaseProfileJSONWriter.h
rename : tools/profiler/public/GeckoProfiler.h => mozglue/baseprofiler/public/BaseProfiler.h
rename : tools/profiler/public/ProfilerCounts.h => mozglue/baseprofiler/public/BaseProfilerCounts.h
rename : tools/profiler/public/ProfilerMarkerPayload.h => mozglue/baseprofiler/public/BaseProfilerMarkerPayload.h
rename : tools/profiler/public/shared-libraries.h => mozglue/baseprofiler/public/BaseProfilerSharedLibraries.h
rename : js/public/ProfilingCategory.h => mozglue/baseprofiler/public/BaseProfilingCategory.h
rename : js/public/ProfilingStack.h => mozglue/baseprofiler/public/BaseProfilingStack.h
extra : moz-landing-system : lando
2019-06-05 23:38:55 +00:00
Bogdan Tara 47274faae8 Backed out 12 changesets (bug 1492121) for platform.cpp and TestBaseProfiler.cpp related bustages CLOSED TREE
Backed out changeset 9d768006784a (bug 1492121)
Backed out changeset 1bf52d547eb7 (bug 1492121)
Backed out changeset da72675c0d37 (bug 1492121)
Backed out changeset bdf3b865c947 (bug 1492121)
Backed out changeset 0c6cf7bc131f (bug 1492121)
Backed out changeset 0cddbdfdfae2 (bug 1492121)
Backed out changeset ac8da816859d (bug 1492121)
Backed out changeset 3800ef0a0e37 (bug 1492121)
Backed out changeset 5f30af0d0f63 (bug 1492121)
Backed out changeset de1c3ae8df14 (bug 1492121)
Backed out changeset 0689c1b8f4f7 (bug 1492121)
Backed out changeset 5e7817b385fc (bug 1492121)
2019-06-04 12:08:39 +03:00
Gerald Squelart fab9b786ac Bug 1492121 - Use BaseProfiler in nsBrowserApp.cpp's main() - r=njn
Start using BaseProfiler in Firefox main(), before&after XPCOM runs.

Also added a BaseProfiler label around Gecko Profiler init/shutdown (so that
samples may be ignored if user is only interested in non-XPCOM profiling).

Main process name changed to "Main Thread (Base Profiler)", so as not to confuse
the front-end, and show where this thread comes from.

Differential Revision: https://phabricator.services.mozilla.com/D31933

--HG--
extra : moz-landing-system : lando
2019-06-04 06:55:46 +00:00
Gerald Squelart 78897828c9 Bug 1492121 - Gecko Profiler integrates BaseProfiler startup profiled threads - r=njn
If MOZ_BASE_PROFILER_STARTUP and MOZ_PROFILER_STARTUP are set, this will integrate
a pre-XPCOM startup profile into the main profile.
It is stored as separate threads (in a single JSON string that is moved around),
which will appear as a new track under the main process.

Only adding threads from BaseProfiler means a better integration with Gecko
Profiler profiles, and is more efficient: Less code, and a smaller memory
footprint.

Differential Revision: https://phabricator.services.mozilla.com/D31932

--HG--
extra : moz-landing-system : lando
2019-06-04 06:55:37 +00:00
Gerald Squelart d0e93db004 Bug 1492121 - Run BaseProfiler's InitializeWin64ProfilerHooks once from either profiler - r=njn
Running identical (but separate) InitializeWin64ProfilerHooks in both profilers
confuses the DLL interceptor and the 2nd one crashes because of unexpected
opcodes introduced by the 1st one.
If MOZ_BASE_PROFILER is defined, Gecko Profiler will use that implementation of
InitializeWin64ProfilerHooks instead of its own; and that code also has a guard
so that it effectively only run once even if called from both profilers.

Differential Revision: https://phabricator.services.mozilla.com/D31931

--HG--
extra : moz-landing-system : lando
2019-06-04 06:55:30 +00:00
Gerald Squelart f76f4b33ab Bug 1492121 - Enclosing BaseProfiler in namespace mozilla::baseprofiler - r=njn
This prevents potential name clashes between the two profilers.

Differential Revision: https://phabricator.services.mozilla.com/D31930

--HG--
extra : moz-landing-system : lando
2019-06-04 06:55:26 +00:00
Gerald Squelart 83c59735be Bug 1492121 - Added "BASE" to all public macros - r=njn
E.g., AUTO_PROFILER_INIT -> AUTO_BASE_PROFILER_INIT.
This will allow #including BaseProfiler.h anywhere as needed, without clashing
with Gecko Profiler macros.

Differential Revision: https://phabricator.services.mozilla.com/D31929

--HG--
extra : moz-landing-system : lando
2019-06-04 06:55:22 +00:00
Gerald Squelart ebef0090cf Bug 1492121 - Rename env-vars MOZ_PROFILER_* to MOZ_BASE_PROFILER_* - r=njn
Notice the extra 'BASE' in the env-var names.
This is to control BaseProfiler separately from the Gecko Profiler.

Differential Revision: https://phabricator.services.mozilla.com/D31928

--HG--
extra : moz-landing-system : lando
2019-06-04 06:53:56 +00:00
Gerald Squelart 4c1ca7ec33 Bug 1492121 - Enable Base Profiler by default on Linux and Mac - r=njn
Android not implemented yet.
Windows not working yet when packaged, so disabled by default, but may be
enabled locally by uncommenting `#define MOZ_BASE_PROFILER` where indicated in
BaseProfiler.h.

Differential Revision: https://phabricator.services.mozilla.com/D31927

--HG--
extra : moz-landing-system : lando
2019-06-04 06:53:36 +00:00
Gerald Squelart b12d32ba33 Bug 1492121 - TestBaseProfiler - r=njn
Simple test program that exercises the most important APIs of BaseProfiler.
(Including checking that macros work even when BaseProfiler is not enabled.)

Differential Revision: https://phabricator.services.mozilla.com/D31926

--HG--
extra : moz-landing-system : lando
2019-06-04 06:53:21 +00:00
Gerald Squelart 10e7d3bf93 Bug 1492121 - All necessary changes to make baseprofiler build - r=njn
Almost-mechanical changes include:
- Removed unneeded/incompatible #includes and functions (any JS- or XPCOM-
  dependent).
- Use std::string for strings and nsIDs.
- Use thin wrappers around mozilla::detail::MutexImpl for mutexes.
- Use hand-rolled AddRef&Release's for ref-counted classes -- could not use
  mfbt/RefCounted.h because of bug 1536656.
- Added some platform-specific polyfills, e.g.: MicrosecondsSince1970().
- Only record the main thread by default.
- Logging controlled by env-vars MOZ_BASE_PROFILER_{,DEBUG_,VERBOSE_}LOGGING.

This now builds (with --enable-base-profiler), but is not usable yet.

Differential Revision: https://phabricator.services.mozilla.com/D31924

--HG--
extra : moz-landing-system : lando
2019-06-04 06:53:01 +00:00
Gerald Squelart 494369648d Bug 1492121 - MOZ_BASE_PROFILER may be defined in BaseProfiler.h to enable Base Profiler - r=njn
Added baseprofiler to mozglue/moz.build, so it will be built.
However all cpp files are dependent on `MOZ_BASE_PROFILER`, which is currently
not #defined by default (in public/BaseProfiler.h).

Differential Revision: https://phabricator.services.mozilla.com/D33258

--HG--
extra : moz-landing-system : lando
2019-06-04 06:52:41 +00:00
Gerald Squelart 38eb2d609e Bug 1492121 - Copy most of Gecko Profiler code to mozglue/baseprofiler - r=njn
Almost-straight copy of a subset of files from tools/profiler to
mozglue/baseprofiler.
Some minor changes first:
- Reduced moz.build to only mention actually-copied files.
- Headers in 'public' prefixed with "Base" (to distinguish them from their
  originals, in case they later get #included from the same units).
- Also copied profiling categories from js/src/vm/GeckoProfiler.cpp to
  ProfilingCategory.cpp, and copied js/src/vm/ProfilingStack.cpp, and their
  respective headers -- as they are needed for a significant part of
  the profiler API, and are not strictly js-specific.

baseprofiler not yet added to parent mozglue/moz.build, so it won't be built yet.

Differential Revision: https://phabricator.services.mozilla.com/D31923

--HG--
rename : tools/profiler/core/EHABIStackWalk.cpp => mozglue/baseprofiler/core/EHABIStackWalk.cpp
rename : tools/profiler/core/EHABIStackWalk.h => mozglue/baseprofiler/core/EHABIStackWalk.h
rename : tools/profiler/core/PageInformation.cpp => mozglue/baseprofiler/core/PageInformation.cpp
rename : tools/profiler/core/PageInformation.h => mozglue/baseprofiler/core/PageInformation.h
rename : tools/profiler/core/PlatformMacros.h => mozglue/baseprofiler/core/PlatformMacros.h
rename : tools/profiler/core/ProfileBuffer.cpp => mozglue/baseprofiler/core/ProfileBuffer.cpp
rename : tools/profiler/core/ProfileBuffer.h => mozglue/baseprofiler/core/ProfileBuffer.h
rename : tools/profiler/core/ProfileBufferEntry.cpp => mozglue/baseprofiler/core/ProfileBufferEntry.cpp
rename : tools/profiler/core/ProfileBufferEntry.h => mozglue/baseprofiler/core/ProfileBufferEntry.h
rename : tools/profiler/core/ProfileJSONWriter.cpp => mozglue/baseprofiler/core/ProfileJSONWriter.cpp
rename : tools/profiler/core/ProfiledThreadData.cpp => mozglue/baseprofiler/core/ProfiledThreadData.cpp
rename : tools/profiler/core/ProfiledThreadData.h => mozglue/baseprofiler/core/ProfiledThreadData.h
rename : tools/profiler/core/ProfilerBacktrace.cpp => mozglue/baseprofiler/core/ProfilerBacktrace.cpp
rename : tools/profiler/core/ProfilerBacktrace.h => mozglue/baseprofiler/core/ProfilerBacktrace.h
rename : tools/profiler/core/ProfilerMarker.h => mozglue/baseprofiler/core/ProfilerMarker.h
rename : tools/profiler/core/ProfilerMarkerPayload.cpp => mozglue/baseprofiler/core/ProfilerMarkerPayload.cpp
rename : js/src/vm/GeckoProfiler.cpp => mozglue/baseprofiler/core/ProfilingCategory.cpp
rename : js/src/vm/ProfilingStack.cpp => mozglue/baseprofiler/core/ProfilingStack.cpp
rename : tools/profiler/core/RegisteredThread.cpp => mozglue/baseprofiler/core/RegisteredThread.cpp
rename : tools/profiler/core/RegisteredThread.h => mozglue/baseprofiler/core/RegisteredThread.h
rename : tools/profiler/core/ThreadInfo.h => mozglue/baseprofiler/core/ThreadInfo.h
rename : tools/profiler/core/VTuneProfiler.cpp => mozglue/baseprofiler/core/VTuneProfiler.cpp
rename : tools/profiler/core/VTuneProfiler.h => mozglue/baseprofiler/core/VTuneProfiler.h
rename : tools/profiler/core/platform-linux-android.cpp => mozglue/baseprofiler/core/platform-linux-android.cpp
rename : tools/profiler/core/platform-macos.cpp => mozglue/baseprofiler/core/platform-macos.cpp
rename : tools/profiler/core/platform-win32.cpp => mozglue/baseprofiler/core/platform-win32.cpp
rename : tools/profiler/core/platform.cpp => mozglue/baseprofiler/core/platform.cpp
rename : tools/profiler/core/platform.h => mozglue/baseprofiler/core/platform.h
rename : tools/profiler/core/shared-libraries-linux.cc => mozglue/baseprofiler/core/shared-libraries-linux.cc
rename : tools/profiler/core/shared-libraries-macos.cc => mozglue/baseprofiler/core/shared-libraries-macos.cc
rename : tools/profiler/core/shared-libraries-win32.cc => mozglue/baseprofiler/core/shared-libraries-win32.cc
rename : tools/profiler/core/vtune/ittnotify.h => mozglue/baseprofiler/core/vtune/ittnotify.h
rename : tools/profiler/lul/AutoObjectMapper.cpp => mozglue/baseprofiler/lul/AutoObjectMapper.cpp
rename : tools/profiler/lul/AutoObjectMapper.h => mozglue/baseprofiler/lul/AutoObjectMapper.h
rename : tools/profiler/lul/LulCommon.cpp => mozglue/baseprofiler/lul/LulCommon.cpp
rename : tools/profiler/lul/LulCommonExt.h => mozglue/baseprofiler/lul/LulCommonExt.h
rename : tools/profiler/lul/LulDwarf.cpp => mozglue/baseprofiler/lul/LulDwarf.cpp
rename : tools/profiler/lul/LulDwarfExt.h => mozglue/baseprofiler/lul/LulDwarfExt.h
rename : tools/profiler/lul/LulDwarfInt.h => mozglue/baseprofiler/lul/LulDwarfInt.h
rename : tools/profiler/lul/LulDwarfSummariser.cpp => mozglue/baseprofiler/lul/LulDwarfSummariser.cpp
rename : tools/profiler/lul/LulDwarfSummariser.h => mozglue/baseprofiler/lul/LulDwarfSummariser.h
rename : tools/profiler/lul/LulElf.cpp => mozglue/baseprofiler/lul/LulElf.cpp
rename : tools/profiler/lul/LulElfExt.h => mozglue/baseprofiler/lul/LulElfExt.h
rename : tools/profiler/lul/LulElfInt.h => mozglue/baseprofiler/lul/LulElfInt.h
rename : tools/profiler/lul/LulMain.cpp => mozglue/baseprofiler/lul/LulMain.cpp
rename : tools/profiler/lul/LulMain.h => mozglue/baseprofiler/lul/LulMain.h
rename : tools/profiler/lul/LulMainInt.h => mozglue/baseprofiler/lul/LulMainInt.h
rename : tools/profiler/lul/platform-linux-lul.cpp => mozglue/baseprofiler/lul/platform-linux-lul.cpp
rename : tools/profiler/lul/platform-linux-lul.h => mozglue/baseprofiler/lul/platform-linux-lul.h
rename : tools/profiler/moz.build => mozglue/baseprofiler/moz.build
rename : tools/profiler/public/ProfileJSONWriter.h => mozglue/baseprofiler/public/BaseProfileJSONWriter.h
rename : tools/profiler/public/GeckoProfiler.h => mozglue/baseprofiler/public/BaseProfiler.h
rename : tools/profiler/public/ProfilerCounts.h => mozglue/baseprofiler/public/BaseProfilerCounts.h
rename : tools/profiler/public/ProfilerMarkerPayload.h => mozglue/baseprofiler/public/BaseProfilerMarkerPayload.h
rename : tools/profiler/public/shared-libraries.h => mozglue/baseprofiler/public/BaseProfilerSharedLibraries.h
rename : js/public/ProfilingCategory.h => mozglue/baseprofiler/public/BaseProfilingCategory.h
rename : js/public/ProfilingStack.h => mozglue/baseprofiler/public/BaseProfilingStack.h
extra : moz-landing-system : lando
2019-06-04 06:52:15 +00:00
Mike Hommey 4c0ecc6982 Bug 1554063 - Move decimal to mozglue. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D32435

--HG--
rename : mfbt/decimal/Decimal.cpp => mozglue/misc/decimal/Decimal.cpp
rename : mfbt/decimal/Decimal.h => mozglue/misc/decimal/Decimal.h
rename : mfbt/decimal/UPSTREAM-GIT-SHA => mozglue/misc/decimal/UPSTREAM-GIT-SHA
rename : mfbt/decimal/comparison-with-nan.patch => mozglue/misc/decimal/comparison-with-nan.patch
rename : mfbt/decimal/fix-wshadow-warnings.patch => mozglue/misc/decimal/fix-wshadow-warnings.patch
rename : mfbt/decimal/mfbt-abi-markers.patch => mozglue/misc/decimal/mfbt-abi-markers.patch
rename : mfbt/decimal/moz-decimal-utils.h => mozglue/misc/decimal/moz-decimal-utils.h
rename : mfbt/decimal/to-moz-dependencies.patch => mozglue/misc/decimal/to-moz-dependencies.patch
rename : mfbt/decimal/update.sh => mozglue/misc/decimal/update.sh
rename : mfbt/decimal/zero-serialization.patch => mozglue/misc/decimal/zero-serialization.patch
extra : moz-landing-system : lando
2019-05-29 06:57:28 +00:00
Mike Hommey 2abcc3d7cb Bug 1553363 - Generalize the *_impl goop for allocation functions in mozglue. r=froydnj
The current situation is suboptimal, where we have the same goop
repeated in multiple files, and where things kinda sorta work out fine
thanks to the linker for files that would have been forbidden, except
when the linker doesn't do its job, which apparently happen on
mingwclang builds.

This change only really covers C++ code using operator new/delete, and
not things that would be using malloc/free, because it's easier.
malloc/free is left for a followup.

Differential Revision: https://phabricator.services.mozilla.com/D32119

--HG--
extra : moz-landing-system : lando
2019-05-29 22:49:42 +00:00
Ehsan Akhgari 4cb428d268 Bug 1555205 - Move db/sqlite3 to third_party/; r=mak
Differential Revision: https://phabricator.services.mozilla.com/D32939

--HG--
rename : db/sqlite3/README => third_party/sqlite3/README
rename : db/sqlite3/README.MOZILLA => third_party/sqlite3/README.MOZILLA
rename : db/sqlite3/src/moz.build => third_party/sqlite3/src/moz.build
rename : db/sqlite3/src/sqlite.symbols => third_party/sqlite3/src/sqlite.symbols
rename : db/sqlite3/src/sqlite3.c => third_party/sqlite3/src/sqlite3.c
rename : db/sqlite3/src/sqlite3.h => third_party/sqlite3/src/sqlite3.h
extra : moz-landing-system : lando
2019-05-29 10:16:29 +00:00
Masatoshi Kimura 6d9fff0168 Bug 1554380 - Fix some issues in mozilla::ReadAhead. r=aklotz
* CreateFileW will return INVALID_HANDLE_VALUE (-1) on failure, not NULL (0).
* MapViewOfFile will map the entire section if the size is 0. No explicit size
  is required.
* If SEC_IMAGE is specified, the mapped image size may be different from the
  file size on the storage.

Differential Revision: https://phabricator.services.mozilla.com/D32563

--HG--
extra : moz-landing-system : lando
2019-05-29 10:13:28 +00:00
Mihai Alexandru Michis 372773e7f5 Backed out changeset 3edc5be703be (bug 1554063) for mass test failures. CLOSED TREE
--HG--
rename : mozglue/misc/decimal/Decimal.cpp => mfbt/decimal/Decimal.cpp
rename : mozglue/misc/decimal/Decimal.h => mfbt/decimal/Decimal.h
rename : mozglue/misc/decimal/UPSTREAM-GIT-SHA => mfbt/decimal/UPSTREAM-GIT-SHA
rename : mozglue/misc/decimal/comparison-with-nan.patch => mfbt/decimal/comparison-with-nan.patch
rename : mozglue/misc/decimal/fix-wshadow-warnings.patch => mfbt/decimal/fix-wshadow-warnings.patch
rename : mozglue/misc/decimal/mfbt-abi-markers.patch => mfbt/decimal/mfbt-abi-markers.patch
rename : mozglue/misc/decimal/moz-decimal-utils.h => mfbt/decimal/moz-decimal-utils.h
rename : mozglue/misc/decimal/to-moz-dependencies.patch => mfbt/decimal/to-moz-dependencies.patch
rename : mozglue/misc/decimal/update.sh => mfbt/decimal/update.sh
rename : mozglue/misc/decimal/zero-serialization.patch => mfbt/decimal/zero-serialization.patch
2019-05-29 09:54:37 +03:00
Mike Hommey 66cb95a768 Bug 1554063 - Move decimal to mozglue. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D32435

--HG--
rename : mfbt/decimal/Decimal.cpp => mozglue/misc/decimal/Decimal.cpp
rename : mfbt/decimal/Decimal.h => mozglue/misc/decimal/Decimal.h
rename : mfbt/decimal/UPSTREAM-GIT-SHA => mozglue/misc/decimal/UPSTREAM-GIT-SHA
rename : mfbt/decimal/comparison-with-nan.patch => mozglue/misc/decimal/comparison-with-nan.patch
rename : mfbt/decimal/fix-wshadow-warnings.patch => mozglue/misc/decimal/fix-wshadow-warnings.patch
rename : mfbt/decimal/mfbt-abi-markers.patch => mozglue/misc/decimal/mfbt-abi-markers.patch
rename : mfbt/decimal/moz-decimal-utils.h => mozglue/misc/decimal/moz-decimal-utils.h
rename : mfbt/decimal/to-moz-dependencies.patch => mozglue/misc/decimal/to-moz-dependencies.patch
rename : mfbt/decimal/update.sh => mozglue/misc/decimal/update.sh
rename : mfbt/decimal/zero-serialization.patch => mozglue/misc/decimal/zero-serialization.patch
extra : moz-landing-system : lando
2019-05-29 00:59:20 +00:00
Mike Hommey 03cd499c91 Bug 1554078 - Remove now unnecessary STL wrapping. r=chmanchester
Some parts of mozglue used to be STL wrapped because mozalloc used to be
a separate library, but that was changed a while ago (in bug 868814, 4
years ago), and those wrappings are not necessary anymore.

Differential Revision: https://phabricator.services.mozilla.com/D32430

--HG--
extra : moz-landing-system : lando
2019-05-29 00:07:22 +00:00
Sylvestre Ledru d57d4905f1 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D30883

--HG--
extra : moz-landing-system : lando
2019-05-25 17:46:15 +00:00
Nathan Froyd 0839a1bd24 Bug 1542746 - remove code for frontend-based PGO instrumentation; r=dmajor
We're moving to IR-level PGO instrumentation for clang-cl.  We've also
moved to using static linker ordering files, which was the primary
application of the previous style of PGO instrumentation.  We therefore
we no longer need this code.

Differential Revision: https://phabricator.services.mozilla.com/D31134

--HG--
extra : moz-landing-system : lando
2019-05-24 20:00:38 +00:00
arthur.iakab af8e458c5f Backed out changeset a296439a25ff (bug 1519636) for frequent Windows cppunit failures CLOSED TREE 2019-05-24 14:26:01 +03:00
Sylvestre Ledru c82ea97226 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D30883

--HG--
extra : moz-landing-system : lando
2019-05-24 09:59:17 +00:00
Aaron Klotz fa7002c45d Bug 1552362: Ensure that the DLL Interceptor's ADRP decoding treats its immediate operand as signed; r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D31550

--HG--
extra : moz-landing-system : lando
2019-05-20 19:01:00 +00:00
Emilio Cobos Álvarez 9d5285ccb9 Bug 1549762 - Turn the linker inline asm into an assembly file. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D31051

--HG--
extra : moz-landing-system : lando
2019-05-16 01:02:00 +00:00
Emilio Cobos Álvarez c74f3a885b Bug 1549762 - Don't build mozglue linker tests if building with icecream. r=glandium
As icecream doesn't deal well with .incbin.

Differential Revision: https://phabricator.services.mozilla.com/D30951

--HG--
extra : moz-landing-system : lando
2019-05-15 13:40:23 +00:00
David Parks 5730f5fc1c Bug 1546546: Part 3 - TestDllInterceptor must leave intercepted functions operable r=aklotz
In part 1, we disabled the unhooking of DLL-intercepted functions at shutdown.  The TestDllInterceptor relied on unhooking -- it worked by hooking functions with a "nonsense function" (nullptr) and then immediately unhooking it.  That restored the original function behavior.  Some hooked functions (e.g. NtWriteFile) are used by functions later in the program (e.g. printf) so the functions need to maintain their behavior.

This patch replaces the nonsense function with an identity function that also sets a global boolean as a side-effect.  The function is written in machine code.  x86-32, x86-64, and aarch64 variants are included.

Differential Revision: https://phabricator.services.mozilla.com/D30244

--HG--
extra : moz-landing-system : lando
2019-05-08 00:26:59 +00:00
David Parks c005eb91b7 Bug 1546546: Part 2 - Pass a real CredHandle to relevant TestDllInterceptor functions r=aklotz
QueryCredentialsAttributesA and FreeCredentialsHandle trigger an exception when null is passed for the CredHandle pointer.  This exception was ignored (when not run in the debugger) but that is no longer the case with the changes in part 3.  This patch passes a real CredHandle to them.

Differential Revision: https://phabricator.services.mozilla.com/D30243

--HG--
extra : moz-landing-system : lando
2019-05-08 00:26:16 +00:00
David Parks b4dbd0065b Bug 1546546: Part 1 - Never unhook DLL-intercepted functions upon VMSharingPolicyShared destruction r=aklotz
This patch fixes a static destructor order dependency between WindowsDllInterceptor and VMSharingPolicyUnique by telling VMSharingPolicyShared not to access the VMSharingPolicyUnique at destruction.  This means that the behavior of intercepted functions is no longer restored in the given process at policy shutdown time.

Differential Revision: https://phabricator.services.mozilla.com/D28764

--HG--
extra : moz-landing-system : lando
2019-05-08 00:25:35 +00:00
Aaron Klotz 6540251ed0 Bug 1545355: Uppercase hash tags before calling WinVerifyTrust on catalog files; r=mhowell
On Windows 7, WinVerifyTrust fails unless the tag is uppercased. This patch
also adds a missing call to CryptCATAdminReleaseCatalogContext, the need for
which was poorly documented on MSDN.

Differential Revision: https://phabricator.services.mozilla.com/D30146

--HG--
extra : moz-landing-system : lando
2019-05-07 16:58:24 +00:00
Sylvestre Ledru e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

Differential Revision: https://phabricator.services.mozilla.com/D28956

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Kartikaya Gupta 0ce8311834 Bug 1544435 - Block wbload.dll as it causes GPU process crashes. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D29378

--HG--
extra : moz-landing-system : lando
2019-04-30 18:22:53 +00:00
Aaron Klotz 70900309f0 Bug 1535704: Part 2 - Add a hook to sandbox target initialization that catches mscom's attempts to resolve user32 when Win32k lockdown is enabled; r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D27833

--HG--
extra : moz-landing-system : lando
2019-04-22 21:38:36 +00:00
David Parks 406cc6afbf Bug 1546545: Part 2 - Create empty TrampolineCollection if the process sandbox forbids dynamic code r=aklotz
TrampolineCollection iterates over an array of Trampolines that it has set 'write' permissions for.  If this happens in a process whose sandbox forbids dynamic code then these permissions cannot be set.  This patch detects that condition and returns an empty TrampolineCollection in that case.  We ASSERT if we fail to set permissions for any other reason.

Differential Revision: https://phabricator.services.mozilla.com/D28613

--HG--
extra : moz-landing-system : lando
2019-04-29 21:07:20 +00:00
David Parks d9d0882177 Bug 1546545: Part 1 - Properly store pointer to sandboxed DLL intercepted method r=aklotz
Bug 1533808 introduced code to intercept DLL methods that the Chromium sandbox had already intercepted.  That patch did not store the the pointer to the intercepted function in the trampoline data, as is done when intercepting other methods.

Differential Revision: https://phabricator.services.mozilla.com/D28612

--HG--
extra : moz-landing-system : lando
2019-04-26 00:49:32 +00:00
Sylvestre Ledru 96da5036ad Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D28948

--HG--
extra : moz-landing-system : lando
2019-04-28 09:30:05 +00:00
Aaron Klotz c2bb05fdfb Bug 1547113: Add support for section table parsing to nt::PEHeaders; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D28905

--HG--
extra : moz-landing-system : lando
2019-04-26 15:55:11 +00:00
Mike Hommey e12a4b2881 Bug 1546587 - Convert TestZip to a gtest. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D28759

--HG--
extra : moz-landing-system : lando
2019-04-25 23:41:50 +00:00
Mike Hommey 36b33e0796 Bug 1546587 - Include the TestZip zip files as binary data. r=froydnj
We're going to convert the test to a gtest, and it's simpler not to have
to deal with finding the path to the testcase zip files. They're small
enough anyways, and can be inserted as raw binary data via some assembly
magic. This being android-only code, we don't need extreme portability
here. This is the same trick we use in
config/external/icu/data/icudata_gas.S.

Differential Revision: https://phabricator.services.mozilla.com/D28758

--HG--
extra : moz-landing-system : lando
2019-04-25 23:41:47 +00:00
Mike Hommey cf749be8f7 Bug 1546587 - Modernize loops in TestZip. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D28757

--HG--
extra : moz-landing-system : lando
2019-04-25 23:41:45 +00:00
Dorel Luca cf86de4259 Backed out changeset 3096a547bb84 (bug 1546546) for Cpp failures in TestDllInterceptor.exe. CLOSED TREE 2019-04-26 00:52:11 +03:00
David Parks a138049df1 Bug 1546546: Never unhook DLL-intercepted methods upon VMSharingPolicyShared destruction r=aklotz
This patch fixes a static destructor order dependency between WindowsDllInterceptor and VMSharingPolicyUnique by telling VMSharingPolicyShared not to access the VMSharingPolicyUnique at destruction.  See the bug for details of the order dependency.

Differential Revision: https://phabricator.services.mozilla.com/D28764

--HG--
extra : moz-landing-system : lando
2019-04-25 17:10:24 +00:00
Aaron Klotz 5a16846aa3 Bug 1535704: Part 1 - Move IsWin32kLockedDown into mozglue; r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D27832

--HG--
extra : moz-landing-system : lando
2019-04-22 19:13:23 +00:00
Sylvestre Ledru a1dce6440a Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D28329

--HG--
extra : moz-landing-system : lando
2019-04-22 16:35:03 +00:00
Geoff Brown a58ba7930b Bug 1530874 - Version the mozglue symbols on Android. r=froydnj
See comment 24 in the bug for details on what can go wrong without this
change. This change ensures system libraries are not going to pick
symbols from mozglue when running processes outside dalvik.

As a side effect, this makes things kind of closer to what happens when
dalvik is involved, exposing unit tests to possible allocator mismatches
that could happen like bug 1531887.

On the flip side, libraries that link against mozglue explicitly are
going to get a reference to the versioned symbols, so everything is fine
in that regard. The custom linker, however, will ignore the versions
altogether, and its symbols resolution just ends up unchanged. So we're
fine there too.

We use something that is close to what using a SYMBOLS_FILE would
generate as a version script, but we need to do so manually because
SYMBOLS_FILE doesn't support exporting all the symbols.

Differential Revision: https://phabricator.services.mozilla.com/D28030

--HG--
extra : moz-landing-system : lando
2019-04-18 21:39:10 +00:00
Mike Hommey 777665d869 Bug 1545007 - Remove our pthread_atfork implementation for Android. r=froydnj
Bug 884239 added a build-time Android version check around the
pthread_atfork function definition at the same time as for timer_create,
which was subsequently removed. But it turns out the version that
documented was wrong: per the comment added in bug 680190,
pthread_atfork might have been supported since Android 2.3 (gingerbread,
API 9 or 10). That might not be entirely accurate, though, because the
bionic repository seems to show it made it to Android 4.0 (ice cream
sandwich, API 14 or 15).

Either way, that is less than the minimum API version we currently
support, which is 16.

Differential Revision: https://phabricator.services.mozilla.com/D27848

--HG--
extra : moz-landing-system : lando
2019-04-17 18:26:02 +00:00
Aaron Klotz 1a74deabad Bug 1503538: Part 3 - Changes to NativeNt and ImportDir to allow for blocking injected static DLL dependencies; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D27145

--HG--
extra : moz-landing-system : lando
2019-04-12 19:58:01 +00:00
Doug Thayer 2d3776cd66 Bug 1538279 - Only readahead DLLs in parent process r=glandium
There shouldn't be any need to do this for content processes as
the DLL should already be in the system file cache.

Differential Revision: https://phabricator.services.mozilla.com/D26017

--HG--
extra : moz-landing-system : lando
2019-04-13 18:46:13 +00:00
Cosmin Sabou c64f16b342 Backed out 3 changesets (bug 1538279) for mass test failures. CLOSED TREE
Backed out changeset af07f58d18cc (bug 1538279)
Backed out changeset 508ee4cf9ea2 (bug 1538279)
Backed out changeset 6f2e7c819c11 (bug 1538279)
2019-04-12 07:47:53 +03:00
Doug Thayer 13a4a8518f Bug 1538279 - Only readahead DLLs in parent process r=glandium
There shouldn't be any need to do this for content processes as
the DLL should already be in the system file cache.

Differential Revision: https://phabricator.services.mozilla.com/D26017

--HG--
extra : moz-landing-system : lando
2019-04-12 02:17:48 +00:00
Mike Hommey 492bd126b6 Bug 1543555 - Stop using our linker to resolve libc/libm symbols when not strictly necessary. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D27019

--HG--
extra : moz-landing-system : lando
2019-04-12 02:12:31 +00:00
Sylvestre Ledru 03fc65347c Bug 1542146 - Apply the change with the option StatementMacros from clang-format-8 r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26280

--HG--
extra : moz-landing-system : lando
2019-04-05 21:42:17 +00:00
Csoregi Natalia ba58e936bd Backed out changeset 4ad80127f89f (bug 1519636) for bustage on MarkupMap.h and nsAccessibilityService.cpp. CLOSED TREE 2019-04-05 09:48:19 +03:00
Sylvestre Ledru d1c1878603 Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
2019-04-04 21:36:16 +00:00
Narcis Beleuzu 24dbe577a5 Backed out changeset 389b6bbd76db (bug 1519636) for bustages on MarkupMap.h . CLOSED TREE 2019-04-05 00:27:56 +03:00
Sylvestre Ledru 399dbd28fe Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
2019-04-04 20:12:23 +00:00
Aaron Klotz 87690b594c Bug 1541597: Modify PEHeaders to use NumberOfRvaAndSizes as maximum DataDirectory length; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D26012

--HG--
extra : moz-landing-system : lando
2019-04-03 21:56:24 +00:00
Cameron McCormack eedb6aebd4 Bug 1538081 - Part 3: Add operator<<(ostream&) definitions for a few common types. r=froydnj,gerald
Depends on D25023

Differential Revision: https://phabricator.services.mozilla.com/D25024

--HG--
extra : moz-landing-system : lando
2019-03-30 04:26:26 +00:00
Nathan Froyd dc25b5a9dc Bug 1539605 - add fast paths for integer formatting on nsTSubstring; r=erahm
This way we don't have to go through a bunch of printf nonsense, and we
ought to be able to arrive at optimized routines that take advantage of
constant radices, etc.

Differential Revision: https://phabricator.services.mozilla.com/D25141

--HG--
extra : moz-landing-system : lando
2019-03-29 19:38:53 +00:00
David Parks 20b6a59a5e Bug 1533808: Recognize Chromium-sandboxed methods in WindowsDllInterceptor r=aklotz
Due to coming changes involving the IOInterposer, the WindowsDllInterceptor may be set up later than the sandbox.  The sandbox hooks some of the same functions, so the Interceptor is running into its hooks instead of the original implementations it anticipated.  This patch allows it to recognize and efficiently patch those hooks when that happens.

Differential Revision: https://phabricator.services.mozilla.com/D24654

--HG--
extra : moz-landing-system : lando
2019-03-29 22:57:14 +00:00
John Lin 529784a956 Bug 1308405 - p3: Use sample buffer class directly. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D24589

--HG--
rename : mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SharedMemBuffer.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SampleBuffer.java
extra : moz-landing-system : lando
2019-03-28 18:06:19 +00:00
Karl Tomlinson c58553bcfd Bug 1536316 remove suggestion that spurious condition variable wakeups are magically handled by ConditionVariableImpl r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D23983

--HG--
extra : moz-landing-system : lando
2019-03-25 12:41:19 +00:00
Mike Shal e39a3d6b7c Bug 632954 - Add an explicit __llvm_profile_dump() call for Android; r=snorp
When Android shuts down the ndk process, it doesn't call the registered
atexit() handlers, which is normally where the profile data gets written
to file. Since the PGO test suite closes the browser when it is
finished, the nativeRun routine can manually call out to
__llvm_profile_dump() before returning.

This method has a downside that only the profile data from the calling
library gets written out, rather than for the whole process. Since we
are most interested in optimizing libxul, a new hook is added in
Bootstrap to make sure we get the profile data for the right library.

Differential Revision: https://phabricator.services.mozilla.com/D22817

--HG--
extra : source : 0615c775a0cf6e8f98e1c051cd574c0d602a738a
2019-03-18 23:52:31 +00:00
Noemi Erli b61340c4b0 Backed out 12 changesets (bug 632954) for causing Android Bpgo(run) pending jobs CLOSED TREE
Backed out changeset 429c96e4de32 (bug 632954)
Backed out changeset de8beacc5eb4 (bug 632954)
Backed out changeset c151ebf303ca (bug 632954)
Backed out changeset b96dd954a456 (bug 632954)
Backed out changeset 26031d362333 (bug 632954)
Backed out changeset 097f141a499d (bug 632954)
Backed out changeset 6f5fc0d644dd (bug 632954)
Backed out changeset 53d3443e55d9 (bug 632954)
Backed out changeset 503bcac73583 (bug 632954)
Backed out changeset 142ae187478d (bug 632954)
Backed out changeset 0615c775a0cf (bug 632954)
Backed out changeset 3dfc0e4f8e7c (bug 632954)
2019-03-20 11:58:18 +02:00
Mike Shal 14770d9dbf Bug 632954 - Add an explicit __llvm_profile_dump() call for Android; r=snorp
When Android shuts down the ndk process, it doesn't call the registered
atexit() handlers, which is normally where the profile data gets written
to file. Since the PGO test suite closes the browser when it is
finished, the nativeRun routine can manually call out to
__llvm_profile_dump() before returning.

This method has a downside that only the profile data from the calling
library gets written out, rather than for the whole process. Since we
are most interested in optimizing libxul, a new hook is added in
Bootstrap to make sure we get the profile data for the right library.

Differential Revision: https://phabricator.services.mozilla.com/D22817

--HG--
extra : moz-landing-system : lando
2019-03-18 23:52:31 +00:00
Sylvestre Ledru 4aa92e3091 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D22514
2019-03-13 10:19:06 +01:00
Carl Corcoran d6d1ff2060 Bug 1503538 Part 1/5: Move printf_stderr to a shared header r=aklotz
In the tree we have two copies of printf_stderr() with the comment,
"Ideally this should be shared". This moves the function to a new exported
header which can be the basis for other similar debugging utility functions.

To include it,
#include "mozilla/glue/Debug.h"

A small concern with this is that printf_stderr() is in the global namespace,
and could conflict if it's inadvertently included along with, for example,
nsDebug.h which also defines this function. The warning in the comment at the
top of the file attempts to mitigate this.

Differential Revision: https://phabricator.services.mozilla.com/D13196

--HG--
extra : moz-landing-system : lando
2019-03-06 00:51:15 +00:00
Ryan Hunt 1954ab0781 Bug 1523969 part 18 - Move method definition inline comments to new line in mozglue. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D21119

--HG--
extra : rebase_source : 5f5f0457fc136bc9e3c8edb315e4b7e6275ec3c2
2019-02-25 16:10:53 -06:00
Aaron Klotz 7f14366c55 Bug 1529647: Fix a straggling unused variable warning; r=dmajor
Differential Revision: https://phabricator.services.mozilla.com/D20856

--HG--
extra : moz-landing-system : lando
2019-02-22 19:28:57 +00:00
Aaron Klotz 28466cb97e Bug 1460433: Part 1 - Change BasicDllServices to not do any dll notification callbacks; r=mhowell
BasicDllServices is used to gain access to the authenticode APIs in non-Gecko
contexts. One feature that WinDllServices provides is the ability to register
a callback interface to be notified when a DLL has been loaded.

This is not particularly useful in the BasicDllServices use case, and in the
"handle a launcher process failure on a background thread" use case, would
actually be harmful.

This patch modifies the DLLServices backend to offer a "basic" option that
omits the callback stuff.

Differential Revision: https://phabricator.services.mozilla.com/D19696

--HG--
extra : moz-landing-system : lando
2019-02-20 06:18:45 +00:00
Aaron Klotz 0146031967 Bug 1526016: Get TestDllInterceptor building on aarch64 builds; r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D19447

--HG--
extra : moz-landing-system : lando
2019-02-21 18:42:42 +00:00
Aaron Klotz 67bda80b52 Bug 1526383: Add essential arm64 support to nsWindowsDllInterceptor; r=handyman
This patch doesn't cover all possible functions for which we currently
instantiate interceptors inside Firefox/Gecko. Rather than asserting, we just
fail in those cases (at least until we have full coverage of existing uses).

This is okay, as for the upcoming milestone 2 of aarch64 builds, we are most
concerned with successfully being able to hook the following functions:

ntdll!LdrLoadDll
ntdll!LdrUnloadDll
ntdll!LdrResolveDelayLoadedAPI
user32!GetWindowInfo

So, within that context, the aarch64 implementation is fairly simple:

Each instruction is 4-bytes wide. We iterate down each instruction, and if the
current instruction is *not* PC-relative, we just copy it verbatim. If we
encounter an instruction that *is* PC-relative, we either decode it and
rewrite it inside the trampoline, or we fail. For the purposes of milestone 2,
the only instruction that is essential to decode is ADRP.

In bug 1526016 I modify TestDllInterceptor to exclude functions that are not
yet supported by this patch.

Differential Revision: https://phabricator.services.mozilla.com/D19446

--HG--
extra : moz-landing-system : lando
2019-02-21 18:41:17 +00:00
Cosmin Sabou 9f8b29287b Merge mozilla-central to autoland. 2019-02-21 05:43:34 +02:00
Masatoshi Kimura e59e3b3e20 Bug 1528651 - Fix some trivial warnings and re-enable warnings-as-errors on Windows in some directories. r=dmajor
--HG--
extra : source : 5ee9efeda9e67f6af0521be85266703763cc4c50
2019-02-19 20:42:11 +09:00
Gerald Squelart 4fad2ecf62 Bug 1528842 - Disable ASAN checks in FramePointerStackWalk - r=glandium
FramePointerStackWalk can trip ASAN when walking the stack and reading outside
of ASAN-protected objects.

Differential Revision: https://phabricator.services.mozilla.com/D20208

--HG--
extra : moz-landing-system : lando
2019-02-20 05:01:12 +00:00
Masatoshi Kimura e25fbce870 Bug 1528651 - Re-enable warnings-as-errors on Windows in some directories. r=dmajor
--HG--
extra : source : ba86ea25070b37f4725834e1c2d9ec4c0783e119
2019-02-17 15:03:02 +09:00
Markus Stange 0b151b8c2b Bug 1500692 - Centralize profiling category definition and add infrastructure for subcategories. r=njn
The actual subcategories will be added in later patches, so that there are no
unused categories.

Differential Revision: https://phabricator.services.mozilla.com/D11334

--HG--
extra : moz-landing-system : lando
2019-02-16 17:37:43 +00:00
Mike Hommey 2980c6fe0b Bug 1512504 - Remove now unused CFG test. r=tjr
Depends on D19615

Differential Revision: https://phabricator.services.mozilla.com/D19616

--HG--
extra : moz-landing-system : lando
2019-02-14 18:56:29 +00:00
Mike Hommey ef3ad686ee Bug 1512504 - Remove support for MSVC. r=froydnj
Consequently, this removes:
- MOZ_LIBPRIO, which is now always enabled.
- non_msvc_compiler, which is now always true.
- The cl.py wrapper, since it's not used anymore.
- CL_INCLUDES_PREFIX, which was only used for the cl.py wrapper.
- NONASCII, which was only there to ensure CL_INCLUDES_PREFIX still
  worked in non-ASCII cases.

This however keeps a large part of detecting and configuring for MSVC,
because we still do need it for at least headers, libraries, and midl.

Depends on D19614

Differential Revision: https://phabricator.services.mozilla.com/D19615

--HG--
extra : moz-landing-system : lando
2019-02-14 21:45:27 +00:00
Aaron Klotz 84c01f8930 Bug 1400344: Rename mscom::MainThreadRuntime to mscom::ProcessRuntime and make it aware of Win32k lockdown and of multiple instantiations; r=Jamie
This patch takes care of a bunch of issues and does some cleanup:

* We rename mscom::MainThreadRuntime to mscom::ProcessRuntime, as the latter
  is a more accurate name going forward.
* We make ProcessRuntime aware of the Win32k Lockdown process mitigation
  policy. When Win32k is disabled, we perform process-wide COM initialization
  in the multi-threaded apartment (since we cannot create an STA window).
* We refactor the mscom apartment region stuff to enable the Win32k lockdown
  pieces in ProcessRuntime.
* We move some Gecko-specific stuff into MOZILLA_INTERNAL_API guards so that
  ProcessRuntime is usable outside of xul.dll (I will be needing it for the
  launcher process).
* Another thing that might happen with the launcher process is that, under
  error conditions in the launcher, we create a ProcessRuntime object on a
  background thread for the purposes of telemetry logging, but we also allow
  the main thread to proceed to start as the browser. This could result in a
  scenario where the main thread, as the browser process, is attempting to
  instantiate its ProcessRuntime and ends up racing with the launcher process's
  telemetry thread which has its own ProcessRuntime. To account for this
  situation, we add mutual exclusion to the process-wide initialization code.
  We host this part inside mozglue since that state is shared between both
  firefox.exe and xul.dll.
* We clean up ProcessRuntime::InitializeSecurity by using Vector to set up
  the EXPLICIT_ACCESS entries.
* We remove mscom::MainThreadClientInfo and replace it with a direct call to
  CoGetCallerTID
* We revise all references to this class to use the new name.

Differential Revision: https://phabricator.services.mozilla.com/D19551

--HG--
rename : ipc/mscom/COMApartmentRegion.h => ipc/mscom/ApartmentRegion.h
rename : ipc/mscom/MainThreadRuntime.cpp => ipc/mscom/ProcessRuntime.cpp
rename : ipc/mscom/MainThreadRuntime.h => ipc/mscom/ProcessRuntime.h
extra : moz-landing-system : lando
2019-02-14 18:56:20 +00:00
Dorel Luca 67115dd61b Backed out changeset 2d4b8d90cbd7 (bug 1400344) for Spider monkey failrues. CLOSED TREE
--HG--
rename : ipc/mscom/ApartmentRegion.h => ipc/mscom/COMApartmentRegion.h
rename : ipc/mscom/ProcessRuntime.cpp => ipc/mscom/MainThreadRuntime.cpp
rename : ipc/mscom/ProcessRuntime.h => ipc/mscom/MainThreadRuntime.h
2019-02-14 20:45:26 +02:00
Aaron Klotz 0cb12a123a Bug 1400344: Rename mscom::MainThreadRuntime to mscom::ProcessRuntime and make it aware of Win32k lockdown and of multiple instantiations; r=Jamie
This patch takes care of a bunch of issues and does some cleanup:

* We rename mscom::MainThreadRuntime to mscom::ProcessRuntime, as the latter
  is a more accurate name going forward.
* We make ProcessRuntime aware of the Win32k Lockdown process mitigation
  policy. When Win32k is disabled, we perform process-wide COM initialization
  in the multi-threaded apartment (since we cannot create an STA window).
* We refactor the mscom apartment region stuff to enable the Win32k lockdown
  pieces in ProcessRuntime.
* We move some Gecko-specific stuff into MOZILLA_INTERNAL_API guards so that
  ProcessRuntime is usable outside of xul.dll (I will be needing it for the
  launcher process).
* Another thing that might happen with the launcher process is that, under
  error conditions in the launcher, we create a ProcessRuntime object on a
  background thread for the purposes of telemetry logging, but we also allow
  the main thread to proceed to start as the browser. This could result in a
  scenario where the main thread, as the browser process, is attempting to
  instantiate its ProcessRuntime and ends up racing with the launcher process's
  telemetry thread which has its own ProcessRuntime. To account for this
  situation, we add mutual exclusion to the process-wide initialization code.
  We host this part inside mozglue since that state is shared between both
  firefox.exe and xul.dll.
* We clean up ProcessRuntime::InitializeSecurity by using Vector to set up
  the EXPLICIT_ACCESS entries.
* We remove mscom::MainThreadClientInfo and replace it with a direct call to
  CoGetCallerTID
* We revise all references to this class to use the new name.

Differential Revision: https://phabricator.services.mozilla.com/D19551

--HG--
rename : ipc/mscom/COMApartmentRegion.h => ipc/mscom/ApartmentRegion.h
rename : ipc/mscom/MainThreadRuntime.cpp => ipc/mscom/ProcessRuntime.cpp
rename : ipc/mscom/MainThreadRuntime.h => ipc/mscom/ProcessRuntime.h
extra : moz-landing-system : lando
2019-02-14 16:40:58 +00:00
Eric Rahm e75dbf47de Bug 1520962 - Update stackwalking bounds check to avoid aStackEnd. r=dmajor
Differential Revision: https://phabricator.services.mozilla.com/D19210

--HG--
extra : moz-landing-system : lando
2019-02-08 20:22:21 +00:00
Tom Ritter dba455e2b4 Bug 1525644 - Remove MSVC-enabled CFG flags r=dmajor
We no longer ship or support MSVC builds. This is just taking up space.
2019-02-06 11:44:56 -06:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
David Major b141aa3e7b Bug 1520880: Silence an unused variable warning in the stubbed-out ARM64 interceptor. r=aklotz 2019-01-17 21:59:06 -05:00
Gabriele Svelto a27ca2c584 Bug 1516983 - Add the FRAPS .dll to the blocklist r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D15524

--HG--
extra : moz-landing-system : lando
2019-01-16 19:33:45 +00:00
Carl Corcoran 63ba2c68d7 Bug 1518490 Part 1/3: Measure DLL load timings and pass into UntrustedModulesManager r=aklotz
This patch measures the duration of module loads and passes it up to
UntrustedModulesManager where, in later patches, it will be consumed by
telemetry.

Differential Revision: https://phabricator.services.mozilla.com/D16011

--HG--
extra : moz-landing-system : lando
2019-01-15 10:49:36 +00:00
Chris Martin 31a8e2ccae Bug 1508312 - Add assert to catch accidental re-enter of Slim RW lock r=ccorcoran,aklotz
WindowsDllBlocklist installs a callback function that fires whenever a DLL
is loaded. The installer function shares an SRWLock with the callback
function.

SRWLock is not re-entrant, so if the installer function accidently causes a
DLL load before releasing the lock, the callback function will deadlock.

This occured trying to solve Bug 1402282, where the installer function used
"new" to allocate memory, which called the Win32 "RtlGenRandom()" function,
which loaded bcrypt.dll, which caused the callback to fire off, which tried
to lock the mutex that was already locked by the installer function.

Hopefully this will save another developer lots of debug time in the future by
turning a difficult-to-debug deadlock into a nice, loud assertion.

Differential Revision: https://phabricator.services.mozilla.com/D15840

--HG--
extra : moz-landing-system : lando
2019-01-16 01:21:16 +00:00
Aaron Klotz 99ef8003dd Bug 1511078: Add LauncherRegistryInfo as a temporary mechanism for runtime disabling of launcher process; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D15756

--HG--
rename : browser/app/winlauncher/NativeNt.h => mozglue/misc/NativeNt.h
rename : browser/app/winlauncher/test/TestNativeNt.cpp => mozglue/tests/TestNativeNt.cpp
rename : browser/app/winlauncher/LauncherResult.h => toolkit/xre/LauncherResult.h
extra : moz-landing-system : lando
2019-01-15 23:10:00 +00:00
Coroiu Cristina d263400b1c Backed out 2 changesets (bug 1511078) for build bustages at Unified_cpp_toolkit_xre0.obj
Backed out changeset 61a47d6d5e26 (bug 1511078)
Backed out changeset 006df494925a (bug 1511078)

--HG--
rename : toolkit/xre/LauncherResult.h => browser/app/winlauncher/LauncherResult.h
rename : mozglue/misc/NativeNt.h => browser/app/winlauncher/NativeNt.h
rename : mozglue/tests/TestNativeNt.cpp => browser/app/winlauncher/test/TestNativeNt.cpp
2019-01-15 23:15:50 +02:00
Aaron Klotz 3171e2da60 Bug 1511078: Follow-up - fix mingw build failures for TestNativeNt; r=bustage 2019-01-15 13:39:49 -07:00
Aaron Klotz 64310051e7 Bug 1511078: Add LauncherRegistryInfo as a temporary mechanism for runtime disabling of launcher process; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D15756

--HG--
rename : browser/app/winlauncher/NativeNt.h => mozglue/misc/NativeNt.h
rename : browser/app/winlauncher/test/TestNativeNt.cpp => mozglue/tests/TestNativeNt.cpp
rename : browser/app/winlauncher/LauncherResult.h => toolkit/xre/LauncherResult.h
extra : moz-landing-system : lando
2019-01-15 20:19:46 +00:00
Mike Hommey 106cde5e98 Bug 1519744 - Remove MOZ_GLUE_WRAP_LDFLAGS. r=dmajor
It's been unused since NUWA was removed in bug 1284674.

Differential Revision: https://phabricator.services.mozilla.com/D16426

--HG--
extra : moz-landing-system : lando
2019-01-14 16:58:34 +00:00
Jacek Caban 10da17814d Bug 1515982 - Don't use RT_MANIFEST in mozglue.rc file. r=froydnj
It's a define that needs winuser.rh to be included.

MozReview-Commit-ID: LPfJOwnNm6V

Differential Revision: https://phabricator.services.mozilla.com/D15333

--HG--
extra : moz-landing-system : lando
2019-01-12 06:44:11 +00:00
shindli eae80bd903 Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-01-09 23:45:39 +02:00
Tom Tromey 18e18bcdb3 Bug 1517433 - do not assert on over-long float printf; r=froydnj
mozilla::PrintfTarget::cvt_f release asserts that the desired printf
fit into a statically-sized buffer.  However, this may not be the case
if the user requested a larger width or precision.  Handle this
unusual case by allocating a temporary buffer.

MozReview-Commit-ID: 2WicecHDzDR

Differential Revision: https://phabricator.services.mozilla.com/D15989

--HG--
extra : moz-landing-system : lando
2019-01-09 15:50:27 +00:00
Nathan Froyd 42bd2abf83 Bug 1062533 - part 4 - expose a tryLock method for PlatformMutex; r=mccr8
Chromium IPC locks have this and the API gets used, so we need to expose
it ourselves if we're going to use our locks in place of the Chromium
IPC locks.  This patch changes the mozglue parts; tweaking the xpcom
parts is the next patch.
2019-01-09 11:09:24 -04:00
David Parks a19f3aae29 Bug 1505482: Allow DLL patcher to resolve some backward short JMPs (r=aklotz)
In Windows 7 x64, GetFileAttributesW begins with a short, backwards jump that can't safely be converted by the interceptor.  Additionally, the function doesn't have enough NOP space after the JMP for the trampoline.  However, the target of the short JMP is a long JMP, followed by plenty of NOP space.  This patch moves the trampoline location from the first JMP to the second.

Differential Revision: https://phabricator.services.mozilla.com/D11258

--HG--
extra : moz-landing-system : lando
2018-12-26 17:28:37 +00:00
Carl Corcoran b2b3ea7d03 Bug 1513176: Prevent mozglue.dll from appearing erroneously in the untrusted modules ping;r=aklotz
Nightly is reporting mozglue.dll as being untrusted in the untrusted modules
ping. Until now, xpcshell tests hard-code mozglue to appear as untrusted in
order to cover certain code paths related to startup modules.

This patch:
1. Checks explicitly for the xpcshell environment and only applies this logic
   during xpcshell tests.
2. Uses a purpose-build DLL, "untrusted-startup-test-dll.dll", instead of
   mozglue. This is more explicit and doesn't interfere with any "true"
   processing of mozglue.

Differential Revision: https://phabricator.services.mozilla.com/D14720

--HG--
extra : moz-landing-system : lando
2018-12-24 21:04:13 +00:00
Mike Hommey e8843c3a0b Bug 1513088 - Switch aarch64-windows MozStackWalk code to RtlVirtualUnwind. r=froydnj
As far as my stepping through WalkStackMain64 goes, it seems StackWalk64
doesn't work, even with more information added to the frame data it's
given.

Switching to the same code as for x86-64, however, works, albeit
skipping too many frames, but all platforms are actually skipping too
many frames, so let's ignore that for now and leave it to bug 1515229.

Differential Revision: https://phabricator.services.mozilla.com/D14929

--HG--
extra : moz-landing-system : lando
2018-12-19 20:14:17 +00:00
Tooru Fujisawa 7983faeb5d Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09:00
Benjamin Bouvier a7f1d173a0 Bug 1511383: Update vim modelines after clang-format; r=sylvestre
- modify line wrap up to 80 chars; (tw=80)
- modify size of tab to 2 chars everywhere; (sts=2, sw=2)

--HG--
extra : rebase_source : 7eedce0311b340c9a5a1265dc42d3121cc0f32a0
extra : amend_source : 9cb4ffdd5005f5c4c14172390dd00b04b2066cd7
2018-11-30 16:39:55 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Ehsan Akhgari 490e611801 Bug 1508472 - Part 5: Fifth batch of comment fix-ups in preparation for the tree reformat r=sylvestre
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal. I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.

Differential Revision: https://phabricator.services.mozilla.com/D13371

--HG--
extra : moz-landing-system : lando
2018-11-29 10:30:46 +00:00
Honza Bambas 743553b81f Bug 1487778 - Protect QueryPerformanceCounter against going backward, r=froydnj 2018-11-26 03:08:00 +02:00
James Willcox 992335e0bf Bug 1486524 - Don't use XZ compression for libs on Android r=glandium,nalexander
This also uses idiomatic packaging of the native libraries, which
will allow easier downstream consumption of GeckoView.

Differential Revision: https://phabricator.services.mozilla.com/D10775

--HG--
extra : moz-landing-system : lando
2018-11-23 20:31:57 +00:00
Aaron Klotz 83877256da Bug 1495512: Part 2 - Add test for 10-byte DLL interception; r=handyman
Added a test to TestCrossProcessInterceptor that forcibly uses a 10-byte patch
on NtMapViewOfSection (which is a realistic case) and then ensures that
disabling the hook also works.

Differential Revision: https://phabricator.services.mozilla.com/D10286

--HG--
extra : moz-landing-system : lando
2018-11-23 05:57:01 +00:00
Aaron Klotz b1df9cbd91 Bug 1495512: Part 1 - DLL Interceptor - Add capability to do 10-byte detour patches against ntdll; r=handyman
This patch adds support on x64 for 10-byte detour patches in certain cases.
In particular, the reserved region of trampoline memory must be allocated
within the bottommost 2GB of the address space.

This feature is currently only activated when detouring functions exported by
ntdll.dll.

Differential Revision: https://phabricator.services.mozilla.com/D10285

--HG--
extra : moz-landing-system : lando
2018-11-23 05:56:42 +00:00
Cosmin Sabou 49e2a3a0cf Backed out changeset 1e076b0054cc (bug 1486524) for toolchains gradle bustages. CLOSED TREE 2018-11-21 18:01:10 +02:00
James Willcox 976e18d241 Bug 1486524 - Don't use XZ compression for libs on Android r=glandium,nalexander
This also uses idiomatic packaging of the native libraries, which
will allow easier downstream consumption of GeckoView.

Differential Revision: https://phabricator.services.mozilla.com/D10775

--HG--
extra : moz-landing-system : lando
2018-11-21 15:21:59 +00:00
Andreea Pavel 9351d666e7 Backed out changeset 2bc6db0a2574 (bug 1486524) android raptor failures ona CLOSED TREE 2018-11-14 23:04:59 +02:00
James Willcox b97296cf79 Bug 1486524 - Don't use XZ compression for libs on Android r=glandium,nalexander
This also uses idiomatic packaging of the native libraries, which
will allow easier downstream consumption of GeckoView.

Differential Revision: https://phabricator.services.mozilla.com/D10775

--HG--
extra : moz-landing-system : lando
2018-11-14 17:48:58 +00:00
Bogdan Tara 0f6f614304 Backed out 2 changesets (bug 1495512) for Windows build bustages CLOSED TREE
Backed out changeset 0cd30c3d9b30 (bug 1495512)
Backed out changeset 7ae82cae37d9 (bug 1495512)
2018-11-14 05:09:12 +02:00
Aaron Klotz d318ffbb7a Bug 1495512: Part 2 - Add test for 10-byte DLL interception; r=handyman
Added a test to TestCrossProcessInterceptor that forcibly uses a 10-byte patch
on NtMapViewOfSection (which is a realistic case) and then ensures that
disabling the hook also works.

Differential Revision: https://phabricator.services.mozilla.com/D10286

--HG--
extra : moz-landing-system : lando
2018-11-13 19:51:21 +00:00
Aaron Klotz c29e536879 Bug 1495512: Part 1 - DLL Interceptor - Add capability to do 10-byte detour patches against ntdll; r=handyman
This patch adds support on x64 for 10-byte detour patches in certain cases.
In particular, the reserved region of trampoline memory must be allocated
within the bottommost 2GB of the address space.

This feature is currently only activated when detouring functions exported by
ntdll.dll.

Differential Revision: https://phabricator.services.mozilla.com/D10285

--HG--
extra : moz-landing-system : lando
2018-11-13 19:48:58 +00:00
Andreea Pavel 7cb075753d Backed out 2 changesets (bug 1495512) for failing Win MinGW builds
Backed out changeset 78154ca1e2ac (bug 1495512)
Backed out changeset 17212e7dfe29 (bug 1495512)
2018-11-10 04:06:10 +02:00
Aaron Klotz 6e620ffbcc Bug 1495512: Part 2 - Add test for 10-byte DLL interception; r=handyman
Added a test to TestCrossProcessInterceptor that forcibly uses a 10-byte patch
on NtMapViewOfSection (which is a realistic case) and then ensures that
disabling the hook also works.

Differential Revision: https://phabricator.services.mozilla.com/D10286

--HG--
extra : moz-landing-system : lando
2018-11-10 00:50:23 +00:00
Aaron Klotz 29006b00c1 Bug 1495512: Part 1 - DLL Interceptor - Add capability to do 10-byte detour patches against ntdll; r=handyman
This patch adds support on x64 for 10-byte detour patches in certain cases.
In particular, the reserved region of trampoline memory must be allocated
within the bottommost 2GB of the address space.

This feature is currently only activated when detouring functions exported by
ntdll.dll.

Differential Revision: https://phabricator.services.mozilla.com/D10285

--HG--
extra : moz-landing-system : lando
2018-11-10 00:49:57 +00:00
Markus Stange ab700f9fc0 Bug 1499507 - Don't collect line numbers for profiling stack frames. r=njn
They were not displayed in the UI, and the instructions to initialize the line
field of a stack frame increased code size unnecessarily.

This change reduces the binary size on Linux x64 by around 100KB.

Here's a diff of the impact on the code generated for Attr_Binding::get_specified
in the Mac build:

@@ -20,17 +20,16 @@
    movq       0x8(%rbx), %rax
    movq       %r12, %rcx
    shlq       $0x5, %rcx
    leaq       aGetAttrspecifi, %rdx                       ; "get Attr.specified"
    movq       %rdx, (%rax,%rcx)
    movq       $0x0, 0x8(%rax,%rcx)
    leaq       -40(%rbp), %rdx
    movq       %rdx, 0x10(%rax,%rcx)
-   movl       $0x106, 0x18(%rax,%rcx)
    movl       $0x1c, 0x1c(%rax,%rcx)
    leal       0x1(%r12), %eax
    movl       %eax, 0x10(%rbx)

    movq       %r15, %rdi
    call       __ZNK7mozilla3dom4Attr9SpecifiedEv          ; mozilla::dom::Attr::Specified() const
    movzxl     %al, %eax
    movabsq    $0xfff9000000000000, %rcx

Depends on D9193

Differential Revision: https://phabricator.services.mozilla.com/D9195

--HG--
extra : moz-landing-system : lando
2018-11-06 04:31:02 +00:00
Brindusan Cristian ab89743379 Backed out 9 changesets (bug 1499507) for build bustages on /profiler/core/platform.cpp. CLOSED TREE
Backed out changeset 4c79a5557d7b (bug 1499507)
Backed out changeset 35d05a53e0a9 (bug 1499507)
Backed out changeset 9254e6c721b3 (bug 1499507)
Backed out changeset cf40b044af3f (bug 1499507)
Backed out changeset 76dd85b9aaf7 (bug 1499507)
Backed out changeset 6256446f16c4 (bug 1499507)
Backed out changeset 41cede6bc7d2 (bug 1499507)
Backed out changeset 30476b824eb4 (bug 1499507)
Backed out changeset 24a9494155fe (bug 1499507)
2018-11-05 23:24:49 +02:00
Markus Stange 4c59aa793c Bug 1499507 - Don't collect line numbers for profiling stack frames. r=njn
They were not displayed in the UI, and the instructions to initialize the line
field of a stack frame increased code size unnecessarily.

This change reduces the binary size on Linux x64 by around 100KB.

Here's a diff of the impact on the code generated for Attr_Binding::get_specified
in the Mac build:

@@ -20,17 +20,16 @@
    movq       0x8(%rbx), %rax
    movq       %r12, %rcx
    shlq       $0x5, %rcx
    leaq       aGetAttrspecifi, %rdx                       ; "get Attr.specified"
    movq       %rdx, (%rax,%rcx)
    movq       $0x0, 0x8(%rax,%rcx)
    leaq       -40(%rbp), %rdx
    movq       %rdx, 0x10(%rax,%rcx)
-   movl       $0x106, 0x18(%rax,%rcx)
    movl       $0x1c, 0x1c(%rax,%rcx)
    leal       0x1(%r12), %eax
    movl       %eax, 0x10(%rbx)

    movq       %r15, %rdi
    call       __ZNK7mozilla3dom4Attr9SpecifiedEv          ; mozilla::dom::Attr::Specified() const
    movzxl     %al, %eax
    movabsq    $0xfff9000000000000, %rcx

Depends on D9193

Differential Revision: https://phabricator.services.mozilla.com/D9195

--HG--
extra : moz-landing-system : lando
2018-11-05 20:55:10 +00:00
Narcis Beleuzu 2c6edfdde8 Backed out 9 changesets (bug 1499507) for bustages on ProfileBuffer.cpp . CLOSED TREE
Backed out changeset 541186291b88 (bug 1499507)
Backed out changeset 8a3f4acbad3b (bug 1499507)
Backed out changeset f427afc392b0 (bug 1499507)
Backed out changeset 58dc19fb2b76 (bug 1499507)
Backed out changeset 9225e9aea377 (bug 1499507)
Backed out changeset ca23a517da63 (bug 1499507)
Backed out changeset 16d6c90333de (bug 1499507)
Backed out changeset bc134fe1722a (bug 1499507)
Backed out changeset 4a9c9a91182c (bug 1499507)
2018-11-05 21:48:11 +02:00
Markus Stange 000dc83f31 Bug 1499507 - Don't collect line numbers for profiling stack frames. r=njn
They were not displayed in the UI, and the instructions to initialize the line
field of a stack frame increased code size unnecessarily.

This change reduces the binary size on Linux x64 by around 100KB.

Here's a diff of the impact on the code generated for Attr_Binding::get_specified
in the Mac build:

@@ -20,17 +20,16 @@
    movq       0x8(%rbx), %rax
    movq       %r12, %rcx
    shlq       $0x5, %rcx
    leaq       aGetAttrspecifi, %rdx                       ; "get Attr.specified"
    movq       %rdx, (%rax,%rcx)
    movq       $0x0, 0x8(%rax,%rcx)
    leaq       -40(%rbp), %rdx
    movq       %rdx, 0x10(%rax,%rcx)
-   movl       $0x106, 0x18(%rax,%rcx)
    movl       $0x1c, 0x1c(%rax,%rcx)
    leal       0x1(%r12), %eax
    movl       %eax, 0x10(%rbx)

    movq       %r15, %rdi
    call       __ZNK7mozilla3dom4Attr9SpecifiedEv          ; mozilla::dom::Attr::Specified() const
    movzxl     %al, %eax
    movabsq    $0xfff9000000000000, %rcx

Depends on D9193

Differential Revision: https://phabricator.services.mozilla.com/D9195

--HG--
extra : moz-landing-system : lando
2018-11-05 19:07:45 +00:00
Carl Corcoran 13f66b51b6 Bug 1435827 part 1/9: Send DLL load event info to xul;r=aklotz
We now record DLL load events along with stack trace and other data so we can
later determine trustworthiness and report the DLL via telemetry.

Differential Revision: https://phabricator.services.mozilla.com/D7175

--HG--
extra : moz-landing-system : lando
2018-11-02 08:01:52 +00:00
Tom Ritter 2e4e7ddd81 Bug 1432429 - Point the JS Runtimes at TimeStamp for the current time. r=jandem
This patch adds a new static member to the TimeStamp class to store the
current locked *time* (in ms since the epoch) in addition to the current locked
timestamp.

We point the JS Engine at this value if Fuzzyfox is enabled.
2018-10-26 13:28:51 -05:00
Tom Ritter 61ca4f10d9 Bug 1432429 - Integrate FuzzyFox into the TimeStamp class. r=baku,froydnj
Creates GetFuzzyfoxEnabled() functions that check a static boolean.
Exposes SetFuzzyfoxEnabled() because we cannot depend on Pref
Observation code inside the TimeStamp class.

TimeStamp::Now will now return a Fuzzy value.

We add a NowReally function to support obtaining the real timestamp.

We also add a UsedCanonicalNow to expose whether the TimeStamp was real or fuzzy.
2018-10-09 12:05:25 -05:00
Tom Ritter b83b9c5b11 Bug 1432429 - Add FuzzyFox class and prefs. r=baku,froydnj
Creates a FuzzyFox class for implementating the core of the step/sleep
algorithm. Starts it in nsLayoutStatics::Initialize()

Adds the fuzzyfox prefs.

Moves the ms2mt macros from TimeStamp_windows.cpp to TimeStamp_windows.h
and creates a new public function GetQueryPerformanceFrequencyPerSec() to
expose a static variable in the .cpp file. This is necessary to support
the macros being usable anywhere.  (And we use the macros in FuzzyFox.)
2018-09-18 13:05:26 -05:00
Jeff Gilbert 02e6ff5ccb Bug 1499587 - Fix win64 clang-cl -Wwritable-strings. r=ted
Differential Revision: https://phabricator.services.mozilla.com/D9031

--HG--
extra : moz-landing-system : lando
2018-10-25 14:16:27 +00:00
Masatoshi Kimura f38cdcfbf1 Bug 1496179 - Make mozglue.dll a private SxS assembly. r=aklotz,froydnj
SxS assemblies do not obey the usual DLL search order. It will make it possible
to load mozglue.dll from appdir even if the PreferSystem32Images mitigation is
enabled and System32 has a random mozglue.dll.
2018-10-10 22:57:53 +09:00
David Major 46eec958f3 Bug 1496173 - More aarch64 interceptor fixups. r=mhowell 2018-10-03 17:01:05 -04:00
shindli 14c2437eec Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-09-27 00:57:23 +03:00
Gabriele Svelto 1f10595529 Bug 1490240 - Fix the remaining compiler warnings in the crash reporter r=ted,glandium
Differential Revision: https://phabricator.services.mozilla.com/D5741

--HG--
extra : moz-landing-system : lando
2018-09-26 11:54:34 +00:00
Brindusan Cristian f997140c00 Backed out changeset 628ebca30ce3 (bug 1490240) for bustages on [Unified_cpp_crashreporter0.obj]. CLOSED TREE 2018-09-24 17:10:58 +03:00
Gabriele Svelto a47a091a6d Bug 1490240 - Fix the remaining compiler warnings in the crash reporter r=ted,glandium
Differential Revision: https://phabricator.services.mozilla.com/D5741

--HG--
extra : moz-landing-system : lando
2018-09-24 13:21:38 +00:00
arthur.iakab 12be75264f Backed out changeset 5a566d2d6722 (bug 1490240)for build bustages on Unified_cpp_crashreporter0.obj CLOSED TREE 2018-09-21 15:25:15 +03:00
Gabriele Svelto 37759d8ccd Bug 1490240 - Fix the remaining compiler warnings in the crash reporter r=ted,glandium
Differential Revision: https://phabricator.services.mozilla.com/D5741

--HG--
extra : moz-landing-system : lando
2018-09-21 11:38:04 +00:00
Aaron Klotz 98d8754140 Bug 1492865: Test NTSTATUS code to determine whether DLL load actually succeeded; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D6434

--HG--
extra : moz-landing-system : lando
2018-09-20 21:58:04 +00:00
Carl Corcoran 2ba0b97140 Bug 1489092: Handle return value of append() to suppress warnings;r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D5139

--HG--
extra : moz-landing-system : lando
2018-09-18 18:59:54 +00:00
arthur.iakab 1ee75a928a Merge inbound to mozilla-central a=merge 2018-09-19 05:18:50 +03:00
Ted Mielczarek de99592416 Bug 1399870 - make DEFFILE a Path instead of a string; r=gps
All but one of the current uses of DEFFILE use `SRCDIR + '/file.def'` to
get a srcdir-relative path anyway, and the other one wants an
objdir-relative path, so using Path makes everything clearer.

This makes it more straightforward to translate the paths for the WSL
build.
2018-09-18 15:50:19 -04:00
Carl Corcoran b29044d236 Bug 1491783: Allow file delete and write during VerifySignature;r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D6014

--HG--
extra : moz-landing-system : lando
2018-09-17 20:51:43 +00:00
philipp beae23b892 Bug 1465787 - Add old versions of nviewh64.dll to the dll blocklist. r=marco 2018-09-18 19:01:10 +03:00
Honza Bambas 9a6441ab15 Bug 1487778 - Sentinel QueryPerformanceCounter results for monotonicity even when TSC is reported stable via CPU features, r=froydnj 2018-09-18 03:49:00 +03:00
Thomas P. ac7fc2f5a6 Bug 1474488: add --enable-undefined-sanitizer with custom checks r=froydnj 2018-09-11 02:47:23 +00:00
Jim Chen d92debaff7 Bug 1480834 - 3. Fix linker compile errors under x86-64; r=glandium
The linker has x86-64 support but currently fails to compile. This patch
fixes these compile errors to make it build under x86-64.

Differential Revision: https://phabricator.services.mozilla.com/D4481
2018-09-13 12:09:25 -04:00
Tom Ritter 3fec4a70cd Bug 1490725 Add this-> to some interceptor code to fix the MinGW x86 build r=aklotz
Related to Bug 1480457

Differential Revision: https://phabricator.services.mozilla.com/D5677

--HG--
extra : moz-landing-system : lando
2018-09-12 18:24:20 +00:00
Carl Corcoran b174116dd2 Bug 1490624: Correcting incorrect captitalization of windows.h r=bustage-fix
--HG--
extra : rebase_source : 086899a6cb5817abeff2bef94de57f7a16981f1e
2018-09-12 12:14:10 +02:00
Carl Corcoran 7db61ed776 Bug 1473103: Add unit tests for DLL blocklist integrity; r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D2219

--HG--
extra : moz-landing-system : lando
2018-09-10 22:01:10 +00:00
Nathan Froyd 6d14711d3f Bug 1494392 - fix thinkos in the aarch64 windows interceptor code; r=aklotz 2018-09-26 15:36:51 -04:00
Tom Ritter 74b5d87cd9 Bug 1480457 - Address moz.build failures for mingw-clang r=aklotz
--HG--
extra : amend_source : 61f7bfdd7b827d6fd12c16c8ed7cd3c00f5bf09e
2018-08-30 23:17:15 +03:00
Tom Ritter 45e0e41278 Bug 1480457 Address template parameter shadowing r=aklotz
This code throws an error in clang on the inner MMPolicy:
error: declaration of 'MMPolicy' shadows template parameter

Notethat the template parameter is declared earlier at the
class definition of ReadOnlyTargetFunction

MozReview-Commit-ID: buLE9d22YS

Differential Revision: https://phabricator.services.mozilla.com/D4571

--HG--
extra : moz-landing-system : lando
2018-08-30 12:08:26 +00:00
Carl Corcoran 7da8e04c87 Bug 1467736: Add support for DllBlocklist_Shutdown;r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D4544

--HG--
extra : moz-landing-system : lando
2018-08-29 18:49:49 +00:00
Nathan Froyd 62ef49df4d Bug 1486898 - make WindowsCFGStatus test work with aarch64 windows; r=glandium 2018-08-28 20:40:36 -04:00
Nathan Froyd 0b8d2e01f3 Bug 1485701 - make the interceptor code compilable, if not functional, on aarch64 windows; r=aklotz 2018-08-28 09:27:57 -04:00
Nathan Froyd 7d55fef8da Bug 1486040 - make WindowsDllBlocklist.h functional for aarch64 windows; r=aklotz 2018-08-28 09:27:57 -04:00
Nathan Froyd b8909530ab Bug 1485716 - part 2 - add aarch64 windows support to the stack walking code; r=aklotz
This code is untested and has been cargo-culted a little bit from the
existing x86 code, but should work OK; all the code in Windows is
compiled with frame pointers, we're compiled with frame pointers after
the previous patch, and so the frame pointer unwinding path makes the
most sense.
2018-08-23 16:48:53 -04:00
Nathan Froyd 8c484e785c Bug 1480595 - make TimeStamp compilable for AArch64 Windows; r=glandium
We don't have to check whether AArch64 systems have a stable counter;
they are all specified to do so in the architecture reference manual.
2018-08-23 12:54:29 -04:00
Aaron Klotz fff6fb1ff1 Bug 1485487: Add an assertion to ensure that DllServices::GetBinaryOrgName is not called on the Gecko main thread; r=mhowell
--HG--
extra : rebase_source : 51e91fd9fcac54decd083bd0943d4af9bcbd539e
2018-08-22 15:23:04 -06:00
Gabriele Svelto 15adf94f4d Bug 1348273 - Convert crash annotations into a machine-readable list of constants; r=ted.mielczarek,njn,dholbert,mak,cpearce,mcmanus,froydnj,Dexter,jrmuizel,jchen,jimm,bz,surkov
This introduces the machinery needed to generate crash annotations from a YAML
file. The relevant C++ functions are updated to take a typed enum. JavaScript
calls are unaffected but they will throw if the string argument does not
correspond to one of the known entries in the C++ enum. The existing whitelists
and blacklists of annotations are also generated from the YAML file and all
duplicate code related to them has been consolidated. Once written out to the
.extra file the annotations are converted in string form and are no different
than the existing ones.

All existing annotations have been included in the list (and some obsolete ones
have been removed) and all call sites have been updated including tests where
appropriate.

--HG--
extra : source : 4f6c43f2830701ec5552e08e3f1b06fe6d045860
2018-07-05 15:42:11 +02:00
Mike Hommey 6d197a0707 Bug 1481719 - Disable profile-instr-out-of-date warnings explicitly rather than allowing all warnings where they appear. r=dmajor 2018-08-09 06:07:33 +09:00
Masatoshi Kimura 2a18be87fb Bug 1481433 - ifdef-out the entire TestDLLEject.cpp. r=froydnj
--HG--
extra : rebase_source : 3fe4e30beae5ea7e2ee17b7e3b47c189a1c31b4e
2018-08-08 03:24:46 +09:00
Masatoshi Kimura 3b21b7868b Bug 1090497 - Re-enable warnings as errors on clang-cl. r=froydnj
--HG--
extra : rebase_source : c09366fb93e5b0f72abe1e99d3094e3d96a934fb
extra : intermediate-source : 5950c9d63c3b4fd63a25464a7b50944aaec7079f
extra : source : ca1b9a2bcc4381795f556fea2fb59066567c30f3
2018-07-31 22:10:07 +09:00
Tom Ritter c9e4e2854a Bug 1480177 Lowercase includes to fix MinGW Build Errors r=froydnj
MozReview-Commit-ID: LvFS90CRAFe

--HG--
extra : rebase_source : bfbcc59d061128e5440378448523bbaf939d5a45
2018-07-30 22:43:24 -05:00
Cosmin Sabou de8c2bd891 Backed out changeset 5950c9d63c3b (bug 1090497) for build bustages on several files. CLOSED TREE 2018-08-02 19:59:53 +03:00
Masatoshi Kimura feea19030c Bug 1090497 - Re-enable warnings as errors on clang-cl. r=froydnj
--HG--
extra : rebase_source : a62521fdc66def4e4d5d7bf52e68365a786b5c55
extra : source : ca1b9a2bcc4381795f556fea2fb59066567c30f3
2018-07-31 22:10:07 +09:00
Masatoshi Kimura 8b236812bd Bug 1479777 - Reduce clang-cl warnings from mozglue/misc/interceptor/. r=aklotz
--HG--
extra : source : 8b3d7161cbc7e582c79b3b28f961972af104a4f8
extra : intermediate-source : d434b3e9de5d973b031d685cfd7a2e8f8f3f8303
2018-07-31 22:03:43 +09:00
Changqing Li 32081d48aa Bug 1480315 - Fix coredump caused by getenv. r=glandium
--HG--
extra : amend_source : dbd613ec9ed864aa07e957fc181e2554097d1cc5
2018-08-01 20:49:00 +03:00
Aaron Klotz 9669df786c Bug 1478036: Ensure that inproc nop-space patches use atomic writes; r=handyman
--HG--
extra : rebase_source : 9542cd801a8d4589e47d161c17c92552db468e7a
2018-07-26 15:34:48 -06:00
Csoregi Natalia a851ae46ec Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-07-27 01:02:37 +03:00
David Major 7995320ed3 Bug 1478020 - Fix some -Wmicrosoft-template in the interceptor. r=aklotz 2018-07-26 16:02:30 -04:00
Jim Chen f61f04949b Bug 1451891 - Fix race conditions in __wrap_dlerror; r=glandium
__wrap_dlerror uses a single pointer for all threads, which means one
thread could get the dlerror result from another thread. Normally this
wouldn't cause crashes. However, because dlerror results come from a
per-thread buffer, if a thread exits and our saved dlerror result came
from that thread, the saved pointer could then refer to invalid memory.

The proper way to fix this is to use TLS and have a per-thread pointer
for __wrap_dlerror. However, instead of using up a TLS slot, this patch
keeps the single pointer for custom messages, and fallback to per-thread
dlerror call for system messages. While the race condition still exists,
I think the risk is acceptable. Even when races occur, they should no
longer cause crashes.

MozReview-Commit-ID: 4hGksidjiVz

--HG--
extra : rebase_source : 373000686c426b81ffd7cee88264e89b7a733957
2018-07-25 13:59:30 -04:00
Christian Holler dbb1c632c3 Bug 1478143 - Adjust default malloc_context_size for ASan builds. r=froydnj
MozReview-Commit-ID: BbYWTtrsHLH

--HG--
extra : amend_source : 54d17e32b91e3768e30ee7db0ac0aa0845c6c0ad
2018-07-24 23:01:21 +02:00
Narcis Beleuzu 2f8c84f735 Backed out changeset f7b56df2e870 (bug 1478143) for wpt failures on Linux asan. CLOSED TREE 2018-07-25 02:13:29 +03:00
Christian Holler 7a8be4d393 Bug 1478143 - Adjust default malloc_context_size for ASan builds. r=froydnj
MozReview-Commit-ID: BbYWTtrsHLH

--HG--
extra : rebase_source : 70e94b35c13422e1e39f3e11c199d024fec88e61
2018-07-24 23:01:21 +02:00
Nathan Froyd 695cb9d23b Bug 1477081 - remove TARGET_CPU use from moz.build files; r=ted.mielczarek
TARGET_CPU is not canonicalized, whereas CPU_ARCH is, so we should be
using CPU_ARCH to get consistent values everywhere.
2018-07-24 16:08:55 -04:00
Aaron Klotz ae68a9de15 Bug 1467798: Fix problems with inlining and paths in TestDllInterceptorCrossProcess; r=handyman 2018-07-04 14:12:36 -06:00
Brian Hackett 38e406e8a5 Bug 1465452 Part 1 - Allow platform mutexes to specify whether they are recorded, r=froydnj.
--HG--
extra : rebase_source : 5270a2370717577d454eb00d92be224635495be3
2018-07-21 14:28:21 +00:00
Brian Hackett f6b8e6f81c Bug 1309552 - Specify buffer size when freeing data in AllocPolicy, r=waldo.
--HG--
extra : rebase_source : f4e2d9f8831cf41c19d592ce252e87161f32250b
2018-07-20 23:58:34 +00:00
Carl Corcoran b3ec4a65d9 Bug 1475335: Restrict TestInjectEject gtests to nightly builds;r=aklotz
MozReview-Commit-ID: 4zzm7DN5mBm

--HG--
extra : rebase_source : 63c545d06512102ba8ff69a13226a5af6355eff8
2018-07-13 16:59:52 +02:00
Jim Blandy 001ad997b8 Bug 1469223: Delete mozilla::detail::MutexImpl::operator==. r=froydnj
There is no meaningful equality relationship on any plausible mutex
implementation other than object identity. Having MutexImpl's users simply
compare by addresses makes it clearer in the callers that that's what's going
on.
2018-06-17 15:57:18 -07:00
Kris Maglione b744713e4e Bug 1471025: Part 3c - Also pass the shared preference map handle to Android content processes. r=jld
MozReview-Commit-ID: CTjDzVC9gcD

--HG--
extra : intermediate-source : 7c03b7dd00e9675f9ac045ed1ea733eb0486904f
extra : absorb_source : c79df6bd9ebbec3454fcca1a81cbfa540ad91a3e
extra : source : 38f690f30e78764763bb012045073fa781efa691
extra : histedit_source : 544ff4257f38fae99a800276d06eb0d719882ca2
2018-07-13 11:06:58 -07:00
Kris Maglione f071708db7 Bug 1471025: Part 3b - Refactor Android shared FD API to require fewer modifications per change. r=jld
Adding or removing an FD from this API currently requires changes in about a
half dozen places. Ignoring the Java side of things. This patch changes the
API to pass a struct, rather than additional arguments for each FD, so that
adding and removing FDs only requires changing one declaration, and the two
call sites that add and consume the FDs.

MozReview-Commit-ID: CToSEVp1oqP

--HG--
extra : intermediate-source : ff41551f5ff1b98b72ed771a6f2a3f66a8b79a57
extra : absorb_source : c9fe7423fcbb47655b05209b44fb02b69b272d07
extra : source : 4b7a8a35ed956159e2f443c6211164c0cbf3d926
extra : histedit_source : b98b792791274f00a5e649c82dc25043cc1d699a
2018-07-02 15:01:25 -07:00
Brindusan Cristian fe91a8922e Backed out 13 changesets (bug 1471025) for reftest failures on variation-format-hint-1a.html; bc failures performance/browser_preferences_usage.js; wpt failures on format-specifiers-variations.html. CLOSED TREE
Backed out changeset 6b672d70f335 (bug 1471025)
Backed out changeset 200bec7e766a (bug 1471025)
Backed out changeset 6c72dc1bff88 (bug 1471025)
Backed out changeset 7f4cc96fae12 (bug 1471025)
Backed out changeset b4f9178f132d (bug 1471025)
Backed out changeset 8eff817d2f7e (bug 1471025)
Backed out changeset f9362cf1add4 (bug 1471025)
Backed out changeset ce379eaab179 (bug 1471025)
Backed out changeset 7c03b7dd00e9 (bug 1471025)
Backed out changeset ff41551f5ff1 (bug 1471025)
Backed out changeset 46a6f9d0773b (bug 1471025)
Backed out changeset 434106f1b75e (bug 1471025)
Backed out changeset c490838c8329 (bug 1471025)
2018-07-14 01:16:06 +03:00
Kris Maglione 92550be97d Bug 1471025: Part 3c - Also pass the shared preference map handle to Android content processes. r=jld
MozReview-Commit-ID: CTjDzVC9gcD

--HG--
extra : source : 38f690f30e78764763bb012045073fa781efa691
extra : histedit_source : 2daf7386fbc9f9696c73168d6421139c5cefc5b4%2Ca0adf715f65281047915e678f8c054e5ec671de3
2018-07-13 11:06:58 -07:00
Kris Maglione 954d6a28ca Bug 1471025: Part 3b - Refactor Android shared FD API to require fewer modifications per change. r=jld
Adding or removing an FD from this API currently requires changes in about a
half dozen places. Ignoring the Java side of things. This patch changes the
API to pass a struct, rather than additional arguments for each FD, so that
adding and removing FDs only requires changing one declaration, and the two
call sites that add and consume the FDs.

MozReview-Commit-ID: CToSEVp1oqP

--HG--
extra : source : 4b7a8a35ed956159e2f443c6211164c0cbf3d926
extra : histedit_source : 01a1160ce1107d12e8b376d4512dedb0478e447c
2018-07-02 15:01:25 -07:00
Brindusan Cristian a68383b333 Backed out 12 changesets (bug 1471025) for build bustages on dom/ipc/ContentProcess.cpp. CLOSED TREE
Backed out changeset 398ccedc20dc (bug 1471025)
Backed out changeset 599895de063e (bug 1471025)
Backed out changeset dc7ec17179d1 (bug 1471025)
Backed out changeset 5051f15fc200 (bug 1471025)
Backed out changeset faef4df47b20 (bug 1471025)
Backed out changeset d344247b8706 (bug 1471025)
Backed out changeset 83d98ea5ebac (bug 1471025)
Backed out changeset 38f690f30e78 (bug 1471025)
Backed out changeset 4b7a8a35ed95 (bug 1471025)
Backed out changeset e3bbc87b71af (bug 1471025)
Backed out changeset 68bb03c63b3c (bug 1471025)
Backed out changeset 4a8fbb472c91 (bug 1471025)
2018-07-13 22:11:24 +03:00
Kris Maglione 6c6960d4c8 Bug 1471025: Part 3c - Also pass the shared preference map handle to Android content processes. r=jld
MozReview-Commit-ID: CTjDzVC9gcD

--HG--
extra : rebase_source : c06aa38ff4bc2bdfa09a4aae359e1f418727ce29
extra : absorb_source : c68cd5f0e8f52980d35432cf21e1fc5552542bf2
2018-07-13 11:06:58 -07:00
Kris Maglione de31493580 Bug 1471025: Part 3b - Refactor Android shared FD API to require fewer modifications per change. r=jld
Adding or removing an FD from this API currently requires changes in about a
half dozen places. Ignoring the Java side of things. This patch changes the
API to pass a struct, rather than additional arguments for each FD, so that
adding and removing FDs only requires changing one declaration, and the two
call sites that add and consume the FDs.

MozReview-Commit-ID: CToSEVp1oqP

--HG--
extra : rebase_source : 28e8c6075bacf5f610058227a9731aeadb50f320
extra : absorb_source : f63602a163ed19fb65e26640319750fdd9b92ad1
2018-07-02 15:01:25 -07:00
Chris Manchester ae2d841079 Bug 1475210 - Do not generate rules to install test-specific libraries during artifact builds. r=gps
MozReview-Commit-ID: B25vvkhBUo2

--HG--
extra : rebase_source : bd5f4a07490d4165234c396337d7d92123dd14be
2018-07-12 12:37:46 -07:00
Aaron Klotz 9f11895c62 Bug 1475067: Faster handling of UNICODE_STRINGs in bootstrap blocklist; r=mhowell 2018-07-06 18:11:48 -06:00
Aaron Klotz 09a7297c55 Bug 1473175: Add support for catalog files to DLL signature verifications; r=mhowell 2018-07-10 14:09:44 -06:00
Ciure Andrei 7515739963 Backed out 1 changesets (bug 1473175) for windows 2012 build bustages CLOSED TREE
Backed out changeset 92c393ca18d6 (bug 1473175)
2018-07-12 02:22:54 +03:00
Aaron Klotz 12b5f4ebbe Bug 1473175: Add support for catalog files to DLL signature verifications; r=mhowell
--HG--
extra : rebase_source : f2a1cb4059f80e7cf025879e09998dff9b49981b
2018-07-10 14:09:44 -06:00
Carl Corcoran 63153c7e3b Bug 1443411: Add gtests for blocking threads with LoadLibrary start address;r=aklotz
MozReview-Commit-ID: 2wIUNnNoKa8

--HG--
extra : rebase_source : f1990af6cd130d9bca38ef21d64d66584d20b94e
2018-06-14 00:15:26 -07:00
Nathan Froyd 0daa8edfcc Bug 1444171 - Add pgo-generate-only source functionality; r=glandium
For clang-cl, we want to add code to libxul that only exists during the
PGO generation phase, so we can collect data.  The most expedient way to
do that is to enable certain files in SOURCES to be marked as to only be
compiled during the PGO generation step.
2018-07-09 18:35:49 -04:00
Aaron Klotz 5c9335136e Bug 1473371: Create a separate function hook type for use with cross-process DLL interceptors; r=handyman 2018-07-04 14:14:18 -06:00
Ciure Andrei 46d4610039 Backed out 1 changesets (bug 1473371)for windows-specific changes and fails on windows CLOSED TREE
Backed out changeset f86b10b13521 (bug 1473371)
2018-07-06 22:22:05 +03:00
Aaron Klotz 9f585dd45c Bug 1473371: Create a separate function hook type for use with cross-process DLL interceptors; r=handyman 2018-07-04 14:14:18 -06:00
Gabriele Svelto 016baeca8b Bug 1468207 - Use the new timer-based available memory tracker on Win32; r=dmajor
--HG--
extra : source : 9028b2953c7d4fcf90c12586d4077daef4335419
2018-07-04 21:06:07 +02:00
Aaron Klotz d88f616e24 Bug 1460022: Part 8 - Update DLL blocklist to work with revised DLL interceptor interface; r=mhowell 2018-06-27 11:51:10 -06:00
Aaron Klotz 9b29ad04f3 Bug 1460022: Part 3 - Update TestDllInterceptorCrossProcess to reflect new interceptor interface; r=handyman 2018-06-27 11:48:45 -06:00
Aaron Klotz 084151562b Bug 1460022: Part 2 - Update TestDllInterceptor to use new DLL interceptor interface; r=handyman
In addition to updating the interface, this patch also significantly alters the
structure of this test. In particular, it removes the Test* functions in favour
of using template magic.

I did this because I noticed that, in the majority of cases, the stub function
was being called with all zero arguments, and then we check for the expected
error code. I thought that maybe we could replace that repetition with some
templates that instantiate a blank tuple that may then be applied to a callable
object.

See the (MAYBE_)TEST_HOOK* and TEST_DETOUR* macro definitions for detailed
information about how to use these things.

The test successfully completes with both 32-bit and 64-bit builds.
2018-06-27 11:48:28 -06:00
Aaron Klotz 4572b1b561 Bug 1460022: Part 1 - Modify DLL interceptor to use one-time initialization when setting hooks; r=handyman
This patch makes the interceptor's AddHook functions private, and converts
the stubs from simple function pointers into objects containing both the stub
function pointer, plus a INIT_ONCE sentinel.

Setting a hook now requires calling Set or SetDetour on the stub, which ensures
that the hook attempt happens once and only once.

The constructor for the new object is constexpr, so it should not generate
static initializers if it is declared statically.

Note that, as a corollary of the new behaviour, we no longer need to set guards
around any hook setting code. I have removed those when present.
2018-06-27 11:48:05 -06:00
shindli dd50d1646e Backed out 13 changesets (bug 1460022) for bustages in :/build/build/src/mozglue/tests/interceptor/TestDllInterceptor.cpp(113) on a CLOSED TREE
Backed out changeset b798c3689bbf (bug 1460022)
Backed out changeset c3b3b854affd (bug 1460022)
Backed out changeset ecb1b6fd3134 (bug 1460022)
Backed out changeset 91fed649dd5a (bug 1460022)
Backed out changeset be7032cddad2 (bug 1460022)
Backed out changeset d4a036b976e6 (bug 1460022)
Backed out changeset 5f3dfde41e38 (bug 1460022)
Backed out changeset a16486a6f685 (bug 1460022)
Backed out changeset 69eacc5c3ab8 (bug 1460022)
Backed out changeset 34aa7c29b31e (bug 1460022)
Backed out changeset 00b20c0a7637 (bug 1460022)
Backed out changeset b8e8aea4a01f (bug 1460022)
Backed out changeset 15822d9848d8 (bug 1460022)
2018-07-04 03:37:11 +03:00