Commit Graph

951 Commits

Author SHA1 Message Date
Nicholas Nethercote
cb7d796cb1 Bug 1333296 (part 3) - Remove SPS mentions in tools/profiler. r=mstange.
--HG--
extra : rebase_source : d4ee3eccbffc86ea902be2b80a159fb84445c027
2017-01-24 14:18:50 +11:00
Nicholas Nethercote
997c2d8b00 Bug 1333296 (part 2) - Change "SPS:" mentions in logging code. r=mstange.
--HG--
extra : rebase_source : 2cb0718e120a2d0f988a7456d6fbf5946ce2e3a6
2017-01-24 14:17:13 +11:00
Nicholas Nethercote
22b6d342d7 Bug 1333296 (part 1) - Rename MOZ_ENABLE_PROFILER_SPS as MOZ_GECKO_PROFILER. r=mstange,glandium.
--HG--
extra : rebase_source : 223f3a17f009645369be503392cc1f0cea7f19a1
2017-01-24 14:15:12 +11:00
Nicholas Nethercote
82d4c11201 Bug 1332577 (part 9) - Remove all mozilla_sampler_*() functions. r=mstange.
There are lots of profiler_*() functions that simply call onto equivalent or
nearly-equivalent mozilla_sampler_*() functions. This patch removes the
unnecessary indirection by removing the mozilla_sampler_*() functions.

The most important changes:

- In platform.cpp, all the mozilla_sampler_*() definitions are renamed as
  profiler_*().

- In GeckoProfiler.h, the new PROFILER_FUNC{,_VOID} macros provide a neat way
  to declare the functions that must be present whether the profiler is enabled
  or not.

- In GeckoProfiler.h, all the mozilla_sampler_*() declarations are removed, as
  are all the profiler_*() definitions that corresponded to a
  mozilla_sampler_*() function.

Other things of note:

- profiler_log(const char* str) is now defined in platform.cpp, instead of in
  GeckoProfiler.h, for consistency with all the other profiler_*() functions.
  Likewise with profiler_js_operation_callback() and
  profiler_in_privacy_mode().

- ProfilerBacktraceDestructor::operator() is treated slightly different to all
  the profiler_*() functions.

- Both variants of profiler_tracing() got some early-return conditions moved
  into them from GeckoProfiler.h.

- There were some cases where the profiler_*() and mozilla_sampler_*() name
  didn't quite match. Specifically:

  * mozilla_sampler_get_profile_data() and profiler_get_profiler_jsobject():
    name mismatch. Kept the latter.

  * mozilla_sampler_get_profile_data_async() and
    profiler_get_profile_jsobject_async(): name mismatch. Kept the latter.

  * mozilla_sampler_register_thread() and profiler_register_thread(): return
    type mismatch. Changed to void.

  * mozilla_sampler_frame_number() and profiler_set_frame_number(): name
    mismatch. Kept the latter.

  * mozilla_sampler_save_profile_to_file() and
    profile_sampler_save_profile_to_file(): the former was 'extern "C"' so it
    could be called from a debugger easily. The latter now is 'extern "C"'.

- profiler_get_buffer_info() didn't fit the patterns handled by
  PROFILER_FUNC{,VOID}, so the patch makes it call onto the new function
  profiler_get_buffer_info_helper(), which does fit the pattern.

--HG--
extra : rebase_source : fa1817854ade81e8a3027907d1476ff2563f1cc2
2017-01-20 15:05:16 +11:00
Nicholas Nethercote
47ba5aca68 Bug 1332577 (part 8) - Rename moz_profiler_*() as profiler_*(). r=mstange.
This makes them consistent with other profiler functions.

--HG--
extra : rebase_source : bfdd878f4ca9cab50f0fa769b3cd1a4cdae18575
2017-01-21 08:45:49 +11:00
Nicholas Nethercote
12647a7223 Bug 1332577 (part 7) - Rename mozilla_get_pseudo_stack() as profiler_get_pseudo_stack(). r=mstange.
This makes it consistent with other profiler functions.

--HG--
extra : rebase_source : 1e52acdc448691b8859bb147a0c70b198b432fe2
2017-01-20 15:07:05 +11:00
Nicholas Nethercote
12530089df Bug 1332577 (part 6) - Move some function definitions in GeckoProfiler.h. r=mstange.
This patch moves the definitions of profiler_call_{entry,exit}() up so that
forward declarations aren't necessary. It also removes an unnecessary second
declaration of mozilla_sampler_add_marker().

