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

4816 Коммитов

Автор SHA1 Сообщение Дата
Carsten "Tomcat" Book fdc689ba16 merge mozilla-inbound to mozilla-central a=merge 2017-05-05 15:17:26 +02:00
Nicholas Nethercote ea25e62e3c Bug 1360471 (part 4) - Use a bitfield to represent profiler features. r=mstange.
Currently the profiler mostly uses an array of strings to represent which
features are available and in use. This patch changes the profiler core to use
a uint32_t bitfield, which is a much simpler and faster representation.
(nsProfiler and the profiler add-on still use the array of strings, alas.) The
new ProfilerFeature type defines the values in the bitfield.

One side-effect of this change is that profiler_feature_active() now can be
used to query all features. Previously it was just a subset.

Another side-effect is that profiler_get_available_features() no longer incorrectly
indicates support for Java and stack-walking when they aren't supported. (The
handling of task tracer support is unchanged, because the old code handled it
correctly.)
2017-05-01 14:23:34 +10:00
Nicholas Nethercote cc78872f8c Bug 1360471 (part 3) - Rename various "thread name filters" identifiers as "filters". r=mstange.
The new names are more concise and matches common usage elsewhere (e.g.
profiler_start() arguments).

This patch is similar to bug 1358074 part 5.
2017-05-01 13:42:53 +10:00
Nicholas Nethercote ebe44f1856 Bug 1360471 (part 2) - Rename profiler_get_features() as profiler_get_available_features(). r=mstange.
It clarifies that it's not just the features chosen in profiler_start().
2017-05-01 12:07:17 +10:00
Nicholas Nethercote de4eac378e Bug 1360471 (part 1) - Make nsIProfilerStartParams only usable in C++. r=mstange.
The patch also makes the |entries| and |interval| fields readonly, because they
are never changed.
2017-05-01 11:53:18 +10:00
Wes Kocher 4e89a77541 Merge m-c to autoland, a=merge
MozReview-Commit-ID: F7qkNALe0WT
2017-05-03 13:52:24 -07:00
Wes Kocher 21203b47b5 Merge inbound to m-c a=merge
MozReview-Commit-ID: JgXkqrOwl3N
2017-05-03 13:40:24 -07:00
Mark Banner 72059d82da Bug 1360595 - Add a git pre-commit hook for running ESLint. r=mossop
MozReview-Commit-ID: 1YJL5Sd4dlb

--HG--
rename : tools/mercurial/eslintvalidate.py => tools/lint/eslint/hook_helper.py
extra : rebase_source : eec3ee2761dd7178de1562229bfda24c0859b4ae
2017-04-28 12:19:15 +01:00
Mark Banner 046debbc74 Bug 1360595 - Make the ESLint Mercurial pre-commit hook be run in and pass flake8 validation. r=mossop
MozReview-Commit-ID: 1GW59lKpVrI

--HG--
extra : rebase_source : bad1919b52fc29a9874090f314ad682e72840f70
2017-04-28 12:15:56 +01:00
Jim Chen 3434ba087b Bug 1360322 - 3. Only build LUL on supported architectures; r=mstange
Only build LUL and its tests on ARM, x86, and x86_64, because only those
architectures are currently supported by LUL.
2017-05-03 11:36:18 -04:00
Jim Chen 7041014748 Bug 1360322 - 2. Add initial AArch64 support to Gecko profiler; r=mstange
Add enough AArch64-specific code for the Gecko profiler to build.
2017-05-03 11:36:18 -04:00
Jim Chen 28cf921283 Bug 1360322 - 1. Convert tools/profiler/moz.build to Unix line ending; r=me 2017-05-03 11:36:18 -04:00
Kershaw Chang e8df9986bf Bug 1351281 - Remove NetworkPrioritizer.jsm, r=dao
Since Necko has already given higher priority to http transactions from the focused window, we don't need NetworkPrioritizer.jsm anymore.
2017-05-03 03:28:00 +02:00
Dan Banner f2a6a685fe Bug 1359540 - Enable the Mozilla ESlint recommended rules for services/. r=markh
MozReview-Commit-ID: D6qH5XtEtHO

--HG--
extra : rebase_source : 8e4c319c7fb8b727ac0193e5dd78411e1ec2785c
2017-04-27 17:24:18 +01:00
Dan Banner c07b5f8b23 Bug 1360293 - Enable the Mozilla ESlint recommended rules for tools/. r=jryans
MozReview-Commit-ID: JMcgZ9taEV5

--HG--
extra : rebase_source : 806d9aa8c470ab35253682a5f16e528ca8d73cc5
2017-05-01 11:38:39 +01:00
Edouard Oger b80261a3ec Bug 1358648 part 3 - Remove Async, Services and XPCOMUtils from util.js. r=markh
MozReview-Commit-ID: 8na204K9cXp

--HG--
extra : rebase_source : 96e7738aa6612cf67543d50053f50c2bccf1ab7e
2017-05-02 16:57:37 -04:00
Edouard Oger abba8c5b31 Bug 1358648 part 2 - Remove util.js Svc.{DefaultPrefs,Session,Idle, FormHistory} and Str. r=markh
MozReview-Commit-ID: Jc1th8Snvhv

--HG--
extra : rebase_source : dd950a5d7bb0f2cb2ea4f32c7b61eb2a15ae327d
2017-05-02 18:30:23 -04:00
David Major f7b2b2533f Bug 1360575: Use PR_SetCurrentThreadName to set the sampler thread's name on all platforms. r=mstange 2017-05-01 22:56:47 -04:00
David Major 8040b396bd Bug 1351838: Don't sprintf within the profiler since it may take a lock. r=froydnj
--HG--
extra : rebase_source : 8d5f8c4fc5a5f205653db12fb34f9cd51fddfc65
2017-05-01 17:57:12 -04:00
David Major e5d98f2a57 Bug 1360642: Increase SAMPLER_MAX_STRING_LENGTH to capture more URLs. r=mstange
--HG--
extra : rebase_source : b4cbbce0b1240190d93488daa06456536588cf55
2017-05-01 16:26:39 -04:00
Michael Layzell 58464c1919 Bug 1346415 - Use FramePointerStackWalk for less deadlocking when stackwalking on x86, r=njn
MozReview-Commit-ID: CAHarvGSuTY
2017-05-01 13:40:37 -04:00
Nicholas Nethercote 31a9d19faa Bug 1360442 - Fix up macros in GeckoProfiler.h. r=mstange.
- Use PROFILER_ consistently as the prefix for macros in this file. (As opposed
  to PROFILE_ or SAMPLE_ or SAMPLER_ or MOZ_ or PLATFORM_ or no prefix.)

- Split overly long macros across multiple lines.

- Fix some macro indenting.
2017-04-28 15:57:03 +10:00
Nicholas Nethercote d79729cfc6 Bug 1359717 - Remove unnecessary SetIsPaused() calls. r=mstange.
We pause/unpause the profiler before/after some streaming operations. But these
pause/unpause pairs occur with gPSMutex locked, and ActivePS::IsPaused() also
requires that gPSMutex be locked. Therefore these pause/unpause pairs cannot
be observed, and so this patch removes them.
2017-04-27 15:57:35 +10:00
Nicholas Nethercote 93b0b152aa Bug 1123754 (part 2) - Move ProfilerMarker into ProfilerMarker.h. r=mstange.
ProfilerMarker is simple enough that it's best to fully define it in
ProfilerMarker.h, without introducing a ProfilerMarker.cpp.

This requires moving STORE_SEQUENCER() into its own header, StoreSequencer.h.

As a result, the following types are no longer visible outside the profiler:
ProfilerMarker, ProfilerLinkedList, ProfilerMarkerLinkedList,
ProfilerSignalSafeLinkedList. (PseudoStack.h now contains the PseudoStack class
and nothing else.)

The patch also makes the following non-obvious changes.

- It changes ProfilerMarker::{mMarkerName,mPayload} to unique pointers, which
  removes the need for an explicit ~ProfilerMarker().

- It removes ProfilerMarker::GetMarkerName(), because that method is only used
  within ProfilerMarker itself.

--HG--
extra : rebase_source : 22bdfb1c9c30751253ed66352d7edd51d308152d
2017-04-27 07:36:22 +10:00
Nicholas Nethercote 273ec65c56 Bug 1123754 (part 1) - Rename ProfilerMarkers.{h,cpp} as ProfilerMarkerPayload.{h,cpp}. r=mstange.
Because ProfilerMarkerPayload is the main type defined in these files, and
because the next patch is going to introduce ProfilerMarker.{h,cpp}, which
would be confusingly similar to the old names.

--HG--
rename : tools/profiler/core/ProfilerMarkers.cpp => tools/profiler/core/ProfilerMarkerPayload.cpp
rename : tools/profiler/public/ProfilerMarkers.h => tools/profiler/public/ProfilerMarkerPayload.h
extra : rebase_source : df22a2ab3867650348ae78fe959ff0366aff230b
2017-04-27 07:36:19 +10:00
Nicholas Nethercote 4e6950332a Bug 1359000 (part 7) - Move mContext and mJSSampling from RacyThreadInfo to ThreadInfo. r=mstange.
None of the accesses to these fields occur in hot operations, so it's
reasonable to do them with gPSMutex held. As a result, mJSSampling doesn't need
to be Atomic<>, and mContext's lack of Atomic-ness is no longer a cause for
concern.

This required adding an extra field, mJSContext, to TickSample.

--HG--
extra : rebase_source : 1485de5e493cef655233507248006574d0ab6ebd
2017-04-27 07:36:17 +10:00
Nicholas Nethercote 93d021e19b Bug 1359000 (part 6) - Split off RacyThreadInfo from PseudoStack. r=mstange.
PseudoStack is misnamed: it contains the pseudo-stack plus other stuff that is
accessed via TLS.

This patch moves the non-pseudo-stack parts of PseudoStack into a new type
called RacyThreadInfo, which is a subclass of PseudoStack. The patch also
capitalizes the first letter of the names of methods that it moves.

This means that PseudoStack is now accurately named. Also non-pseudo-stack
parts are now no longer visible outside the profiler, which is nice.

--HG--
extra : rebase_source : c110acfb6d2a1527ed33cc073fab3fb188851b22
2017-04-27 07:36:15 +10:00
Nicholas Nethercote 9a52c4f399 Bug 1359000 (part 5) - Introduce TLSInfo. r=mstange.
Currently a reference to each thread's PseudoStack is stored in tlsPseudoStack.
This patch changes the TLS reference to refer to the enclosing ThreadInfo
instead. This allows profiler_clear_js_context() to access the current thread's
ThreadInfo via TLs, rather than searching with FindLiveThreadInfo().

