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

977 Коммитов

Автор SHA1 Сообщение Дата
Nicholas Nethercote d6624d0e50 Bug 816598 - Add a memory reporter for the Gecko Profiler. r=mstange,jseward.
It's fairly straightforward, and measures the important parts of:

- Sampler, PseudoStack, ProfileBuffer, ThreadInfo.

- LUL, PriMap, SecMap

Coverage isn't perfect, but it gets the major things I found via DMD on Linux.

Example output in about:memory:

├──151.21 MB (49.73%) -- profiler
│  ├──141.49 MB (46.53%) ── lul
│  └────9.72 MB (03.20%) ── sampler

--HG--
extra : rebase_source : 67d2ada42aead43f68f5100a08204a1d1f1cfceb
2017-01-30 12:37:26 +11:00
Julian Seward 11b9557938 Bug 1328385 - Replace the profile entry tag with an enum. r=kvijayan.
--HG--
extra : rebase_source : 4e8de98fc4e89a772e8fdc2261e0ebb8d30e2642
2017-02-07 16:47:28 +01:00
Julian Seward eed29460b1 Bug 1245477 - Crashes in lul::DerefTUW. r=nfroyd.
--HG--
extra : rebase_source : 647ea253f987720f3a641f382426de3d8ad1d1d4
2017-02-06 09:03:38 +01:00
Nicholas Nethercote 46b88ab7a6 Bug 1336326 (part 3) - Remove SamplerRegistry. r=mstange.
We only have one global Sampler, gSampler, and so SamplerRegistry is just an
unnecessary and obfuscating wrapper around it.

--HG--
extra : rebase_source : b675c414d0081dab2cd7dac864ffdff5070afe7d
2017-02-03 13:18:02 +11:00
Nicholas Nethercote 7302f2a052 Bug 1336326 (part 2) - Make sRegisteredThreadsMutex a StaticMutex. r=mstange.
StaticMutexes don't need to be created or destroyed, which avoids the need for
checking if they still exist.

This patch also adds locking to a few functions that lacked it. Every access to
sRegisteredThreads is now protected appropriately.

--HG--
extra : rebase_source : 2ea1d7372652ddd532e6e98c167be0997df33f07
2017-02-03 13:11:34 +11:00
Nicholas Nethercote e68e4a6f44 Bug 1336326 (part 1) - Remove Sampler::GetRegisteredThreads(). r=mstange.
Sampler::sRegisteredThreadsMutex is public. Might as well make
Sampler::sRegisteredThreads public too. This allows the getter to be removed,
and makes the code a little easier to read.

--HG--
extra : rebase_source : 4ff3ba92c9d74ae1b10a2be227ca15f61d15bee2
2017-02-03 11:27:14 +11:00
Greg Mierzwinski d034427bd2 Bug 1301197 - Add xpcshell code coverage to linux64-jsdcov and the 'coverage' mozinfo flag. r=jmaher
This patch makes it possible to collect code coverage for xpcshell tests using the linux64-jsdcov build. It also enables the use of a 'coverage' flag to disable tests when they are instrumented with the js debugger for code coverage. Lastly, it uses the 'coverage' flag to disable certain tests.

MozReview-Commit-ID: 97VFkJmlwQn

--HG--
extra : rebase_source : 26c841f5a68f927889c0903e701bfde4b7ca84ac
2016-11-08 15:57:21 -05:00
Shih-Chiang Chien e452abf554 Bug 1336004 - add missing header file for TaskTracer. r=cyu
MozReview-Commit-ID: 11cMTxBWCRl

--HG--
extra : rebase_source : d8fb52e1b4d81f72fbb674a19b983a0e376fabde
2017-02-02 12:00:58 +08:00
Julian Seward 62b845c331 Bug 1328916 - Remove ProfilerSaveSignalHandler and transitively reachable code. r=mstange.
--HG--
extra : rebase_source : c4b95dcf205d4df81e22d4b08947d55ab4fac8ca
2017-02-02 10:04:02 +01:00
Julian Seward 95cd90edee Bug 1329150 - Remove ENABLE_ARM_LR_SAVING and its code. r=mstange.
--HG--
extra : rebase_source : 14c459cbfa061a885221d2d89a98f98d721679c2
2017-02-02 08:29:18 +01:00
Nicholas Nethercote bd934d48e6 Bug 1335595 (part 5) - Remove ThreadResponsiveness::mThreadInfo. r=mstange.
ThreadInfo contains a ThreadResponsiveness, and then ThreadResponsiveness has a
pointer back to its containing ThreadInfo, which is gross.