--HG--
extra : rebase_source : 254fa7b6400770f5af7bac9559eb1c8a3be77231
2017-01-20 14:29:20 +11:00
Nicholas Nethercote
a6815f5654 Bug 1332577 (part 5) - Fix indentation in platform.cpp. r=mstange.
The patch fixes some 4 space indents and tab indents.

--HG--
extra : rebase_source : aeef635fe85c6b68e055346d6602382316ae51c9
2017-01-20 14:20:11 +11:00
Nicholas Nethercote
07ed817efc Bug 1332577 (part 4) - Inline and remove GeckoProfilerTypes.h. r=mstange.
It's only included once, so there's no point having a separate file.

--HG--
extra : rebase_source : b81fb0b90adeb16e81cb6f52d847a2a28c516fed
2017-01-20 10:14:01 +11:00
Nicholas Nethercote
b549639a20 Bug 1332577 (part 3) - Inline and remove GeckoProfilerImpl.h. r=mstange.
It's only included once, so there's no point having a separate file.

--HG--
extra : rebase_source : b8bd266e3e792b350c16a3d59d125430ff1b42db
2017-01-20 09:54:56 +11:00
Nicholas Nethercote
e0bd6662d5 Bug 1332577 (part 2) - Inline and remove GeckoProfilerFunc.h. r=mstange.
It's only included once, so there's no point having a separate file.

--HG--
extra : rebase_source : 486b7c40ffe2b185efb145ba6e0e0c784e0299f5
2017-01-19 17:44:17 +11:00
Nicholas Nethercote
11ca48a8ae Bug 1332577 (part 1) - Remove PROFILER_MAIN_THREAD_* macros. r=mstange.
The comment suggests these are performance-critical specializations. But (a)
they look very similar to all the other macros, i.e. have no obvious
specialization, and (b) they are unused.

--HG--
extra : rebase_source : d9a0088bfc9154336f56a536320b270fd993ff10
2017-01-19 16:37:02 +11:00
Mark Banner
16e6d381ac Bug 503613 - Remove old 'tail =' lines from xpcshell.ini files; r=gps
MozReview-Commit-ID: 62Hp5ISxowJ

--HG--
extra : rebase_source : daa8efb3409031fea553f4fd0c9d0746e38dc308
extra : histedit_source : b4c23aacf678ba0d0ac9c09191a7c494ead11a08
2017-01-18 10:30:39 +00:00
Nicholas Nethercote
7f3476781b Bug 1328373 (part 2) - Remove mozilla_sampler_get_responsiveness declaration. r=mstange.
It's unused.

--HG--
extra : rebase_source : 6e1e0f896f10367bb538c8e5839e2ac36174230c
2017-01-19 08:07:51 +11:00
Nicholas Nethercote
5fa7607c99 Bug 1328373 (part 1) - Remove mozilla_sampler_save. r=mstange.
It's unused.

--HG--
extra : rebase_source : ae05fc3bb205833e86f542ad2eba36de4d71b3b4
2017-01-19 08:07:50 +11:00
Nicholas Nethercote
a0ab21e630 Bug 1328369 - Remove tlsStackTop and set_tls_stack_top. r=mstange.
They are unused.

--HG--
extra : rebase_source : 1dd53c26f07c828102b3c12122d22bb1b0e74f3f
2017-01-19 08:07:23 +11:00
Nicholas Nethercote
eee9038a2f Bug 1317771 (part 2) - Remove SPS_STANDALONE. r=mstange.
This patch removes all the |#ifdef SPS_STANDALONE| blocks.

--HG--
extra : rebase_source : 0ccb72987e6b951360c6b9905ab47c61f59282c0
2017-01-19 08:07:00 +11:00
Nicholas Nethercote
4a820fa2dd Bug 1317771 (part 1) - Remove SPS_STANDALONE. r=mstange.
This patch removes all the |#ifndef SPS_STANDALONE| guards.