The patch also encapsulates the TLS within a new class called TLSInfo. This
class allows access to the PseudoStack without protection from gPSMutex, but
access to the enclosing ThreadInfo requires a PSLockRef. This maintains the
current access regime.

--HG--
extra : rebase_source : de9967f6c055061bb65930ffd02e369703b1362e
2017-04-27 07:36:13 +10:00
Nicholas Nethercote 9471adc672 Bug 1359000 (part 4) - De-inline profiler_call_{enter,exit}. r=mstange.
This possibly incurs an extra function call (depends on exactly how much inling
the compiler does). But it helps enormously with subsequent refactorings,
because PseudoStack (and related types) don't need to be visible in
GeckoProfiler.h, which is exported outside the profiler.

--HG--
extra : rebase_source : f2dc5952d7444dfe12e627e86e6d37632b283107
2017-04-27 07:36:11 +10:00
Nicholas Nethercote 0510e9b058 Bug 1359000 (part 3) - Rename some "stack" variables as "pseudoStack". r=mstange.
"pseudoStack" more closely matches the type name, and is more specific.

--HG--
extra : rebase_source : 4605c66925f29fae0a4c800a4459a7904a6187ab
2017-04-27 07:36:09 +10:00
Nicholas Nethercote 7fc314e4d2 Bug 1359000 (part 2) - Tweak manual polling of profiler threads. r=mstange.
This patch moves the manual polling up into the preceding loops, which is a
better place for it.

--HG--
extra : rebase_source : c95932d8f66635b9ca435f30bae78585dd7e04ca
2017-04-24 09:49:28 +10:00
Nicholas Nethercote e2606aa433 Bug 1359000 (part 1) - Remove unused method PseudoStack::push. r=mstange.
--HG--
extra : rebase_source : efff90c7b1de25035a1e9cccf5a8c6027c7a54d9
2017-04-24 09:41:31 +10:00
Wes Kocher 2aa72d4cdc Merge inbound to central, a=merge
MozReview-Commit-ID: HZUHBRK4UmL
2017-04-27 13:00:07 -07:00
Nicholas Nethercote 22e24ef94a Bug 1358074 (part 7) - Split PS in two. r=mstange.
PS contains some state that is always valid, and some state that is only valid
when the profiler is active. This patch does the following.

- Splits PS into two parts for the two kinds of state: CorePS and ActivePS.

- Moves gPS (now split in two) into CorePS and ActivePS, as static instances,
  to improve encapsulation. This required changing all the state getters and
  setters into static methods.

- Existence tests for CorePS and ActivePS are now done via the Exists()
  methods.

Advantages of this change:

- It's now clear which parts of the global state (most of it!) are valid only
  when the profiler is active, and we don't have to invalidate those parts with
  zero/null/false when the profiler stops.

- Better OOP: more use of constructors and destructors, and more |const| to
  indicate what state is immutable.

- With the old code there were some places where the order of things required
  care, but with the new code it's not possible to get the order wrong.

--HG--
extra : rebase_source : dba177acb41e4dc2103ace2212ab5ae1f7b418ce
2017-04-21 13:28:23 +10:00
Carsten "Tomcat" Book e1e203f1f5 Merge mozilla-central to autoland 2017-04-27 16:36:41 +02:00
Wes Kocher 226702fd85 Merge m-c to autoland a=merge
MozReview-Commit-ID: LOGgOErcV9L
2017-04-26 17:43:38 -07:00
Carsten "Tomcat" Book 68e9a2dfd5 Merge mozilla-central to mozilla-inbound 2017-04-26 09:04:59 +02:00
Carsten "Tomcat" Book 8f4e4ca99b merge mozilla-inbound to mozilla-central a=merge 2017-04-26 08:41:31 +02:00
Carsten "Tomcat" Book d9cce3c040 merge autoland to mozilla-central a=merge 2017-04-26 08:40:02 +02:00
Nicholas Nethercote bc1d6a21a2 Bug 1358320 - Make TimeStamp::ProcessCreation()'s outparam optional. r=gsvelto.
TimeStamp::ProcessCreations()'s aIsInconsistent outparam is ignored by the
majority of its caller. This patch makes it optional. Notably, this makes
ProcessCreation() easier to use in a constructor's initializer list.
2017-04-26 14:55:54 +10:00
Wes Kocher 5e8bdb175d Merge inbound to m-c a=merge
MozReview-Commit-ID: A85cs7Yriqj
2017-04-25 13:53:00 -07:00
Nicholas Nethercote 213518b7e8 Bug 1358074 (part 6, attempt 2) - Don't use mWasPaused on Android. r=mstange.
--HG--
extra : rebase_source : 99da4bfb335d27b5ea35ce10a149c82abd13ca77
2017-04-21 13:27:59 +10:00
Nicholas Nethercote 42226dcae0 Bug 1358074 (part 5, attempt 2) - Rename mThreadNameFilters as mFilters. r=mstange.
--HG--
extra : rebase_source : 4d26f553136268ac0b20448708254bdbf972f411
2017-04-21 13:27:55 +10:00
Nicholas Nethercote f51b56128c Bug 1358074 (part 4, attempt 2) - Rename PS::{Mutex,AutoLock,LockRef} as PS{Mutex,AutoLock,LockRef}. r=mstange.
--HG--
extra : rebase_source : e1ea40df9197658b9c3b950e5f259206c6a3785b
2017-04-21 13:27:53 +10:00
Nicholas Nethercote c28a0c41b5 Bug 1358074 (part 3, attempt 2) - Don't measure process creation time on every profiler_start() call. r=mstange.
--HG--
extra : rebase_source : 588969b00e56cd7b65904a8d0baf712ea1b57ca5
2017-04-21 13:23:34 +10:00
Nicholas Nethercote 2c0ca9635a Bug 1358074 (part 2, attempt 2) - Unexport and rename ProfilerState. r=mstange.
--HG--
extra : rebase_source : 5b3e049f24d7d4f2e45989e9ee7f05c0258b1280
2017-04-21 13:23:34 +10:00
Nicholas Nethercote 33655a895b Bug 1358074 (part 1, attempt 2) - Fix some bad indentation in platform.cpp. r=mstange.
--HG--
extra : rebase_source : f572f23eeb8a290aae68b5e77dae52d885729e11
2017-04-19 14:47:18 +10:00
Julian Seward 62e5c659b4 Bug 1357777 - LUL on x86_64-linux: recover frames by following the frame pointer chain. r=froydnj,jandem.
On x86_64-Linux, LUL currently can only unwind frames for which CFI unwind data
is available.  This causes a noticeable number of junk samples in the profiler,
characterised by failures at transition points between JIT and native frame
sequences.  This patch allows LUL to try recovering the previous frame using
frame pointer chasing in the case where CFI isn't present.  This allows LUL to
unwind through or jump over interleaved JIT frames, because, respectively:

* The baseline JIT produces frame-pointerised code.

* If the profiler is enabled, IonMonkey doesn't produce frame-pointerised code,
  but also doesn't change the frame pointer register value.  It can use the
  frame pointer if profiling is disabled, but that's irrelevant here.

The patch also adds counts of FP-recovered frames to LUL's statistics printing,
to make it possible to assess how often this feature is used.

--HG--
extra : rebase_source : eadc54393788693b0e3f8d5129d48aaaad143a0b
2017-04-25 08:14:23 +02:00
Mike Cooper 2440f29f89 Bug 1358310 - eslint-plugin-mozilla: Fix infinite loop when finding repo root. r=mossop
MozReview-Commit-ID: KrOH7qtiLwS

--HG--
extra : rebase_source : 7d3ec6e407c0096e45afc23e6e117533cb4b6522
2017-04-25 14:12:31 -07:00
Chris Peterson 7b85322694 Bug 1358949 - Lower eslint cyclomatic complexity threshold in some directories. r=standard8
We can lower the eslint cyclomatic complexity threshold in some directories without adding eslint suppression comments in any .js source files. We need to specify the complexity rule in accessible/.eslintrc because it doesn't inherit the mozilla/recommended rules. eslint's default complexity threshold is 20.

Also bump the eslint-plugin-mozilla version because we modified the mozilla/recommended rules.

MozReview-Commit-ID: 57T4gAjPH7z

--HG--
extra : rebase_source : 4565abfa722b9459cfb4e006e843da13ed7cffd4
extra : intermediate-source : 658588564c08c9fd5e60633d1457f24087de8570
extra : source : 7e0526e3b943419a80c0cd2fa462cabbf8925eb1
2017-04-23 19:23:18 -07:00
Chris Peterson 893e00d283 Bug 1358947 - Make eslint "max-nested-callbacks" rule an error. r=standard8
eslint's default max-nested-callbacks threshold is 10, but now we make it an error. We could further lower the max-nested-callbacks threshold globally to 8, like browser/.eslintrc.js, but that would require adding suppression comments in (two) more .js test files. 10 seems good enough for now since it's the eslint default.

We need to specify max-nested-callbacks in accessible/.eslintrc because it doesn't inherit the mozilla/recommended rules.

Also bump the eslint-plugin-mozilla version because we modified the mozilla/recommended rules.

MozReview-Commit-ID: JA41vsi4U7j

--HG--
extra : rebase_source : 2dd211ebd3b8cf83f67f26cac5244bec8978f0e2
extra : intermediate-source : 6f5e75502be394038543029e3cfd474c5b1c2e98
extra : source : a13437d73c97fabd073ab8a6f93e85a5084b7405
2017-04-21 23:00:26 -07:00
Gregory Szorc 332db65e17 Bug 1293493 - Remove `mach rage` since it was unused; r=ted
We've had 4 submissions in 2017. jgriffin and I agreed that it was a
failed experiment and we should either abandon it or figure out how
to increase participation. Since nobody is available to improve it,
I'm inclined to just delete it. If we want to bring it back, it is
always in version control.

MozReview-Commit-ID: AizkZxjQ8IJ

--HG--
extra : rebase_source : 0e29058cfc909fb51fc56fa9b46c0e0a6eef0bf9
2017-04-24 16:33:51 -07:00
Greg Tatum 778111225d Bug 1357849 - Instrument performance.measure with markers; r=baku,mstange
MozReview-Commit-ID: KQcQgxYyEYi

