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

4484 Коммитов

Автор SHA1 Сообщение Дата
Nicholas Nethercote af3c0f7fd5 Bug 1347348 (part 2) - Add a comment about the profiler's "startTime" field. r=mstange.
It took me some time to understand this snippet of code, so I wrote a comment
about it.

--HG--
extra : rebase_source : b25fc8384a4fe00df7d8a0585e7a1944226fa212
2017-03-14 16:47:18 +11:00
Nicholas Nethercote 0414a346c4 Bug 1347348 (part 1) - Don't export ProfilerBacktrace.h. r=mstange.
ProfilerBacktrace.h doesn't need to be visible outside the profiler because
the ProfilerBacktrace type is only used in pointers outside the profiler and
the existing forward declaration in GeckoProfiler.h suffices for that.

--HG--
rename : tools/profiler/public/ProfilerBacktrace.h => tools/profiler/core/ProfilerBacktrace.h
extra : rebase_source : 50752626fbd6948de26e193956ed7b82b41b1830
2017-03-07 16:54:50 +11:00
Markus Stange 5c5945bfa0 Bug 1329111 - Change the nsIProfiler shared library information API. r=njn
API before this change:
 - nsIProfiler::getSharedLibraryInformation() returns a string containing a
   JSON array of libraries.
 - The profile format is at version 3.
 - Every profile has a "libs" field that contains the same JSON string as the
   return value of nsIProfiler::getSharedLibraryInformation.
 - The array of libraries is not sorted.
 - Each library has a "name" field that contains:
    - The module's debug name on Windows
    - The full path to the binary on Mac + Linux

API after this change:
 - nsIProfiler::getSharedLibraryInformation() is removed.
 - nsIProfiler has a readonly property called sharedLibraries.
 - The profile format is at version 4.
 - Every profile has a "libs" field that contains the same array as
   nsIProfiler.sharedLibraries, no longer as a JSON string but as a regular
   array.
 - The array of libraries is sorted by start address.
 - Each library has a "name" field that contains the binary file's basename,
   on all platforms.
 - Each library has a "path" field that contains the full path to the binary,
   on all platforms.
 - Each library has a "debugName" field that contains the library's debug
   name, on all platforms. On Windows, the debug name is the filename
   (basename) of the pdb file for that binary. On other platforms, debugName
   is the same as |name|.
 - Each library has a "debugPath" field that contains the absolute path
   library's pdb file on Windows; on non-Windows, debugPath and path are the
   same.
 - Each library has an "arch" field that is either an empty string (Linux +
   Windows) or the library's architecture; it'll differentiate between the
   architectures "x86_64" and "x86_64h". (x86_64h is used for binaries that
   contain instructions that are specific to the Intel Haswell
   microarchitecture.)

MozReview-Commit-ID: 8Nrs4dyHhDS

--HG--
extra : rebase_source : 4039926ae4d776bf53ea71df5fe3f8200d3e2784
extra : source : 4e282aa03422de5b8d51e1aaeb3e53ee547293dd
2017-03-14 18:59:20 -04:00
Markus Stange e552737d0a Bug 1329111 - Use JSONWriter when generating the GetSharedLibraryInfo() JSON. r=njn
MozReview-Commit-ID: LZalkkFreym

--HG--
extra : rebase_source : 71d95c3ff6454d72515c33ea7df742d95e94872b
2017-03-13 17:08:38 -04:00
Markus Stange 5d618f99af Bug 1329111 - Record shared library architecture on Mac. r=glandium,njn
This is interesting information on Mac because some system libraries come in
two 64 bit versions: a regular one, and one that contains Haswell-specific
instructions. The former 'architecture' is called x86_64 and the latter is
called x86_64h (h for Haswell).

We set arch to the empty string on non-Mac platforms. It's not all that
interesting on those platforms because there will be only one architecture
in the binary at the given path, unlike on Mac where you can have fat
binaries with multiple architectures.

MozReview-Commit-ID: Dgnslv0D3Ug

--HG--
extra : rebase_source : cf1fcfc1635d373eaeea35aad2f73b235097c748
2017-03-13 17:51:41 -04:00
Markus Stange 4be87b17a8 Bug 1329111 - Supply SharedLibraryInfo with the absolute module path and debug path on all platforms. r=marco
MozReview-Commit-ID: 9R3ecPxGoMr

--HG--
extra : rebase_source : 3cc2af0e5c2b40f349f9e77e06731188d9af07ea
2017-03-14 18:26:50 -04:00
Markus Stange 0048861a6b Bug 1329111 - Rename SharedLibraryInfo::mName to mModuleName, and consistently cut off the path on all platforms. r=marco
MozReview-Commit-ID: 8gqqVjTjy1Z

--HG--
extra : rebase_source : 646340086cd46fe023495bfca140e859c98a5205
2017-03-14 17:07:43 -04:00
Sebastian Hengst 8b715d46ad Backed out changeset ff2306d8e07f (bug 1329111) for lacking a semicolon in devtools/server/performance/profiler.js. r=backout 2017-03-16 20:00:34 +01:00
Sebastian Hengst 224e25992e Backed out changeset 2656a5fa88a2 (bug 1329111) 2017-03-16 19:59:53 +01:00
Sebastian Hengst 01760e033d Backed out changeset 54d438799138 (bug 1329111) 2017-03-16 19:59:48 +01:00
Sebastian Hengst 43b6b924d6 Backed out changeset 2f4e6242c90c (bug 1329111) 2017-03-16 19:59:43 +01:00
Sebastian Hengst 80e2e16b3e Backed out changeset eaac943ff2f6 (bug 1329111) 2017-03-16 19:59:39 +01:00
Markus Stange 32230f6988 Bug 1329111 - Change the nsIProfiler shared library information API. r=njn
API before this change:
 - nsIProfiler::getSharedLibraryInformation() returns a string containing a
   JSON array of libraries.
 - The profile format is at version 3.
 - Every profile has a "libs" field that contains the same JSON string as the
   return value of nsIProfiler::getSharedLibraryInformation.
 - The array of libraries is not sorted.
 - Each library has a "name" field that contains:
    - The module's debug name on Windows
    - The full path to the binary on Mac + Linux

