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

1318 Коммитов

Автор SHA1 Сообщение Дата
Sylvestre Ledru 1ccd7fd032 hg logBug 1366882 - fix resource leaks CID 1401664 1401662 1401661 r=njn
MozReview-Commit-ID: FAhSIfsV2aP

--HG--
extra : rebase_source : 1cda0ef8e20b970b7c47e20fa690412998cab7a7
2017-05-24 20:09:25 +02:00
Carsten "Tomcat" Book 87a9dfd869 Merge mozilla-central to autoland 2017-06-07 13:49:00 +02:00
Nicholas Nethercote 4c0ca14a86 Bug 1368915 (part 5) - Introduce MAX_JS_FRAMES. r=mstange.
--HG--
extra : rebase_source : 478043cf6e347f2eeb368cf0bcd90f7aa0c73c4e
2017-06-02 09:41:58 +10:00
Nicholas Nethercote 26d1e36a3d Bug 1368915 (part 4) - Clean up NativeStack. r=mstange.
This patch puts the arrays inside NativeStack, gives NativeStack a constructor,
and renames its fields using "mFoo" form.

The patch also moves MAX_NATIVE_FRAMES from the LUL-only code and applies it
globally. This increases the max native frame count from 256 to 1024 on the
LUL platforms, which makes things consistent with other platforms.

--HG--
extra : rebase_source : 0854ab37d101e090ea05cba7cb6d296450f8dfdc
2017-06-02 09:41:55 +10:00
Nicholas Nethercote 90133cc8f9 Bug 1368915 (part 3) - Rename aStartTime parameters as aProcessStartTime where appropriate. r=mstange.
This increases naming consistency. The remaining aStartTime parameters within
the profiler refer to a different start time than the process start time.

--HG--
extra : rebase_source : 0a07c54288f31af5a15518180b00fe59b587f784
2017-06-02 09:41:51 +10:00
Nicholas Nethercote d74c3bc157 Bug 1368915 (part 2) - Remove unnecessary mozilla:: qualifiers in plaform.cpp. r=mstange.
--HG--
extra : rebase_source : 9d88c5f5d8ee7d8bb825a92d5e22fb2c06d60d51
2017-06-02 09:41:48 +10:00
Nicholas Nethercote 53299e2c4a Bug 1368915 (part 1) - Rename a parameter of locked_register_thread(). r=mstange.
--HG--
extra : rebase_source : 6bd4cb02d0758a13b2938055052770a206893651
2017-05-31 15:14:50 +10:00
Nicholas Nethercote ede22c7534 Bug 1369612 - Remove ProfilerStackFrameDynamicRAII and profiler_call_{enter,exit}. r=mstange.
ProfilerStackFrameRAII and ProfilerStackFrameDynamicRAII are very similar; the
latter lets a dynamic string be specified as well (and lacks the
MOZ_GUARD_OBJECT stuff, for no good reason).

This patch does the following.

- Removes ProfilerStackFrameDynamicRAII, and adds a dynamic string to
  ProfilerStackFrameRAII. It also reorders the constructor's arguments to match
  the field ordering of ProfileEntry. There aren't many usage sites so these
  changes don't affect many places.

- With that done, there is only a single callsite for each of
  profiler_call_enter() and profiler_call_exit(), so the patch also inlines and
  removes them.
2017-06-02 15:38:20 +10:00
Nicholas Nethercote 1b418b1c18 Bug 1369644 - Remove use of |volatile| from ProfileEntry. r=mstange,shu,jseward,froydnj.
These annotations aren't doing anything useful. The important thing with
the PseudoStack is that, during pushes, the stack pointer incrementing happens
after the new entry is written, and this is ensured by the stack pointer being
Atomic.

The patch also improves the comments on PseudoStack.

--HG--
extra : rebase_source : 100f8a5e4b750c15fac66175550c4c284a141f16
2017-06-02 17:16:56 +10:00
Markus Stange 5d74644e26 Bug 1370673 - Discard exit profiles when the profiler is stopped. r=njn
MozReview-Commit-ID: DOJt32A1Em8

--HG--
extra : rebase_source : a364e501696fc2e04107fdb3c3e1605d80e2c3ae
2017-06-06 23:12:01 -04:00
Nicholas Nethercote 2b5f064d4e Bug 1369276 (part 2) - Convert ProfileEntry::Flags to Kind. r=shu.
There are three flags in ProfileEntry::Flags, which suggests there are 2**3 = 8
combinations. But there are only actually 4 valid combinations.

