Commit Graph

182 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
71bf77b3fe Bug 1904442 - Rename GlobalTeardownObserver::GetOwner to GetOwnerWindow. r=smaug,media-playback-reviewers,dom-storage-reviewers,aosmond,padenot,asuth
Also HasOrHasHadOwner to HasOrHasHadOwnerWindow.

Differential Revision: https://phabricator.services.mozilla.com/D214772
2024-07-01 11:49:59 +00:00
Michael van Straten
8135451a10 Bug 1902995 - Check if profiler thread is being profiled for markers. r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D213928
2024-06-18 14:09:48 +00:00
Denis Palmeiro
5c062218b6 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
886fe5f5a4 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
a63122839e 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
d9503794a6 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
f61b8829df 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
510461db11 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
cb8586c356 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
1fbcf051bb 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
f3da10359d 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
dc5aa1700a 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
1c5624ed94 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
39e9d8ead9 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
b9d5afe9e6 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
cabef6614e 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
d02e297b2d 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
b8ac2e85bc 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
022e1f7566 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
73cfb8b6d1 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
591c5f154e 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
7b1dc94565 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
2a176abce0 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
00cd84695f 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
7a443c61f2 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
23f9c0cd81 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
d0d15c7c7c 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
227638e467 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
b7bcef3ad7 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
e88447b75e 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
c91a8714b7 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
94985653c4 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
76eaba45b7 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
fda6c757a8 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
3745cf716d 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
4598e301c6 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
b5d69ff02c 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
14e4c5569c 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
4d7d958ad3 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
e83049bfc4 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
9251c6ec90 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
dc8639d1df 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
bb5975b569 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
8ad08f832b 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
03ab52e3b7 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
265e962669 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
77ad5e72e9 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
bb2d563240 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
82d5174548 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
e3152947e6 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