Commit Graph

1949 Commits

Author SHA1 Message Date
Greg Tatum
ba44f243ee Bug 1567390 - Add a merged stack test for the profiler; r=canaltinova
Depends on D40324

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

--HG--
extra : moz-landing-system : lando
2019-08-02 14:18:18 +00:00
Greg Tatum
49a90e42a6 Bug 1567390 - Add a JS stack collection test; r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D40324

--HG--
extra : moz-landing-system : lando
2019-08-02 14:15:15 +00:00
Greg Tatum
0c8eb702d9 Bug 1567390 - Add a stackwalking test to the profiler; r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D40308

--HG--
extra : moz-landing-system : lando
2019-08-02 14:06:26 +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
Olli Pettay
c7ee50989c Bug 1565930, try to make Promise less error prone to compartment mismatches, r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D38762

--HG--
extra : moz-landing-system : lando
2019-07-29 14:43:54 +00:00
Sylvestre Ledru
8abb9a8efd Bug 1562642 - Part 4 - Add missing MPL2 headers in tools r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D37579

--HG--
extra : moz-landing-system : lando
2019-07-10 19:12:07 +00:00
Greg Tatum
52c07a19be Bug 1564150 - Make do_work_500ms.html non-blocking; r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D37282

--HG--
extra : moz-landing-system : lando
2019-07-09 12:10:37 +00:00
Greg Tatum
bb7857b872 Bug 1559486 - Remove scriptFilename from RecordAllocationInfo; r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D36651

--HG--
extra : moz-landing-system : lando
2019-07-04 05:19:58 +00:00
Victor Porof
472d3c137a Bug 1561435 - Fix linting errors for tools/, r=standard8
# ignore-this-changeset

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

--HG--
extra : source : 7082771b68989e7acb642a73d223fbe58f84def9
extra : intermediate-source : f2aff116f1d73052541a6095f3d8c8f0e7cf5340
2019-06-28 22:52:16 +02:00
Victor Porof
5c7cdbd4ba Bug 1561435 - Format tools/, a=automatic-formatting
# ignore-this-changeset

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

--HG--
extra : source : d214f0c82813e5a8d3987debc490a2c11f1308ff
2019-07-05 11:18:19 +02:00
Gerald Squelart
84deee5fb4 Bug 1559000 - Enable/disable mozglue's AutoProfilerLabel when Gecko Profiler starts/stops - r=mstange
Instead of setting entry&exit function when Gecko Profiler is initialized, we
now set them when profiling actually starts, and reset them when profiling
stops. There may be edge cases (missing or unneeded labels at the very start or
end of a session) are not an issue.

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

--HG--
extra : moz-landing-system : lando
2019-07-04 04:38:54 +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
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
491216f7dd Bug 1545582 - Add tests for new JS allocations feature; r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D34544

--HG--
extra : moz-landing-system : lando
2019-07-01 21:53:28 +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
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
Jim Porter
32b61264e9 Bug 1551992 - Compress profile data before sending to perf-html; r=mstange,julienw
Differential Revision: https://phabricator.services.mozilla.com/D33399

--HG--
extra : moz-landing-system : lando
2019-06-25 09:54:49 +00:00
Nazım Can Altınova
2ecffabef5 Bug 1548694 - Split the profiler page information tests to prevent intermittent timeout r=julienw
Differential Revision: https://phabricator.services.mozilla.com/D29812

--HG--
rename : tools/profiler/tests/browser/browser_test_profile_history_page_info.js => tools/profiler/tests/browser/browser_test_profile_pushstate_page_info.js
rename : tools/profiler/tests/browser/browser_test_profile_page_info.js => tools/profiler/tests/browser/browser_test_profile_single_frame_page_info.js
extra : moz-landing-system : lando
2019-05-03 12:43:55 +00:00
Jan de Mooij
a261b8dc01 Bug 1551499 - Support Baseline Interpreter code in the profiler. r=djvj
Because the return address cannot be used to uniquely identify script/pc, this
is unfortunately quite different from what we do for Baseline/Ion code.

The strategy is as follows:

* When the profiler is enabled, ensure each JitScript has a pointer to the
  profile string (released when the script is finalized).

* The BaselineInterpreter code is registered with the JitcodeMap.

* The profiler code treats interpreter frames like C++ Interpreter frames,
  instead of doing the return address based mapping.

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

--HG--
extra : moz-landing-system : lando
2019-06-21 16:13:48 +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
d8ea7bc1ac Bug 1545582 - Add tests for new JS allocations feature; r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D34544

