Commit Graph

124 Commits

Author SHA1 Message Date
Andreea Pavel
a892a1e9b1 Backed out changeset 463f7fc23171 (bug 1466783) build bustages on a CLOSED TREE 2018-07-05 13:26:40 +03:00
Nazım Can Altınova
d36bbb96e0 Bug 1466783 - Avoid copying while passing the profiler data with IPC r=mstange
MozReview-Commit-ID: HfskcLojToC

--HG--
extra : rebase_source : 361efe4349cbe97303313d47450e60f35a91d1b0
2018-06-15 11:16:41 -07:00
Nazım Can Altınova
1a45365811 Bug 1458246 - Use Shmem to pass the profiler data to be able to send large profiler data r=mstange
We were using nsCString to pass the profiler data between processes. But it was
failing to send because there is a ~256MB limit for the string data. So we
changed it to use Shmem instead. Shmem creates a shared memory and passes the
weak reference. With it, we can send larger data without having a problem.

MozReview-Commit-ID: 1kj57fZDXVF

--HG--
extra : rebase_source : 25a8ab57bcae8012fee1cdd9d4b767036db192d7
2018-06-01 19:28:32 +02:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Nika Layzell
2d188849ae Bug 1455217 - Part 3: Use the new xpidl Promise type instead of nsISupports, r=bz 2018-05-14 17:55:54 -04:00
Makoto Kato
63eeec4b3e Bug 1444796 - Part 2. Make nsIProfilerStartParams scriptable. r=mstange
To add test for startProfiler's parameters on devtools, nsIProfilerStartParams
changes to scriptable.

MozReview-Commit-ID: 3Rf39NzsND1

--HG--
extra : rebase_source : 2b4fc908e7c611a36ac8766b9ce7ccd55f2c5620
2018-03-14 15:05:50 +09:00
Chris Peterson
d09123f248 Bug 1436263 - Part 1: Replace final override virtual function specifiers with just final. r=froydnj
MozReview-Commit-ID: DE5HkIhsZ6D

--HG--
extra : rebase_source : 94831c1e13a840dd2ea0600f64bcf70c2bf938d9
extra : source : cf9283bf1b0bca3a6311c98e227329d451f80ecb
2018-02-05 22:46:57 -08:00
Markus Stange
7e880fe1f8 Bug 1431179 - Keep all exit profiles that overlap with the parent process's buffer time range. r=mconley
MozReview-Commit-ID: 1DIYQZ70ckR

--HG--
extra : rebase_source : f7f5e8e2d0380b54c50cb20b3d109cb476a2530f
extra : source : 612e54e7001a5907761d831b92aed5cee0deb017
2018-02-06 15:29:05 -05:00
Markus Stange
030cf34ac9 Bug 1431179 - When storing an exit profile, remember the current write position of the parent process's profiler buffer, instead of a TimeStamp. r=mystor
MozReview-Commit-ID: 3SFo9r5VrcZ

--HG--
extra : rebase_source : 2be8143e369de6dab82e1c1ef40a049aa478276c
extra : source : 9531d79fa5c3de2051a31fc475f6bbe3c93659a6
2018-01-30 13:28:35 -05:00
Markus Stange
49d6d03730 Bug 1348959 - Remove wraparound indexing in ProfileBuffer. r=djvj,mystor,njn
MozReview-Commit-ID: LeBFSRE6GXR

--HG--
extra : rebase_source : c46c0cd0dd543a367f72000e3cae65260a25b365
extra : source : 0f2e9dd7d45551d40944e4219e5a9eb92d54b2c4
2018-02-06 00:25:30 -05:00
Markus Stange
519cb27db8 Bug 1348959 - Make profiler_get_buffer_info() return information in a struct instead of using outparams. r=mystor,njn
MozReview-Commit-ID: 1iJ05NxOdou

--HG--
extra : rebase_source : 1c4e654340630b0f21c165b41b8fc1be30743c48
extra : source : 64b1a4108f6c3319cfc74c1246bdd2e895e93e1a
2018-01-18 17:54:57 -05:00
Byron Campen [:bwc]
816fe1f2b6 Bug 1431755 - Part 3: Remove a redundant dispatch that was causing us to record the duration of _two_ dispatches instead of one. r=mstange
MozReview-Commit-ID: E8lSvMbGjt6