API after this change:
 - nsIProfiler::getSharedLibraryInformation() is removed.
 - nsIProfiler has a readonly property called sharedLibraries.
 - The profile format is at version 4.
 - Every profile has a "libs" field that contains the same array as
   nsIProfiler.sharedLibraries, no longer as a JSON string but as a regular
   array.
 - The array of libraries is sorted by start address.
 - Each library has a "name" field that contains the binary file's basename,
   on all platforms.
 - Each library has a "path" field that contains the full path to the binary,
   on all platforms.
 - Each library has a "debugName" field that contains the library's debug
   name, on all platforms. On Windows, the debug name is the filename
   (basename) of the pdb file for that binary. On other platforms, debugName
   is the same as |name|.
 - Each library has a "debugPath" field that contains the absolute path
   library's pdb file on Windows; on non-Windows, debugPath and path are the
   same.
 - Each library has an "arch" field that is either an empty string (Linux +
   Windows) or the library's architecture; it'll differentiate between the
   architectures "x86_64" and "x86_64h". (x86_64h is used for binaries that
   contain instructions that are specific to the Intel Haswell
   microarchitecture.)

MozReview-Commit-ID: 8Nrs4dyHhDS

--HG--
extra : rebase_source : 4039926ae4d776bf53ea71df5fe3f8200d3e2784
extra : source : 4e282aa03422de5b8d51e1aaeb3e53ee547293dd
2017-03-14 18:59:20 -04:00
Markus Stange 05996c7dbf Bug 1329111 - Use JSONWriter when generating the GetSharedLibraryInfo() JSON. r=njn
MozReview-Commit-ID: LZalkkFreym

--HG--
extra : rebase_source : 71d95c3ff6454d72515c33ea7df742d95e94872b
2017-03-13 17:08:38 -04:00
Markus Stange 5fdbdd6b74 Bug 1329111 - Record shared library architecture on Mac. r=glandium,njn
This is interesting information on Mac because some system libraries come in
two 64 bit versions: a regular one, and one that contains Haswell-specific
instructions. The former 'architecture' is called x86_64 and the latter is
called x86_64h (h for Haswell).

We set arch to the empty string on non-Mac platforms. It's not all that
interesting on those platforms because there will be only one architecture
in the binary at the given path, unlike on Mac where you can have fat
binaries with multiple architectures.

MozReview-Commit-ID: Dgnslv0D3Ug

--HG--
extra : rebase_source : cf1fcfc1635d373eaeea35aad2f73b235097c748
2017-03-13 17:51:41 -04:00
Markus Stange 13cdaa1908 Bug 1329111 - Supply SharedLibraryInfo with the absolute module path and debug path on all platforms. r=marco
MozReview-Commit-ID: 9R3ecPxGoMr

--HG--
extra : rebase_source : 3cc2af0e5c2b40f349f9e77e06731188d9af07ea
2017-03-14 18:26:50 -04:00
Markus Stange c76fa9b925 Bug 1329111 - Rename SharedLibraryInfo::mName to mModuleName, and consistently cut off the path on all platforms. r=marco
MozReview-Commit-ID: 8gqqVjTjy1Z

--HG--
extra : rebase_source : 646340086cd46fe023495bfca140e859c98a5205
2017-03-14 17:07:43 -04:00
Greg Tatum 23488bd6ef Bug 1346776 - Add the process id in the Gecko Profiler; r=mstange
I also tweaked the int type of the JSON writer to match the IntProperty
method.

MozReview-Commit-ID: rtxLDKtJQZ

--HG--
extra : rebase_source : fa924479926cad6e07755d10c049a40ad896c3cd
2017-03-13 14:47:15 +01:00
Jared Wein a54eda04ca Bug 1348068 - Enable the key-spacing rule for eslint and fix the related issues. r=standard8
Running eslint with --fix didn't fix many of the issues. The majority here had to be fixed by hand but a significant majority of the issues were related to a few files that I was able to use find-and-replace with. I regret not making this in to separate commits of the hand-fixes and the fixes from --fix but I don't recall --fix fixing any of the issues.

MozReview-Commit-ID: ANyg2qfo3Qx

--HG--
extra : rebase_source : 61d2aa91bf9474af3d72a5dea41b25dca442c1b7
2017-03-21 14:29:43 -04:00
Sylvestre Ledru 6b9210f7cd Bug 1347474 - Update mach to download clang-format 5.0 r297730 r=andi
MozReview-Commit-ID: 69HZXo00gnG

--HG--
extra : rebase_source : cf045e62184ce96d1ec2f140178900b65636b4c7
2017-03-15 11:20:54 +01:00
Andi-Bogdan Postelnicu 0b7f0cc371 Bug 1346725 - removed useless null check in DoSampleStackTrace. r=mstange
MozReview-Commit-ID: 374xPqkTMxJ

--HG--
extra : rebase_source : f465278b0211f7a5ec47a1302a6d0a08cf35e804
2017-03-13 12:50:22 +02:00
Carsten "Tomcat" Book f807b332df merge mozilla-inbound to mozilla-central a=merge 2017-03-15 13:12:42 +01:00
Nicholas Nethercote 8876b32323 Bug 1345262 (part 5) - Fix how JS sampling is started/stopped by the profiler. r=mstange,djvj.
Currently, JS sampling has major problems.

- JS sampling is enabled for all JS threads from the thread that runs
  locked_profiler_start() -- currently only the main thread -- but the JS
  engine can't handle enabling from off-thread, and asserts. This makes
  profiling workers impossible in a debug build.

- No JS thread will be JS sampled unless enableJSSampling() is called, but that
  only happens in locked_profiler_start(). That means any worker threads
  created while the profiler is active won't be JS sampled.

- Only the thread that runs locked_profiler_stop() -- currently only the main
  thread -- ever calls disableJSSampling(). This means that worker threads that
  start being JS sampled never stop being JS sampled.

This patch fixes these three problems in the following ways.

- locked_profiler_start() now sets a flag in PseudoStack that indicates
  JS sampling is desired, but doesn't directly enable it. Instead, the JS
  thread polls that flag and enables JS sampling itself when it sees the flag
  is set. The polling is done by the interrupt callback. There was already a
  flag of this sort (mJSSampling) but the new one is better.

  This required adding a call to profiler_js_operation_callback() to the
  InterruptCallback() in XPCJSContext.cpp. (In comparison, the
  InterruptCallback() in dom/workers/RuntimeService.cpp already had such a
  call.)

- RegisterCurrentThread() now requests JS sampling of a JS thread when the
  profiler is active, the thread is being profiled, and JS sampling is enabled.