This patch converts the three flags to a single "kind" enum, which makes things
clearer. Note also that the patch moves the condition at the start of
AddPseudoEntry() to its callsite, for consistency with the earlier JS_OSR entry
kind check.

--HG--
extra : rebase_source : 0950769ee1530291860ef3be47d240df5939e871
2017-06-02 12:46:09 +10:00
Nicholas Nethercote 7d540d96fd Bug 1369276 (part 1) - Fix category handling in AddPseudoEntry. r=shu.
The category handling code at the end of AddPseudoEntry has two problems.

- The assertion checks |category| for the IS_CPP_ENTRY flag. This represents a
  confusion between the entry's |category| and its |flags|. They're both stored
  in a single uint32_t, but are conceptually different types. So the assertion
  is vacuously satisfied.

  Furthermore, there's no clear way to fix the assertion -- it doesn't make
  sense to check the entry's flags for IS_CPP_ENTRY, because this code can
  clearly take C++ or JS entries. So the patch just removes the assertion.

- The category is compared to zero. This also doesn't make sense, because zero
  isn't a valid category. The patch removes this comparison.

--HG--
extra : rebase_source : 16a7248ffb90ccd90e6102d597fb5bdff706312e
2017-05-31 15:03:55 +10:00
Nicholas Nethercote 39b2397ba9 Bug 1369280 (part 2) - Merge ProfileGatherer into nsProfiler. r=mstange.
This makes things simpler in general, and lets us remove the
profiler_is_active() check in nsProfiler().
2017-06-02 11:59:32 +10:00
Nicholas Nethercote 5c4ea689ce Bug 1369280 (part 1) - Reindent nsProfiler.h. r=mstange. 2017-06-02 08:16:00 +10:00
Nicholas Nethercote 2d1da95e46 Bug 1347274 (part 4) - Improve the profiler's gtest. r=mstange.
Two improvements.

- More testing of markers by introducing and using a ProfilerMarkerPayload
  subclass that keeps track of how many instances have been created, streamed,
  and destroyed. This change would have caught the defect that was in the first
  landing of part 3 of this bug.

- More testing of JSON output, to check for various substrings that are
  expected to be present.
2017-06-01 19:54:56 +10:00
Nicholas Nethercote 3d29a20915 Bug 1347274 (part 3, attempt 2) - Make some hot profiler functions lockless. r=mstange. 2017-06-01 13:33:22 +10:00
Kan-Ru Chen 69d4811faa Bug 1368031 - Fix PProfiler::GatherProfile r=mstange
MozReview-Commit-ID: YzJ9UA6Rj6
2017-06-01 15:57:21 +08:00
Nicholas Nethercote 19e99ca015 Bug 1347274 (part 2, attempt 2) - Make CorePS::ProcessStartTime() lockless. r=mstange.
--HG--
extra : rebase_source : 5b8983cec8db3535b76003369f2ac6f9946a5562
2017-06-01 10:22:20 +10:00
Nicholas Nethercote 3056033889 Bug 1347274 (part 1, attempt 2) - Rename some profiler parameters. r=mstange.
--HG--
extra : rebase_source : 395a45c494573da9281f27fbd7826f7ea5c12e10
2017-06-01 10:21:58 +10:00
Carsten "Tomcat" Book 1a0d9545b9 merge mozilla-inbound to mozilla-central a=merge 2017-05-31 11:28:43 +02:00
Markus Stange e2336b07a8 Bug 1330185 - Use a top-level PProfiler protocol to control the profiler in other processes. r=billm,njn
MozReview-Commit-ID: EROfGuYQ6a0

--HG--
extra : rebase_source : be0aa1b9c7963882e8e7d47964f2da5b670ab10a
extra : intermediate-source : e6f368f2d8741f2a9655b288d49b59fbbd6b90b7
extra : source : 51cdc2541486d5ddf2d385ec0459a9ec38b8775b
2017-05-30 15:06:14 -04:00
Markus Stange 898434e218 Bug 1330184 - Add some GeckoProfiler tests that call functions on a background thread. r=njn
MozReview-Commit-ID: 9fMPyQ909PW

--HG--
extra : rebase_source : 8b9f82520fe693f3772ef6b1dda7f3bd06ac4ea0
2017-05-30 17:48:19 -04:00
Markus Stange 4ee7b100b1 Bug 1330184 - Remove main-thread-only assertions. r=njn
I think all of these assertions are now unnecessary.

MozReview-Commit-ID: 9EI195QsizN