--HG--
extra : rebase_source : bc26048ca4317d11ab22a5a54064fa2c031a9fdc
2017-04-24 10:15:11 -05:00
Mark Banner c49949be34 Bug 1359739 - Fix eslint-plugin-mozilla's globals import function to correctly handle 'importScripts(url)' cases. r=jaws
MozReview-Commit-ID: 30Ki21DYvzm

--HG--
extra : rebase_source : 076270b0475fb1e9694d5ab13918d5b877bee39b
2017-04-26 10:20:57 +01:00
Mark Banner c4c1dd7179 Bug 1348997 - When ESLint checks for reinstall, check the file diffs rather than a version number. r=mossop
This should make it unnecessary to bump the version number of our self-built modules, by comparing the actual files.

MozReview-Commit-ID: GFbxBs4bc4Z

--HG--
extra : rebase_source : d96d465615254655ce0fa7af29503a534e795428
2017-04-24 10:52:10 +01:00
Nicholas Nethercote 5106aa14b9 Bug 1359007 - Remove js::ProfilingGetPC(). r=shu.
AddPseudoEntry() has a single callsite which always passes nullptr for the
last argument. This means that js::ProfilingGetPC() is never called, and so can
be removed. (Even if it was called, it always returns nullptr because ipToPC()
always returns nullptr!)

--HG--
extra : rebase_source : 1260d726c79bf5116143da9904d39b38e3c93837
2017-04-26 14:32:26 +10:00
Tom Tromey 66313f92eb Bug 1349655 - remove sig_safe_t in favor of mozilla::Atomic<uint32_t>; r=djvj,njn
Remove the definition of sig_safe_t, which is only used by PseudoStack,
and replace the uses with mozilla::Atomic<uint32_t>.

MozReview-Commit-ID: GcPd9R94Vci

--HG--
extra : rebase_source : dcc05a219d59ffdc0486ef2e7118d888c6a93fda
2017-03-22 13:57:31 -06:00
Markus Stange aeb36a2713 Bug 1358360 - Correctly fill in SharedLibrary fields for the main executable. r=jseward
MozReview-Commit-ID: 3ZJ8FB2Zjs8

--HG--
extra : rebase_source : 1119844c78c0d60d97edccf2511df9660a7a6427
2017-04-21 14:30:18 -04:00
Mark Banner 580ed9c407 Bug 1358484 - Add an autofix option to ESLint's no-useless-parameters. r=florian
MozReview-Commit-ID: B8mQteJ1CzF

--HG--
extra : rebase_source : 7fa31b6c0a73529693f0a936d66f55651f0fd3b7
2017-04-21 14:34:37 +01:00
Andi-Bogdan Postelnicu a33974e2da Bug 1359376 - Update Coverity modeling file to support NS_RUNTIMEABORT. r=sylvestre
MozReview-Commit-ID: 4lahuhK5bVx

--HG--
extra : rebase_source : ecd0c90112a94086eca5d50caaf7079d71b9064e
2017-04-25 15:08:48 +03:00
Mark Banner 021f1ff90a Bug 1358540 - Change the *.lint files to be *.lint.py to better support editor integration & flake8 linting. r=smacleod
MozReview-Commit-ID: 4KK2GZK7xul

--HG--
rename : python/mozlint/test/linters/badreturncode.lint => python/mozlint/test/linters/badreturncode.lint.py
rename : python/mozlint/test/linters/explicit_path.lint => python/mozlint/test/linters/explicit_path.lint.py
rename : python/mozlint/test/linters/external.lint => python/mozlint/test/linters/external.lint.py
rename : python/mozlint/test/linters/invalid_exclude.lint => python/mozlint/test/linters/invalid_exclude.lint.py
rename : python/mozlint/test/linters/invalid_include.lint => python/mozlint/test/linters/invalid_include.lint.py
rename : python/mozlint/test/linters/invalid_type.lint => python/mozlint/test/linters/invalid_type.lint.py
rename : python/mozlint/test/linters/missing_attrs.lint => python/mozlint/test/linters/missing_attrs.lint.py
rename : python/mozlint/test/linters/missing_definition.lint => python/mozlint/test/linters/missing_definition.lint.py
rename : python/mozlint/test/linters/raises.lint => python/mozlint/test/linters/raises.lint.py
rename : python/mozlint/test/linters/regex.lint => python/mozlint/test/linters/regex.lint.py
rename : python/mozlint/test/linters/string.lint => python/mozlint/test/linters/string.lint.py
rename : python/mozlint/test/linters/structured.lint => python/mozlint/test/linters/structured.lint.py
rename : tools/lint/eslint.lint => tools/lint/eslint.lint.py
rename : tools/lint/flake8.lint => tools/lint/flake8.lint.py
rename : tools/lint/wpt.lint => tools/lint/wpt.lint.py
rename : tools/lint/wpt_manifest.lint => tools/lint/wpt_manifest.lint.py
extra : rebase_source : 97de88e0328e91347192672b848b286df1904ade
2017-04-21 17:31:15 +01:00
Carsten "Tomcat" Book 1dd975c180 Backed out changeset eec770d062b4 (bug 1358540) for bustage
--HG--
rename : tools/lint/eslint.lint.py => tools/lint/eslint.lint
rename : tools/lint/flake8.lint.py => tools/lint/flake8.lint
rename : tools/lint/wpt.lint.py => tools/lint/wpt.lint
rename : tools/lint/wpt_manifest.lint.py => tools/lint/wpt_manifest.lint
2017-04-25 10:15:07 +02:00
Mark Banner 7cad8fd464 Bug 1358418 - Be more informative about which file ESLint is failing on when getASTSource() hits a computed member expression. r=Mossop
MozReview-Commit-ID: GA4bEvJXH3O

--HG--
extra : amend_source : 1fc5729343f29e429a20e787eab13125ca3c91a2
2017-04-21 10:10:54 +01:00
Carsten "Tomcat" Book be39101bce Backed out changeset 93bf1142be38 (bug 1358418) for ml failure 2017-04-25 09:31:09 +02:00
Mark Banner 05789c2819 Bug 1358418 - Be more informative about which file ESLint is failing on when getASTSource() hits a computed member expression. r=mossop
MozReview-Commit-ID: GA4bEvJXH3O

--HG--
extra : rebase_source : 49fefac7e7ae224872cf121681d9cb2bf6f15eb8
2017-04-21 10:10:54 +01:00
Mark Banner 8e42062ea3 Bug 1358540 - Change the *.lint files to be *.lint.py to better support editor integration & flake8 linting. r=smacleod
MozReview-Commit-ID: 4KK2GZK7xul

--HG--
rename : tools/lint/eslint.lint => tools/lint/eslint.lint.py
rename : tools/lint/flake8.lint => tools/lint/flake8.lint.py
rename : tools/lint/wpt.lint => tools/lint/wpt.lint.py
rename : tools/lint/wpt_manifest.lint => tools/lint/wpt_manifest.lint.py
extra : rebase_source : 66e4b4f95109c2645d0fb7be273de343408b9406
2017-04-21 17:31:15 +01:00
Dan Banner 7e986db6b0 Bug 1351091 - Remove unreferenced Profiler.jsm file r=BenWa
MozReview-Commit-ID: 7nlrsdmEwS8

--HG--
extra : rebase_source : 38259896ef39a9694dbd985714ae430ac245b96f
2017-05-04 17:03:49 +01:00
Jan Beich 30bcfaccb9 Bug 1362598 - Always define ProfilerFeature as there's no stub. r=mstange
MozReview-Commit-ID: Bsj6dFwF1h0

--HG--
extra : rebase_source : 694086b532889e0c820ebd5d37dda778735dea97
2017-05-05 23:29:58 +00:00
Frederik Braun cd1cbcef0f Bug 1359350: Add no-eval rule to eslint config (and whitelist failures in tests) r=standard8
MozReview-Commit-ID: 4nYlX4sSdbF

--HG--
extra : rebase_source : cf610e7d8bf2b8dbd5a0d40c5b835bc6620c3bba
2017-05-08 14:50:50 +02:00
Kit Cambridge 5fc76a861d Bug 1361171 - Remove CloudSync. r=markh
MozReview-Commit-ID: CjBsEZa6oIP

--HG--
extra : rebase_source : 965db37197242acf63e77dbcca74a2984532b4ff
2017-05-01 14:43:00 -07:00
Tom Tromey 2a731f278c Bug 1362215 - use MOZ_FORMAT_PRINTF in TestHarness.h; r=froydnj
MozReview-Commit-ID: JtNSFoowLIv

--HG--
extra : rebase_source : 64b4151db74653b40822b31cd2a5136204d630d4
2017-05-05 14:23:00 -06:00
Nicholas Nethercote 625d4520a7 Bug 1357298 - Remove the 'layers.frame-counter' option. r=mstange,mattwoodrow.
This option turns on a frame counter that is shown in the top left corner via a
QR code. It was designed to be used in video recordings of B2G phones.

It no longer seems useful, so this patch removes it.
* * *
Bug 1357298 - Remove all traces of frame numbers and power from the profiler output. r=mstange.

--HG--
extra : rebase_source : 0ce87963ce375df64bb8d80ef2b5d40ea507bc7c
2017-04-18 15:40:24 +10:00
Dan Banner cbf1ee25cc Bug 1351099 - Remove unused AddonLogging.jsm file r=rhelmer
MozReview-Commit-ID: B1mxqNZhpB

--HG--
extra : rebase_source : 02abddd18ec98fdd2d74eda053d161625fd96d3e
2017-04-19 16:28:41 +01:00
Frederik Braun 777b70a929 Bug 1358050: Add no-implied-eval rule to eslint config r=standard8
MozReview-Commit-ID: KdmpXq2rg1q

--HG--
extra : rebase_source : fc89233a590604e1035be4aebfee9cda894ee07e
2017-04-20 10:33:22 +02:00
Nicholas Nethercote d83ce90018 Bug 1356694 - Create a ProfileGatherer in nsProfiler() if the profiler is active. r=mstange.
This fixes a JS exception that gets thrown when one tries to capture a profile
in this case.