--HG--
extra : rebase_source : a56a4fa76de084d8eeb1baebf520e672ba804119
2018-01-19 10:03:35 -06:00
Byron Campen [:bwc]
8d9cde7d0d Bug 1431755 - Part 2: Teach GeckoProfiler to profile responsiveness on nsIThreads. r=mstange
MozReview-Commit-ID: AqpNf9pDzrg

--HG--
extra : rebase_source : d7c67ec8564345f6b851691f4e3dee666dd025b1
2018-01-19 09:42:47 -06:00
Dorel Luca
aefaa99a3a Backed out 3 changesets (bug 1431755) for Mochitest failure on test_profile_worker_bug_1428076.html on a CLOSED TREE
Backed out changeset c1befb56cf4d (bug 1431755)
Backed out changeset 8116e9cfc3f0 (bug 1431755)
Backed out changeset 1878f143ccda (bug 1431755)
2018-01-31 00:58:04 +02:00
Byron Campen [:bwc]
da943dc517 Bug 1431755 - Part 3: Remove a redundant dispatch that was causing us to record the duration of _two_ dispatches instead of one. r=mstange
MozReview-Commit-ID: E8lSvMbGjt6

--HG--
extra : rebase_source : b303d66dfedcaa272cd851563a1a7585c4779fac
2018-01-19 10:03:35 -06:00
Byron Campen [:bwc]
44f6431bb0 Bug 1431755 - Part 2: Teach GeckoProfiler to profile responsiveness on nsIThreads. r=mstange
MozReview-Commit-ID: AqpNf9pDzrg

--HG--
extra : rebase_source : d873d9f05115004417b4c0d98dd8dceaef263172
2018-01-19 09:42:47 -06:00
Markus Stange
08c6b1b6c0 Bug 1431217 - Fix a typo that caused us to treat the parent process as shutting down when dumping the profile. r=mconley
MozReview-Commit-ID: IMk7VKMR6pE

--HG--
extra : rebase_source : 345ee1248236840a9c2d822b82f72d0b482cb8b4
2018-01-17 16:59:37 -05:00
Chris Peterson
37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Nika Layzell
a7666fd8fe Bug 1418048 - Add a callback-based Send API to async returning IPDL methods, r=billm
Currently if you write an async IPDL method which has a return value, we expose
a SendXXX method which returns a MozPromise. This MozPromise can then be
->Then-ed to run code when it is resolved or rejected.

Unfortunately, using this API loses ordering guarantees which IPDL provides.
MozPromise::Then takes an event target, which the resolve runnable is dispatched
to. This means that the resolve callback's code doesn't have any ordering
guarantees relative to the processing of other IPC messages coming over the same
protocol.

This adds a new overload to SendXXX with two additional arguments, a lambda
callback which is called if the call succeeds, and a lambda callback which is
called if the call fails. These will be called in order with other IPC messages
sent over the same protocol.

MozReview-Commit-ID: FZHJJaSDoZy
2017-11-20 17:55:32 -05:00
Nicholas Nethercote
b66a653de9 Bug 1407458 - Use nsString for Observation filenames. r=erahm.
This avoids some unnecessary string copying.

--HG--
extra : rebase_source : a81a5e1612be2897a4285f5f395e7cb3ed006bc8
2017-10-17 08:22:12 +11:00
Nicholas Nethercote
3076238153 Bug 1409227 (part 2) - Replace nsMemory::Clone(s, strlen(s)+1) with moz_xstrdup(s). r=erahm.
They are equivalent -- both infallible, both requiring measuring the length of
the string -- but moz_xstrdup is much more readable. (One place deals with
16-bit strings and so uses NS_strdup instead, which is also infallible.)

The patch also removes some failure-path code that will never execute due to
the infallibility.

--HG--
extra : rebase_source : 115574cf55db90b60e6bee59e5dc6ee409374159
2017-10-17 13:09:29 +11:00
Nicholas Nethercote
65c894bd04 Bug 1409227 (part 1) - Remove needless duplication of the profile in nsProfiler::GetProfile(). r=mstange.
--HG--
extra : rebase_source : dc546098c3ed7f8b2e162bf6f26ab87191dba186
2017-10-17 13:01:14 +11:00
Nicholas Nethercote
f0d3349d01 Bug 1408279 - Make profile JSON easier to read. r=mstange.
Currently the choices of SingleLineStyle and MultiLineStyle are sub-optimal,
which makes debugging of profiles difficult.

