Commit Graph

69 Commits

Author SHA1 Message Date
Bevis Tseng
ce50e5aaca Bug 1378930 - Part 1: Remove nsINamed::SetName(). r=billm
MozReview-Commit-ID: 7aM1yJRsfPH
2017-07-21 11:50:43 +08:00
Sylvestre Ledru
576cac5ec7 Bug 1381253 - Remove redundant control flow declarations rs=ehsan
MozReview-Commit-ID: FFxP4aMCbOL
2017-07-15 19:03:04 +02:00
Bill McCloskey
de1f843eff Bug 1371136 - Use contexts more safely in performance monitoring service (r=mccr8)
GetCurrentPhysicalThread() uses TLS, but it won't be called very often here.

MozReview-Commit-ID: HIDRt8btJCb
2017-06-12 20:21:43 -07:00
Gijs Kruitbosch
65da082651 Bug 1309946 - remove all traces of add-on performance monitoring, r=Yoric
This removes all the code for add-on performance watching from the
perfmonitoring component. This should mean that for add-on
compartments, we no longer trigger jank or CPOW monitoring in the JS
engine. This should result in minor performance improvements. As a
result, about:performance no longer reports on add-on performance
(but still reports on web page performance).

It also removes the AddonWatchers.jsm module and the related Nightly-
only UI (disabled in the parent commit) and strings. This UI wasn't
ready for release, there wasn't sufficient data it was creating
value for users, and there was some evidence that it didn't always
correctly identify the cause of performance issues, thus potentially
leading to user confusion or annoyance. Removing it therefore seemed
the right thing to do.

MozReview-Commit-ID: LsRwuaUtq6L
2017-03-29 11:03:47 +01:00
David Teller
1cc4670406 Bug 1342714 - Reducing allocations in AutoStopwatch;r=froydnj,jandem
This patch fixes two related issues.

1. The AutoStopwatch uses a stack-allocated `mozilla::Vector` to
communicate with its callback during each compartment switch. This
vector was designed to allow its contents to be stack-allocated but
they turned out to be accidentally heap-allocated.


2. During each tick, the stopwatch fills a vector
`recentGroups_`. This vector always started with minimal capacity and
had to grow repeatedly as groups were added, causing repeated
reallocations. This patch preallocates `recentGroups_` to have the
same capacity as the previous tick. We expect that this should
eventually reach a stable size that closely matches the actual needs
of the process.

MozReview-Commit-ID: A7e3HNdSuML
2017-03-24 22:25:03 +01:00
Bill McCloskey
54da76be6b Bug 1339289 - Give names to a lot of common timers (r=ehsan)
MozReview-Commit-ID: IMsv5bkyjBL
2017-02-15 12:30:01 -08:00
Wes Kocher
dbcc3a2130 Backed out 4 changesets (bug 1325299) for frequent Win7VM failures in browser_addonPerformanceAlerts.js a=backout
Backed out changeset cac5baad14a1 (bug 1325299)
Backed out changeset 933d06e4b567 (bug 1325299)
Backed out changeset c168221313d6 (bug 1325299)
Backed out changeset dcf71e5e5fc3 (bug 1325299)

MozReview-Commit-ID: DLAtTjf0iPB
2017-01-20 12:46:34 -08:00
Masatoshi Kimura
13d4bb95d5 Bug 1325299 - If cyclesDelta > totalCyclesDelta, reset data without comitting instead of failing assertions. r=Yoric
- `totalCyclesDelta` is incremented whenever there is CPU usage in the topmost compartment *and* the execution of the topmost compartment stops on the same core as it started;
- each individual `cyclesDelta` is incremented whenever there is CPU usage in a compartment *and* the execution of the compartment stops on the same core as it started;
- however, with previous versions of Windows, the function to identify a core was not available, so the check was #ifdef-ed away.

It is therefore entirely possible that, at some point during the execution of a mochitest, the thread is rescheduled to another core in a way such that at least one compartment executes entirely on a core but the topmost compartment starts and stops on a different core.

Given that we're running on VMs that presumably run on timeshared servers, reschedulings are bound to be frequent, so it's hardly surprising that this always happens during the execution of mochitests.

The simplest would probably be to throw away results if `cyclesDelta > totalCyclesDelta` for any of `cyclesDelta`. We should check if this happens and, if so, reset stuff without actually committing data.