--HG--
extra : rebase_source : 4f03ef02ba6680ee6cad22d5d3f347db7d70aa9c
extra : intermediate-source : 2b8d50fcb20fc0bd808707aae00d6cbcb4536bac
extra : source : 327c145ded03d39970351a9cc01492f0541d9149
2017-05-29 15:16:34 -04:00
Markus Stange 76f9a761a7 Bug 1330184 - Use threadsafe refcounting for nsProfilerStartParams. r=njn
MozReview-Commit-ID: HVihlkBr4r3

--HG--
extra : rebase_source : 7ecd602f8fd3fb1c7b290e0ff88940eb9f774b42
2017-05-31 00:35:15 -04:00
Markus Stange 9413af4371 Bug 1330184 - Register/unregister the IOInterposeObserver on the main thread, regardless of what thread the profiler is started / stopped on. r=njn
MozReview-Commit-ID: 8Y0rspxBJw3

--HG--
extra : rebase_source : 64def3fc572c55e2865f5adc570eb841fc759352
extra : intermediate-source : dbe452a9eebb5aff9fa30afdd402efdcb2b6ad30
extra : source : fd537bffda4b653dc7191434c42d068b1b9c65b8
2017-05-16 17:35:05 -04:00
Markus Stange 5d85a692ae Bug 1330184 - Allow StreamMetaObject to be called on a background thread, but only include startTime and version for those calls. r=njn
MozReview-Commit-ID: 3AuX0a2Brrd

--HG--
extra : rebase_source : 8c5d2b4ccacbbec92711a9561d4166e1e7c376c7
extra : intermediate-source : e13b9e798e16185e54435a0b926970e8de134804
extra : source : edfdb14bd020233fa29771bb0f78bcfc55f6cbb3
2017-05-29 13:44:28 -04:00
Markus Stange b728005923 Bug 1330184 - Allow notifying observers for profiler state changes on background threads. r=njn
MozReview-Commit-ID: GlkVwGTa2b4

--HG--
extra : rebase_source : b04504b06aa80635a50d7ce1dcec43a994d6ba8d
extra : intermediate-source : 52489c7eadaf8cab111eef93187c7ecb1482fe58
extra : source : b8c27d6137a43ecd031f0b58c62752b7a9cefacb
2017-05-30 17:07:56 -04:00
Nicholas Nethercote a062b9be51 Bug 1366650 (part 2) - In GeckoProfiler, do all pseudo-stack accesses via the PseudoStack class, instead of via raw array manipulation. r=mstange,shu.
- The profiler gives the JS engine a reference to the pseudo-stack via
  SetContextProfiilngStack(). That function now takes a |PseudoStack*| instead
  of a |ProfileEntry*| and pointer to the stack pointer.

- PseudoStack now has a |kMaxEntries| field, which is easier to work with than
  |mozilla::ArrayLength(entries)|.

- AddressOfStackPointer() is no longer needed.

- The patch also neatens up the push operations significantly. PseudoStack now
  has pushCppFrame() and pushJsFrame(), which nicely encapsulate the two main
  cases. These delegate to the updated initCppFrame() and initJsFrame()
  functions in ProfileEntry.

- Renames max_stck in testProfileStrings.cpp as peakStackPointer, which is a
  clearer name.

- Removes a couple of checks from testProfileStrings.cpp. These checks made
  sense when the pseudo-stack was accessed via raw manipulation, but are not
  applicable now because we can't artificially limit the maximum stack size so
  easily.
2017-05-26 09:51:31 +10:00
Nicholas Nethercote 0840bb61c6 Bug 1366650 (part 1) - Move PseudoStack into SpiderMonkey. r=mstange,shu.
This includes renaming its fields to match SpiderMonkey naming conventions
instead of Gecko naming conventions.

This patch is just about moving the code. The next patch will change
SpiderMonkey to actually use PseudoStack directly.

--HG--
extra : rebase_source : 27e77ddf950201eb6bdba60003218056442cf7ab
2017-05-26 09:37:28 +10:00
Nicholas Nethercote caf0e9ec84 Bug 1367654 (part 2) - In GeckoProfiler.h, rename Sampler* as Profiler*. r=mstange.
Because everything else in this file is called ProfilerFoo or PROFILER_FOO.

--HG--
extra : rebase_source : ddab03809d321d4a301f309750e9cf55a528d467
2017-05-26 14:54:33 +10:00
Phil Ringnalda 6368ef89e2 Backed out 5 changesets (bug 1330185, bug 1330184) for leaking an nsTArray_base from the plugin process on Win8
Backed out changeset e6f368f2d874 (bug 1330185)
Backed out changeset 2b8d50fcb20f (bug 1330184)
Backed out changeset dbe452a9eebb (bug 1330184)
Backed out changeset e13b9e798e16 (bug 1330184)
Backed out changeset 52489c7eadaf (bug 1330184)

