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

1431 Коммитов

Автор SHA1 Сообщение Дата
Gerald Squelart 11b3a5f66e Bug 1574143 - Make BlocksRingBuffer::EntryWriter RAII - r=gregtatum
EntryWriter doesn't even need to be moveable, as BlocksRingBuffer can just
create one on the stack, and pass it by reference to callbacks.
This removes risks, and potential data copies.

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

--HG--
extra : moz-landing-system : lando
2019-08-16 04:02:18 +00:00
Makoto Kato c4cb964c8e Bug 1572613 - Use frame pointer based stack walker even if Android/x86 and Android/x86-64. r=jseward
Actually, we use clang for all Linux and Android platform, so it is no reason to use frame pointer based stack walker for LUL on Android/x86 and Android/x86-64 if no DWARF rule.

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

--HG--
extra : moz-landing-system : lando
2019-08-13 07:34:29 +00:00
Aaron Klotz a69086ea54 Bug 1573273: Add ProfilerLabelBegin and ProfilerLabelEnd to mozglue; r=gerald
While mozglue continues to be the correct location for calling the affected
code in this patch, the calls requiring profiler labels will soon be
originating from firefox.exe via the launcher process.

mozglue will be supplying the launcher process with an interface that consists
of what are effectively "OnBeginDllLoad" and "OnEndDllLoad" callback
notifications; obviously an RAII class is not going to be useful for that case.

We still want to keep the RAII stuff around, however, since we still need it
for cases where we need to fall back to using the legacy DLL blocklist.

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

--HG--
extra : moz-landing-system : lando
2019-08-14 03:46:41 +00:00
Aaron Klotz 6e2191877a Bug 1573274: Add mozglue-only SuppressStackWalking and DesuppressStackWalking functions to StackWalk on Windows; r=glandium
While mozglue continues to be the correct location for calling the affected
code in this patch, the calls requiring stackwalk suppression will soon be
originating from firefox.exe via the launcher process.

mozglue will be supplying the launcher process with an interface that consists
of what are effectively "OnBeginDllLoad" and "OnEndDllLoad" callback
notifications; obviously an RAII class is not going to be useful for that case.

We still want to keep the RAII stuff around, however, since we still need it
for cases where we need to fall back to using the legacy DLL blocklist.

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

--HG--
extra : moz-landing-system : lando
2019-08-14 03:34:52 +00:00
Gerald Squelart 86c0b62678 Bug 1573111 - BlocksRingBuffer can switch underlying buffer - r=gregtatum
`BlocksRingBuffer` will be used both inside and outside `ProfileBuffer`:
- Inside to serve as `ProfileBuffer`'s main storage for stack traces,
- Outside to allow marker storage even when `ProfileBuffer` is locked during
  stack sampling.

`ProfileBuffer` only exists while `ActivePS` is alive, but because of the
potential outside accesses above (due to small races between ProfileBuffer
shutdown, and thread-local IsBeingProfiled() flags), we cannot just do the same
for BlocksRingBuffer, and it must remain alive to gracefully deny these accesses
around the profiler startup and shutdown times.

To accomplish this, `BlocksRingBuffer` may be in different states:
- "In-session", we have a real buffer to write to and read from,
- "Out-of-session", without buffer so reads&writes do nothing.
This is implemented by enclosing the underlying `ModuloBuffer` and the entry
deleter in a `Maybe`, which may be `Nothing` when the profiler is not running
and the `ProfileBuffer`'s `BlocksRingBuffer` is out-of-session.

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

--HG--
extra : moz-landing-system : lando
2019-08-13 12:06:40 +00:00
Emilio Cobos Álvarez c3ee3ac3a8 Bug 1418624 - Allow mozilla::Result to be moved, make unwrap{,Err}() move, and add inspect() APIs that return references. r=froydnj
Also adjust some of the callers that were either calling unwrap() repeatedly on
the same result, or were doing silly copies, to use inspect().

We could try to use stuff like:

https://clang.llvm.org/docs/AttributeReference.html#consumed-annotation-checking

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