--HG--
extra : rebase_source : 46f6eeed3c17086b0b6c35b26f3c9e4841dd6cff
2017-04-21 09:38:39 +10:00
Wes Kocher 5ce5528fb1 Merge inbound to m-c a=merge
MozReview-Commit-ID: DQDuEiYLWCO
2017-04-20 15:30:43 -07:00
Chris Peterson f7d9d18c1b Bug 1356843 - Fix -Wcomma warning in tools/profiler/lul/LulDwarf.cpp. r=jseward
clang's -Wcomma warning warns about suspicious use of the comma operator such as between two statements.

tools/profiler/lul/LulDwarf.cpp:604:15: warning: possible misuse of comma operator here [-Wcomma]

MozReview-Commit-ID: 6ZP79hgtrAD

--HG--
extra : rebase_source : 77028600c713aa3235c3729a5db7be0290df57e4
extra : source : e4536bbeb28050b38979a05b379f13eb4a12beee
2017-04-09 21:43:29 -07:00
Nicholas Nethercote 28f7ae49bb Bug 1357936 - Don't leak ProfilerIOInterposeObserver. r=mstange.
The patch adds a missing |delete|. (This leak only occurred when the
"mainthreadio" feature was enabled, which is not the default.)

The patch also makes the unregistering of the interpose observer conditional on
there being one in the first place, avoiding a harmless but useless
unregistering of |nullptr|.

--HG--
extra : rebase_source : 7cc3679192e3effa8d86edad5374643d2e2b8948
2017-04-20 09:24:17 +10:00
Wes Kocher cb8ce82cca Merge inbound to m-c a=merge 2017-04-19 17:10:04 -07:00
Carsten "Tomcat" Book e2b810f97e Merge mozilla-central to mozilla-inbound 2017-04-19 10:49:57 +02:00
Julian Seward 5e2ec6a4bc Bug 1356215 - LUL: increase size of unwound stack to 160k. r=froydnj.
For reasons related to the architecture of the Gecko Profiler in previous years,
which are no longer relevant, LUL will only unwind through the first 32KB of
stack.  This is mostly harmless, since most stacks are smaller than 4KB, per
measurements today, but occasionally they go above 32KB, causing unwinding to
stop prematurely.

This patch changes the max size to 160KB, and documents the rationale for
copying the stack and unwinding, rather than unwinding in place.  160KB is big
enough for all stacks observed in several minutes of profiling all threads at
1KHz.

--HG--
extra : rebase_source : a1d5526aff50345be8b965c2b6b01c66b40fd0d8
2017-04-18 10:30:14 +02:00
Mark Banner fbd29db04b Bug 1357702 - Make eslint-plugin-spidermonkey-js handle paths correct on Windows to avoid Unexpected character issues on ESLint. r=mossop
MozReview-Commit-ID: LsQCgBOgceY

--HG--
extra : rebase_source : 337037ad78c223139a3531a8ca9a68b13dbcb013
2017-04-19 12:17:14 +01:00
Mark Banner 6419084416 Bug 1357502 - Change eslint-plugin-mozilla tests to use the mocha test harness to improve the output. r=mossop
MozReview-Commit-ID: 1xI0tBpbSgM

--HG--
extra : rebase_source : 227dc315767083e88ec88219771d66fade3072b2
2017-04-18 20:06:02 +01:00
Mike Hommey 34e619d1c1 Bug 1357323 - Remove support for gonk in the build system. r=gps
Everything depending on the widget being gonk can go away, as well as
everything depending on MOZ_AUDIO_CHANNEL_MANAGER, which was only
defined on gonk builds under b2g/ (which goes away in bug 1357326).

--HG--
extra : rebase_source : 9f0aeeb7eea8417fa4e06d662d566d67ecaf2a24
2017-04-18 16:56:09 +09:00
Mark Banner 58e3fafe78 Bug 1357546 - Fix how relative paths are handled in Windows for the ESLint import-browser-window-globals rule. r=mossop
MozReview-Commit-ID: Q8YcLRSpkQ
2017-04-18 22:11:54 +01:00
Mark Banner 2e1696e256 Bug 1357393 - Correct getting the rootDir in createExports - used for publishing eslint-plugin-mozilla. r=mossop
Bump the version number to match what is currently published.

MozReview-Commit-ID: 8r8otQQBqBo

--HG--
extra : rebase_source : 1b7daac6b2852117ae08927fd5a09b2a7650d683
2017-04-18 13:56:19 +01:00
Carsten "Tomcat" Book bb87f43c09 merge mozilla-inbound to mozilla-central a=merge 2017-04-18 10:21:31 +02:00
Nicholas Nethercote 4a55f047a5 Bug 1356249 - Fix assertion in profiler_set_frame_number(). r=mstange.
This function can run off the main thread when 'layers.frame-counter' is
enabled.

--HG--
extra : rebase_source : f3db0fd01c636d5af97109761bb0b57b57c79293
2017-04-18 14:40:00 +10:00
Markus Stange 618a091371 Bug 830990 - Stop dispatching CheckResponsivenessEvents when the profiler is stopped. r=njn
MozReview-Commit-ID: 4MnRGqE2sEK

--HG--
extra : rebase_source : 2e6e8b354983240a6f8a177f90d5a59d1e58b94c
2017-04-16 14:48:24 -04:00
Markus Stange 180a94d4c2 Bug 1346592 - When stopping the profiler, mark all ThreadInfos as not being profiled. r=njn
This also renames HasProfile() to IsBeingProfiled().

MozReview-Commit-ID: 70RGHNbyZG3

--HG--
extra : rebase_source : 64f1df6985f41ae52d2385edcfd7822d16fd1e00
2017-04-17 22:46:54 -04:00
Iris Hsiao 063f52934e Backed out changeset 1b277ae21ba5 (bug 1346592)
CLOSED TREE
2017-04-18 11:05:12 +08:00
Iris Hsiao 82a868141d Backed out changeset 9d86f0c3ddd4 (bug 830990) for build bustage
CLOSED TREE
2017-04-18 11:05:00 +08:00
Markus Stange e6bcc1a69f Bug 830990 - Stop dispatching CheckResponsivenessEvents when the profiler is stopped. r=njn
MozReview-Commit-ID: 4MnRGqE2sEK

--HG--
extra : rebase_source : 10078745ac3839ea80879a6ebe710a0f4973f25d
2017-04-16 14:48:24 -04:00
Markus Stange b1002e6197 Bug 1346592 - When stopping the profiler, mark all ThreadInfos as not being profiled. r=njn
This also renames HasProfile() to IsBeingProfiled().

MozReview-Commit-ID: 70RGHNbyZG3

--HG--
extra : rebase_source : fbe6faf0ed9ee7273e77f1f81b79915800772212
2017-04-16 13:41:32 -04:00
Paul Bignier a07aa00315 Bug 1356797 - Update ThirdPartyPaths.txt. r=sylvestre 2017-04-16 19:08:29 -07:00
Sebastian Hengst a7334b2896 Bug 1347709 and Bug 1356569 - Bump eslint plugin version to resolve conflict. r=instruction-by-florian a=bustage-fix
MozReview-Commit-ID: 2zp9hXqxT26

--HG--
extra : amend_source : 465b881899a40cf29d0f3d7dbdd883d8a61edb2c
2017-04-15 20:05:51 +02:00
Sebastian Hengst 8bd051237a merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: JpAhOPjgvkF
2017-04-15 19:59:24 +02:00
Mark Banner f515ecdff3 Bug 1347709 - Allow modules.json to be loaded from a local version for out-of-tree uses of eslint-plugin-mozilla. r=mossop
MozReview-Commit-ID: 7RzAUqNJQ15

--HG--
extra : rebase_source : c71873fd9864032345fb48047f2c272c2703a210
2017-04-13 12:03:30 +01:00
Mark Banner 4ef57a002d Bug 1347709 - Add a prepublish script to save the current globals for the published version of eslint-plugin-mozilla, and use that when not in mozilla-central. r=mossop
MozReview-Commit-ID: GHD7GQ0Pjnp

--HG--
extra : rebase_source : 8a8deeb0544799426baa820fa91a22eb9e1d3526
2017-04-12 18:02:53 +01:00
Markus Stange 2d2f47f7b2 Bug 1355634 - Use MozPromise to make ProfileGatherer more generic. r=njn
MozReview-Commit-ID: GKqxJW8zjca

--HG--
extra : rebase_source : a6f0903008503ae34cb1584bbd38357ff2343c22
extra : histedit_source : 7e077d757dfa919b4a88a10cff0fc15beb3a62f9
2017-04-12 16:57:58 -04:00
Markus Stange c0b86ef8ba Bug 1321617 - Add a test for profiler_stream_json_for_this_process. r=njn
MozReview-Commit-ID: A5Iu3dQFvHK

--HG--
extra : rebase_source : e15843dba66e427c6b1eb7bc2f8a63f419f9e3ca
extra : histedit_source : 6f7e9ee3a31aa2463c4946d543e4358fd724f02f
2017-04-12 16:48:16 -04:00
Markus Stange e668a84964 Bug 1321617 - Capture parent process profiles in ProfileGatherer::Start2, not in ProfileGatherer::Finish. r=njn
MozReview-Commit-ID: 3vC2qb90KN5

--HG--
extra : rebase_source : 45930d88a88648b9d472f990e79e815c106d4fa3
extra : histedit_source : e8b1ef002432231cf3698a5408a1a0d80f3bcac6
2017-04-09 16:52:22 -04:00
Markus Stange dcfba9f179 Bug 1321617 - Call profiler_stream_json_for_this_process in ProfileGatherer::Finish() and get rid of the 'profile-subprocess' notification indirection. r=njn
MozReview-Commit-ID: CnE0SJBsfDN

--HG--
extra : rebase_source : 59f4201d3d8b8fb0d5bc7743f9dafd60789d916a
extra : histedit_source : 5b8b9b26ac87d22d118891868a8a07fe225e85b2
2017-04-12 16:40:03 -04:00
Markus Stange 4a1b5c4027 Bug 1321617 - Reduce the scope of the lock in profiler_get_profile. r=njn
MozReview-Commit-ID: 5OmVMwy1yMl

--HG--
extra : rebase_source : 9cebf6f6ff860fc6b0750e9e4d9eaf23773ccc19
extra : histedit_source : cbd1321ea17a26553384efb6ee7511d800878b84
2017-04-12 16:45:28 -04:00
Markus Stange a951919765 Bug 1321617 - Move parts of StreamJSON out into the callers and rename it to locked_profiler_stream_json_for_this_process. r=njn
MozReview-Commit-ID: 239BJOa2bix