MozReview-Commit-ID: 8L20BZ5E3t2
2017-05-22 19:45:35 -07:00
Markus Stange 9bf6b534a2 Bug 1330185 - Use a top-level PProfiler protocol to control the profiler in other processes. r=njn, r=billm
MozReview-Commit-ID: EROfGuYQ6a0

--HG--
extra : rebase_source : 3495ccc7700703cc587f571dfc12e46a682c29a2
extra : source : 51cdc2541486d5ddf2d385ec0459a9ec38b8775b
2017-05-22 13:47:02 -04:00
Markus Stange 001adf56c0 Bug 1330184 - Remove main-thread-only assertions. r=njn
I think all of these assertions are now unnecessary.

MozReview-Commit-ID: 9EI195QsizN

--HG--
extra : rebase_source : ddeb80dfc61ff843b6ba4b35f73d005ca060e429
extra : source : 327c145ded03d39970351a9cc01492f0541d9149
2017-05-21 14:29:12 -04:00
Markus Stange 1c59e2f54d Bug 1330184 - Register/unregister the IOInterposeObserver on the main thread, regardless of what thread the profiler is started / stopped on. r=njn
MozReview-Commit-ID: 8Y0rspxBJw3

--HG--
extra : rebase_source : a3fff1f5d94f7071200b7adc7010c11a1198661f
extra : source : fd537bffda4b653dc7191434c42d068b1b9c65b8
2017-05-16 17:35:05 -04:00
Markus Stange fe9d6d3008 Bug 1330184 - Allow StreamMetaObject to be called on a background thread, but only include startTime and version for those calls. r=njn
MozReview-Commit-ID: 3AuX0a2Brrd

--HG--
extra : rebase_source : 9af9870a3f150d1d975b71e214c84bdf02b6cf62
extra : source : edfdb14bd020233fa29771bb0f78bcfc55f6cbb3
2017-05-04 17:24:56 -04:00
Markus Stange f83374a5e5 Bug 1330184 - Allow notifying observers for profiler state changes on background threads. r=njn
If NotifyObservers is called on a background thread, dispatch a runnable to
the main thread which will send the observer notification. This can result in
awkward orders of the notifications if the profiler functions are called in
quick succession on both the main thread and another thread, but I'm not sure
what to do about that.

MozReview-Commit-ID: GlkVwGTa2b4

--HG--
extra : rebase_source : 628ae91c3adef85c7fb07441b6573eda55e7ba48
extra : intermediate-source : 8c96ac2d762fbed161b6e577f845c1b58ec8bc17
extra : source : b8c27d6137a43ecd031f0b58c62752b7a9cefacb
2017-05-15 19:43:08 -04:00
Nicholas Nethercote d1e495344b Bug 1365854 - Remove FRAME_LABEL_COPY. r=mstange,shu.
ProfileEntry has |string|, which can be static or dynamic, and |dynamicString|.
If |string| is dynamic, the FRAME_LABEL_COPY flag must be set, and it will be
copied into profiler output.

But there is only one place that uses dynamic |string| values, in SpiderMonkey.
And that place doesn't use |dynamicString|. So this patch changes that place to
use an empty |string| and put the old dynamic |string| value in
|dynamicString|. This in turn removes the need for FRAME_LABEL_COPY.

One minor wrinkle is that when |dynamicString| is used the old code put a space
between |string| and |dynamicString|. The new code omits the space if |string|
is empty.

The patch also renames ProfileEntry::string as ProfileEntry::label_, which
better matches how it's used, and ProfileEntry::dynamicString as
ProfileEntry::dynamicString_ so the getter can be renamed dynamicString().
2017-05-18 17:17:46 +10:00
Nicholas Nethercote cbb477c02f Bug 1365515 (part 2, attempt 2) - Remove tick_context_t. r=jseward.
--HG--
extra : rebase_source : 1d9774d694383bdbf25c3c389351c4b7bf3b398a
2017-05-17 17:29:59 +10:00
Nicholas Nethercote f897ce8673 Bug 1365515 (part 1, attempt 2) - Remove profiler support for x86/Darwin. r=mstange.
--HG--
extra : rebase_source : 47f20e763d62c5e3dd0ba662da0822f9cf3e1526
2017-05-17 17:28:59 +10:00
Nicholas Nethercote 282086d9d5 Bug 1366171 - Fix misplaced PSAutoLock. r=mstange.
profiler_resume() mistakenly has the PSAutoLock outside the scope created
specially for it. This patch move the PSAutoLock inside the scope, making it
the same as profiler_pause().
2017-05-19 16:30:06 +10:00
Markus Stange 42b5d166ec Back out bug 1330184 and bug 1330185 because of test failures.
MozReview-Commit-ID: ILD4mevlSU6
2017-05-21 15:11:15 -04:00
Markus Stange b5fdcd479d Bug 1330185 - Use a top-level PProfiler protocol to control the profiler in other processes. r=njn, r=billm
MozReview-Commit-ID: EROfGuYQ6a0