The back pointer is only needed for Update(), and it's easy to pass in the
necessary info instead via a new method UpdateThreadResponsiveness().

This change also means ThreadInfo::GetThread() can be removed.

--HG--
extra : rebase_source : 46ebeb142e8c678be204b106713147738bcbc4a4
2017-02-02 11:07:13 +11:00
Nicholas Nethercote 9373d7166c Bug 1335595 (part 4) - Merge ThreadProfile into ThreadInfo. r=mstange.
ThreadInfo and ThreadProfile are hopelessly intertwined.

- ThreadInfo has an owning pointer to ThreadProfile. ThreadProfile has a raw
  back pointer to ThreadInfo. A reference to one is as good as a reference to
  the other, and references to one frequently reach into the other.

- An exception is SyncProfile, a sub-class of ThreadProfile, which instead has
  an owning pointer to its ThreadInfo. (This makes the SyncProfile's destructor
  dubious, because it deletes the ThreadInfo, which could conceivably re-call
  into SyncProfile's destructor.)

- ThreadProfile also has copies of five ThreadInfo fields (mThreadId,
  mIsMainThread, mPlatformData, mStackTop, mPseudoStack) even though it also
  has direct ThreadInfo access via the back pointer.

The only good reason for having the two classes separate is that some
ThreadInfo objects have a null ThreadProfile pointer. But this doesn't justify
the entanglement.

So this patch merges ThreadProfile into ThreadInfo. It visually separates the
methods and fields related to profiles to partially preserve the original
meaning of the split. The new ThreadInfo::hasProfile() method replaces
ThreadInfo::Profile() as the indicator of whether a ThreadInfo has associated
profile data.

Notable points of simplification:

- The five duplicated fields are no longer duplicated.

- NewSyncProfile(), RegisterThread() no longer create ThreadProfile objects.

- ~SyncProfile() becomes trivial.

- ThreadInfo::SetPendingDelete() is simpler.

- Overall it removes ~80 lines of code.

Much of the rest is just plumbing changes.

--HG--
extra : rebase_source : 2e8c4cc46aa15943ffdc1fa19d9c829587267ee9
2017-02-02 11:07:13 +11:00
Nicholas Nethercote 8b717f8d56 Bug 1335595 (part 3) - Remove ThreadProfile::AsSyncProfile(). r=mstange.
It's unused.

--HG--
extra : rebase_source : fb855811ff1d807707fd1b605b747cff1b6d6be3
2017-02-02 11:07:12 +11:00
Nicholas Nethercote afd35b70c0 Bug 1335595 (part 2) - Remove useless null checks in Sampler::InplaceTick(). r=mstange.
|sample| is non-null at all callsites. The function derefs |sampler| before
doing any of the null checks, anyway.

--HG--
extra : rebase_source : 5c3c917009310ade1faaf985ac866a4a98fe6abc
2017-02-01 15:41:29 +11:00
Nicholas Nethercote f542865603 Bug 1335595 (part 1) - Remove the profiler's ASSERT macro. r=mstange.
MOZ_ASSERT is the standard macro.

--HG--
extra : rebase_source : 8aa9b96b82ff4b7ec2de4ec5c62aeb23aafea85f
2017-02-01 15:40:55 +11:00
Nicholas Nethercote dfbacc4a42 Bug 1334466 (part 5) - Remove PlatformData::profiled_pthread_. r=mstange.
It's unused.

--HG--
extra : rebase_source : a755202318cf8abceefd1d29326380f3bc2746b7
2017-01-28 01:07:01 +11:00
Nicholas Nethercote d1afdf0d74 Bug 1334466 (part 4) - Remove Sampler::profiling_. r=mstange.
Because it's always true.

--HG--
extra : rebase_source : b77cccb79989e6e93f003609baab34ca588e455e
2017-01-28 00:58:55 +11:00
Nicholas Nethercote 9c6ed67ad7 Bug 1334466 (part 3) - Rename GeckoSampler.cpp as Sampler.cpp. r=mstange.
The patch also moves some Sampler methods from platform.cpp to Sampler.cpp. Now
all Sampler methods are in Sampler.cpp except for a small number of
platform-specific ones, which are in platform-*.cpp.

--HG--
rename : tools/profiler/core/GeckoSampler.cpp => tools/profiler/core/Sampler.cpp
extra : rebase_source : a13862dccfcb1c78567cc9eb22e92b8410d2e544
2017-01-28 00:57:52 +11:00
Nicholas Nethercote b33fc679ac Bug 1334466 (part 2) - Merge Sampler and GeckoSampler. r=mstange.
There's no point having them as separate classes. This removes the need for
some virtual functions, too.

--HG--
extra : rebase_source : b2607ba2431ae043b6e015f4f435b0d660b02d71
2017-01-25 14:34:25 +11:00
Nicholas Nethercote 0a42d0f79c Bug 1334466 (part 1) - Merge Sampler constructors and destructors. r=mstange.
They're defined separately for each platform, but the definitions are almost
identical and can be commoned up.

--HG--
extra : rebase_source : 67b7f88410db1951a20f03f6c156aa6b35a3ee20
2017-01-28 00:52:57 +11:00
Nicholas Nethercote e584767774 Bug 1333655 - Improve the profiler's Thread class. r=mstange.
It's a clumsy cross-platform abstraction. GetCurrentId() and tid_t are the only
genuinely cross-platform things in it, and the patch keeps those in place.

The remaining methods are not implemented on all platforms (none are
implemented on Linux) and the fields are all used on either Mac or Windows, but
not both. So the patch moves the relevant Thread method implementations and
fields into the existing SamplerThread classes. There is sufficiently little
overlap between the two SamplerThread classes that there is no point sharing a
base class between them. This avoids the need for virtual functions, and
simplifies thread naming on Mac.

The patch also changes some of the existing code to use Gecko style, e.g.
|mFoo| instead of |foo_| for class fields.
2017-01-25 14:34:25 +11:00
Nicholas Nethercote 234a671f05 Bug 1328365 (part 3) - Remove GeckoSampler::sActiveSampler. r=mstange.
This variable is set in GeckoSampler's destructor and cleared in GeckoSampler's
destructor, which means it's just another handle to the GeckoSampler singleton,
which means it duplicates gSampler.

This patch replaces its uses with gSampler uses. This exposes various places
where GeckoSampler is being accessed off the main thread, which I have marked
with XXX comments.

--HG--
extra : rebase_source : 3c2d012b4d38d353022f384c31a528096a462711
2017-01-27 16:25:23 +11:00
Nicholas Nethercote 9fcc3d9c39 Bug 1328365 (part 2) - Rename ProfileGatherer::mTicker as mSampler. r=mstange.
It's a better name, given that the type is |GeckoSampler*|.

--HG--
extra : rebase_source : aaeb9d0c34f8650c2e034e334825c7e8d7c1e832
2017-01-25 16:09:06 +11:00
Nicholas Nethercote fd25b06c81 Bug 1328365 (part 1) - Replace tlsTicker with gSampler. r=mstange.
There is a single GeckoSampler and it is currently only accessed on the main
thread, so it's silly to use TLS for it; a normal global variable is better.

This patch also adds main thread assertions to a number of the profiler_*()
functions. Even though bug 1330184 may get rid of some of them, right now they
are a useful as both a sanity check and documentation.

--HG--
extra : rebase_source : 7613eb3cc8089b31180365f6463c81f4556c7b66
2017-01-25 16:00:47 +11:00
Nicholas Nethercote 45bf8c43bb Bug 1329684 (part 2) - Remove OS::msPerSecond, which is unused. r=mstange.
--HG--
extra : rebase_source : 5c0fcac9c52e8c9b0022002cbbdcaef33982a682
2017-01-25 14:33:34 +11:00
Nicholas Nethercote 6eb4bf69b1 Bug 1329684 (part 1) - Remove GeckoMutex, ::Mutex and ::MutexAutoLock from the profiler. r=mstange.
Note that the comment on ::Mutex said that it should support recursive locking,
but GeckoMutex was implemented using mozilla::Mutex which does *not* support
recursive locking.

The patch also removes OS::CreateMutex(), because it's only used twice and
doesn't make the code more concise.

--HG--
extra : rebase_source : 81f324cb3856ea5329d8b6edb457c8ec44395c56
2017-01-25 14:33:32 +11:00
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