--HG--
extra : rebase_source : 36f248d60bf4c82deb2a62c5a45d9c1c3c44af2e
extra : histedit_source : e5b2b4cb5f19e6efb69ff8e2d391199d3dbaf3ea
2017-04-08 21:07:52 -04:00
Markus Stange 0fc86487fd Bug 1321617 - Don't store profiles on the CPPC; pass them right to the ProfileGatherer. r=njn
MozReview-Commit-ID: 6gaP8Ltm7ms

--HG--
extra : rebase_source : c91f87f096286f8914553a26d692ea99ec9369c5
extra : histedit_source : 0fd9f4a9bf8b9f8f0acaaab30640a5e2f462148b
2017-04-08 21:54:16 -04:00
Markus Stange 59446b4f09 Bug 1321617 - Tell the CrossProcessProfilerController whether a profile is a response to a GatherProfile request or whether it was sent because the process was exiting. r=mconley
MozReview-Commit-ID: BLkaeZqtRhv

--HG--
extra : rebase_source : b0271115a66afbf54d98b5bad61165f815f5bd8c
extra : histedit_source : 299cccc9cc8c06de4d61686ff49d2b0e7649da78
2017-04-12 16:44:31 -04:00
Markus Stange dc05eb93fd Bug 1329114 - Put profiles from other processes into a 'processes' array, not into the threads array, and don't stringify them. r=njn
MozReview-Commit-ID: Ccl6JIbRMyX

--HG--
extra : rebase_source : 1b9a5bbff6da5b1dbfb907630900526e95981a28
extra : histedit_source : 8c830a0178c14fdb044dea2c7323025d3892454b
2017-04-08 16:00:30 -04:00
Mark Banner b624a1a95b Bug 1347709 - Add a .npmignore file to stop publishing unnecessary files for eslint-plugin-mozilla. r=mossop
MozReview-Commit-ID: BcZBIFM1Ugu

--HG--
extra : rebase_source : ca8cbc2e04cb96e98da5febdd82d8ac7393ebc8b
2017-04-06 12:04:52 +01:00
Markus Stange eb07a56986 Bug 1356752 - Fix --enable-tasktracer build by adding the missing aWriter argument. r=njn
MozReview-Commit-ID: L87KE3BmYRB

--HG--
extra : rebase_source : 09e34cc04ea7f76a07419e0e75cc0b097c001b6b
2017-04-15 00:22:07 -04:00
Julian Seward 0187151352 Bug 1355136 - LUL on i686/x86_64-linux: allow CFAs to be arbitrary prefix expressions. r=froydnj.
For reasons which are unclear, but possibly due to lack of any known use cases
when the code was written, LUL on i686/x86_64-linux only accepts CFA (canonical
frame address) expressions of the form SP+offset or FP+offset.  However, on
Fedora 25 x86_64 and Ubuntu 16.10 x86_64, at least one address range per object
uses a Dwarf expression for the CFA, for example:

00000018 000000000024 0000001c FDE cie=00000000 pc=0000000031e0..0000000031f0
  DW_CFA_def_cfa_offset: 16
  DW_CFA_advance_loc: 6 to 00000000000031e6
  DW_CFA_def_cfa_offset: 24
  DW_CFA_advance_loc: 10 to 00000000000031f0
  DW_CFA_def_cfa_expression(
          DW_OP_breg7 (rsp): 8; DW_OP_breg16 (rip): 0; DW_OP_lit15; DW_OP_and;
          DW_OP_lit11; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus)

producing the following complaint from LUL:

  can't summarise: SVMA=0x31f0: rule for DW_REG_CFA: invalid |how|, expr=LExpr(PFXEXPR,0,0)

Given that LUL is capable of handling such a CFA expression, it seems artificial
to stop it doing so.  This patch changes Summariser::Rule() so as to allow such
expressions.
2017-04-12 08:42:02 +02:00
Wes Kocher c8a2033f35 Merge m-c to inbound, a=merge 2017-04-13 17:33:39 -07:00
Wes Kocher 514e230373 Merge inbound to central, a=merge 2017-04-13 17:24:01 -07:00
Nicholas Nethercote 1fbc5e1dab Bug 1355807 - Fix condition guarding stopJSSampling() calls. r=jseward.
PseudoStack requires that startJSSampling() and stopJSSampling() calls be
interleaved. But currently the conditions guarding those calls don't match:
startJSSampling() is guarded by ShouldProfileThread(), and stopJSSampling() is
guarded by HasProfile().

It's possible for HasProfile() to be true when ShouldProfileThread() is not
true -- e.g. profile many threads, then restart and profile fewer threads, and
we end up with live threads that have a profile but aren't being profiled right
now -- which leads to assertion failures in stopJSSampling().

This patch makes the stopJSSampling() condition use ShouldProfileThread(), just
like the startJSSampling() condition, which fixes the assertion failure.

--HG--
extra : rebase_source : e9931928c8ac1301f5018f9da319bc478722b98e
2017-04-13 09:34:42 +10:00
Julian Seward 553b8e9b10 Bug 1354546 - Make LUL read CFI from the main executable on x86_64-Linux. r=n.nethercote.
LUL doesn't read CFI from the main executable on x86_64-linux, and possibly
other Linux variants, because SharedLibraryInfo::GetInfoForSelf() doesn't
produce a name for the main executable object, even though it does notice the
mapping.

This causes noticeable unwind breakage because the main executable on Linux
contains various wrapper functions pertaining to memory allocation and locking,
such as

  moz_xmalloc, moz_xcalloc, moz_xrealloc
  mozilla::detail::MutexImpl::lock, mozilla::detail::MutexImpl::unlock

and is generally observable on x86_64-Linux as unwinding failures out of
functions with addresses around 0x40xxxx, since that's the traditional load
address for the main executable.

This patch modifies the Linux implementation of GetInfoForSelf() so as to
harvest the main executable's name from /proc/self/maps.  This is then added
into the information acquired from dl_iterate_phdr.  As a result
GetInfoForSelf() does correctly report the executable name, so LUL reads Dwarf
unwind info from it, and the abovementioned unwinding failures disappear.

--HG--
extra : rebase_source : 267c6d7c3967a4d29f8ff0b4a91d339a6625085d
2017-04-12 07:56:58 +02:00
Wes Kocher dd8c316d53 Merge m-c to inbound, a=merge 2017-04-12 18:24:24 -07:00
Wes Kocher 2986c817dc Merge autoland to central, a=merge CLOSED TREE 2017-04-12 15:13:30 -07:00
Wes Kocher 25d50f2c30 Merge inbound to central, a=merge 2017-04-12 14:39:09 -07:00
Nicholas Nethercote 32998fa82c Bug 1347258 - Pass TickSample as a reference, not a pointer. r=mstange.
--HG--
extra : rebase_source : cec4e4435b5e67b4bbf29c5f0637f5ebe3a37fca
2017-04-12 14:56:41 +10:00
Mark Banner 3dd96b34b3 Bug 1355776 - Upgrade ESLint to version 3.19.0 to pick up autofix improvements and other fixes. r=mossop
Pick up autofix improvements in 3.19.0. Upgrade eslint-plugin-react. Also fix issues with the package.json file and the ESLint node_modules upload script.

MozReview-Commit-ID: IDZ1n4qTTuv

--HG--
extra : rebase_source : aa97cd6f314ce10d16d12446e50a27d6f994a9f1
2017-04-12 12:07:01 +01:00
Nicholas Nethercote 02ad712a35 Bug 1355357 (part 3) - Construct nativeStack with the right count. r=jseward.
--HG--
extra : rebase_source : 1f619c7fd3af728d34d1f0d350e0d94fa618b5d0
2017-04-11 18:49:00 +10:00
Nicholas Nethercote 2ce4e19d9c Bug 1355357 (part 2) - Avoid a GetThreadHandle() call. r=jseward.
Using ProfiledThread() instead avoids a cast.

--HG--
extra : rebase_source : ddd6b75bc741fc04aa94d0ec2494eb24a2ef9fca
2017-04-11 18:48:02 +10:00
Nicholas Nethercote e64832b7ec Bug 1355357 (part 1) - Rename profiled_thread_ and profiled_thread() in PlatformData. r=jseward.
--HG--
extra : rebase_source : e223ab428aeeb0e711c31dc47a19d5d1bcc471ed
2017-04-11 18:47:15 +10:00
Iris Hsiao 944f87c575 merge mozilla-inbound to mozilla-central a=merge 2017-04-12 11:16:46 +08:00
Julian Seward ac843f7319 Bug 1355052 - Tidy up shared-linux-libraries.cc. r=n.nethercote.
shared-linux-libraries.cc is a maze of ifdefs which is hard to navigate, hard to
reason about and gets in the way of making a proper fix for bug 1354546.  This
bug is for cleanup only.  It should not change any functionality.

The following changes are made:

* adds emacs/vi tab-width lines

* removes the ARRAY_SIZE macro as it appears to be unused

* documents the 3 different configurations, splits #includes accordingly

* comments SharedLibraryInfo::GetInfoForSelf accordingly

* wraps some long lines

* documents in which cases dl_iterate_phdr is used and in which cases
  /proc/<pid>/maps is used

* Puts /proc/<pid>/maps reading in its own scope

* Makes the LOG messages on failure clearer
2017-04-11 18:11:16 +02:00
Kan-Ru Chen da0e46ae95 Bug 1355123 - Initialize gecko profiler properly for IPDL test runner. r=mstange,njn
MozReview-Commit-ID: C9hkZPj3SVL
2017-04-11 10:56:58 -04:00
Nicholas Nethercote d8427b066c Bug 1354436 - Fix crash when MOZ_PROFILER_HELP is specified. r=jseward.
--HG--
extra : rebase_source : 86bedf7edc2b0bfce3b75f8828f3c4fb5015a16c
2017-04-10 14:52:05 +10:00
Carsten "Tomcat" Book 023be17063 Merge mozilla-central to autoland 2017-04-11 10:24:02 +02:00
Mark Banner a49e5501a1 Bug 1354460 - Fix the Mercurial ESLint Hook after the node_modules location change. r=mossop
MozReview-Commit-ID: LhB6twS4TLI

--HG--
extra : rebase_source : 07167ded1cab35a4ade756d773e02b297aaf36bf
2017-04-10 10:07:37 +01:00
Kearwood Gilbert 8cedccb89e Bug 1341423 - Integrate OpenVR binding library r=daoshengmu
MozReview-Commit-ID: GaUnfbXgh9L

