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

95 Коммитов

Автор SHA1 Сообщение Дата
Doug Thayer 8aae071723 Bug 1382440 - Watch CPU usage in BHR r=froydnj
We would like to be able to see if a given hang in BHR occurred
under high CPU load, as this is an indication that the hang is
of less use to us, since it's likely that the external CPU use
is more responsible for it.

The way this works is fairly simple. We get the system CPU usage
on a scale from 0 to 1, and we get the current process's CPU
usage, also on a scale from 0 to 1, and we subtract the latter
from the former. We then compare this value to a threshold, which
is 1 - (1 / p), where p is the number of (virtual) cores on the
machine. This threshold might need to be tuned, so that we
require an entire physical core in order to not annotate the hang,
but for now it seemed the most reasonable line in the sand.

I should note that this considers CPU usage in child or parent
processes as external. While we are responsible for that CPU usage,
it still indicates that the stack we receive from BHR is of little
value to us, since the source of the actual hang is external to
that stack.

MozReview-Commit-ID: JkG53zq1MdY

--HG--
extra : rebase_source : 16553a9b5eac0a73cd1619c6ee01fa177ca60e58
2017-07-24 13:46:09 -07:00
Nicholas Nethercote d5f5450783 Bug 1392884 - Remove nsIAtomService. r=froydnj.
It's no longer used, and we're in the process of making nsIAtom not usable from
scripts, so we don't want it to be used.
2017-08-25 17:06:58 +10:00
Nicholas Nethercote e99e711d3f Bug 1382099 - Remove MOZ_WIDGET_GONK from xpcom/. r=erahm.
As well as the straightforward things, this lets us remove ReadSysFile and
WriteSysFile, which in turn lets us remove TestFileUtils.cpp.

--HG--
extra : rebase_source : fc90c05352e654ffc41009d8504a9c54f394fc3f
2017-07-21 10:45:39 +10:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02: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
Kris Maglione fc0586811d Bug 1361900: Part 4 - Use a separate script cache for scripts loaded in the child process. r=erahm,gabor
MozReview-Commit-ID: EIdwmuTOl90

--HG--
extra : rebase_source : d2f6ba18a03cb54459e98b9d2ff03bc3d9567e83
extra : source : ad243db647c708b74859d73e8787b5b34897c140
2017-05-09 19:52:17 -07:00
Sebastian Hengst e1ddae17f8 Backed out changeset ad243db647c7 (bug 1361900) 2017-05-13 18:53:40 +02:00
Kris Maglione 34e20a0617 Bug 1361900: Part 4 - Use a separate script cache for scripts loaded in the child process. r=erahm,gabor
MozReview-Commit-ID: EIdwmuTOl90

--HG--
extra : rebase_source : bce9efcd7b97c281bf4e17e30eed31e6e93c614a
2017-05-09 19:52:17 -07:00
Kris Maglione 15e7adf3aa Bug 1359653: Part 5 - Pre-load scripts needed during startup in a background thread. r=shu,erahm
One of the things that I've noticed in profiling startup overhead is that,
even with the startup cache, we spend about 130ms just loading and decoding
scripts from the startup cache on my machine.

I think we should be able to do better than that by doing some of that work in
the background for scripts that we know we'll need during startup. With this
change, we seem to consistently save about 3-5% on non-e10s startup overhead
on talos. But there's a lot of room for tuning, and I think we get some
considerable improvement with a few ongoing tweeks.

Some notes about the approach:

- Setting up the off-thread compile is fairly expensive, since we need to
create a global object, and a lot of its built-in prototype objects for each
compile. So in order for there to be a performance improvement for OMT
compiles, the script has to be pretty large. Right now, the tipping point
seems to be about 20K.

  There's currently no easy way to improve the per-compile setup overhead, but
we should be able to combine the off-thread compiles for multiple smaller
scripts into a single operation without any additional per-script overhead.

- The time we spend setting up scripts for OMT compile is almost entirely
CPU-bound. That means that we have a chunk of about 20-50ms where we can
safely schedule thread-safe IO work during early startup, so if we schedule
some of our current synchronous IO operations on background threads during the
script cache setup, we basically get them for free, and can probably increase
the number of scripts we compile in the background.

- I went with an uncompressed mmap of the raw XDR data for a storage format.
That currently occupies about 5MB of disk space. Gzipped, it's ~1.2MB, so
compressing it might save some startup disk IO, but keeping it uncompressed
simplifies a lot of the OMT and even main thread decoding process, but, more
importantly:

- We currently don't use the startup cache in content processes, for a variety
of reasons. However, with this approach, I think we can safely store the
cached script data from a content process before we load any untrusted code
into it, and then share mmapped startup cache data between all content
processes. That should speed up content process startup *a lot*, and very
likely save memory, too. And:

- If we're especially concerned about saving per-process memory, and we keep
the cache data mapped for the lifetime of the JS runtime, I think that with
some effort we can probably share the static string data from scripts between
content processes, without any copying. Right now, it looks like for the main
process, there's about 1.5MB of string-ish data in the XDR dumps. It's
probably less for content processes, but if we could save .5MB per process
this way, it might make it easier to increase the number of content processes
we allow.

MozReview-Commit-ID: CVJahyNktKB

--HG--
extra : source : 1c7df945505930d2d86a076ee20807104324c8cc
extra : histedit_source : 75e193839edf727874f01b2a9f6852f6c1f087fb%2C3ce966d7dcf2bd0454a7d673d0467097456bd782
2017-05-06 12:24:22 -07:00
Sebastian Hengst 544da0524c Backed out changeset 1c7df9455059 (bug 1359653) 2017-05-06 11:02:23 +02:00
Kris Maglione a4368ffba1 Bug 1359653: Part 5 - Pre-load scripts needed during startup in a background thread. r=shu,erahm
One of the things that I've noticed in profiling startup overhead is that,
even with the startup cache, we spend about 130ms just loading and decoding
scripts from the startup cache on my machine.

I think we should be able to do better than that by doing some of that work in
the background for scripts that we know we'll need during startup. With this
change, we seem to consistently save about 3-5% on non-e10s startup overhead
on talos. But there's a lot of room for tuning, and I think we get some
considerable improvement with a few ongoing tweeks.

Some notes about the approach:

- Setting up the off-thread compile is fairly expensive, since we need to
create a global object, and a lot of its built-in prototype objects for each
compile. So in order for there to be a performance improvement for OMT
compiles, the script has to be pretty large. Right now, the tipping point
seems to be about 20K.

  There's currently no easy way to improve the per-compile setup overhead, but
we should be able to combine the off-thread compiles for multiple smaller
scripts into a single operation without any additional per-script overhead.

- The time we spend setting up scripts for OMT compile is almost entirely
CPU-bound. That means that we have a chunk of about 20-50ms where we can
safely schedule thread-safe IO work during early startup, so if we schedule
some of our current synchronous IO operations on background threads during the
script cache setup, we basically get them for free, and can probably increase
the number of scripts we compile in the background.

- I went with an uncompressed mmap of the raw XDR data for a storage format.
That currently occupies about 5MB of disk space. Gzipped, it's ~1.2MB, so
compressing it might save some startup disk IO, but keeping it uncompressed
simplifies a lot of the OMT and even main thread decoding process, but, more
importantly:

- We currently don't use the startup cache in content processes, for a variety
of reasons. However, with this approach, I think we can safely store the
cached script data from a content process before we load any untrusted code
into it, and then share mmapped startup cache data between all content
processes. That should speed up content process startup *a lot*, and very
likely save memory, too. And:

- If we're especially concerned about saving per-process memory, and we keep
the cache data mapped for the lifetime of the JS runtime, I think that with
some effort we can probably share the static string data from scripts between
content processes, without any copying. Right now, it looks like for the main
process, there's about 1.5MB of string-ish data in the XDR dumps. It's
probably less for content processes, but if we could save .5MB per process
this way, it might make it easier to increase the number of content processes
we allow.

MozReview-Commit-ID: CVJahyNktKB

--HG--
extra : rebase_source : 2ec24c8b0000f9187a9bf4a096ee8d93403d7ab2
extra : absorb_source : bb9d799d664a03941447a294ac43c54f334ef6f5
2017-05-05 16:15:04 -07:00
Kan-Ru Chen 36e1ce5909 Bug 1313200 - Init AbstractThread properly and early. r=froydnj
Separate AbstractThread::InitTLS and
AbstractThread::InitMainThread. Init AbstractThread main thread when
init nsThreadManager. Init AbstractThread TLS for all content process
types because for plugin and gmp processes we are doing IPC even
without init XPCOM and for content process init XPCOM requires IPC.

MozReview-Commit-ID: DhLub23oZz8