- A large chunk of the profile is put on a single line, which is very hard to
  read in a text editor.

- Other short and repetitive constructs are unnecessarily spread across
  multiple lines.

This patch makes things more readable.
2017-10-13 15:32:14 +11:00
Kris Maglione
4a767c7e6e Bug 1404198: Part 2j - Switch to NS_NewTimer* everywhere else. r=njn
MozReview-Commit-ID: LmGIgfmNSmk

--HG--
extra : rebase_source : bf34e852beb0c8f6eafd09184c2e0cda95f95f83
2017-09-24 19:57:48 -07:00
Markus Stange
88bdb191e3 Bug 1393123 - Don't attempt to dispatch a runnable before the main thread is known to the thread manager. r=billm
MozReview-Commit-ID: FO2tDQJBGAl

--HG--
extra : rebase_source : 7bb73064a706b4c42263bfe62dc4738fe2f176fc
2017-08-23 13:36:42 -04:00
Eric Rahm
a33f11e0f5 Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.

--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
2017-08-16 16:48:52 -07:00
Markus Stange
55ea239b11 Bug 1387155 - Make nsIProfiler::dumpProfileToFileAsync return a promise. r=njn
MozReview-Commit-ID: 5yJMYrcRPBM

--HG--
extra : rebase_source : 7ceda2b9592f84687e0abaadf2bffb3a90dfbaff
2017-08-03 21:12:45 -04:00
Markus Stange
cfee6598e0 Bug 1382928 - Use atomics for thread-shared pieces of state in ThreadResponsiveness.cpp. r=njn
MozReview-Commit-ID: LZJ4XHZPi7N

--HG--
extra : rebase_source : 0b66d03165571c39948076961c69c40bb35a37af
2017-08-01 15:32:18 -04:00
Markus Stange
d3ab6645a3 Bug 1384688 - Pass aIsShuttingDown == true when obtaining shutdown profiles. r=njn
MozReview-Commit-ID: Aw79gYQgkqy

--HG--
extra : rebase_source : 9cc2d61dd3d2f238b5f52e0b2fee261b1ede608f
2017-07-28 16:16:54 -04:00
Markus Stange
803835a8f1 Bug 1384688 - Add an aIsShuttingDown argument to profiler_get_profile() and to profiler_stream_json_for_this_process(). r=njn
When set to true, the resulting profile will have a non-null meta.shutdownTime
field which is set to current time.
Non-shutdown profiles also get that field, but it's null for them.

MozReview-Commit-ID: 1vpmhBR8rC6

--HG--
extra : rebase_source : b026088053c30acd287f0dc3afa7ddf14093ec27
2017-07-31 14:23:13 -04:00
Sebastian Hengst
38fbb8e007 Backed out changeset 3ad8f1ba9de6 (bug 1384688) 2017-07-31 20:09:52 +02:00
Markus Stange
e7f6342e36 Bug 1384688 - Pass aIsShuttingDown == true when obtaining shutdown profiles. r=njn
MozReview-Commit-ID: Aw79gYQgkqy

--HG--
extra : rebase_source : 9da690a660db226779011a61181e4cdad6219757
2017-07-28 16:16:54 -04:00
Markus Stange
c7ea693fd8 Bug 1384693 - Cull exit profiles that don't have any overlap with the parent process profile. r=njn
This avoids large gaps in the profiler output.

Sometimes we hold on to exit profiles for a long time before a profile is
gathered. During that time, the parent process's profile buffer might have
looped around several times. At that point, profiles from processes that have
exited long ago are no longer interesting.

MozReview-Commit-ID: 5C47vb69DfK

--HG--
extra : rebase_source : 57f0df2f21ab778ec689a08d0bbf010b10f18ed9
2017-07-25 20:29:17 -04:00
Bevis Tseng
a7505864a8 Bug 1378930 - Part 2: Remove the aName parameter from SchedulerGroup/DocGroup/DispatcherTrait. r=billm
--HG--
extra : rebase_source : 11319e568a51d16754a6a9990f76c35c86c2bda7
2017-07-26 16:13:35 +08:00
Wes Kocher
f19f28adfd Merge m-c to autoland, a=merge
MozReview-Commit-ID: F1X8wKqbkg
2017-07-25 19:16:09 -07:00
Nathan Froyd
66c5fc1c12 Bug 1378975 - label the profiler's ThreadResponsiveness runnables; r=billm 2017-07-25 11:17:32 -04:00
Markus Stange
bdcac7a378 Bug 1382910 - Update the profiler state in the child process once PProfiler is connected. r=njn
This handles the case where the profiler state changes in the parent process
between the initial launch of the child process and the time at which the
PProfiler connection is established.