--HG--
rename : gfx/vr/openvr/openvr.h => gfx/vr/openvr/headers/openvr.h
extra : rebase_source : e7a0983371c1ed381ddf431e2d5a814c510d4967
2017-02-27 16:59:30 -08:00
Nicholas Nethercote 632b8b594d Bug 1353630 (part 5) - Allocate PseudoStack within ThreadInfo's constructor. r=jseward. 2017-04-06 09:40:28 +10:00
Nicholas Nethercote bd098b6cbc Bug 1353630 (part 4) - Separate ThreadInfos for live and dead threads. r=jseward.
Currently, ThreadInfos for live and dead threads are stored in a single vector.
This patch separates them into two separate vectors.

This ensures that the two kinds of ThreadInfos can't be mixed up. It also means
ThreadInfo::mPendingDelete can be removed.
2017-04-03 10:40:23 +10:00
Nicholas Nethercote 3bd73aaa4b Bug 1353630 (part 3) - Don't hold onto ThreadInfos for dead threads that aren't being profiled. r=jseward.
Currently, when the profiler is active we hold onto the ThreadInfo of all
threads that die. Then when capturing a profile we ignore all threads that
aren't being profiled.

This patch changes things so we only hold onto the ThreadInfos of threads that
die if they are being profiled. In effect it removes state 3 from the following
list of possible ThreadInfo states:

  1. !PendingDelete + !HasProfile
  2. !PendingDelete + HasProfile
  3. PendingDelete + !HasProfile  (no longer used)
  4. PendingDelete + HasProfile
2017-04-03 10:40:23 +10:00
Nicholas Nethercote 76d203f1da Bug 1353630 (part 2) - Replace MaybeSetProfile() with ShouldProfileThread(). r=jseward.
MaybeSetProfile() does a check and then sets on success. By separating the
check from the set, we can avoid some subsequent HasProfile() checks.
2017-04-06 07:44:59 +10:00
Nicholas Nethercote 9c349c7a6c Bug 1353630 (part 1) - Refactor ThreadResponsiveness use in ThreadInfo. r=mstange.
Now that ThreadResponsiveness is only used on the main thread, we can refactor
ThreadInfo a bit. This patch does the following.

- Removes ThreadInfo::mThread, which is unused.

- Changes ThreadInfo::mRespInfo to a Maybe<>, and moves the is-main-thread
  checking outside of ThreadInfo and ThreadResponsiveness.

- Renames {ThreadInfo,TickSample}::mRespInfo as mResponsiveness, to better
  match the class name.
2017-04-05 15:53:13 +10:00
Nicholas Nethercote df889bc9f6 Bug 1350967 (part 2) - Remove profiler_get_profile_jsobject_async() and profiler_save_profile_to_file_async(). r=mstange.
The state management is better done within nsProfiler::GetProfileDataAsync()
and nsProfiler::DumpProfileToFileAsync(). (The latter function is new in this
patch.)

This fixes a deadlock.

Other notes:

- The patch moves ProfileGatherer from ProfilerState to nsProfiler. This is
  nice because the former is shared between threads but the latter is main
  thread only. (This is how the deadlock is avoided.)

- ProfilerStateMutex and PSLockRef are no longer required in platform.h. Those
  types and variables are now only used in platform.cpp and platform-*.cpp.

- ProfilerGatherer now calls profiler_get_profile() instead of ToJSON(). Which
  means that ToJSON() now has a single caller, so the patch inlines it at the
  callsite and removes it.

- profiler_save_profile_to_file_async() dispatched a Runnable to the main
  thread. But this wasn't necessary, because it always ran on the main thread
  itself. So the new function nsProfiler::DumpProfileToFileAsync() doesn't do
  that.

- profiler_will_gather_OOP_profile(), profiler_gathered_OOP_profile(), and
  profiler_OOP_exit_profile() are all moved into nsProfiler as well. This
  removes the need for the horrible fake lock in
  profiler_will_gather_OOP_profile(), hooray!
2017-03-29 15:48:13 +11:00
Nicholas Nethercote 445b5b7145 Bug 1350967 (part 1) - Remove profiler_get_profile_jsobject. r=mstange.
The conversion to a JSObject is better done within
nsProfiler::GetProfileData().

--HG--
extra : rebase_source : 4a0ba97d99681fca96f2d26b609bafe188095787
2017-03-29 14:02:37 +11:00
Mark Banner 92c422a2d6 Bug 1342459 - Add a rule to automatically detect ContentTask.spawn and inject the relevant globals. r=mossop
This reduces the amount of places where we need to specify the mozilla/frame-script environment. It does have
the side effect of allowing those globals in the whole file, but that is what specifying the environment would
do, and this is also for mochitest test files only.

MozReview-Commit-ID: 1LLFbn6fFJR

--HG--
extra : rebase_source : 82a6934d90bbbbd25f91b7b06bf4f9354e38865a
2017-04-05 10:00:25 +01:00
Mark Banner 427e3b23dc Bug 1342459 - Fix various no-undef issues in browser/base. r=mossop
MozReview-Commit-ID: CRYxu7copKb