- locked_profiler_stop() now calls stopJSSampling() on all live threads.

The patch makes the following smaller changes as well.

- Renames profiler_js_operation_callback() as profiler_js_interrupt_callback(),
  because "interrupt callback" is the standard name (viz.
  JS_AddInterruptCallback()).

- Calls js::RegisterContextProfilingEventMarker() with nullptr when stopping
  JS sampling, so that ProfilerJSEventMarker won't fire unnecessarily.

- Some minor formatting changes.

--HG--
extra : rebase_source : 372f94c963a9e5b2493389892499b1ca205ebc2f
2017-03-10 09:04:23 +11:00
Nicholas Nethercote ce17b32bef Bug 1345262 (part 4) - Remove and inline PseudoStack::{clearContext,flushSamplerOnJSShutdown}(). r=mstange.
They each have a single call site, and this code makes makes more sense in
platform.cpp than as PseudoStack methods because it's mostly dealing with gPS.

--HG--
extra : rebase_source : 84d8c7d8989f0e02b238d591ece2be110cbbcb1a
2017-03-10 08:33:33 +11:00
Nicholas Nethercote 5703ff4afb Bug 1345262 (part 3) - Split PseudoStack::sampleContext() in two. r=mstange.
It does almost entirely different things depending on whether we are setting or
clearing the context.

--HG--
extra : rebase_source : 356445957968e1d055f4b717c65476fa765d8bd5
2017-03-09 17:06:39 +11:00
Nicholas Nethercote d8023679e3 Bug 1345262 (part 2) - Add profiler_{set,clear}_js_context(). r=mstange.
PseudoContext::sampleContext() is always called immediately after
profiler_get_pseudo_stack(). This patch introduces profiler_set_js_context()
and profiler_clear_js_context(), which replace the profiler_get_pseudo_stack()
+ sampleContext() pairs. This takes us a step closer to not having to export
PseudoStack outside the profiler.

--HG--
extra : rebase_source : 8558d1600eafd395cc696d31f3d21fb52a1a74b0
2017-03-09 17:06:35 +11:00
Markus Stange f3242f83fb Bug 1341924 - Don't attempt to dispatch CheckResponsivenessTasks to non-main threads. r=njn
This is more of a workaround than a real fix, but the old code wasn't working
for non-main threads either, and we'd like to change the way this information
is computed anyway (bug 1340714) and then we won't need CheckResponsivenessTask
any more.

MozReview-Commit-ID: FGiomjwpk3z

--HG--
extra : rebase_source : 95fc57c0622fdbaa928700a971a4ce839ad92797
2017-03-13 20:44:15 -04:00
Nicholas Nethercote 8c96fbb044 Bug 1345262 (part 1) - Remove unnecessary assertion. r=jseward.
Bug 1341255 changed PseudoStack::mStack to a js::ProfileEntry[], so we don't
need this assertion any more.

--HG--
extra : rebase_source : 7fcb5218db56b5a9409d81ff67d653e9db37414e
2017-03-07 16:54:54 +11:00
Nicholas Nethercote 9b58a42f2d Bug 1347044 - Shrink two gPSMutex thread-locking scopes in platform.cpp. r=mstange.
The most important of these is the one in profiler_get_profile_jsobject().
Currently the JS_ParseJSON() call frequently leads to deadlock, due to
profiler_log() being called within it.

--HG--
extra : rebase_source : 7825229da61ad0d567c11bd455a7a9b8f25b5b78
2017-03-14 16:13:55 +11:00
Nicholas Nethercote d4cea5f1de Bug 1346356 (part 4) - Clean up notification in the profiler. r=mstange.
This patch does the following.

- Introduces NotifyObservers() for the simple notification cases in
  platform.cpp.

- Removes profiler_lock() and profiler_unlock() because they do notifications
  that the profiler add-on no longer listens for.

--HG--
extra : rebase_source : 77a1868ba494dea314702bbdf9478a1da36c9efb
2017-03-14 10:03:33 +11:00
Nicholas Nethercote b152707def Bug 1346356 (part 3) - Do most NotifyObserver() calls when gPSMutex is unlocked. r=mstange.
Calling NotifyObserver() with gPSMutex locked is a bad idea; arbitrary code can
run in observers, which can easily include code that calls other profiler
functions that themselves lock gPSMutex, causing deadlock. This has been seen
in practise with locked_profiler_stop().

This patch moves all but one of the NotifyObserver() calls in platform.cpp to
after the sections where gPSMutex is locked. The remaining call (for the
"profiler-subprocess") is harmless, because it just calls a simple callback
implemented within platform.cpp, and hard to move.