--HG--
extra : rebase_source : de266bda4fc2d6532ff45a6d548b13cd0b4f7206
extra : histedit_source : ad5c4e140c068f17c51d5085fd88ac691e50ab4f
2017-05-21 14:06:50 -04:00
Markus Stange 3bf894099b Bug 1330184 - Remove main-thread-only assertions. r=njn
I think all of these assertions are now unnecessary.

MozReview-Commit-ID: 9EI195QsizN

--HG--
extra : rebase_source : 2a9969dd9e48873f6ec333a5ddfa32b6d938de80
extra : histedit_source : ea4dab2b111e465d3a1e29996cc7f10eb8cdbb67%2C8ab59878e4b1b5a715e0738408c26ac3aa0501e7
2017-05-21 14:29:12 -04:00
Markus Stange cff8ee519e Bug 1330184 - Register/unregister the IOInterposeObserver on the main thread, regardless of what thread the profiler is started / stopped on. r=njn
MozReview-Commit-ID: 8Y0rspxBJw3

--HG--
extra : rebase_source : f88773d3f62a6399299101f84b890d3e253d664c
extra : histedit_source : 4c9a8264e015205a68394fa4e5030082244594f1
2017-05-16 17:35:05 -04:00
Markus Stange 11d48ea717 Bug 1330184 - Allow StreamMetaObject to be called on a background thread, but only include startTime and version for those calls. r=njn
MozReview-Commit-ID: 3AuX0a2Brrd

--HG--
extra : rebase_source : 35f0280c1dcbbcee6e1a8c0c1239f22e817ca1b9
extra : histedit_source : 4f0da56858ced5e3dcc88c34806228f75a25a875
2017-05-04 17:24:56 -04:00
Markus Stange eede579636 Bug 1330184 - Allow notifying observers for profiler state changes on background threads. r=njn
If NotifyObservers is called on a background thread, dispatch a runnable to
the main thread which will send the observer notification. This can result in
awkward orders of the notifications if the profiler functions are called in
quick succession on both the main thread and another thread, but I'm not sure
what to do about that.

MozReview-Commit-ID: GlkVwGTa2b4

--HG--
extra : rebase_source : 30537a31cc828ad7828e41c2885d84a8299a5e70
extra : source : b8c27d6137a43ecd031f0b58c62752b7a9cefacb
extra : histedit_source : f1340ef14acde098de281b81d5ea89e386e7ab42
2017-05-15 19:43:08 -04:00
Nicholas Nethercote 7d44af05e2 Bug 1365824 - Remove STORE_SEQUENCER. r=froydnj.
It's a software memory barrier, and not a very strong one. If the values it is
protecting are Atomic, that provides a stronger hardware memory barrier.

This patch removes it, and changes one of the values it was protecting from
|volatile| to Atomic. (The other value it was protecting was already Atomic.)
2017-05-18 13:24:13 +10:00
Iris Hsiao 02cae69058 Backed out 4 changesets (bug 1357829) for build bustage in xpcshell\selftest.py on windows 8 x64 opt. a=backout
Backed out changeset 8ea202bb1103 (bug 1357829)
Backed out changeset cebe4d7abeda (bug 1357829)
Backed out changeset 378d473c9619 (bug 1357829)
Backed out changeset 86ebe868d443 (bug 1357829)
2017-05-19 11:27:38 +08:00
Michael Layzell 8a302e6be2 Bug 1357829 - Part 4: Remove TickController, r=njn
MozReview-Commit-ID: 2IHa6ybR9ug
2017-05-18 13:56:20 -04:00
Michael Layzell e62bfa945f Bug 1357829 - Part 3: Remove profiler_get_stack_top, r=njn
MozReview-Commit-ID: C4DvuOvYSrs
2017-05-18 13:56:20 -04:00