--HG--
extra : rebase_source : bc176c5e6890ffc6a4e26cb9bc9d441d9486ce7b
2017-04-04 13:42:33 +01:00
Carsten "Tomcat" Book c5364b4b43 Merge mozilla-central to mozilla-inbound 2017-04-05 14:50:28 +02:00
Carsten "Tomcat" Book 7a670cdd01 merge mozilla-inbound to mozilla-central a=merge 2017-04-05 14:33:35 +02:00
Joel Maher 8db607ac7d Bug 1341876 - annotate tools/* with BUG_COMPONENTS. r=gps
MozReview-Commit-ID: 4v1CzI8RtJs
2017-04-05 08:31:05 -04:00
Nicholas Nethercote f9e82b4a80 Bug 1351136 (follow-up) - Fix a harmless argument mis-ordering in a call to profiler_get_start_params(). r=me.
Found by Coverity.

--HG--
extra : rebase_source : 6f65ceef59e8b32252146eec6703a7fd17b3479b
2017-04-05 11:56:37 +10:00
Andrew McCreight 2f83bee3a7 Bug 1353174, part 1 - Turn ContentObservers.jsm into a process script. r=Gijs
This retains the advantage of running only once per process, while
avoiding the per-process overhead of a jsm.

MozReview-Commit-ID: 1N53MvRwUpg

--HG--
rename : browser/modules/ContentObservers.jsm => browser/modules/ContentObservers.js
extra : rebase_source : 6a502cff26fcb55526f97385274bbae871f5cc6c
2017-04-04 11:21:48 -07:00
Mark Banner 9f564cd9e1 Bug 1352969 - Improve ESLint environment browser-window globals list, and automatically inject it into browser-window scripts. r=mossop
MozReview-Commit-ID: 3lv0K1unAc

--HG--
extra : rebase_source : 4e4ef0f40f377298013dc17ca0f077890d32669c
2017-03-09 17:17:26 +00:00
Mark Banner 1087fc1884 Bug 1352969 - Fix various ESLint no-undef issues in browser/base (no-undef is not enabled yet). r=mossop
MozReview-Commit-ID: BuTyJAfUoWR

--HG--
extra : rebase_source : 482bdc039362347f35aec9fd15e07a143dccb860
2017-02-22 17:02:59 +00:00
Mark Banner 2cc135d612 Bug 1353385 - Make './mach eslint --setup' a little quieter and fix the reported location of the eslint binary. r=mossop
MozReview-Commit-ID: 3ucPJP5JXV8

--HG--
extra : rebase_source : ba9f2f1b79e6bbdbf20884ec01d095bd40f8c3c3
2017-04-04 16:06:14 +01:00
Nicholas Nethercote f91e7e7672 Bug 1351963 (part 9) - Improve SetSampleContext(). r=jseward.
SetSampleContext() sets the TickSample's register fields, and the two callers
of SetSampleContext() set the TickSample's mContext.

This patch changes SetSampleContext() so it sets all the fields in one place.
It also renames SetSampleContext() as FillInSample(), because it sets more than
just the context.

--HG--
extra : rebase_source : 9b9f749fe3de687a7fd32f5c38e2321c2abebfdc
2017-03-31 11:13:28 +11:00
Nicholas Nethercote c29e97d66d Bug 1351963 (part 8) - Simplify PseudoStack ownership. r=jseward.
Currently each live thread has a PseudoStack that is owned by tlsPseudoStack,
and a ThreadInfo that has a non-owning pointer to the same PseudoStack.
Then, if the profile is active when the thread dies, ownership of the
PseudoStack is transferred to the ThreadInfo.

This patch simplifies the ownership rules. Every ThreadInfo now always owns its
PseudoStack and is responsible for destroying it. tlsPseudoStack is a
non-owning pointer, and so must be cleared when a PseudoStack is destroyed.
This simplifies the code in a few places.

--HG--
extra : rebase_source : 1012b6590380091d60eff98b4e0c5b1ba946cc7e
2017-03-31 11:01:50 +11:00
Nicholas Nethercote 00f3bc4e23 Bug 1351963 (part 7) - Factor out repeated thread-finding code. r=jseward.
The patch also adds a MOZ_RELEASE_ASSERT in profiler_unregister_thread() for
the case where the ThreadInfo isn't found, which is informative.

--HG--
extra : rebase_source : 11a86914db235e4a60955ff1c9b77d46109af548
2017-03-24 09:24:45 +11:00
Nicholas Nethercote 28cde67779 Bug 1351963 (part 6) - Remove ThreadInfo from TickSample. r=jseward.
This avoids the need for the fake ThreadInfo in profiler_get_backtrace(). It
requires adding a few extra fields to TickSample.

--HG--
extra : rebase_source : c28e5493edc7db96a7160e78b297ae09dc05ca7c
2017-03-31 10:49:36 +11:00
Nicholas Nethercote f76f4f4892 Bug 1351963 (part 5) - Improve TickSample. r=jseward.
This patch does the following.

- Splits TickSample's constructor in two, one for the periodic sample case, and
  one for the synchronous sample case, and initializes more stuff in them. (The
  two constructors aren't that different right now, but they will become more
  different when I remove TickSample::mThreadInfo.)

- Makes all the constructor-filled fields in TickSample |const|.

- Reorders the fields so that the constructor-filled ones are before the ones
  that get filled in later.

- Omits mContext on Mac via conditional compilation, to make the omission
  clearer.

--HG--
extra : rebase_source : f3e392c4cf777df5b9f39577af82615890137018
2017-03-31 10:35:54 +11:00
Nicholas Nethercote 25993378b9 Bug 1351963 (part 4) - Make the LastSample argument to addTagThreadId optional. r=jseward.
LastSample only makes sense for periodic samples, which are written to the
global ProfileBuffer. It doesn't make sense for synchronous samples which are
written to their own unshared buffer. At the moment it doesn't hurt to use
them in this nonsensical way, but the ThreadInfo profiler_get_backtrace()
will be removed soon, and we won't even have a LastSample to use nonsensically.

So this patch makes the LastSample argument to addTagThreadId() optional. Which
means we have to pass in a ThreadId, so there's no longer much point
duplicating the ThreadId in LastSample, so the patch removes that field too.
This avoids the possibility of the duplicate ThreadId failing to match, which
is nice.

--HG--
extra : rebase_source : dad76ff8b33663398e6f45f85da500b0fd7a598f
2017-03-31 10:13:13 +11:00
Nicholas Nethercote f9ffeeb27b Bug 1351963 (part 3, attempt 2) - Remove ThreadInfo from ProfilerBacktrace. r=mstange. 2017-04-04 09:41:53 +10:00
Nicholas Nethercote 44c0cb1064 Bug 1351963 (part 2, attempt 2) - Move StreamSamplesAndMarkers() out of ThreadInfo. r=mstange. 2017-04-04 09:41:11 +10:00
Mark Banner b8e9cadef9 Bug 1305023 - Move ESLint's package.json and node_modules to the top level to improve editor integration. r=gps
Editors generally look for configurations at the top level of a project. For ESLint, they also look for the specific binary in node_modules before defaulting to the system binary. Whilst you can override the location, generally it doesn't work well when switching between projects.

The custom in-tree libraries make setup of a system ESLint more difficult as well.

Therefore to make it simple for developers to pick up the ESLint integrations with Editors, by moving the package.json and associated node_modules to the top-level directory.

MozReview-Commit-ID: 1pQpd7hTQ61

--HG--
rename : tools/lint/eslint/npm-shrinkwrap.json => npm-shrinkwrap.json
rename : tools/lint/eslint/package.json => package.json
extra : rebase_source : 9d69d791f86b5c55b1fcd5f6449f0ab84e56b05c
2017-03-22 12:27:00 +01:00
Carsten "Tomcat" Book 8d910c41e3 merge mozilla-inbound to mozilla-central a=merge 2017-04-03 12:13:46 +02:00
Carsten "Tomcat" Book ac161c6904 Backed out changeset d9ce5cdb4e5a (bug 1351963) for hopefully fix the dt leaks 2017-04-03 08:19:22 +02:00
Carsten "Tomcat" Book b9e48685b2 Backed out changeset 016c13131fff (bug 1351963) 2017-04-03 08:18:55 +02:00
Nicholas Nethercote 5ed484057c Bug 1351963 (part 3) - Remove ThreadInfo from ProfilerBacktrace. r=mstange.
At this point the only things in the ThreadInfo it uses are the thread name and
id, which are easy to store instead. This gets a step closer to avoiding the
use of ThreadInfo in profiler_get_backtrace().

--HG--
extra : rebase_source : f4feb08ec9fe7880ee43f784c6878c1c04fd3294
2017-03-31 09:41:42 +11:00
Nicholas Nethercote 9fe90f9b94 Bug 1351963 (part 2) - Move StreamSamplesAndMarkers() out of ThreadInfo. r=mstange.
StreamSamplesAndMarkers() is the only ThreadInfo method called on
ProfilerBacktrace::mThreadInfo. Furthermore, it doesn't use all that much stuff
from ThreadInfo, and what stuff it does use we can instead pass in as
arguments.

This patch moves StreamSamplesAndMarkers() out of the class. It's a little
ugly, but a necessary precursor for removing ProfilerBacktrace::mThreadInfo and
all the subsequent improvements.

--HG--
extra : rebase_source : 417bda4f29a27c525f7240d3427494dd86b9a868
2017-03-31 09:37:24 +11:00
Nicholas Nethercote c6942af645 Bug 1351963 (part 1) - Tidy up ThreadInfo. r=mstange.
It doesn't need any virtual methods, nor the FRIEND_TEST declarations.

--HG--
extra : rebase_source : 973c01f43737d5672b0257bb40e029894857a90d
2017-03-31 09:28:41 +11:00
Nicholas Nethercote 8a81f4a587 Bug 1351136 - Write a gtest for basic features of the Gecko Profiler. r=mstange.
This required a tweak to DoNativeBacktrace() to work around an ASAN false
positive.

--HG--
extra : rebase_source : 2e21ae4c132db812150f42c26aa708aefce311be
2017-03-29 15:49:44 +11:00
Markus Stange fcdd5dbd1f Bug 1351920 - Remove the nsCString&& version of PROFILER_LABEL_DYNAMIC because it makes misleading promises about performance. r=njn
MozReview-Commit-ID: I4y5xnFyfUj

--HG--
extra : rebase_source : 8cd3d9fc90df1cb7ff6199cf0a5b1cf3319bebe0
2017-03-29 21:47:51 -04:00
Markus Stange 353da4ad55 Bug 1351920 - Check privacy mode during sampling, not during PROFILER_LABEL_DYNAMIC. r=njn
When the profiler is running in privacy mode, we don't want to include dynamic
strings from PROFILER_LABEL_DYNAMIC to end up in the profile.
Rather than checking this every time we enter a scope marked with
PROFILER_LABEL_DYNAMIC, with this patch we will push the dynamic string into
the pseudo stack entry regardless, and then check the privacy mode during
sampling and ignore the dynamic string as necessary.
This way we can avoid taking the profiler state lock in PROFILER_LABEL_DYNAMIC
and also save a branch.

MozReview-Commit-ID: 5dXrtMuFJ5r

--HG--
extra : rebase_source : 1c2057e7ced332d9001137b5b280feab77a712e5
2017-03-30 12:41:04 -04:00
Carsten "Tomcat" Book 095969b8ee merge mozilla-inbound to mozilla-central a=merge 2017-03-31 14:45:33 +02:00
Nicholas Nethercote 6e2f13d8c2 Bug 1351946 (part 2) - Inline and remove GetEntries() and GetInterval(). r=mstange.
--HG--
extra : rebase_source : 127ff560940a93bf9bd5298ac6ab92812bdd94c7
2017-03-30 17:49:27 +11:00
Nicholas Nethercote 35bc116a65 Bug 1351946 (part 1) - Remove SigstartHandler from the profiler. r=mstange.
It was only needed for B2G.

--HG--
extra : rebase_source : 2063f1560503989d0ae0d3f2609e031bd06851a9
2017-03-30 16:27:20 +11:00
Bryce Van Dyk 19caff72af Bug 1325481 - Update clang-format fetch/locate codepath to gracefully fail. r=sylvestre
The checking on the return of value of fetch/locate is not working as intended.
The code should be early returning, but the return value of fetch/locate is 1 in
failure cases, which will not trigger the early return. The return value has
been altered to None, which will trigger the early return.

MozReview-Commit-ID: FDCW6rbZI6T

--HG--
extra : rebase_source : 8b087174db268d7d6a0bb62e6537f82a3b15b28d
2016-12-23 11:15:00 +13:00
Edouard Oger d09f746bfb Bug 1345955 - Update FxA profile when push notification received. r=markh
MozReview-Commit-ID: 4LL6F5Qnnj4

--HG--
extra : rebase_source : 00bc6a445d22fdfb626e7af6ad62fb750f444460
2017-03-16 17:15:18 -04:00
Nicholas Nethercote ecaa485dee Bug 1348024 - Make the env vars MOZ_PROFILER_{ENTRIES,INTERVAL} specific to startup. r=mstange.
The patch also renames profiler_usage() as PrintUsageThenExit().

--HG--
extra : rebase_source : 28b49f9f99d760ef1fcd1d56f8035caa0c5f2192
2017-03-23 13:44:15 +11:00
Mark Banner d12d56b126 Bug 1355778 - Manual fix of ESLint issues in eslint-plugin-* due to the rule changes. r=mossop
MozReview-Commit-ID: Ieh4qkSORjW

--HG--
extra : rebase_source : 9ad2b0257d578eac6106ee16b97394b4f69d1ef3
2017-04-12 12:19:14 +01:00
Mark Banner c8c632d328 Bug 1355778 - Autofix ESLint issues in eslint-plugin-* due to the rule changes. r=mossop
MozReview-Commit-ID: AGnEkeNuxhx

--HG--
extra : rebase_source : 668e5f11679c909b25d15da08c32ce8a1d05fef2
2017-04-12 12:15:13 +01:00
Mark Banner 6bf4da0caf Bug 1355778 - Unify some of the eslint-plugin-* rules to match the Mozilla recommended configuration. r=mossop
MozReview-Commit-ID: IyLtlZCtMtH

--HG--
extra : rebase_source : cb7beeea5d6e59a4cb6503c3d80c65a206679315
2017-04-12 12:14:43 +01:00
Florian Queze 457e21bc53 Bug 1356569 - Update the no-useless-parameters eslint rule to report trailing optional parameters for addObserver, appendElement and notifyObservers, r=jaws. 2017-04-14 21:51:40 +02:00
Florian Queze 37ff4fc7cc Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Sebastian Hengst a07223d699 Backed out changeset 322fde2d53bf (bug 1356569) so bug 1355161 can be backed out. r=backout 2017-04-14 23:39:22 +02:00
Sebastian Hengst 608dc9589d Backed out changeset c724e1485608 (bug 1356569) 2017-04-14 23:39:15 +02:00
Florian Queze 9b6b71947a Bug 1356569 - Update the no-useless-parameters eslint rule to report trailing optional parameters for addObserver, appendElement and notifyObservers, r=jaws. 2017-04-14 21:51:40 +02:00
Florian Queze 95d4d20c17 Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Nicholas Nethercote 2a3ba6e9fa Bug 1351528 (part 2) - Rename TracingMetadata as TracingKind. r=mstange.
"Metadata" regularly confuses me, because it suggests something complicated
rather than a simple enum.

This change also has the benefit of removing inconsistent capitalization
("Metadata" vs. "MetaData").

--HG--
extra : rebase_source : b651e124142c8d93139d22dae1c993c899be4d7a
2017-03-29 13:56:14 +11:00
Nicholas Nethercote 4285c8907d Bug 1351528 (part 1) - Streamline TracingMetadata. r=mstange.
This patch:

- Removes TRACING_EVENT_BACKTRACE, which is unused.

- Removes TRACING_DEFAULT and replaces all its uses with TRACING_EVENT, because
  there is no difference in how those two are used.

- Removes TRACING_TIMESTAMP, which is unused and also doesn't do anything
  different to TRACING_EVENT.

--HG--
extra : rebase_source : 69af1c53aa918798d8050e6b9d1a2658a0902af5
2017-03-29 13:52:47 +11:00
Nicholas Nethercote 37a83290da Bug 1351523 - Reorder profiler_get_start_params() arguments. r=mstange.
profiler_start() and nsProfilerStartParams() both have features before filters.
This patch makes profiler_get_start_params() follow suit.
2017-03-29 13:22:29 +11:00
Nicholas Nethercote a8a6c5c4ba Bug 1348776 (part 2) - Fix up HAVE_NATIVE_UNWIND. r=mstange.
This patch simplifies and increases the consistency of how HAVE_NATIVE_UNWIND
is used.

- Its definition is moved from platform.h to platform.cpp, because the latter
  is the only file that uses it.

- It's now defined in the same place as USE_{NS,EHABI,LUL}_STACKWALK, and used
  in preference to those, where possible. Also, it's now defined on Linux and
  Android even if MOZ_PROFILING is not.

- HAVE_NATIVE_UNWIND is now used consistently and by itself for all relevant
  conditions, including when defining the presence and use of the "stackwalk"
  feature.

- The patch inlines and removes is_native_unwinding_avail().

Note that MOZ_PROFILING must be defined for HAVE_NATIVE_UNWIND to be true on
Windows and Mac, but not on Linux and Android.

--HG--
extra : rebase_source : 5be3e5fe65706a15179a2cf46ba9451f68fff815
2017-03-27 17:04:56 +11:00
Nicholas Nethercote 399c98ac3c Bug 1348776 (part 1) - Fix a crash in the profiler when MOZ_PROFILING is undefined. r=mstange.
Bug 1339695 part 8 unintentionally changed behaviour in profiler_init() when
MOZ_PROFILING is undefined. This patch undoes that change.

--HG--
extra : rebase_source : 16e992382e06fbc673555c87499c236e2b39bc7f
2017-03-27 16:49:41 +11:00
Carsten "Tomcat" Book a441709a12 Merge mozilla-central to autoland 2017-03-27 13:00:23 +02:00
Carsten "Tomcat" Book 8fa2774978 merge mozilla-inbound to mozilla-central a=merge 2017-03-27 12:57:16 +02:00
Mark Banner 314a1804e2 Bug 1350298 - Enable ESLint of nsContextMenu.js, fixing the last issues. Also enable it for finding globals for the browser-window environment. r=jaws
MozReview-Commit-ID: Cl8AFvzR6o8

--HG--
extra : rebase_source : 8ad57d20d53def238bbe214aa2f33f6948e49809
2017-03-24 12:04:36 +00:00
Andreas Tolfsen 869b1b932a Bug 1344748 - Rename and register Marionette prefs; r=maja_zf
This change renames the following Marionette preferences:

    	marionette.defaultPrefs.enabled	marionette.enabled
    	marionette.defaultPrefs.port	marionette.port
    	marionette.force-local		marionette.forcelocal
    	marionette.logging		marionette.log.level

The old preference names are still usable, but are henceforth considered
deprecated.  They will be removed when Firefox 55 ships.

It also registers these preferences in Firefox so that they are
discoverable through about:config.

This patch also refactors testing/marionette/components/marionette.js.

MozReview-Commit-ID: 1dAMQS2e0og

--HG--
extra : rebase_source : e59a9e656442d8e8cebeaf5e741dc8306436bc22
2017-03-09 11:12:53 +00:00
Andreas Tolfsen 55ec9308b0 Bug 1344748 - Make testing/marionette/server.js a class; r=maja_zf,whimboo
No functional changes apart from class'ifying the file and harmonising
the export symbol with the rest of the Marionette code base by renaming
the MarionetteServer class to server.TCPListener.

MozReview-Commit-ID: 8WJKoprGGvr

--HG--
extra : rebase_source : 1f706a0f5e4c9fdccac90bfc14f767763ec85257
2017-03-06 17:09:07 +00:00
Nicholas Nethercote 32c944de0f Bug 1350212 - Improve TickSample. r=jseward.
This patch does the following.

- Renames TickSample's members to mFoo style.

- Changes TickSample's constructor to set mTimeStamp.

- Moves TickSample creation from
  SamplerThread::SuspendAndSampleAndResumeThread() to SamplerThread::Run(), so
  it's not repeated for each platform.

- Changes TickSample::PopulateContext() so it takes a |tick_context_t*|
  parameter, which avoids having to cast from |void*|.
2017-03-24 15:09:05 +11:00
Nicholas Nethercote 56501f9f6f Bug 1350211 - Re-enable native stack walking on Android. r=mstange.
Bug 1339695 part 8 accidentally disabled native stack walking on Android by
using GP_arm_android instead of GP_PLAT_arm_android in a #if. This patch fixes
that. It also fixes a couple of compile errors that crept into the relevant
code while it was disabled.

--HG--
extra : rebase_source : a7a94b018b8de7a7ca3c621a2b662859a65e69c1
2017-03-24 17:02:54 +11:00
Thinker K.F. Li 885084ba60 Bug 1323076 - Part 1: TaskTracer with only flag checking overhead. r=cervantes 2017-03-22 21:43:00 +01:00
Nicholas Nethercote e0caeb137c Bug 1346132 (part 5) - Remove ThreadInfo::CanInvokeJS. r=jseward.
It's unused.

--HG--
extra : rebase_source : 37483099d82004ba1d66cf7a3bb60d5cefd3f03d
2017-03-23 12:42:55 +11:00
Nicholas Nethercote be676c67d2 Bug 1346132 (part 4) - Improve the profiler's logging output. r=jseward.
This patch adds logging to some important functions that currently lack it.
Thread registration/unregistration is done with DEBUG_LOG because it's
more verbose than the other profiler logging, but less verbose than LUL's
logging.

The patch also scraps the BEGIN/END logging pairs because they bloat the output
for little gain. Now it just logs on function entry.

--HG--
extra : rebase_source : 3ef3d263c19cda03198e8b3a9ab89866f74ed1cd
2017-03-15 10:56:50 +11:00
Nicholas Nethercote f1d3df720c Bug 1346132 (part 3) - Remove the profiler's bespoke logging system in favour of MOZ_LOG. r=erahm,jseward.
The profiler will use level 3 (Info) and 4 (Debug) logging, though this patch
only uses level 3. LUL will use level 5 (Verbose) debugging.

The patch also tweaks parts of the the usage message, including adding
MOZ_PROFILER_{STARTUP,SHUTDOWN} to it.

--HG--
extra : rebase_source : f43a023912fbce993ed367cdd26b8f25f25381de
2017-03-14 16:49:12 +11:00
Nicholas Nethercote e105cad299 Bug 1346132 (part 2) - Remove set_stderr_callback(). r=mstange.
It's a very general mechanism for replacing the implementation of
printf_stderr().

It's primarily used by the profiler, sparingly, and not in an important way.
Worse, it prevents us from using MOZ_LOG in the profiler, which is something I
want. Because if any code that locks gPSMutex also calls MOZ_LOG, that then
calls printf_stderr(), which calls profiler_log(), which locks gPSMutex, which
deadlocks.

The only other use of set_stderr_callback() is for the ultra-hacky,
for-local-use-only copy_stderr_to_file() function, which was added for B2G
debugging and is no longer necessary.

This patch removes set_stderr_callback() altogether.

--HG--
extra : rebase_source : d31ecb482fe5899f62dc56a38e87d91f9271bab0
2017-03-16 08:17:56 +11:00
Wes Kocher 1d9dc01136 Merge m-c to inbound, a=merge
MozReview-Commit-ID: HwfVdTF9Np5
2017-03-23 16:55:48 -07:00
Mark Banner 0eb1f2ca26 Bug 1349203 - Upgrade ESLint to version 3.18.0 to pick up performance and other fixes. Also update other dependencies for ESLint. r=mossop
MozReview-Commit-ID: C1oB0pQ3fev

--HG--
extra : rebase_source : 93e63db48f815e173b80611ae592806e4ef43fae
2017-03-21 14:50:45 +01:00
Julian Seward 31acb1259a Bug 1344169 - Factor out the common parts of SamplerThread::Run(). r=n.nethercote.
All three platform-*.cpp files have similar structure, most especially for
SamplerThread::Run(), with considerable duplication.  This patch factors out
the common parts into a single implementation in platform.cpp.

* The top level structure of class SamplerThread has been moved to
  platform.cpp.

* The class has some target-dependent fields, relating to signal handling and
  thread identity.

* There's a single implementation of Run() in platform.cpp.

* AllocPlatformData() and PlatformDataDestructor::operator() have also been
  commoned up and moved into platform.cpp.

* Time units in SamplerThread have been tidied up.  We now use microseconds
  throughout, except in the constructor.  All time interval field and variable
  names incorporate the unit (microseconds/milliseconds) for clarity.  The
  Windows uses of such values are scaled up/down by 1000 accordingly.

* The pre-existing MacOS Run() implementation contained logic that attempted
  to keep "to schedule" in the presence of inaccuracy in the actual sleep
  intervals.  This now applies to all targets.  A couple of comments on this
  code have been added.

* platform-{win32,macos,linux-android}.cpp have had their Run() methods
  removed, and all other methods placed in the same sequences, to the extent
  that is possible.

* In the Win32 and MacOS implementations, Thread::SampleContext has been
  renamed to Thread::SuspendSampleAndResumeThread as that better describes
  what it does.  In the Linux/Android implementation there was no such
  separate method, so one has been created.

* The three Thread::SuspendSampleAndResumeThread methods have been commented
  in such a way as to emphasise their identical top level structure.

* The point in platform.cpp where platform-{win32,macos,linux-android}.cpp are
  #included has been moved slightly earlier in the file, into the
  SamplerThread encampment, as that seems like a better place for it.

--HG--
extra : rebase_source : 0f93e15967b810c09e645fa593dbf85f94b53a9b
2017-03-10 16:10:14 +01:00