--HG--
extra : rebase_source : af03e38e521d7ef0c3c920209cc8330a40d9b007
2017-01-19 08:06:59 +11:00
Nicholas Nethercote
d7d1bbbb95 Bug 1331571 - Remove Intel Power Gadget integration from the compiler. r=mstange.
Nobody has ever used this, and measuring power consumption while running a
sampling profiler at 1000 Hz isn't a good idea.

--HG--
extra : rebase_source : b84255a08bfea07b90bedc1f24086695143d5c8e
2017-01-19 08:05:47 +11:00
Jan Beich
9e123aa5bd Bug 1329467 - Drop non-SPS version of AutoProfilerRegister. r=mstange
MozReview-Commit-ID: 9lZLPAi5ZZT

--HG--
extra : rebase_source : 4dc3e2926b80308d9a7ec2e23b505518c9e10b02
2017-01-09 23:03:22 +00:00
Jan Beich
ab093993b7 Bug 1329467 - Move remaining *RAII classes from GeckoProfiler under mozilla namespace. r=mstange
MozReview-Commit-ID: I8qqGDLJkgo

--HG--
extra : rebase_source : eeda752a75c050e5f88851d7401a462d86c24b80
2017-01-09 22:11:58 +00:00
Jan Beich
4676a59c08 Bug 1329467 - Revert bug 1151829 to unbreak non-SPS build after bug 1322553. r=mstange
MozReview-Commit-ID: 14QL0Unr84G

--HG--
extra : rebase_source : 0b0cd50d4c08bfc1d16f648a40c21ce56a72af5f
2017-01-09 21:46:56 +00:00
Luke Wagner
094950cd37 Bug 1330150 - Don't abandon sample if native stack walk fails (r=ehsan)
MozReview-Commit-ID: CyPPGEGX8R2
2017-01-12 17:40:20 -06:00
Eric Rahm
87cfbc1b65 Bug 1322735 - Remove MOZ_STACKWALKING define. r=glandium
With frame pointer omission disabled we should always have usable stacks on Windows. This allows us to remove the MOZ_STACKWALKING define as it will always be enabled.

MozReview-Commit-ID: 54xs3Hf1r4P

--HG--
extra : rebase_source : dfaf13fb4c2185985f4f074c338ccf1fef8f3c94
2016-12-20 15:11:36 -08:00
Phil Ringnalda
1c2d0d367f Backed out 3 changesets (bug 1322735) for ASan leaks and xpcshell/selftest.py failures
CLOSED TREE

Backed out changeset 01cfc71ce542 (bug 1322735)
Backed out changeset 84c729c41230 (bug 1322735)
Backed out changeset b419aaefae95 (bug 1322735)
2017-01-10 20:17:34 -08:00
Eric Rahm
2e195de610 Bug 1322735 - Remove MOZ_STACKWALKING define. r=glandium
With frame pointer omission disabled we should always have usable stacks on Windows. This allows us to remove the MOZ_STACKWALKING define as it will always be enabled.

MozReview-Commit-ID: 54xs3Hf1r4P

--HG--
extra : rebase_source : 5fe27cdeeb464d81fbedc8c02ac187658bd759e7
2016-12-20 15:11:36 -08:00
Thinker K.F. Li
ac11da5245 Bug 1319669 - Add class AutoScopedLabel. r=cyu
--HG--
extra : rebase_source : 7f39a2a74117442126c2280d35d80a45eecdcf57
2017-01-09 18:46:00 +01:00
Carsten "Tomcat" Book
89882dc5f4 merge mozilla-inbound to mozilla-central a=merge 2017-01-10 12:11:31 +01:00
Phil Ringnalda
1501dc93d8 Backed out changeset e39a1f381b85 (bug 1329861) for failures in browser_webconsole_console_trace_async.js and browser_net_cause.js
CLOSED TREE

MozReview-Commit-ID: GeiUQqUy9NG
2017-01-09 21:30:17 -08:00
Ehsan Akhgari
232b749f36 Bug 1329861 - Disable async stack capturing while profiling using the Gecko Profiler; r=mstange 2017-01-10 11:29:52 +08:00
Nathan Froyd
e4b0546d8d Bug 1329634 - actually call profiler_tracing in GeckoProfilerTracingRAII constructor; r=mstange 2017-01-09 18:50:53 -05:00
Jan Beich
b492741091 Bug 1329291 - Unbreak build on non-SPS platforms after bug 1142197. r=froydnj
MozReview-Commit-ID: LIfC5mj8uzL

