Commit graph

180 commits

Author SHA1 Message Date
Denis Palmeiro
a37693bbe8 Bug 1887068: Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug
Depends on D205662

Differential Revision: https://phabricator.services.mozilla.com/D205663
2024-04-15 15:34:04 +00:00
Cristina Horotan
fd5658787a Backed out 4 changesets (bug 1887068, bug 1890934) on request by causing build bustages
Backed out changeset 68a7a8a3bb0f (bug 1890934)
Backed out changeset 658f4b57b8ec (bug 1887068)
Backed out changeset 61a9d3a1e592 (bug 1887068)
Backed out changeset efbf5c7065e3 (bug 1887068)
2024-04-12 02:14:44 +03:00
Denis Palmeiro
7a98a8955a Bug 1887068: Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug
Depends on D205662

Differential Revision: https://phabricator.services.mozilla.com/D205663
2024-04-10 17:48:08 +00:00
Cristian Tuns
8fdef5ff9e Backed out 3 changesets (bug 1887068) for causing build bustages in toolkit/* CLOSED TREE
Backed out changeset c6863f012b03 (bug 1887068)
Backed out changeset 3a4d2b74219e (bug 1887068)
Backed out changeset 90a702920d77 (bug 1887068)
2024-04-09 18:19:08 -04:00
Denis Palmeiro
bea9a256f9 Bug 1887068: Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D205663
2024-04-09 19:05:36 +00:00
Markus Stange
88398f1e16 Bug 1883522 - When running with MOZ_USE_PERFORMANCE_MARKER_FILE=1, mmap the marker file to help out perf + simpleperf + samply. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D203536
2024-03-09 23:04:01 +00:00
Mike Hommey
6f04746769 Bug 1884021 - Avoid warning about unused startTimeStamp/endTimeStamp in cases not using the values. r=profiler-reviewers,canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D203842
2024-03-07 20:26:03 +00:00
Cristian Tuns
ba6b30df79 Backed out changeset eea5db012489 (bug 1883522) for causing build bustages in Performance.cpp CLOSED TREE 2024-03-05 17:16:25 -05:00
Markus Stange
d673dc5ebd Bug 1883522 - When running with MOZ_USE_PERFORMANCE_MARKER_FILE=1, mmap the marker file to help out perf + simpleperf + samply. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D203536
2024-03-05 21:34:13 +00:00
Jason Kratzer
ec1792d1a2 Bug 1876138: Check if in main thread before attempting to create PerformanceMark. r=dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D199384
2024-01-29 17:25:25 +00:00
Markus Stange
b75080bb8b Bug 1876415 - Make timestamp formats consistent between Jitdump and the marker file. r=glandium
On Linux and Android, both jitdump and the marker file will keep using
`CLOCK_MONOTONIC` nanoseconds, as before.

On macOS, both jitdump and the marker file will now be using
`TimeStamp::RawMachAbsoluteTimeNanoseconds()` , i.e. "nanoseconds since
mach_absolute_time origin".
This value has the advantage that it is also relatively easy to obtain
in other browser engines, because their internal timestamp value is stored
in milliseconds or nanoseconds rather than in `mach_absolute_time` ticks.
In the past, on macOS, Firefox was using `CLOCK_MONOTONIC` nanoseconds for
jitdump and `TimeStamp::RawMachAbsoluteTimeValue()` for the marker file.
This inconsistency is now fixed.
I will update samply to change how it treats jitdump timestamps on macOS.
There are no other consumers of jitdump files on macOS that I know of.

On Windows, we will keep using raw QPC values for the marker file - this
matches what's in the ETW events. Jitdump on Windows is mostly unused but
I'm updating it to match.

Furthermore, this fixes the order in mozglue/misc/moz.build to make sure
we always use the TimeStamp_darwin implementation on Darwin (and not just
due to a broken configure check, see bug 1681445), and it fixes the #ifdef
in TimeStamp.h to match the Darwin check.

Differential Revision: https://phabricator.services.mozilla.com/D199592
2024-01-26 03:38:54 +00:00
Doug Thayer
3956b52760 Bug 1811750 - Eliminate redundant array filling in performance.measure r=sefeng
Basically we were falling off a cliff where if we had a bunch of marks recorded
with a particular name, when trying to measure we would fill an array with all
of them only to return the last one. This just replaces that by iterating in
reverse and returning the first matching mark. Arguably we should be using a
hashmap or something here, but this is a quick and trivial improvement that I
think will resolve the reported issue.

Differential Revision: https://phabricator.services.mozilla.com/D199451
2024-01-24 18:02:35 +00:00
Markus Stange
76f7fda5c5 Bug 1873244 - Reintroduce a call that was accidentally removed in bug 1869835. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D197810
2024-01-05 19:00:39 +00:00
Bas Schouten
7e993cd699 Bug 1869835 - Part 2: Do some code deduplication and convert UserTimingMarker to the new schema. r=mstange,profiler-reviewers
This will allow ETW to collect the additional payload on the UserTiming markers. As well as allow the provider to filter on these markers in order to minimize overhead from other markers that don't need to be collected.

Differential Revision: https://phabricator.services.mozilla.com/D196332
2023-12-21 18:17:41 +00:00
Emilio Cobos Álvarez
25c0d10932 Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.

I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).

Differential Revision: https://phabricator.services.mozilla.com/D190450
2023-10-10 08:51:12 +00:00
Jamie Nicol
51c68d3e2a Bug 1838398 - Add env variable to override output dir for external performance marker files. r=mstange
Currently these get output to the current working directory. On
Android, however, we cannot write to that directory, so this
environment variable can be used to set a directory that is writeable.

Differential Revision: https://phabricator.services.mozilla.com/D190289
2023-10-06 20:56:06 +00:00
Tom Schuster
ebd792fb02 Bug 1838415 - Use RFPTarget::ReduceTimerPrecision for Performance(Timing). r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D181240
2023-06-26 07:17:39 +00:00
Eden Chuang
ea1bf2603a Bug 1800659 - P3 Remove WorkerPrivate::ClearMainEventQueue() r=asuth,smaug
Pending->Canceling->Killing (WorkerNeverRan)

Need to clear WorkerPrivate::mPreStartRunnables

Could we call WorkerRunnable::WorkerRun() to release resource? There could be no WorkerGlobalScope...

Pending->Running->Closing->Canceling->Killing(WorkerRan)
Pending->Running->Canceling->Killing(WorkerRan)

When entering “Closing”
1. Keeping receives normal WorkerRunnables
2. Making ParentStatus as Closing
3. Cancel all timeout
4. Don’t clear the main event queue anymore. But we still wait for all SyncLoops be completed.
5. Call WorkerGlobalScope::NoteTerminating() and nsIGlobalObject::DisconnectEventTargetObjects().
6. Switching to “Canceling” by asking parent thread to call WorkerPrivate::Cancel()

When entering “Canceling”
1. Call WorkerGlobalScope::NoteTerminating()
2. Notify StrongWorkerRefs, worker is in “Canceling”, send and complete the corresponding shutdown work right now.
3. Executing all runnables until no normal WorkerRunnables in queue and no WorkerRefs, SyncLoops and children workers
4. Stop receiving normal WorkerRunnables and DisconnectEventTargetObjects of WorkerScope.
4. Entering “Killing”

When entering “Killing”
1. We would not notify WorkerRefs anymore. Logically all WorkerRefs should be released in “Canceling”
2. Executing all remaining ControlRunnables
3. Release corresponding resources of Worker on worker thread.

Depends on D173850

Differential Revision: https://phabricator.services.mozilla.com/D177511
2023-06-06 06:36:50 +00:00
Tom Schuster
0119f3c072 Bug 1834737 - Make RFPTarget parameter of nsIGlobalObject::ShouldResistFingerprinting non-optional. r=tjr,media-playback-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D178924
2023-05-31 09:46:53 +00:00
Jeff Muizelaar
f70ce93a5c Bug 1835513 - Add support emit performance.measure data to an external file. r=sefeng,mstange
This is for use in external profilers like samply and etw-gecko

Differential Revision: https://phabricator.services.mozilla.com/D179302
2023-05-29 15:37:51 +00:00
Randell Jesup
44d730bd47 Bug 1835172: Don't clear performance user entries on MemoryPressure events r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D179174
2023-05-29 00:00:24 +00:00
Nazım Can Altınova
ed5c1264ed Bug 1820826 - Use the startTime in performance.mark API if it's provided in its options r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D173003
2023-03-22 10:12:50 +00:00
Nazım Can Altınova
f70f3717d1 Bug 1820813 - Keep an unclamped startTime inside PerformanceMark and use it for profiler markers r=sefeng
Differential Revision: https://phabricator.services.mozilla.com/D173002
2023-03-22 10:12:50 +00:00
Tom Schuster
38d425da3c Bug 1811566 - Cut DomainLookupStart/End over to fine-grained RFP. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D167563
2023-01-27 09:17:24 +00:00
Tom Ritter
df00f0130c Bug 1811567: Remove unnecessary restrictions on APIs when RFP is enabled r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D167444
2023-01-26 17:01:35 +00:00
Sean Feng
cee3b2b255 Bug 1808841 - Make resource timing entires always be queued regardless the size of the buffer r=valentin
Somehow we have a bug in Gecko such that if the resource timing buffer
is full, no further resource entries will be queued unless you clear
or increase the buffer size. This is wrong because the spec specifies
the entry should always be queued regardless the size of the buffer.

Spec: https://w3c.github.io/resource-timing/#dfn-mark-resource-timing

Differential Revision: https://phabricator.services.mozilla.com/D166723
2023-01-16 18:36:09 +00:00
Iulian Moraru
c6a200294e Backed out changeset a2c7e0b750e4 (bug 1808841) for causing mozilla-central only wpt failure of performance-timeline/droppedentriescount.any.html 2023-01-16 11:38:53 +02:00
Sean Feng
314cb6336f Bug 1808841 - Make resource timing entires always be queued regardless the size of the buffer r=valentin
Somehow we have a bug in Gecko such that if the resource timing buffer
is full, no further resource entries will be queued unless you clear
or increase the buffer size. This is wrong because the spec specifies
the entry should always be queued regardless the size of the buffer.

Spec: https://w3c.github.io/resource-timing/#dfn-mark-resource-timing

Differential Revision: https://phabricator.services.mozilla.com/D166723
2023-01-13 16:09:12 +00:00
Nazım Can Altınova
ee86610605 Bug 1803751 - Make some marker fields searchable and bump the profile version r=julienw
Differential Revision: https://phabricator.services.mozilla.com/D163714
2022-12-13 14:19:07 +00:00
Iulian Moraru
e7e2922cb1 Backed out changeset 27f8690ebc50 (bug 1803751) for causing xpcshell failures on test_feature_mainthreadio.js. CLOSED TREE 2022-12-12 17:43:23 +02:00
Nazım Can Altınova
0d5987410a Bug 1803751 - Make some marker fields searchable and bump the profile version r=julienw
Differential Revision: https://phabricator.services.mozilla.com/D163714
2022-12-12 13:11:56 +00:00
Tom Ritter
ff7b10f887 Bug 1778510: Improve the comment on a short-circuit check we still haven't solved r=sefeng
Depends on D151307

Differential Revision: https://phabricator.services.mozilla.com/D151308
2022-11-29 13:34:19 +00:00
Tom Ritter
3f482941b5 Bug 1778510: Cut over a bunch of performance time precision calls to use the new calling convention r=sefeng
Depends on D151306

Differential Revision: https://phabricator.services.mozilla.com/D151307
2022-11-29 13:34:19 +00:00
Tom Ritter
702f5027e4 Bug 1778510: Change Performance objects from taking SystemPrincipal bool to a Timer Caller Type r=sefeng,asuth
The System Principal boolean was only used for RFP purposes.
We replace it with an RTPCallerType and populate it not in
the Performance ctor but rather in the CreateFor methods
that will populate it based on the context of their
construction.

Depends on D151305

Differential Revision: https://phabricator.services.mozilla.com/D151306
2022-11-29 13:34:19 +00:00
Butkovits Atila
cb853b7f77 Backed out 33 changesets (bug 1778510) for causing build bustages at nsIGlobalObject.h. CLOSED TREE
Backed out changeset f2a53c9e497c
Backed out changeset 59350ca6f3f2 (bug 1778510)
Backed out changeset abbba7e72b57 (bug 1778510)
Backed out changeset 6cf7473afae8 (bug 1778510)
Backed out changeset 74fb5fed93ea (bug 1778510)
Backed out changeset 5b5dc70cdd0a (bug 1778510)
Backed out changeset ff93191cafd2 (bug 1778510)
Backed out changeset 39cc006b610c (bug 1778510)
Backed out changeset dfaef3ad17a9 (bug 1778510)
Backed out changeset 8fbabeb8244b (bug 1778510)
Backed out changeset 45051b62e3f1 (bug 1778510)
Backed out changeset 86c0923fd81f (bug 1778510)
Backed out changeset a49c0f69d519 (bug 1778510)
Backed out changeset cfad733d4aaf (bug 1778510)
Backed out changeset df6d0fe89d5b (bug 1778510)
Backed out changeset 704db76eab17 (bug 1778510)
Backed out changeset 0651c128e369 (bug 1778510)
Backed out changeset 1e650de647c0 (bug 1778510)
Backed out changeset fa15a3572741 (bug 1778510)
Backed out changeset 4ceffd409eae (bug 1778510)
Backed out changeset 47db43142c62 (bug 1778510)
Backed out changeset ebb21153aaac (bug 1778510)
Backed out changeset a87eaaec3f9c (bug 1778510)
Backed out changeset 43ad5ee21f79 (bug 1778510)
Backed out changeset 5f20af8e1263 (bug 1778510)
Backed out changeset b78576875db0 (bug 1778510)
Backed out changeset d801fdeac90b (bug 1778510)
Backed out changeset 5af032c628c0 (bug 1778510)
Backed out changeset 86aa59de11b4 (bug 1778510)
Backed out changeset 58642357a19c (bug 1778510)
Backed out changeset c575e824e291 (bug 1778510)
Backed out changeset 32a358de4843 (bug 1778510)
Backed out changeset 40e0708c01e7 (bug 1778510)
2022-11-28 23:14:52 +02:00
Tom Ritter
32d4a29f8d Bug 1778510: Improve the comment on a short-circuit check we still haven't solved r=sefeng
Depends on D151307

Differential Revision: https://phabricator.services.mozilla.com/D151308
2022-11-28 18:04:11 +00:00
Tom Ritter
2b467ece7c Bug 1778510: Cut over a bunch of performance time precision calls to use the new calling convention r=sefeng
Depends on D151306

Differential Revision: https://phabricator.services.mozilla.com/D151307
2022-11-28 18:04:11 +00:00
Tom Ritter
1590fa267d Bug 1778510: Change Performance objects from taking SystemPrincipal bool to a Timer Caller Type r=sefeng,asuth
The System Principal boolean was only used for RFP purposes.
We replace it with an RTPCallerType and populate it not in
the Performance ctor but rather in the CreateFor methods
that will populate it based on the context of their
construction.

Depends on D151305

Differential Revision: https://phabricator.services.mozilla.com/D151306
2022-11-28 18:04:10 +00:00
Cosmin Sabou
d245f666b9 Backed out 33 changesets (bug 1778510) for causing bp-hybrid bustages on nsIPrincipal.h. CLOSED TREE
Backed out changeset 282f589ede4a
Backed out changeset e23d03ba5a89 (bug 1778510)
Backed out changeset cbdb34cf7c8d (bug 1778510)
Backed out changeset d9a54521f3fb (bug 1778510)
Backed out changeset f5b7f8ce38b0 (bug 1778510)
Backed out changeset eb64607765a9 (bug 1778510)
Backed out changeset 18291e692834 (bug 1778510)
Backed out changeset bb71cc94a8be (bug 1778510)
Backed out changeset 507e84e1dafe (bug 1778510)
Backed out changeset 6d42e7a083ac (bug 1778510)
Backed out changeset 53799e6a46dd (bug 1778510)
Backed out changeset ff20d709839a (bug 1778510)
Backed out changeset 328d4d2df591 (bug 1778510)
Backed out changeset 9ba44fd8a440 (bug 1778510)
Backed out changeset eb1b7e30e519 (bug 1778510)
Backed out changeset c0927de6153b (bug 1778510)
Backed out changeset 02a306acd093 (bug 1778510)
Backed out changeset 2c5eecc4ad4c (bug 1778510)
Backed out changeset 38a9f45c9621 (bug 1778510)
Backed out changeset 35b7c7df62ce (bug 1778510)
Backed out changeset 187d71f42593 (bug 1778510)
Backed out changeset 450f4ccd6cd0 (bug 1778510)
Backed out changeset 915149e27da0 (bug 1778510)
Backed out changeset 9c6e85369f15 (bug 1778510)
Backed out changeset c6a9fe0ce713 (bug 1778510)
Backed out changeset a2f00462157e (bug 1778510)
Backed out changeset 5278e40b80c3 (bug 1778510)
Backed out changeset dba220581d93 (bug 1778510)
Backed out changeset 17a63044b0dc (bug 1778510)
Backed out changeset 68d607aaa121 (bug 1778510)
Backed out changeset e93004f91f6f (bug 1778510)
Backed out changeset 41d6d9f889e1 (bug 1778510)
Backed out changeset 28ac62019086 (bug 1778510)
2022-11-28 07:34:46 +02:00
Tom Ritter
13987f16ec Bug 1778510: Improve the comment on a short-circuit check we still haven't solved r=sefeng
Depends on D151307

Differential Revision: https://phabricator.services.mozilla.com/D151308
2022-11-28 04:21:31 +00:00
Tom Ritter
ea0a478056 Bug 1778510: Cut over a bunch of performance time precision calls to use the new calling convention r=sefeng
Depends on D151306

Differential Revision: https://phabricator.services.mozilla.com/D151307
2022-11-28 04:21:30 +00:00
Tom Ritter
21bae9c01b Bug 1778510: Change Performance objects from taking SystemPrincipal bool to a Timer Caller Type r=sefeng,asuth
The System Principal boolean was only used for RFP purposes.
We replace it with an RTPCallerType and populate it not in
the Performance ctor but rather in the CreateFor methods
that will populate it based on the context of their
construction.

Depends on D151305

Differential Revision: https://phabricator.services.mozilla.com/D151306
2022-11-28 04:21:30 +00:00
Michael Comella
2f4dbb0e6b Bug 1772417 - correct web-platform convert name to timestamp. r=sefeng
This fixes the performance-measure-invalid.worker.html test. The test failed
because User Timing L3 section 4.2, "Convert a name to a timestamp", was not
implemented - the code was presumably residual from an earlier version of User
Timing. In particular, we never threw if the global object was not a Window. We
also corrected the code order for section 4.1, "Convert a mark to a timestamp",
which was incorrect but didn't cause any tests to fail.

Differential Revision: https://phabricator.services.mozilla.com/D154820
2022-08-18 21:18:25 +00:00
Michael Comella
312bff454e Bug 1772417 - align IsPerformanceTimingAttribute to user-timing spec. r=sefeng
IsPerformanceTimingAttribute can be called by both Window and WorkerGlobalScope
global objects so we move it to the Performance* superclass.

Differential Revision: https://phabricator.services.mozilla.com/D154819
2022-08-18 21:18:24 +00:00
Michael Comella
bd58669a22 Bug 1775499 - check for null GetParentObject in Performance::Measure. r=sefeng
Root cause: the global object can be null but I wasn't checking for it so it
caused a crash. I don't remember under what conditions it can be null but I saw
I had checked for null when I wrote Performance::Mark and remember debugging it
so it makes sense to do so here as well.

Differential Revision: https://phabricator.services.mozilla.com/D151960
2022-07-27 18:17:17 +00:00
Csoregi Natalia
534e4ed4cc Backed out changeset 1644072b7eac (bug 1775499) for causing failures on /test_performance_user_timing_dying_global.html. CLOSED TREE 2022-07-25 19:46:17 +03:00
Michael Comella
f9dff05051 Bug 1775499 - check for null GetParentObject in Performance::Measure. r=sefeng
Root cause: the global object can be null but I wasn't checking for it so it
caused a crash. I don't remember under what conditions it can be null but I saw
I had checked for null when I wrote Performance::Mark and remember debugging it
so it makes sense to do so here as well.

Differential Revision: https://phabricator.services.mozilla.com/D151960
2022-07-25 16:07:13 +00:00
Michael Comella
6dfd826505 Bug 1762482 - update PerformanceMeasure to User Timing L3. r=sefeng,smaug
Differential Revision: https://phabricator.services.mozilla.com/D143858
2022-05-31 16:48:14 +00:00
Michael Comella
3f9fef6bd8 Bug 1767063 - make PerformanceEntry.mEpoch narrowing conversion explicit. r=sefeng
The converted value gets passed into TimingNotification which assigns the value
into a PerformanceEntry (this is the only usage). Since PerformanceEntry is
defined in WebIDL, we could not change its types (which is double for mEpoch) so
we were forced to safely convert the value where we did.

I don't think the existing conversion code had any bugs since we converted a
64-bit signed integer timestamp into uint64_t (safe) into a double (which is
safe for the reasons mentioned in the code comments).

Differential Revision: https://phabricator.services.mozilla.com/D145142
2022-05-18 17:22:15 +00:00
Michael Comella
b6153dda2b Bug 1724645 - update PerformanceMark to User Timing L3. r=sefeng,smaug
To follow the spec more closely, some functionality moved from
`performance.mark` to the PerformanceMark constructor.

I verified the new fingerprinting protection behavior with :tjr: they said it's
okay to return a PerformanceMark as long as it uses the same reduced precision
of `performance.now`.

Differential Revision: https://phabricator.services.mozilla.com/D142625
2022-04-26 19:30:52 +00:00