--HG--
extra : rebase_source : 6e4bfa03ec69e1eb694924903f1fa5e7259cbba3
2017-04-19 13:24:09 +08:00
Sebastian Hengst f12d3f3f0d Backed out changeset aa882c81840b (bug 1346415) for frequently failing toolkit/components/telemetry/tests/unit/test_ThreadHangStats.js and likely also breaking Windows 8 x64 opt builds. r=backout 2017-03-29 17:56:14 +02:00
Michael Layzell ee460f557c Bug 1346415 - Collect native stacks for all hangs over 128ms on Nightly, r=gfritzsche
MozReview-Commit-ID: 4LVBFHkeTdD
2017-03-29 10:10:26 -04:00
Nicholas Nethercote d8023679e3 Bug 1345262 (part 2) - Add profiler_{set,clear}_js_context(). r=mstange.
PseudoContext::sampleContext() is always called immediately after
profiler_get_pseudo_stack(). This patch introduces profiler_set_js_context()
and profiler_clear_js_context(), which replace the profiler_get_pseudo_stack()
+ sampleContext() pairs. This takes us a step closer to not having to export
PseudoStack outside the profiler.

--HG--
extra : rebase_source : 8558d1600eafd395cc696d31f3d21fb52a1a74b0
2017-03-09 17:06:35 +11:00
Eric Rahm 3bec954d62 Bug 792209 - Remove nsISupportsArray. r=froydnj
MozReview-Commit-ID: G28VUoYj9Wj
2016-11-17 11:45:41 -08:00
Nicholas Nethercote 352554c8f6 Bug 1340928 (part 10) - Remove nested calls to profiler_{init,shutdown}(). r=mstange.
The profiler can currently handle nested calls to profiler_{init,shutdown}() --
only the first call to profiler_init() and the last call to profiler_shutdown()
do anything. And sure enough, we have the following.

- Outer init/shutdown pairs in XRE_main()/XRE_InitChildProcess() (via
  GeckoProfilerInitRAII).

- Inner init/shutdown pairs in NS_InitXPCOM2()/NS_InitMinimalXPCOM() (both shut
  down in ShutdownXPCOM()).

This is a bit silly, so the patch removes the inner pairs, and adds a
now-needed pair in XRE_XPCShellMain. This will allow gInitCount -- which tracks
the nesting depth -- to be removed in a future patch.

--HG--
extra : rebase_source : 7e8dc6ce81ce10269d2db6a7bf32852c396dba0e
2017-02-15 17:08:38 +11:00
Bill McCloskey e1b2f2ef09 Bug 1337537 - Make a SystemGroup singleton (r=ehsan)
MozReview-Commit-ID: Jnwrr49daeM
2017-02-13 17:02:52 -08:00
Tom Tromey ada066d0b0 Bug 1324434 - remove JS_GetCurrentEmbedderTime in favor of TimeStamp; r=sfink
MozReview-Commit-ID: CG0MidpH8k3

--HG--
extra : rebase_source : 1facc7347c19d9975bbeb168166ddd4c7de4545b
2016-12-19 08:23:59 -07:00
Chris Peterson e3e3523d58 Bug 1331171 - Part 3: Remove xpcom checks for Windows Vista. r=froydnj
Also remove the #includes of some unused header files.

MozReview-Commit-ID: 6mRoIazEA3j

--HG--
extra : rebase_source : 6f96d22543509bf09b684b0bfbfa624eafc58b94
2017-01-12 01:13:55 -08:00
Chris Peterson 2ffa3b99a7 Bug 1331171 - Part 1: Remove StartupSpecialSystemDirectory() workaround for Windows XP. r=jimm
SHGetKnownFolderPath() is available on Windows Vista+ so we no longer need to GetProcAddress("SHGetKnownFolderPath"). We can set _WIN32_WINNT 0x0600 to expose the SHGetKnownFolderPath function declaration in shlobj.h and call it directly.

Also remove a redundant #include <shlobj.h>.

MozReview-Commit-ID: AoAlrfvQ5AB

--HG--
extra : rebase_source : 2fa3a0d3d122ca31fb3369a43a03b6e2c5d5dec2
2017-01-14 01:12:02 -08:00
Nathan Froyd f5b2c78c1a Bug 1276669 - part 8 - add a comment in NS_InitXPCOM2 to make static atom initialization less cryptic; r=erahm
This comment makes things slightly more greppable.
2017-01-26 15:43:38 -05:00
Nicholas Nethercote 22b6d342d7 Bug 1333296 (part 1) - Rename MOZ_ENABLE_PROFILER_SPS as MOZ_GECKO_PROFILER. r=mstange,glandium.
--HG--
extra : rebase_source : 223f3a17f009645369be503392cc1f0cea7f19a1
2017-01-24 14:15:12 +11:00
Nicholas Nethercote 12647a7223 Bug 1332577 (part 7) - Rename mozilla_get_pseudo_stack() as profiler_get_pseudo_stack(). r=mstange.
This makes it consistent with other profiler functions.