--HG--
extra : moz-landing-system : lando
2019-08-13 08:26:18 +00:00
Sylvestre Ledru 645f2d5773 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-08-13 07:15:25 +00:00
Brindusan Cristian a8a9f04996 Backed out changeset 58dd47c5aa51 (bug 1573111) for build bustages at TestBaseProfiler.cpp:875:51. CLOSED TREE 2019-08-13 06:21:16 +03:00
Gerald Squelart b2274966d4 Bug 1573111 - BlocksRingBuffer can switch underlying buffer - r=gregtatum
`BlocksRingBuffer` will be used both inside and outside `ProfileBuffer`:
- Inside to serve as `ProfileBuffer`'s main storage for stack traces,
- Outside to allow marker storage even when `ProfileBuffer` is locked during
  stack sampling.

`ProfileBuffer` only exists while `ActivePS` is alive, but because of the
potential outside accesses above (due to small races between ProfileBuffer
shutdown, and thread-local IsBeingProfiled() flags), we cannot just do the same
for BlocksRingBuffer, and it must remain alive to gracefully deny these accesses
around the profiler startup and shutdown times.

To accomplish this, `BlocksRingBuffer` may be in different states:
- "In-session", we have a real buffer to write to and read from,
- "Out-of-session", without buffer so reads&writes do nothing.
This is implemented by enclosing the underlying `ModuloBuffer` and the entry
deleter in a `Maybe`, which may be `Nothing` when the profiler is not running
and the `ProfileBuffer`'s `BlocksRingBuffer` is out-of-session.

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

--HG--
extra : moz-landing-system : lando
2019-08-13 03:11:53 +00:00
Gerald Squelart 41c580344f Bug 1572027 - Make BlocksRingBuffer::EntryReader move-only - r=gregtatum
After some bad experiences, I think EntryReader should be move-only:
- It needs to be moveable so it can be created from a function, and move-
  constructed into a Maybe<> if needed.
- It can be passed around as a reference.

Previously, it could be passed by value, but it was too easy to create bugs,
e.g.: A function delegates to a sub-function to read something at the beginning,
then the first function wants to read more past that, but if the reader was
passed by value the first function would not see past what the sub-function did
read.

As a bonus, `mRing` can now be a reference instead of a pointer, and other
members can be const.

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

--HG--
extra : moz-landing-system : lando
2019-08-07 21:33:09 +00:00
Aaron Klotz fb977a3526 Bug 1571875: Part 2 - Change over all existing static local uses of DynamicallyLinkedFunctionPtr to use StaticDynamicallyLinkedFunctionPtr instead; r=mhowell
Depends on D40885

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

--HG--
extra : moz-landing-system : lando
2019-08-07 15:58:09 +00:00
Aaron Klotz d46e27a5ed Bug 1571875: Part 1 - Refactor DynamicallyLinkedFunctionPtr into static local and normal variants; r=mhowell
This patch does two things:

1. We refactor the resolution of function pointer and return type so that we
may support additional calling conventions besides just __stdcall;

2. We refactor DynamicallyLinkedFunctionPtr into a base class, and create
StaticDynamicallyLinkedFunctionPtr to specifically handle the static local
use case.

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

--HG--
extra : moz-landing-system : lando
2019-08-07 15:57:23 +00:00
Gerald Squelart 5d6dbb3289 Bug 1571392 - Make BlocksRingBuffer::EntryWriter move-only - r=gregtatum
It makes little sense to copy a writer (also an output iterator).

We're keeping it move-constructible (so it can be passed around for construction
purposes), but not move-assignable to help make more members `const`.

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

--HG--
extra : moz-landing-system : lando
2019-08-07 01:54:45 +00:00
Gerald Squelart c05de0f147 Bug 1571390 - BlocksRingBuffer::GetState() takes a snapshot of the current state - r=gregtatum
This makes it easier to grab all BlocksRingBuffer state variables:
- Range start and end.
- Number of pushed blocks/entries, number of cleared blocks/entries.

The function is thread-safe, and the returned values are consistent with each
other, but they may become stale straight after the function returns (and the
lock is released).
They are still valuable to statistics, and to know how far the range has at
least reached (but may go further soon).

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