MozReview-Commit-ID: 5SQme5M7P30

--HG--
extra : rebase_source : 301d5541ff5c05a9540e45f1b57c13fb37d5d6fa
2017-07-24 16:33:50 -04:00
Markus Stange
5ecaa17d34 Bug 1382910 - Propagate the current profiler state to a newly-launched child process using environment variables. r=njn
This also fixes the bug where we would always profile child processes if the
parent process had been launched with MOZ_PROFILER_STARTUP=1, regardless of
whether the profiler was still running in the parent process.

MozReview-Commit-ID: LkIpYmKJOJ1

--HG--
extra : rebase_source : 49b38bc58ded91ecc2e2fce08bcb4f2d20a13b92
2017-07-24 18:16:33 -04:00
Markus Stange
22afd028e6 Bug 960153 - Factor out ParseFeaturesFromStringArray. r=njn
MozReview-Commit-ID: JrRecdiMPB0

--HG--
extra : rebase_source : 72d32cf396fc8a3e6e0363487bff9e66355af281
2017-07-20 14:49:35 -04:00
Bill McCloskey
f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Nicholas Nethercote
915a56fb41 Bug 1375299 (part 2) - Remove PROFILER_MARKER. r=mstange.
PROFILER_MARKER is now just a trivial wrapper for profiler_add_marker(). This
patch removes it.

--HG--
extra : rebase_source : 9858f34763bb343757896a91ab7ad8bd8e56b076
2017-06-22 13:40:21 +10:00
Nicholas Nethercote
4b364cf3f3 Bug 1375299 (part 1) - Reduce usage of MOZ_GECKO_PROFILER. r=mstange.
This patch reduces the differences between builds where the profiler is enabled
and those where the profiler is disabled. It does this by removing numerous
MOZ_GECKO_PROFILER checks.

These changes have the following consequences.

- Various functions and classes are now defined in all builds, and so can be
  used unconditionally: profiler_add_marker(), profiler_set_js_context(),
  profiler_clear_js_context(), profiler_get_pseudo_stack(), AutoProfilerLabel.
  (They are effectively no-ops in non-profiler builds, of course.)

- The no-op versions of PROFILER_* are now gone. The remaining versions are
  almost no-ops when the profiler isn't built.

--HG--
extra : rebase_source : 8fb5e8757600210c2f77865694d25162f0b7698a
2017-06-22 06:26:16 +10:00
Carsten "Tomcat" Book
8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey
6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book
ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey
4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Nicholas Nethercote
5d3808c6e5 Bug 1373436 (part 4) - Use UniquePtr with profile_add_marker(). r=mstange.
Once the |aPayload| argument to profile_add_marker() became a UniquePtr the
default value of nullptr caused compilation difficulties that could only be
fixed by #including ProfilerMarkerPayload.h into lots of additional places
(because the UniquePtr<T> instantiation required the T to be fully defined). To
get around this I just split profile_add_marker() into two functions, one with
1 argument and one with 2 arguments.

The patch also removes the definition of PROFILER_MARKER_PAYLOAD in the case
where MOZ_GECKO_PROFILER isn't defined. A comment explains why.
2017-06-16 12:26:26 +10:00
Markus Stange
61580a8992 Bug 1365400 - Add nsIProfiler::GetAllFeatures. r=njn
MozReview-Commit-ID: EfjiUYvfIgM

--HG--
extra : rebase_source : a690e0a451c31fe644ac3843f96afc1e6a2b42f0
2017-06-14 00:20:35 -04:00
Bill McCloskey
0767e31489 Bug 1372736 - Avoid using AbstractThread for non-media MozPromises (r=bkelly)
MozReview-Commit-ID: BBi0pK4DXxf
2017-06-15 20:16:25 -07:00
Nicholas Nethercote
e7083443e9 Bug 1372864 - Change CheckResponsivenessTask::mMonitor to a Mutex. r=mstange.
A mutex is good enough.

--HG--
extra : rebase_source : af7494cd308f67a3599e18f8740cbb36da2f0fac
2017-06-14 21:06:41 +10:00