--HG--
extra : rebase_source : 1e52acdc448691b8859bb147a0c70b198b432fe2
2017-01-20 15:07:05 +11:00
Nathan Froyd ec503a0996 Bug 1329718 - remove nsISupportsVoid and associated machinery; r=erahm
Nothing uses it, it's virtually impossible to use from script, and there
are better ways to pass a |void*| around in C++.
2017-01-10 16:31:48 -05:00
Tomislav Jurin 348bfffc19 Bug 1296189 - Replace NS_RUNTIMEABORT("some string literal message") with MOZ_CRASH(). r=froydnj 2016-12-02 13:46:53 -08:00
Eric Rahm 5ae299f0d8 Bug 1315812 - Mark nsISupportsArray, nsICollection, nsIEnumerator as deprecated. r=froydnj
This marks the idl classes as deprecated, removes an unnecessary include that
was triggering deprecation warnings and wraps a necessary include in
XPCOMInit.cpp that is used for registering the component in deprecation
disabling pragmas.

MozReview-Commit-ID: BbNU5q8O4Q4
2016-11-10 13:15:33 -08:00
Matt Woodrow 12feacb4da Bug 1314191 - Make sure we shut down VideoDecoderManagerChild before threads go away. r=dvander 2016-11-03 09:57:17 +13:00
David Anderson ea1b39856a Ensure we start the Telemetry singleton in the GPU process. (bug 1304494 part 1, r=gfritzsche) 2016-10-30 22:35:56 -07:00
Matt Woodrow 4d0b10822d Bug 1308363 - Remove GONK specific code from gfx/. r=jrmuizel,sotaro 2016-10-27 13:17:10 +13:00
David Anderson b6b222c57c Ensure the hang monitor is enabled in the GPU process. (bug 1311716, r=billm) 2016-10-24 01:07:54 -07:00
Matt Woodrow 67cd537af3 Bug 1300682 - Part 6: Use SharedThreadPool for GPU process decoders. r=dvander 2016-10-07 21:13:33 +13:00
Byron Campen [:bwc] 0cf5031cd7 Bug 1157323 - Part 2: Factor nsTimerImpl into two classes, so we don't need to do racy stuff in nsTimerImpl::Release. r=froydnj
MozReview-Commit-ID: DAe4TpMqBpA

--HG--
extra : rebase_source : 4caeb1ffc41b0704e5c1c111ef869d8edfb6d30c
2016-07-20 15:16:40 -05:00
Matt Woodrow 64a71f90da Bug 1288618 - Part 7: Initialize AbstractThread in the GPU process. r=dvander 2016-09-21 21:24:43 +12:00
Carsten "Tomcat" Book f918af64da Backed out 16 changesets (bug 1288618) for bustage on a CLOSED TREE
Backed out changeset 06187d250f7a (bug 1288618)
Backed out changeset 2a47f8ea1d89 (bug 1288618)
Backed out changeset e179c8e8265d (bug 1288618)
Backed out changeset 25396a1af922 (bug 1288618)
Backed out changeset e98f835c6ee5 (bug 1288618)
Backed out changeset 24df0e89b273 (bug 1288618)
Backed out changeset f8bbdabdb6da (bug 1288618)
Backed out changeset 8b0adeab93df (bug 1288618)
Backed out changeset 95f23366de82 (bug 1288618)
Backed out changeset 63a9c689e1d5 (bug 1288618)
Backed out changeset 8f67443dccb8 (bug 1288618)
Backed out changeset 4e7fe69d5f45 (bug 1288618)
Backed out changeset 53b113acee42 (bug 1288618)
Backed out changeset 2583ae4e2e3b (bug 1288618)
Backed out changeset 75a61d0e71b7 (bug 1288618)
Backed out changeset da740b4fd484 (bug 1288618)
2016-09-21 08:44:11 +02:00
Matt Woodrow 97147af527 Bug 1288618 - Part 7: Initialize AbstractThread in the GPU process. r=dvander
--HG--
extra : rebase_source : fd702b96f36645a2b0d8a7a4e4afc74c063a68c4
2016-09-21 15:36:09 +12:00
Carsten "Tomcat" Book 6155a378e7 Backed out changeset 30e2b2eea845 (bug 1288618) 2016-09-15 16:34:09 +02:00
Matt Woodrow 0f949621e5 Bug 1288618 - Part 7: Initialize AbstractThread in the GPU process. r=dvander 2016-09-15 23:17:59 +12:00
Jan de Mooij 7f794780e0 Bug 1302448 part 2 - Rename XPCJSRuntime to XPCJSContext. r=mrbkap
--HG--
rename : js/xpconnect/src/XPCJSRuntime.cpp => js/xpconnect/src/XPCJSContext.cpp
extra : rebase_source : e6b435ab1ca2739e340669195dff77c561ea573e
2016-09-14 15:48:17 +02:00
Andrew McCreight f9e6d19361 Bug 1299934 - Run shutdown collection in workers in opt builds. r=froydnj,smaug
We skip running shutdown collection on the main thread, because we're
exiting right after, but the process still continues when we shut down
a worker, so we should always do collections there.