MozReview-Commit-ID: 3w2D1gtW4AQ
2017-01-12 22:22:18 +09:00
Kan-Ru Chen
a9b19d0584 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES
2016-08-24 14:47:04 +08:00
Jan de Mooij
bd0f1c9018 Bug 1292892 part 1 - Stop using JSRuntime outside SpiderMonkey. r=bz,terrence,fitzgen,kanru 2016-08-11 14:39:22 +02:00
Jan de Mooij
da141f30c3 Bug 1283855 part 21 - Make performance monitoring APIs take JSContext instead of JSRuntime. r=Yoric 2016-07-06 16:53:50 +02:00
Jon Coppeard
08c0ae42b1 Bug 1280407 - Use SystemAllocPolicy rather that the default with mozilla::Vector in the JS engine r=sfink r=fitzgen r=jandem 2016-06-18 10:46:13 +01:00
Sebastian Hengst
2aab1c454d Backed out changeset afc3c6a5f93a (bug 1280407) for mass Spidermonkey failures. r=backout 2016-06-18 14:50:38 +02:00
Jon Coppeard
09a84a1160 Bug 1280407 - Use SystemAllocPolicy rather that the default with mozilla::Vector in the JS engine r=sfink r=fitzgen r=jandem 2016-06-18 10:46:13 +01:00
Sebastian Hengst
315d975726 Backed out changeset a58b9ab5dff0 (bug 1280407) for errors in testThreadingThread.cpp in SM(nu). r=backout 2016-06-18 12:53:01 +02:00
Jon Coppeard
a8cac86cfc Bug 1280407 - Use SystemAllocPolicy rather that the default with mozilla::Vector in the JS engine r=sfink r=fitzgen r=jandem 2016-06-18 10:46:13 +01:00
David Rajchenbach-Teller
fc7e340620 Bug 1261702 - Make nsPerformanceStatsService::Dispose() idempotent,r=froydnj
Although I haven't been able to pinpoint why, it looks like
nsPerformanceStatsService::Dispose() may be called twice, which in
turn causes crashes. This patch makes sure that calling the method
twice is idempotent.

Also, just in case this was due to a typo in
AddObserver/RemoveObserver, this patch replaces the literal strings
used in both with constants.

MozReview-Commit-ID: 8fXO20r5xvO
2016-06-07 10:45:44 +02:00
Wes Kocher
537416f46f Backed out changeset 66e0240f8c06 (bug 1261702) for mass assertion failures 2016-06-06 11:35:25 -07:00
David Rajchenbach-Teller
0ab8fede40 Bug 1261702 - Make nsPerformanceStatsService::Dispose() idempotent,r=froydnj
Although I haven't been able to pinpoint why, it looks like
nsPerformanceStatsService::Dispose() may be called twice, which in
turn causes crashes. This patch makes sure that calling the method
twice is idempotent.

Also, just in case this was due to a typo in
AddObserver/RemoveObserver, this patch replaces the literal strings
used in both with constants.

MozReview-Commit-ID: 8fXO20r5xvO
2016-05-30 12:24:50 +02:00
Bill McCloskey
58f09d0377 Bug 1270628 - Stop using content-child-shutdown observer in nsPerformanceStats (r=Yoric) 2016-05-27 17:22:21 -07:00
Kyle Huey
e95edb30a9 Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
David Rajchenbach-Teller
6ddd95efcc Bug 1219144 - Using the nsRefreshDriver's jank indication for performance monitoring;f?froydnj r=froydnj
This patch (currently WIP) alters the way we determine whether jank is user-visible or not.

Instead of measuring the total time spent doing JS, we now use an
indicator provided by the vsync driver: how long it takes to deliver
the signal from the vsync timer to the main thread. This lets us find
out more accurately if there is user-visible jank. In the future, this
will also let us add an observer to find out whether the process
itself is janky, regardless of JS.
2016-01-14 15:07:18 +01:00
David Rajchenbach-Teller
5bfb6c3c1c Bug 1219144 - Performance alerts are now labelled with isJankVisible;r=avih,froydnj
To decrease the number of apparent false positives, we classify jank
alerts as visible or invisible. We use the following heuristic:
- if the process is currently animating something, any jank alert is visible;
- if the process has just handled a user input, any jank alert is visible;
- if some user input is handled during the current iteration, any jank alert is visible;
- otherwise, jank alerts are not visible.
2016-01-12 10:45:22 +01:00
Jan de Mooij
71d37a198e Bug 1237201 part 7 - Handle Vector OOM in nsPerformanceStats, telemetry. r=Yoric 2016-01-14 15:19:37 +01:00
Nathan Froyd
54dfa729a9 Bug 1218454 - part 2 - don't #include nsContentUtils.h from CallbackObject.h; r=bz
We used to need nsContentUtils.h here for nsCxPusher, but since that got
moved to ScriptSettings.h, we no longer need nsContentUtils.h for
anything.
2015-10-26 12:14:47 -04:00
David Rajchenbach-Teller
1a948e69b9 Bug 1186491 - An API for watching slow performance alerts (xpcom-level);r=froydnj
This patch introduces a new API to the nsPerformanceStatsService to register observers for slow performance. This API has several advantages:
- as it doesn't require polling, it also doesn't need to wake up the parent process every 15 seconds for the AddonWatcher;
- as it doesn't require polling, it doesn't need to wake up the child processes every time we wish to obtain data on slow performance;
- as it provides immediate data on performance alerts, it makes it possible to get rid of the complex and expensive post-processing performed by JS to merge data from all processes and attempt to extract performance alerts.