--HG--
extra : moz-landing-system : lando
2019-08-07 01:54:31 +00:00
Gerald Squelart f2af619bd3 Bug 1571355 - Base Profiler mutex tweaks - r=gregtatum
Renamed `BPAutoLock` to `BaseProfilerAutoLock`.
DEBUG-build `~BaseProfilerMutex()` checks that it is unlocked.
Prevent `BaseProfilerMutex` and `BaseProfilerAutoLock` copies&moves.
DEBUG-build check that `Lock()` sees `mOwningThreadId`==0 (because that is the
initial value, and the value after a previous `Unlock()`).
Don't preserve atomic `mOwningThreadId` in JS recording.

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

--HG--
extra : moz-landing-system : lando
2019-08-07 01:54:09 +00:00
Gerald Squelart a2e0f9390e Bug 1571348 - ProfilerMarkerPayload::Set...() can be replaced with constructor arguments - r=gregtatum
`ProfilerMarkerPayload::Set...()` functions are only used by derived classes in
the same files, and these values could just be set during construction.

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

--HG--
extra : moz-landing-system : lando
2019-08-07 01:53:55 +00:00
Toshihito Kikuchi 82aae30d17 Bug 1568610 - Delete the definition of IATThunks structure. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D40703

--HG--
extra : moz-landing-system : lando
2019-08-06 22:58:20 +00:00
Greg Tatum cf59c7c0d7 Bug 1521929 - Remove RSS and USS measurements from the profiler; r=gerald,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D40287

--HG--
extra : moz-landing-system : lando
2019-08-05 15:37:18 +00:00
Sylvestre Ledru a34ae8d650 Bug 1571292 - -Wbool-operation: fix a warning (! instead of ~) r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D40574

--HG--
extra : moz-landing-system : lando
2019-08-04 22:00:40 +00:00
Gerald Squelart a8ae8a7a30 Bug 1569515 - Show overhead stats in Profiler tests - r=canaltinova
cppunittest TestBaseProfiler and gtest GeckoProfiler.Markers now show overhead
stats.
(Separate patch, because we may want to remove them after a while.)

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

--HG--
extra : moz-landing-system : lando
2019-07-31 01:28:53 +00:00
Gerald Squelart ce889db273 Bug 1569515 - Collect overhead stats in ProfileBuffer - r=canaltinova
`ProfileBuffer` is now responsible for collecting overhead stats, and adding
them to the struct returned by `profiler_get_buffer_info()`.

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

--HG--
extra : moz-landing-system : lando
2019-07-31 01:28:51 +00:00
Gerald Squelart 68db1b82de Bug 1569506 - SamplerThread can own a Sampler instead of being one - r=canaltinova
`SamplerThread` inheriting from `Sampler` was a bit confusing, and scary with no
virtual destructor&functions.
`SamplerThread` only uses `Sampler`'s `Disable()` and
`SuspendAndSampleAndResumeThread()` functions, and `SamplerThread` is never
accessed through a `Sampler` reference/pointer.
So `SamplerThread` can just own a `Sampler` to make that relationship clearer.

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

--HG--
extra : moz-landing-system : lando
2019-07-31 01:28:49 +00:00
Gerald Squelart 6abdf8f681 Bug 1569458 - Use mMutex.AssertCurrentThreadOwns() in BlocksRingBuffer - r=gregtatum
This of course checks that the mutex is locked as expected in non-public APIs.
It also checks that user callbacks will not keep readers/writers longer than
they should.

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