--HG--
extra : rebase_source : 5290d461c6bba0d26b7ff1dbbc42964af8dcb8cc
2017-01-08 03:03:39 +00:00
Jan Beich
f77c4a415c Bug 1329466 - Unbreak build on non-SPS platforms after bug 1323100. r=mstange
MozReview-Commit-ID: Af1CuVYSNCj

--HG--
extra : rebase_source : ac6c76674785912a24081e7140df33ec0c2789e1
2017-01-08 03:04:48 +00:00
Nathan Froyd
9f924cc32c Bug 1322553 - part 1 - add a non-backtrace-taking constructor for GeckoProfilerTracingRAII; r=mstange
Sometimes there's no backtrace available, but you still want to denote
an interesting event.
2017-01-07 15:56:49 -05:00
Ryan VanderMeulen
1e6f972917 Merge inbound to m-c. a=merge 2017-01-07 11:22:47 -05:00
Iris Hsiao
7e248d8cc9 Merge mozilla-central to autoland 2017-01-06 11:13:22 -05:00
Markus Stange
4bdc4ca0fb Bug 1323100 - Register most of the remaining threadfunc threads with the profiler. r=froydnj
As far as I can tell, this covers all the remaining threads which we start
using PR_CreateThread, except the ones that are created inside NSPR or NSS,
and except for the Shutdown Watchdog thread in nsTerminator.cpp and the
CacheIO thread. The Shutdown Watchdog thread stays alive past leak detection
during shutdown (by design), so we'd report leaks if we profiled it. The
CacheIO thread seems to stay alive past shutdown leak detection sometimes as
well.

This adds a AutoProfilerRegister stack class for easy registering and
unregistering. There are a few places where we still call
profiler_register_thread() and profiler_unregister_thread() manually, either
because registration happens conditionally, or because there is a variable that
gets put on the stack before the AutoProfilerRegister (e.g. a dynamically
generated thread name). AutoProfilerRegister needs to be the first object on
the stack because it uses its own `this` pointer as the stack top address.

MozReview-Commit-ID: 3vwhS55Yzt

--HG--
extra : rebase_source : 56dd27282e7bd09a7e7dc7ca09ccfe3a0198e7af
2017-01-05 16:34:26 +01:00
Joel Maher
767b9e9306 Bug 1253155 - remove test_saved_stacks.js as it isn't useful. r=fitzgen
MozReview-Commit-ID: FLBM9k6jpn6
2016-12-30 12:30:17 -05:00
Wes Kocher
26a1ba5c14 Backed out 27 changesets (bug 1323100) for clipboard leaktest failures a=backout
Backed out changeset 84fb749698ab (bug 1323100)
Backed out changeset d6d25e8bd001 (bug 1323100)
Backed out changeset 1b0855bb0c38 (bug 1323100)
Backed out changeset b6953e3f5739 (bug 1323100)
Backed out changeset 5572f3b63215 (bug 1323100)
Backed out changeset 12fb4c533659 (bug 1323100)
Backed out changeset c36524e4e919 (bug 1323100)
Backed out changeset 1e3b3eddbe26 (bug 1323100)
Backed out changeset 061110f1ae12 (bug 1323100)
Backed out changeset 413dbd31725b (bug 1323100)
Backed out changeset 06550f7eca62 (bug 1323100)
Backed out changeset 940933b13b36 (bug 1323100)
Backed out changeset a6d75c1cd724 (bug 1323100)
Backed out changeset 681cacbbaa3b (bug 1323100)
Backed out changeset 3d53787293f6 (bug 1323100)
Backed out changeset c0340dfe4766 (bug 1323100)
Backed out changeset 9f554991549d (bug 1323100)
Backed out changeset 757539e7039a (bug 1323100)
Backed out changeset a3c9b45aa917 (bug 1323100)
Backed out changeset 23d69df98a66 (bug 1323100)
Backed out changeset 1297ded6a01d (bug 1323100)
Backed out changeset f4235b97257f (bug 1323100)
Backed out changeset 93419cb4f29f (bug 1323100)
Backed out changeset 865d1b81c804 (bug 1323100)
Backed out changeset 54acf4ef8e84 (bug 1323100)
Backed out changeset 88d17bcd8205 (bug 1323100)
Backed out changeset 0c466e5e8933 (bug 1323100)
2016-12-29 16:28:36 -08:00
Markus Stange
2319d2881d Bug 1324941 - Add a profiler label and a profiler marker for DOMEvent dispatch. r=smaug
MozReview-Commit-ID: 9nyftWPKRVe