--HG--
extra : moz-landing-system : lando
2019-06-19 21:08:27 +00: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
dd7d3f3708 Bug 1545582 - Add tests for new JS allocations feature; r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D34544

--HG--
extra : moz-landing-system : lando
2019-06-13 20:25:12 +00: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
Nicholas Nethercote
94ec493862 Bug 1557907 - Fix jemalloc_replace_dynamic(). r=glandium
`jemalloc_replace_dynamic()` is badly broken. If you install a malloc table
other than the default at startup (e.g. DMD's or PHC's), when you call
`jemalloc_replace_dynamic()` it installs a new allocator that wraps the
*default* allocator, and then when you call `jemalloc_replace_dynamic(nullptr)`
it switches back to the *default* allocator.

This commits makes numerous improvements.

- It removes the "flip-flopping" between malloc tables, which didn't really
  work and isn't necessary.

- `jemalloc_replace_dynamic()` now switches between the *original* malloc table
  and the new one, rather than the *default* malloc table and the new one.

- It renames various things, to make the names shorter and clearer.

- It clearly documents the dangers and limitations of
  `jemalloc_replace_dynamic()`.

- It removes and inlines `profiler::Init()`, because there was only one call
  site.

- It rearranges `install_memory_counter()` so the control flow is simpler.

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

--HG--
extra : moz-landing-system : lando
2019-06-13 20:42:19 +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
Nazım Can Altınova
91197b28a2 Bug 1552286 - Move back GeckoJavaSampler to GeckoView and enable for it and fennec r=nalexander,gerald
Bug 1303806 moved `GeckoJavaSampler` to be Fennec-only as part of a general push
to slim GeckoView down.  But there is no reason to restrict to Fennec and it is useful
for other non-Fennec GeckoView vehicles.

This patch moves the `GeckoJavaSampler` inside `geckoview` and changes profiler
code to make Java sampling work in both GeckoView and Fennec.

Depends on D33522

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

--HG--
rename : mobile/android/base/java/org/mozilla/gecko/GeckoJavaSampler.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoJavaSampler.java
extra : moz-landing-system : lando
2019-06-05 10:58:47 +00:00
Gerald Squelart
3b85f8b3c7 Bug 1492121 - Use BaseProfiler in XRE_Init{Parent,Child}Process() - r=njn
Differential Revision: https://phabricator.services.mozilla.com/D31934

--HG--
extra : moz-landing-system : lando
2019-06-06 06:20:49 +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
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
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
ad5d0acdd9 Bug 1492121 - Use BaseProfiler in XRE_Init{Parent,Child}Process() - r=njn
Differential Revision: https://phabricator.services.mozilla.com/D31934

--HG--
extra : moz-landing-system : lando
2019-06-05 23:43:01 +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
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
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
eadc54dcc3 Bug 1492121 - Use BaseProfiler in XRE_Init{Parent,Child}Process() - r=njn
Differential Revision: https://phabricator.services.mozilla.com/D31934

--HG--
extra : moz-landing-system : lando
2019-06-04 06:55:48 +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
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
Nika Layzell
95e8f0306b Bug 1540731 - Part 2: Move toplevel actors to override ActorDestroy, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D28573

--HG--
extra : moz-landing-system : lando
2019-05-21 17:04:21 +00:00
Denis Palmeiro
49502b1ffa Bug 1545091 - Spew tracelogger statistics with IONFLAGS=tracelogger r=iain,mstange
Add Jitspewing control for tracelogger data.  This can be enabled from the profiler or from the JS shell.  Usage is as follows:

From browser (ION_SPEW_FILENAME is recommended here so stdout doesn't get clobbered by each process):
  1.  JS_TRACE_LOGGING=1 IONFLAGS=tracelogger ION_SPEW_FILENAME=tracelogger ./mach run
  2.  Enable JSTracer feature in profiler addon
  3.  Start profiling and ctrl+shift+2 to view profile, and the data will be automatically spewed during profile collection.

From shell:
  1.  JS_TRACE_LOGGING=1 IONFLAGS=tracelogger dist/bin/js test.js
  2.  Data is automatically spewed to stdout when the shell exits, or use ION_SPEW_FILENAME.

There is an optional environment variable JS_TRACELOGGER_SPEW that can be used to emit specific events, for example JS_TRACELOGGER_SPEW="Interpreter,Baseline,GC" will emit only those specific events along with the script and self time of each script.

The structured spewer is also supported with SPEW=tracelogger, and this will emit the tracelogger data for every recorded event.

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

--HG--
extra : moz-landing-system : lando
2019-05-21 15:25:32 +00:00