--HG--
extra : moz-landing-system : lando
2019-07-30 12:19:55 +00:00
Gerald Squelart d5ac2c3154 Bug 1569458 - Unify Base Profiler mutexes into one class - r=gregtatum
`BaeProfilerMutex` is a concrete mutex based on MutexImpl, which was previously
implemented twice in both platform.h and BlocksRingBuffer.h.
This combined mutex has some DEBUG code (when MOZ_BASE_PROFILER is #defined) to
catch recursive locking, and to assert that the mutex is held (for code that
cannot easily use the "proof of lock" pattern; e.g., going through user-provided
callbacks).

This class needs to be public (because it is used in public headers), but is an
implementation detail, so it is located in a new header
"mozilla/BaseProfilerDetail.h" that will collect `mozilla::baseprofiler::detail`
code that may be useful to a few files in Base Profiler.

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

--HG--
extra : moz-landing-system : lando
2019-07-30 12:19:54 +00:00
Gerald Squelart ce8cf3d633 Bug 1567861 - Fix BlocksRingBuffer::ClearBefore() with past-the-end BlockIndex - r=gregtatum
`ClearBefore()` with a past-the-end `BlockIndex` was calling `Clear()`, which
tried to take the lock again! Also we didn't return after that.
Fixed, and added corresponding test.

Also: Removed ambiguous "delete" word, now using more precise "destroy" or
"entry destructor".

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

--HG--
extra : moz-landing-system : lando
2019-07-30 07:24:20 +00:00
Gerald Squelart f5ca1ba02d Bug 1567465 - Default BlockIndex used as empty value index before any valid entry - r=gregtatum
This is a similar concept as `nullptr` is to a pointer.

`BlocksRingBuffer` now skips the first byte in the buffer, so that no entries
start at 0 (the internal default `BlockIndex` value).
All `BlocksRingBuffer` public APIs handle this default value, and do nothing
and/or return Nothing (as if it pointed at an already-deleted entry).

Added tests for this, and for all BlockIndex operations.

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

--HG--
extra : moz-landing-system : lando
2019-07-19 16:10:30 +00:00
Gerald Squelart dd5708c6dc Bug 1567461 - Ensure ModuloBuffer can be properly move-constructed - r=gregtatum
Without declaring them, ModuloBuffer had its copy&move constructor&assignments
defaulted. This means it could have been copied, and then both objects would now
own the same resource and attempt to free it on destruction!

So now:
- Copy construction&assignment are now explicitly disallowed.
- Move assignment is disallowed, to keep some members `const`.
- Move construction is allowed (so a function can return a ModuloBuffer), and
  ensures that the moved-from object won't free the resource anymore.

Bonus: `mBuffer` is now `const`, to ensure that it cannot point at something
else, but note the pointed-at bytes are *not* const.
So ModuloBuffer is like an unchanging resource, but it allows to be moved-from
as an xvalue that should not be used after the move.

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

--HG--
extra : moz-landing-system : lando
2019-07-20 00:13:59 +00:00
Gerald Squelart 6ea0a33e9a Bug 1566706 - ModuloBuffer and BlocksRingBuffer can be given a external underlying buffer - r=gregtatum
By default `ModuloBuffer` allocates its own buffer on the heap.
Now `ModuloBuffer` adds two alternatives:
- Take ownership of a pre-allocated `UniquePtr<uint8_t>` buffer.
- Work over an unowned `uint8_t*` array. The caller is responsible for
  ownership, and ensuring that the array lives at least as long as the
  `ModuloBuffer`/`BlocksRingBuffer`.

`BlocksRingBuffer` can pass along these new options to its underlying
`ModuloBuffer`.

The main use will be for small on-stack `BlocksRingBuffer` that can store a
stack trace, or to more easily collect data (without allocating anything on the
heap) that can then go into the upcoming `ProfileBuffer`'s `BlocksRingBuffer`.

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

--HG--
extra : moz-landing-system : lando
2019-07-19 00:56:18 +00:00
Aaron Klotz e95bbdcbd0 Bug 1567013: Change gen_dll_blocklist_defs.py to use the DLL name for dupe detection; r=bytesized
Differential Revision: https://phabricator.services.mozilla.com/D38423

--HG--
extra : moz-landing-system : lando
2019-07-18 03:29:45 +00:00
Gerald Squelart 2af2523782 Bug 1565137 - BlocksRingBuffer is a thread-safe variable-sized circular buffer - r=gregtatum
This adds to the byte-oriented ModuloBuffer from bug 1563425:
- Thread-safety: All APIs may be called at any time from any thread.
- Structure: The buffer will be divided in "blocks" of different size, with some
  block meta-data and space for the user "entry".
- Capable of handling user resources: The user may provide a "deleter" that will
  be informed about soon-to-be-destroyed entries; so if some entries reference
  outside resources, these references may be properly released.

Note: This first implementation still only allows the user to manipulate bytes
and trivially-copyable objects (same as with the ModuloBuffer iterators). A
follow-up bug will introduce better serialization capabilities, with the aim to
eventually store everything that current Profiler Markers and their payloads
contain.

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

--HG--
extra : moz-landing-system : lando
2019-07-16 07:57:24 +00:00
Aaron Klotz 8f1d66c29a Bug 1483687: Part 5 - Update the legacy DLL blocklist to support the revised data structure format; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D36999

--HG--
extra : moz-landing-system : lando
2019-07-16 18:02:42 +00:00
Aaron Klotz 206fc29ac7 Bug 1483687: Part 3 - Update DLL blocklist gtests to support the revised blocklist data structures; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D36997

--HG--
extra : moz-landing-system : lando
2019-07-16 18:02:13 +00:00
Aaron Klotz 5e011338b2 Bug 1483687: Part 2 - Updates to WindowsDllBlocklistCommon.h macros; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D36994

--HG--
extra : moz-landing-system : lando
2019-07-16 18:01:53 +00:00
Aaron Klotz 41e787ef1a Bug 1483687: Part 1 - Use a build script to generate various DLL blocklist headers; r=bytesized
As we are increasingly moving toward enabling new types of DLL blocking across
our various process types, we need to be able to generate various headers in
various distinct formats.

This script enables us to use a unified DLL blocklist input that generates
these distinct headers. From WindowsDllBlocklistDefs.in, we generate:

WindowsDllBlocklistA11yDefs.h - definitions for a11y
WindowsDllBlocklistLauncherDefs.h - definitions for the launcher process
WindowsDllBlocklistLegacyDefs.h - definitions for the legacy mozglue blocklist
WindowsDllBlocklistTestDefs.h - test-only definitions

These headers are then exported to mozilla.

Note that not all headers use the same format, as not all consumers of these
headers have identical workings. There will be additional header types added
in the future which diverge even more from the standard blocklist format. While
this work may seem a bit pointless at the moment, it will become more necessary
in the future. In particular, this work is a prerequisite for bug 1238735.

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

--HG--
extra : moz-landing-system : lando
2019-07-16 18:01:40 +00:00
Sylvestre Ledru ddf2513ea7 Bug 1519636 - Ride along: Move to the unix CR type r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-07-16 07:34:18 +00:00
James Teh 07f7390618 Bug 1536227: Block safemon64.dll (360 Safeguard/360 Total Security) for causing a11y crashes. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D27203

--HG--
extra : moz-landing-system : lando
2019-07-12 23:39:15 +00:00
Aaron Klotz 38d143880e Bug 1564106: Reorder interceptor tests so that lower-level APIs are hooked before higher-level APIs; r=handyman
Since higher-level APIs that we test may depend on lower-level APIs that we
also test, and since those higher-level APIs may spin up background threads
that call those lower-level APIs, we should ensure that tests are ordered
such that the lower-level APIs are hooked first, thus preventing races where
higher-level background threads call lower-level APIs while the test's main
thread is in the midst of hooking a lower-level API.

I also added some fflush calls to the test so that, the next time we see lots
of crashes in this test, the log output is more complete.

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

--HG--
extra : moz-landing-system : lando
2019-07-10 18:26:40 +00:00
Aaron Klotz 579b3f8116 Bug 1553776: Add DLL blocklist entries for injected Ivanti Security Endpoint DLLs; r=dmajor
Differential Revision: https://phabricator.services.mozilla.com/D37483

--HG--
extra : moz-landing-system : lando
2019-07-10 13:52:27 +00:00
Razvan Maries 76724ce338 Backed out changeset 1ccaad832c1d (bug 1557564) for causing bug 1531789. 2019-07-10 13:19:27 +03:00
Gerald Squelart 20f9546725 Bug 1563425 - ModuloBuffer is a basic circular byte buffer with iterator and LEB128 helpers - r=gregtatum
Basic usage:
- Create buffer: `ModuloBuffer mb(PowerOfTwo);`
- Get iterator: `auto writer = mb.WriterAt(Index);` (or `ReaderAt()`)
- Basic iterator functions on bytes: `*++writer = 'x';`
- Write: `writer.WriteULEB128(sizeof(int)); writer.WriteObject<int>(42);`
- Comparisons, move: `while (writer > reader) { --writer; }`
- Read: `size_t s = reader.ReadULEB128<size_t>(); int i = ReadObject<int>();`

There are no safety checks, it will be up to the caller to ensure thread-safety,
and data safety when wrapping around the buffer.

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

--HG--
extra : moz-landing-system : lando
2019-07-09 04:46:19 +00:00
Gerald Squelart 82b21811d2 Bug 1557564 - Enable Base Profiler in Windows - r=florian
Bug 1556993 fixed the crash in PoisonIOInterposer (due to missing stdout&stderr
fd's), and bug 1559379 fixed the mozglue memory issue that the unit test
experienced.
So now Base Profiler can be enabled by default on Windows, still using
`MOZ_BASE_PROFILER_...` env-vars for now (upcoming bug will merge these with
non-BASE env-vars soon).

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

--HG--
extra : moz-landing-system : lando
2019-07-09 08:09:14 +00:00
Sylvestre Ledru fc2eb5393c Bug 1562642 - Part 2 - Add missing MPL2 headers r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D37146

--HG--
extra : moz-landing-system : lando
2019-07-08 09:27:47 +00:00
Sylvestre Ledru 131d0c6a02 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-07-06 08:18:28 +00:00
Gerald Squelart 58334f8543 Bug 1559000 - Enable/disable mozglue's AutoProfilerLabel when Base Profiler starts/stops - r=mstange
Now that Gecko Profiler only registers its entry&exit functions when running,
and it ensures that Base Profiler is stopped beforehand, Base Profiler can now
register its own entry&exit functions to capture labels before xpcom starts.

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

--HG--
extra : moz-landing-system : lando
2019-07-04 04:39:08 +00:00
Gerald Squelart 5fcb437d2b Bug 1559000 - Make AutoProfilerLabel thread-safe - r=mstange
Profilers will soon be able to set/reset entry&exit functions at different
times, but simultaneously other code may want to use AutoProfilerLabel, so we
need to make this all thread-safe.

All shared static information is now encapsulated in an RAII class that enforces
proper locking before giving access to this information.

Also added a "generation" count, so that if an AutoProfilerLabel is in-flight
when entry&exit functions are changed, the context given by the old entry
function will not be passed to a mismatched new exit function.

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

--HG--
extra : moz-landing-system : lando
2019-07-04 04:43:41 +00:00
Gerald Squelart 4d91208989 Bug 1559000 - mozglue's AutoProfilerLabel doesn't need to know about ProfilingStack - r=mstange
`ProfilingStack*` happens to be the information that the current Gecko Profiler
entry function wants to forward to the exit function, but AutoProfilerLabel does
not really need to know about that.
Changing it to `void*`, so that we can later use different entry/exit functions
that use different context types.

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

--HG--
extra : moz-landing-system : lando
2019-07-04 04:38:16 +00:00
Gerald Squelart e610854d8e Bug 1562606 - Implement unsigned LEB128 functions working over iterators - r=gregtatum
The new ProfileBuffer data structure will need to store block sizes (usually
small, LEB128 uses fewer bytes for small numbers), and the circular buffer will
provide iterators that hide the wrapping-around.

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

--HG--
extra : moz-landing-system : lando
2019-07-03 14:49:10 +00:00
Markus Stange 053b6b369b Bug 1557789 - Expose subcategory information in the profile JSON. r=njn
This was reviewed before in bug 1500692.

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

--HG--
extra : moz-landing-system : lando
2019-07-02 17:27:13 +00:00
Greg Tatum bbec67e8f2 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-07-01 21:53:11 +00:00
Julien Wajsberg 319394f539 Bug 1561881 - Always capture the memory counters when profiling r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D36186

--HG--
extra : moz-landing-system : lando
2019-06-27 14:02:30 +00:00
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