--HG--
extra : rebase_source : 0ef900fa5c7749dd5bcec32da6b37aad91f0a518
2016-12-23 12:44:35 +01:00
Markus Stange
48513de60f Bug 1323100 - Register most of the remaining threadfunc threads with the profiler. r=froydnj
As far as I can tell, this covers all the remaining threads which we start
using PR_CreateThread, except the ones that are created inside NSPR or NSS.

This adds a AutoProfilerRegister stack class for easy registering and
unregistering. There are a few places where we still call
profiler_register_thread() and profiler_unregister_thread() manually, either
because registration happens conditionally, or because there is a variable that
gets put on the stack before the AutoProfilerRegister (e.g. a dynamically
generated thread name). AutoProfilerRegister needs to be the first object on
the stack because it uses its own `this` pointer as the stack top address.

MozReview-Commit-ID: 3vwhS55Yzt

--HG--
extra : rebase_source : dffab11abf7d4b57fa54475fd22e71b84375cd7b
2016-12-29 22:32:52 +01:00
Steve Fink
bb5723d671 Bug 1326134 - Report whether javascript.options.asyncstack is active, r=fitzgen
--HG--
extra : rebase_source : dce39aa1d4c1c3ae264beb3bd6ea2866b6d960b7
2016-12-28 17:33:12 -08:00
Steve Fink
3949f5f1e8 Bug 1326134 - Report DEBUG builds in profiles, r=mstange
--HG--
extra : rebase_source : 6b63ad187df9f1591e30397e017c69277d014697
2016-12-28 17:20:42 -08:00
Steve Fink
8ccd756578 Bug 1326134 - Report whether GC poisoning is enabled in profiles, r=jonco
--HG--
extra : rebase_source : 8b64acda00627b1ab9c8ba3666dc0dc4e51819d9
2016-12-28 17:12:23 -08:00
Nathan Froyd
e618b8d55a Bug 1328408 - make Sampler::GetRegisteredThreads not copy the registered threads list; r=mstange
We call GetRegisteredThreads repeatedly on the sampler thread whenever
the profiler is active; there's no reason to have it churn memory.
2017-01-05 15:55:47 -05:00
Nathan Froyd
fea256a2e2 Bug 1328636 - move Sampler::{Register,Unregister}CurrentThread into common code; r=mstange
We have an abstraction over the current thread ID already, so we can use
that to get the current thread id and eliminate this bit of
cut-and-paste programming.
2017-01-05 15:41:09 -05:00
Nathan Froyd
977ac8192b Bug 1328370 - remove GeckoSampler::mPrimaryThreadProfile; r=mstange
The only interesting setter of this field is
GeckoSampler::GetPrimaryThreadProfile, which is unused.  Once that
function is removed, mPrimaryThreadProfile is set to null in
GeckoSampler's constructor and never changed or referenced.
2017-01-06 09:21:01 -05:00
Nathan Froyd
4039d9589a Bug 1142197 - manage ProfilerBacktrace with UniquePtr; r=mstange
Smart pointers are better than raw pointers.
2017-01-06 09:21:01 -05:00
Nathan Froyd
0dab5bba8e Bug 1322863 - part 3 - manage Sampler::PlatformData with UniquePtr; r=mstange
Smart pointers are better than raw pointers, and this makes clients of
PlatformData slightly simpler because they don't have to manage
destruction themselves: the new UniquePtr-derived type handles all of
that for us.
2017-01-06 09:21:01 -05:00
Nathan Froyd
5767fcd327 Bug 1322863 - part 2 - make ThreadInfo manage mProfile with UniquePtr; r=mstange
Smart pointers are better than raw pointers.  This change also has the
benefit of removing the manual memory management in ~GeckoSampler and
locating all the memory management in ThreadInfo, where it belongs.
2017-01-06 09:21:01 -05:00