In the future we plan to allow profiler_start() and profiler_stop() to be
called from different threads. When that happens, it will be possible for the
"profiler-start" and "profiler-stop" notifications to arrive out of order.
Unfortunately this seems difficult to avoid. (Well, recursive mutexes would
make this problem much easier, but we don't have those...)

--HG--
extra : rebase_source : 78455c4b2d93a0d4110cdd401d6b542b641dd217
2017-03-14 10:03:33 +11:00
Nicholas Nethercote bb5a8f5d97 Bug 1346356 (part 2) - Merge SamplerThread::Join() into ~SamplerThread(). r=mstange.
SamplerThread::Join() is always called just before the SamplerThread object is
deleted. Might as well combine them.

--HG--
extra : rebase_source : d7fc013b83ec77e347ffc3929533c5259df77e06
2017-03-14 10:03:33 +11:00
Nicholas Nethercote d498318442 Bug 1346356 (part 1) - Fix SamplerThread leak in profiler_start(). r=mstange.
profiler_start() can call locked_profiler_stop(). In that case it must then
call SamplerThread::Join() in order to free the SamplerThread, but it currently
doesn't.

This patch adds such a call. It also marks locked_profiler_start() with
MOZ_MUST_USE to make this mistake less likely in the future.

--HG--
extra : rebase_source : 9045561aa54b54099e710c3eaea5ac533ca5485b
2017-03-14 10:03:33 +11:00
Carsten "Tomcat" Book c1edc7067d merge mozilla-inbound to mozilla-central a=merge 2017-03-13 15:22:26 +01:00
Thinker K.F. Li 3a54d26c11 Bug 1346151 - Avoid compile time warning for format strings. r=cervantes
--HG--
extra : rebase_source : 9a8d0732a6d08288bf705c9fbc4ade23453cce19
2017-03-10 02:03:00 -05:00
Christoph Diehl 4d87f0665b Bug 777600 - Add MessageManager Fuzzer. r=billm
--HG--
extra : rebase_source : 2e37fe0109e45216820543512dfbe58f1fba15fe
2017-02-28 16:24:43 -08:00
Dave Townsend 15bd196ab5 Bug 1346014: Update the minimum required version of node to 6.9.1. r=jaws
MozReview-Commit-ID: Ex0HiKWHfwK

--HG--
extra : rebase_source : 2af12fc6b9c4153ed1b3c6d5b46ecda68c478dc2
2017-03-09 13:57:20 -08:00
Mark Banner 5420828c24 Bug 1314405 - Provide a readme for eslint-plugin-mozilla, and add some more details to its package.json. r=mossop
MozReview-Commit-ID: DdzWwWEFvf6

--HG--
extra : rebase_source : 6d1825b1007b56cd99567b46e735740ac0414757
2017-03-09 11:45:04 +00:00
Dan Minor 52f0cc6d8b Bug 1343557 - Make PfxInstr::operator== const; r=jseward
MozReview-Commit-ID: 5WpBNHbqz0q

--HG--
extra : rebase_source : 04a53887c9542cdafbb5d837090a62dd56a1333d
2017-03-01 15:26:29 -05:00
Joel Maher ca7bfa4829 Bug 1341819 - remove old tools/memory/ files. r=ahal
MozReview-Commit-ID: 6tFZH1tKATz
2017-03-08 11:17:11 -05:00
Florian Quèze 9d62681259 Bug 1345253 - Use element.firstChild.remove() instead of element.removeChild(element.firstChild), r=jaws. 2017-03-08 10:17:52 +01:00
Nicholas Nethercote d5457902e2 Bug 1342306 (part 3) - Properly synchronize the global state in platform*.cpp. r=mstange.
This patch properly synchronizes all the global state in platform*.cpp, which
gets us a long way towards implementing bug 1330184.

- Most of the global state goes in a new class, ProfilerState, with a single
  instance, gPS. All accesses to gPS are protected by gPSMutex. All functions
  that access ProfilerState require a token proving that gPS is locked; this
  makes things much clearer.

  gRegisteredThreadsMutex is removed because it is subsumed by gPSMutex.

- gVerbosity, however, does not go in ProfilerState. It stays separate, and
  gains its own mutex, gVerbosityMutex.

Also, the tracking of the current profiler state is streamlined. Previously it
was tracked via:

- stack_key_initialized, gInitCount, gSampler, gIsProfiling, gIsActive, and
  gIsPaused.

Now it is tracked via:

- gPS, gPS->sActivity, and gPS->mIsPaused.

This means that the Sampler class is no longer necessary, and the patch removes
it.

Other changes of note made by the patch are as follows.

- It removes ThreadInfo::{mMutex,GetMutex}. This mutex was only used in two
  places, and both these are now protected by gPSMutex.

- It tweaks the LOG calls. All the main functions (init(), shutdown(), start(),
  stop()) now do consistent BEGIN/END logging, and a couple of other low-value
  incidental LOG calls have been removed.

- It adds a lot of release assertions requiring that gPS be initialized (e.g.
  profiler_init() has been called but profiler_shutdown() has not).

- It uses alphabetical order for everything involving profiler feature names.

- It removes Platform{Start,Stop}() and SamplerThread::{Start,Stop}Sampler().
  These are no longer necessary now that SamplerThread::sInstance has been
  replaced with ProfilerState::mSamplerThread which allows more direct access
  to the current SamplerThread instance.

- It removes PseudoStack::mPrivacyMode. This was derived from the "privacy"
  feature, and we now use gPS->mFeaturePrivacy directly, which is simpler.
  It also replaces profiler_in_privacy_mode() with
  profiler_is_active_and_not_in_privacy_mode(), which avoids an unnecessary
  lock/unlock of gPSMutex on a moderately hot path.

Finally, the new code does more locking than the old one. A number of operation
The following operations now lock a mutex when they previously didn't; the
following are ones that are significant, according to some ad hoc profiling.

- profiler_tracing()
- profiler_is_active()
- profiler_is_active_and_not_in_privacy_mode()
- profiler_add_marker()
- profiler_feature_active()
- SamplerThread::Run() [when the profiler is paused]

All up this roughly doubles the amount of mutex locking done by the profiler.
It's probably possible to avoid this increase by allowing careful unlocked
access to three of the fields in ProfilerState (mActivityGeneration,
mFeaturePrivacy, mStartTime), but this should only be done as a follow-up if
the extra locking is found to be a problem.

--HG--
extra : rebase_source : c2e41231f131b3e9ccd23ddf43626b54ccc77b7b
2017-03-08 12:40:39 +11:00
Nicholas Nethercote f16f2400e4 Bug 1340161 - Fix PseudoStack handling when profiler threads are marked with SetPendingDelete(). r=jseward.
Instead of nulling ThreadInfo::mPseudoStack, the patch changes things so that
ownership of the PseudoStack is transferred to the ThreadInfo. This avoids
crashes in some cases.

The patch also makes ThreadInfo::mPseudoStack a NotNull<>.

--HG--
extra : rebase_source : 95ace8886092ebe17ac0f4431c8c0936946c1f44
2017-03-08 11:37:00 +11:00
Florian Quèze e2b53c13ce Bug 1344711 - Add an eslint rule to report an error when a get*Pref call is the only instruction in a try block, r=jaws.
--HG--
extra : rebase_source : b98fc9c75089c3eeb2f1317623b08ee9cd4d1541
2017-03-07 15:29:47 +01:00
Carsten "Tomcat" Book 087da3f0d9 merge mozilla-inbound to mozilla-central a=merge 2017-03-07 15:13:31 +01:00
djmdev 9ac2a16551 Bug 1332651 - Enabled python code linting in Telemetry. r=Dexter
Enabled python code linting in Telemetry and created a new .flake8 file in
toolkit/components/telemetry.
2017-03-03 23:47:04 +05:30
Zibi Braniecki 100766fec4 Bug 1335877 - Remove resource://services-common/stringbundle.js from gecko. r=gandalf
MozReview-Commit-ID: FNoj7XH71E4

--HG--
extra : rebase_source : 294d3e425ca60e2aac6149998da7f39f62864ae5
2017-03-06 09:39:52 -08:00
Carsten "Tomcat" Book 1bc7720a43 Backed out changeset 0bd17b868a31 (bug 1335877) for causing regression bug 1344760 2017-03-06 17:03:11 +01:00
Carsten "Tomcat" Book d0bd960945 merge mozilla-inbound to mozilla-central a=merge 2017-03-06 10:53:27 +01:00
Nicholas Nethercote 548ee91cb0 Bug 1342306 (part 2a) - Fix a comment that part 2 made out-of-date. r=me.
DONTBUILD because it's a comment-only change.
2017-03-06 12:53:37 +11:00
David Major 544886d651 Bug 1343752 - Guard against modules list shrinking between EnumProcessModules calls. (telemetry/) r=marco
--HG--
extra : rebase_source : ab1539bec3d74c22b06f00bcb42f8c589bc8433f
2017-03-06 14:10:36 +13:00
Mark Banner 7d5e6f23c5 Bug 1344027 - Move eslint-plugin-mozilla's .eslintrc.js file so that all of the plugin is linted, and fix the resulting issues. r=mossop
MozReview-Commit-ID: POYhxkeOaw

--HG--
rename : tools/lint/eslint/eslint-plugin-mozilla/lib/rules/.eslintrc.js => tools/lint/eslint/eslint-plugin-mozilla/.eslintrc.js
extra : rebase_source : efd9a97796e72e94c436df6f4223a12d6daa036a
2017-03-03 10:17:54 +00:00
Mark Banner 8796160b00 Bug 1344027 - Add a places-overlay environment for ESLint for when placesOverlay.xul is included. r=mossop
MozReview-Commit-ID: 3uoneyJdEmx

--HG--
extra : rebase_source : 4c09327246e3c490c0fa30fd792c04b53d6b142e
2017-03-03 09:25:31 +00:00
Mark Banner 800c6a4602 Bug 1344027 - Change the import-global-from option for eslint to allow circular references and resolve most of the no-undef issues in browser/components/preferences. r=mossop
MozReview-Commit-ID: BERAbtYkxsF

--HG--
extra : rebase_source : e319699651a8d33db026d7697ccaddd2d1e4e2d3
2017-02-22 10:19:11 +00:00
Wes Kocher 1b29a33fce Merge m-c to autoland, a=merge
MozReview-Commit-ID: K0Q4b2wzvlJ
2017-03-03 17:29:54 -08:00
Nicholas Nethercote 5b2fe03654 Bug 1344118 - Fix the profiler's sleeping threads optimization. r=jseward.
When ProfilerBuffer::reset() is called, DuplicateLastSample() will start
failing for all sleeping threads because there will be no prior thread data in
the buffer to duplicate. But the sampling loop doesn't detect such failure.
This causes two problems:

- Missing samples.

- CPU usage goes through the roof, because each time around the sampling loop
  the length of the failing search increases.

The fix is simple: detect failure in the sampling loop and do a normal sample
in that case.

The patch also removes ThreadInfo::DuplicateLastSample(), because it just calls
onto ProfileBuffer::DuplicateLastSample().

--HG--
extra : rebase_source : d51709994e701fdd63c292df5f723a2d43c4d754
2017-03-03 15:32:11 +11:00
Mark Hammond 9b6693b8ee Bug 1317223 (part 5) - a bookmark repair responder. r=kitcambridge
This is the "repair responder" - it handles a "repairRequest" command sent
by another client and attempts to take the list of IDs that client lists as
missing and upload whatever records are necessary such that the requesting
client would then be likely to find a complete and valid tree on the server.

MozReview-Commit-ID: 4xw19nH6EfL
2017-02-28 15:34:37 +11:00
Zibi Braniecki 4b7b3d4092 Bug 1335877 - Remove resource://services-common/stringbundle.js. r=rnewman
MozReview-Commit-ID: M7V6JS5myy

--HG--
extra : rebase_source : a47d739d3dd67ce563088aaf9fab5421de376cd7
2017-03-02 15:26:53 -08:00
Mark Hammond 8c4e55d022 Bug 1317223 (part 3) - a bookmark repair requestor. r=markh,tcsc
The bookmark repair requestor takes the validation results and possibly
initiates a bookmark repair.

MozReview-Commit-ID: 7rRNbBx8Vo3
2017-03-02 19:21:53 +11:00
Mark Hammond de20e8f357 Bug 1317223 (part 2) - add 'doctor' concept and move bookmark validation logic to it. r=tcsc
This patch defines the concept of a "doctor" for collections. The doctor is
responsible for running all validators and deciding whether or not to initiate
a repair request based on the validation results.

MozReview-Commit-ID: 6NLRE6L0OpA
2017-03-02 17:14:31 +11:00
Mark Hammond fdeace22db Bug 1317223 (part 1) - a collection_repair module (without any repairers) and integration with the clients engine. r=rnewman
This creates a collection_repair module, somewhat analogous to the existing
collection_validator module. This defines the public interface to request a
new repair and respond to a remote repair request, and also includes changes
to clients.js to call this public interface.

MozReview-Commit-ID: 9JPpRrLgFoR
2017-03-02 16:14:51 +11:00
Carsten "Tomcat" Book 4a4777d1aa merge mozilla-inbound to mozilla-central a=merge 2017-03-02 14:02:48 +01:00
Mark Banner e43ef8d772 Bug 1343519 - Bump the version number for eslint-plugin-mozilla for the changes. r=bustage-fix-for-developers a=tomcat
MozReview-Commit-ID: EIykbh2t5mv
2017-03-02 00:26:00 +01:00
Mark Banner 23b7396105 Bug 1343519 - Change the ESLint browser-window environment to determine most of the scripts for globals by parsing global-scripts.inc. r=mossop
MozReview-Commit-ID: 6rxN3ORgItH

--HG--
extra : rebase_source : 100ddf6c09f229baa2334d11211c6fb28d643c3b
2017-03-01 21:44:45 +00:00
Mark Banner fb13a772a1 Bug 1343519 - Change the ESLint rule 'import-test-globals' to be an environment (mozilla/simpletest) to better describe the purpose of it. r=mossop
MozReview-Commit-ID: DbrsnUVrAas

--HG--
rename : tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-test-globals.js => tools/lint/eslint/eslint-plugin-mozilla/lib/environments/simpletest.js
extra : rebase_source : 97d0537c347999159c82d4757b265f580ec981eb
2017-03-01 21:34:24 +00:00
Mark Banner 09889d3184 Bug 1343519 - Change the ESLint rule 'import-browserjs-globals' to be an environment (mozilla/browser-window) to better describe the purpose of it. r=mossop
MozReview-Commit-ID: FTDV8BcMGeF

--HG--
rename : tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-browserjs-globals.js => tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js
extra : rebase_source : f0e89f2ce3cfdf343213f66a007f74a80a785c19
2017-03-01 21:29:52 +00:00
Mark Banner c23e14f565 Bug 1343519 - Change some function calls from using 'this' to 'context' in the eslint-plugin-mozilla code so that it works correctly when timing rule lengths. r=mossop
MozReview-Commit-ID: Dzjnhtu9bml

--HG--
extra : rebase_source : 16746dab5a46fd447329ca381ef44fc854695af0
2017-03-01 21:05:01 +00:00
Thinker K.F. Li 56974b9768 Bug 1342774 - Fix the deadlock caused by TaskTracer. r=cervantes 2017-03-01 00:57:00 -05:00
Nicholas Nethercote 085c9b47e4 Bug 1328378 (part 6) - Eliminate SyncProfile. r=mstange.
It's now a very thin wrapper around ThreadInfo, and so can be removed.

The patch also has the bonus of setting mIsMainThread correctly for the
ThreadInfos that used to be SyncProfiles (i.e. the ones created in
profiler_get_backtrace()). As far as I can tell this has only one very minor
effect, because that field is only used for those objects to determine how
ThreadResponsiveness::Update() dispatches its runnables.

--HG--
extra : rebase_source : 39318dba51316dc473321d6e4215e5b950a4d41d
2017-02-27 12:56:42 +11:00
Nicholas Nethercote ec3c7ad3a1 Bug 1328378 (part 5) - Simplify ProfileBuffer handling. r=mstange.
Currently ThreadInfo objects all share gBuffer, while SyncProfile objects each
get their own ProfileBuffer.

This patch removes ThreadInfo::mBuffer to reduce this difference, taking us a
step towards eliminating SyncProfile.

To support this, the patch:

- passes in a buffer as an additional argument in a bunch of places where the
  buffer used to be obtained from a ThreadInfo;

- adds an mBuffer field to ProfilerBacktrace;

- changes ThreadInfo::SetProfile() to SetHasProfile();

- removes ThreadInfo::{addTag,StoredMarker,bufferGeneration}(), all of which
  just redirected to ThreadInfo anyway;

- changes ProfileBuffer so it's no longer refcounted, which is unnecessary now
  that gBuffer and ProfilerBacktrace::mBuffer don't have multiple references,
  which makes their lifetimes obvious.

The patch also removes some ThreadInfo& args in functions in platform.cpp, in
places where that ThreadInfo is available within the accompanying TickSampler*
arg.

--HG--
extra : rebase_source : 7e6cb370866d3f3fd657c6aa66d3c3eb3d83a4b1
2017-02-27 12:34:59 +11:00
André Bargull f5150ddf41 Bug 1340146 - Part 2: Process js/src/shell JavaScript files as self-hosted in eslint plugin. r=evilpie 2017-02-27 09:55:21 -08:00
Julian Seward f7c6560850 Bug 1342102 - Use the same threading structure in platform-linux-android.cpp as for the -macos and -win32 versions. r=n.nethercote.
The MacOS and Windows profiler cores have a threading structure where one
thread ("sampler thread") collects information from a thread to be profiled
("samplee thread") by suspending it, getting its register state, unwinding its
stack, and then resuming it.  This requires kernel-level primitives to perform
the suspend, get-registers and resume steps.

The Linux/Android core is different, because none of those three primitives
exist.  Until now, data collection has been done by sending a SIGPROF to the
samplee, and collecting all relevant data within the signal handler.  This has
a number of disadvantages:

(1) Current work to rationalise/clean up the threading structure of the
    profiler is complicated by the need to reason about/verify two different
    schemes.

    In particular, the Tick call in the Windows and MacOS implementations will
    produce its output on the sampler thread.  In the Linux implementation
    that is produced on the sampled threads.

(2) Dynamic verification results (primarily, absence of data races and
    deadlocks) established for the Linux implementation are less likely to
    carry over to the other two implementations, because the threading
    structures are different.

(3) It causes a lot of duplicated code in platform-*.cpp.  For example
    SamplerThread::Run() in the -win32.cpp and -macos.cpp files are very
    similar.  Ideally all three could be merged into a single file with the
    identical logic commoned up.

(4) Running lots of code -- the entire contents of Tick -- in a signal handler
    isn't considered good practice.  POSIX severely restricts the set of
    functions we can safely call from within a signal handler.

This commit changes the Linux implementation by using semaphores to implement
the suspend and resume primitives, and moves the bulk of the data collection
work to the sampler thread.  By doing this, it causes the Linux implementation
to have the same threading structure as the other two.

--HG--
extra : rebase_source : 675b6ef76915d164ed263b831dddd6ce0c0e97f3
2017-03-01 14:57:34 +01:00
Mark Banner 9500176490 Bug 1346167 - Make the eslint-plugin-mozilla environments more flexible for when they are used outside of mozilla-central. r=mossop
For now, we return virtually no globals for browser-window/places-overlay/simpletest as they aren't able to load the m-c files. Later we may want to find a way of enabling this to work for outside repositories.

MozReview-Commit-ID: 8SFVuQuEqfL

--HG--
extra : rebase_source : ff773796d14ef27b47f25b0b8503ae3f093bfb9e
2017-03-10 11:44:35 +00:00
Julian Seward cd94503136 Bug 1344258 - Remove integer mod from loop in ProfileBuffer::FindLastSampleOfThread. r=n.nethercote.
--HG--
extra : rebase_source : 7a47f3f96393032e5455337dd8dbecc3f87e263f
2017-03-06 16:24:18 +01:00
Nicholas Nethercote 51df94092b Bug 1342306 (part 2) - Avoid profiler_time() calls deep in profiler streaming code. r=mstange.
Because profiler_time() is going to need the global lock when I add it, and the
lock will already be held when streaming is happening, so it'll cause the
thread to deadlock itself.

Unfortunately this requires adding an |aStartTime| parameter to a lot of
functions, but this is the least worst way I can think of handling it.

This also removes the need for one of the profiler_time() functions, which the
patch removes.
2017-02-27 13:52:58 +11:00
Nicholas Nethercote 742c5d02aa Bug 1342306 (part 1) - Introduce SamplerThread class in platform-linux-android.cpp. r=jseward.
This makes it more like platform-{macos,win32}.cpp, and will make it easier to
introduce locking around all the globals in platform.cpp.

The following things were moved into the new class.

- Types:
  - SigHandlerCoordinator

- Functions:
  - SigProfHandler()
  - SigprofSender() as Run()

- Variables:
  - gOldSigprofHandler as mOldSigprofHandler
  - gSigprofSenderThread as mThread
  - gIntervalMicro as mIntervalMicro
  - gSigHandlerCoordinator as sSigHandlerCoordinator

sInstance is the singleton instance. PlatformStart() and PlatformStop() now
just delegate to StartSampler/StopSampler.

The patch also does the following tidy-ups.

Linux:
- gWasPaused is now cleared in the parent and child processes after forking.
- LUL: inlined and removed gLUL_initialization_routine().
- LUL: now only calling EnabledUnwinding() and doing the unit tests on the
  first call to profiler_start(), instead of all of them.

Mac:
- Removed a useless call to pthread_self() -- mThread is already set by the
  earlier call to pthread_create().
- Removed some low-value checking involving kNoThread.

Mac + Win:
- Renamed SamplerThread::mInstance as sInstance, because it's static.
- Merged SamplerThread::Start() with the constructor.
- Tweaked how mInterval/mIntervalMicro is initialized, so it can become const.

All platforms:
- Converted NULL to nullptr throughout.
- A few other very minor clean-ups, e.g. formatting.

--HG--
extra : rebase_source : 4d10be873c4a7544f450e6a3b3d86c5d5b2fb603
2017-03-03 15:52:35 +11:00
Nicholas Nethercote 54ff9e9a14 Bug 1328378 (part 4) - Remove sample_obj. r=mstange.
It's silly indirection.

--HG--
extra : rebase_source : 6eb2f7c13d689db57e604f871372e98d06fea5a1
2017-02-27 12:32:55 +11:00
Nicholas Nethercote c1b1bc70df Bug 1328378 (part 3) - Remove unnecessary locking in profiler_get_backtrace(). r=mstange.
There's no need to lock when calling Tick() on a local TickSample that uses a
fresh SyncProfile with its own fresh ProfileBuffer -- none of that data can
be touched by another thread.

--HG--
extra : rebase_source : aaabef89e8481758b566e6dd01e4bb61a5855b1a
2017-02-27 12:32:18 +11:00
Nicholas Nethercote 8c0fd1de93 Bug 1328378 (part 2) - Remove BeginUnwind() and EndUnwind(). r=mstange.
Both of these functions are now trivial and identical in both ThreadInfo and
SyncProfile. This patch inlines and removes them.

--HG--
extra : rebase_source : 15fb7c1d4df9fbc80d8e671761b4aa1508845cac
2017-02-27 12:31:44 +11:00
Nicholas Nethercote 97a8ad79df Bug 1328378 (part 1) - Remove SyncProfile::mOwnerState. r=mstange.
It appears to be a remnant of a time when SyncProfile lifetimes were more
complex. Nowadays they are simple.

- profiler_get_backtrace() constructs a SyncProfile called |profile|.
  |profile|'s mOwnerState is REFERENCED.

- profiler_get_backtrace() then calls BeginUnwind() and EndUnwind() on
  |profile|. After the EndUnwind(), |profile->mOwnerState| is always OWNED.

- |profile| then is put into the returned ProfilerBacktrace. That
  ProfilerBacktrace will destroy |profile| in its destructor because
  ShouldDestroy() always returns true because mOwnerState is always OWNED.

The OWNER_DESTROYING and ORPHANED states are never used, and the whole
OwnerState type isn't necessary. This patch removes it and ShouldDestroy().

--HG--
extra : rebase_source : f1828b4a5d6b8f73245e666f457b93a24ca7266e
2017-02-27 12:30:25 +11:00
Wes Kocher dbf209197e Backed out 2 changesets (bug 1340146) for spidermonkey bustage a=backout
Backed out changeset 5556b171034e (bug 1340146)
Backed out changeset c355a0ffcb10 (bug 1340146)

MozReview-Commit-ID: JTVSUcenPdC
2017-02-27 15:28:34 -08:00
André Bargull a8358b9891 Bug 1340146 - Process js/src/shell JavaScript files as self-hosted in eslint plugin. r=evilpie
--HG--
extra : rebase_source : c34e54150dafbab3f6422b1beb0689b9ced87608
2017-02-27 09:55:21 -08:00
Wes Kocher e84fc624ff Merge inbound to central, a=merge
MozReview-Commit-ID: DpCZgRV1csS
2017-02-24 16:46:12 -08:00
Marco Castelluccio d97c0c84f6 Bug 1342349 - Backout mistakenly pushed patch and push the actual fix. r=me 2017-02-24 18:03:48 +00:00
Marco Castelluccio 3f1fdf3508 Bug 1342349 - Fix out-of-bounds access in GetInfoForSelf. r=mstange 2017-02-24 17:42:43 +00:00
Carsten "Tomcat" Book 7256146318 merge mozilla-inbound to mozilla-central a=merge 2017-02-24 11:46:38 +01:00
Julian Seward 36611ba3ae Bug 1341255 - Profiler tidyups: remove StackEntry, rename ProfileEntry to ProfileBufferEntry (part 2: rename ProfileEntry). r=n.nethercote.
--HG--
rename : tools/profiler/core/ProfileEntry.cpp => tools/profiler/core/ProfileBufferEntry.cpp
rename : tools/profiler/core/ProfileEntry.h => tools/profiler/core/ProfileBufferEntry.h
extra : rebase_source : f08a1e4aeab0db27097ed2c52b0eb92d50ef23da
2017-02-23 23:05:23 +01:00
Julian Seward 4cd04ecc8a Bug 1341255 - Profiler tidyups: remove StackEntry, rename ProfileEntry to ProfileBufferEntry (part 1: remove StackEntry). r=n.nethercote.
--HG--
extra : rebase_source : 6418946b1ebeb82abdccdb10a03380a40c00da21
2017-02-23 23:04:13 +01:00
Nicholas Nethercote af10e0c45c Bug 1340928 (part 16) - Clean up profiler env var handling. r=mstange.
This patch does the following.

- Uses "entries" consistently for the name of the value that is obtained from
  MOZ_PROFILER_ENTRIES and is the first argument to profiler_start(). (I.e. not
  "entry" or "entrySize".)

- Removes variables (e.g. PROFILER_HELP) holding env var names and uses the
  names (e.g. "MOZ_PROFILER_HELP") directly. Some of the names are already used
  directly and I think the slight repetition isn't harmful. It's unlikely that
  we'd want to change these names the way we might need to change a numeric
  value, and they're perfectly descriptive.

- Changes the "MOZ_PROFILING_FEATURES" string in the weird Android-only startup
  code to be "MOZ_PROFILER_FEATURES", for consistency.

- Renames gUnwindInterval and gProfileEntries as gEnvVarInterval and
  gEnvVarEntries to make it clearer that they come from environment variables,
  but otherwise are parallel to gInterval and gEntries.

- Puts entries before intervals in most places, to match the profiler_start()
  argument order.

- Changes profiler_usage() so that (a) it always prints, no matter the
  verbosity, (b) it exits at its end, and (c) doesn't double-print "Profiler: "
  at the start of each line.

--HG--
extra : rebase_source : e5a0b1c48e390ada894c746f050f08ff5c241066
2017-02-23 14:26:46 +11:00
Thinker K.F. Li 60b7a61d43 Bug 1329929 - Fix memory leaking of TaskTracer. r=cervantes 2017-02-22 00:26:00 -05:00
Nicholas Nethercote 33da826017 Bug 1340928 (part 15) - Inline and remove ToJSObject(). r=mstange.
It has a single call site.

--HG--
extra : rebase_source : ac17c229cffc6a25014c6060f99892ecbdda74cf
2017-02-22 13:42:14 +11:00
Nicholas Nethercote 354d0d388f Bug 1340928 (part 14) - Factor out code repeated in both ProfileGatherer::Start() methods. r=mstange.
--HG--
extra : rebase_source : 47deafe39aa208654398cb0795831bd273aa3265
2017-02-22 11:46:28 +11:00
Nicholas Nethercote aedaf0a73c Bug 1340928 (part 13) - Merge two ProfileGatherer::Start() variants. r=mstange.
The |nsIFile*| one is only called by the |const nsACString&| one, so this patch
combines them.

--HG--
extra : rebase_source : d8338e88cef4799d95e590c056ab343d5a1c546a
2017-02-22 11:35:43 +11:00
Nicholas Nethercote 348841f745 Bug 1340928 (part 12) - Remove profiler_get_gatherer(). r=mstange.
profiler_get_gatherer() exposes ProfileGatherer to the outside world in a way
that makes future changes difficult.

This patch:

- Removes ProfileGatherer.h from the list of headers exported from the
  profiler.

- Removes nsIProfiler.profileGatherer and nsProfiler::GetProfileGatherer().

- Replaces profiler_get_gatherer() with three new functions that provide
  minimal but sufficient access to ProfileGatherer:
  profiler_will_gather_OOP_profile(), profiler_gathered_OOP_profile(), and
  profiler_OOP_exit_profile().

  These functions provide access to the ProfileGatherer in a similar fashion to
  the pre-existing functions profiler_get_profile_jsobject_async() and
  profiler_save_profile_to_file_async()

This significantly reduces the size of the profiler's API surface.

--HG--
rename : tools/profiler/public/ProfileGatherer.h => tools/profiler/gecko/ProfileGatherer.h
extra : rebase_source : d8e06a1133d4098c3a214858d3ff2c4bdcd9f1f2
2017-02-22 10:19:53 +11:00
Nicholas Nethercote 883fc3f925 Bug 1340928 (part 9) - Remove MOZ_PROFILER_STACK_SCAN env var. r=mstange.
It's used to set gUnwindStackScan, which is never used.

--HG--
extra : rebase_source : 3993df4cba27eb7eec39a40125df9a3190fe25a6
2017-02-21 13:53:19 +11:00
Nicholas Nethercote d60b476a02 Bug 1340928 (part 8) - Pass gStartTime to DuplicateLastSample(). r=mstange.
This removes the one use of gStartTime outside of platform*.cpp, which lets us
restrict its visibility to just that compilation unit.

--HG--
extra : rebase_source : bf7207572cba5c1a31b544ea73e783ecd559978a
2017-02-21 10:18:51 +11:00
Nicholas Nethercote 45a8d3ea6a Bug 1340928 (part 7) - Factor out gIsActive handling in platform-*.cpp. r=mstange.
PlatformStart() and PlatformStop() are currently responsible for setting and
clearing gIsActive, but it's better if we do it in profiler_{start,stop}().

The patch also does the following.

- Adds some missing emacs/vim modelines.

- Makes Platform{Start,Stop}() crash if they have failures. I'm not at all
  confident that ignoring the errors as is currently done will result in
  sensible behaviour, so brittleness is better.

--HG--
extra : rebase_source : b9ab8437f5b92f6a8993ba7677ecb74a321ce219
2017-02-16 15:08:07 +11:00
Wes Kocher 29443ed98c Merge m-c to inbound, a=merge
MozReview-Commit-ID: HDHJC8X9xWG
2017-02-22 15:06:46 -08:00
Nicholas Nethercote 5c520e77db Bug 1340928 (part 6) - Clean up profiler code relating to env vars. r=mstange.
This patch mostly does formatting fixes.

It also removes some declarations from platform.h that are no longer necessary
now that platform-linux-android.cpp is in the same compilation unit as
platform.cpp (due to it being #include-d directly); this required reordering
some things.

--HG--
extra : rebase_source : d07ef71455885fe8f1414d87c261ca054989a6a8
2017-02-16 13:59:35 +11:00
Nicholas Nethercote 8c6f56c330 Bug 1340928 (part 5) - Pass the interval to PlatformStart(). r=mstange.
This avoids the need for platform-linux-android.cpp to read gInterval off the
main thread in an awkward spot. It also makes platform-linux-android.cpp
more like platform-{win32,macos}.cpp.

--HG--
extra : rebase_source : c1c76a382d6373f9fd2e3f89a1e1f8fef9072257
2017-02-15 14:44:12 +11:00