MozReview-Commit-ID: IQZItm1qWXW

--HG--
extra : rebase_source : 4fd89e36db124a524c240e806a885dee3b68979e
2016-09-08 13:04:30 -07:00
Nicholas Nethercote 819433bae0 Bug 1299389 - Replace some raw pointers in nsThreadManager. r=froydnj.
nsThreadManager::get() can return a reference. This lets us remove some
redundant assertions.

nsThreadArray elements can be NotNull<>s.

--HG--
extra : rebase_source : fd49010167101bc15f7f6d01bf95fd63b81d60fb
2016-06-10 16:04:49 +10:00
Nicholas Nethercote c2306345d5 Bug 1297658 - Avoid unnecessary checking in memory reporters. r=erahm.
This patch removes checking of all the callback calls in memory reporter
CollectReport() functions, because it's not useful.

The patch also does some associated clean-up.

- Replaces some uses of nsIMemoryReporterCallback with the preferred
  nsIHandleReportCallback typedef.

- Replaces aCallback/aCb/aClosure with aHandleRepor/aData for CollectReports()
  parameter names, for consistency.

- Adds MOZ_MUST_USE/[must_use] in a few places in nsIMemoryReporter.idl.

- Uses the MOZ_COLLECT_REPORT macro in all suitable places.

Overall the patch reduces code size by ~300 lines and reduces the size of
libxul by about 37 KiB on my Linux64 builds.

--HG--
extra : rebase_source : e94323614bd10463a0c5134a7276238a7ca1cf23
2016-08-24 15:23:45 +10:00
Matthew Gregan 94df8b79e6 Bug 1296988 - Update libnestegg. r=rillian 2016-08-25 13:49:22 +12:00
David Anderson 424b5eb180 Initialize nsAppShell in the GPU process. (bug 1294350 part 5, r=nfroyd) 2016-08-22 22:57:36 -07:00
David Anderson 9495e20273 Enable nsComponentManager in the GPU process. (bug 1294350 part 4, r=nfroyd) 2016-08-22 22:57:36 -07:00
David Anderson 3f96d36cdd Initialize a subset of XPCOM in the GPU process. (bug 1294350 part 3, r=froydnj) 2016-08-22 22:57:36 -07:00
Jan de Mooij 0ad12515f4 Bug 1292892 part 1 - Stop using JSRuntime outside SpiderMonkey. r=bz,terrence,fitzgen,kanru 2016-08-11 14:39:22 +02:00
Nicholas Nethercote bab6d17ebf Bug 1293117 (part 4) - Change many NS_IMETHODIMP occurrences to NS_IMETHOD. r=froydnj.
This patch makes the following changes on many in-class methods.

- NS_IMETHODIMP F() override;      --> NS_IMETHOD F() override;
- NS_IMETHODIMP F() override {...} --> NS_IMETHOD F() override {...}
- NS_IMETHODIMP F() final;         --> NS_IMETHOD F() final;
- NS_IMETHODIMP F() final {...}    --> NS_IMETHOD F() final {...}

Using NS_IMETHOD is the preferred way of marking in-class virtual methods.
Although these transformations add an explicit |virtual|, they are safe --
there's an implicit |virtual| anyway because |override| and |final| only work
with virtual methods.

--HG--
extra : rebase_source : 386ee4e4ea2ecd8d5001efabc3ac87b4d6c0659f
2016-08-08 10:54:47 +10:00
Andrew McCreight 4f63d0eaf2 Bug 1287623, part 2 - Use StaticRefPtr for nsDirectoryService::gService. r=froydnj 2016-07-21 09:54:16 -07:00