The old API is still available.
2015-11-24 13:37:32 +01:00
David Rajchenbach-Teller
3d37bc1b53 Bug 1186491 - Splitting nsIPerformanceStats in two;r=froydnj 2015-10-23 10:58:40 +02:00
Carsten "Tomcat" Book
d50cc9a6ee Merge mozilla-central to fx-team 2015-11-02 12:05:19 +01:00
Birunthan Mohanathas
ac37dec517 Bug 1219392 - Capitalize mozilla::unused to avoid conflicts. r=froydnj 2015-11-02 07:53:26 +02:00
Landry Breuil
cc35fe59d8 Bug 1220407 - include sys/resource.h for struct rusage and getrusage() on all unices, not linux only. r=yoric 2015-10-31 14:49:00 +01:00
David Rajchenbach-Teller
7b8179a1fc Bug 1217218 - Consolidate shutdown of nsPerformanceStatsService. r=froydnj 2015-10-22 21:01:47 +02:00
David Rajchenbach-Teller
eb24794560 Bug 1188248 - Merge jank monitoring and CPOW monitoring (low-level);r=jandem,yoric 2015-09-28 12:31:31 +02:00
Birunthan Mohanathas
d382a21947 Bug 1217320 - Remove more XPIDL signature comments in .cpp files. r=froydnj
Comment-only, DONTBUILD.
2015-10-27 06:54:25 +02:00
Kyle Huey
8f8794e1c7 Bug 1216401: Eviscerate nsIDOMWindow, move still needed methods to nsPIDOMWindow. r=bz 2015-10-26 14:37:32 -07:00
David Rajchenbach-Teller
8d8035d838 Bug 1208747 - Move most of Stopwatch-related code to XPCOM-land (XPCOM-level + XPConnect-level);r=froydnj 2015-10-02 23:44:23 +02:00
Carsten "Tomcat" Book
5319c04bcc Backed out changeset 33afbc6c4997 (bug 1208747) 2015-10-21 11:39:22 +02:00
David Rajchenbach-Teller
f1cc78b023 Bug 1208747 - Move most of Stopwatch-related code to XPCOM-land (XPCOM-level + XPConnect-level);r=froydnj 2015-10-02 23:44:23 +02:00
Nathan Froyd
4e6d8f6705 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
2015-10-18 01:24:48 -04:00
David Rajchenbach-Teller
67603e8af8 Bug 1199603 - Don't wait for shutdown to update nsPerformanceStats Telemetry. r=Mossop 2015-08-28 12:14:01 +02:00
David Rajchenbach-Teller
b4031b6c19 Bug 1198167 - nsPerformanceStatsService should wait for profile-before-change, not profile-before-shutdown. r=yoric 2015-08-25 11:20:40 +02:00
David Rajchenbach-Teller
14b1c812e5 Bug 1181175 - Telemetry for finding out how often our process is rescheduled to another CPU. r=jandem, r=bsmedberg 2015-07-29 19:01:05 +02:00
Ryan VanderMeulen
7dbb7dc565 Backed out changesets db4294fb662d and de9ae2ccb73b (bug 1181175) for Android test_compartments.js failures.
CLOSED TREE
2015-08-10 15:07:27 -04:00
David Rajchenbach-Teller
0979349348 Bug 1181175 - Telemetry for finding out how often our process is rescheduled to another CPU. r=jandem, r=bsmedberg 2015-07-29 19:01:05 +02:00
Birunthan Mohanathas
a0f7c73250 Bug 1191100 - Remove XPIDL signature comments in .cpp files. r=ehsan
Comment-only so DONTBUILD.
2015-08-04 16:17:36 -07:00
David Rajchenbach-Teller
0f1a30c9e3 Bug 1184486 - Let PerformanceStats.jsm play nicer with process-per-tab. r=mconley 2015-07-16 12:19:17 +02:00
Ryan VanderMeulen
0ba883337d Backed out changeset 82fac7af188e (bug 1184486) for Static Analysis failures. 2015-07-29 09:11:52 -04:00
David Rajchenbach-Teller
1b943fd2f1 Bug 1184486 - Let PerformanceStats.jsm play nicer with process-per-tab. r=mconley 2015-07-16 12:19:17 +02:00
David Rajchenbach-Teller
005b7ffaf6 Bug 1147664 - Detailed mode for PerformanceStats (high-level). r=mossop 2015-06-12 21:52:06 +02:00
David Rajchenbach-Teller
7e03a999f4 Bug 1147664 - Detailed mode for PerformanceStats (low-level). r=jandem 2015-06-10 15:56:19 +02:00
Wes Kocher
042e3e091c Backed out 2 changesets (bug 1147664) for b2g xpcshell failures in test_compartments.js
Backed out changeset cfd27d5ffc58 (bug 1147664)
Backed out changeset cace9a3246c1 (bug 1147664)
2015-07-23 18:39:43 -07:00