@paulirish/trace_engine 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -5
- package/generated/protocol.d.ts +210 -4
- package/models/cpu_profile/CPUProfileDataModel.js +3 -3
- package/models/cpu_profile/CPUProfileDataModel.js.map +1 -1
- package/models/trace/LegacyTracingModel.js.map +1 -1
- package/models/trace/ModelImpl.d.ts +1 -0
- package/models/trace/ModelImpl.js +5 -0
- package/models/trace/ModelImpl.js.map +1 -1
- package/models/trace/extras/FetchNodes.d.ts +8 -0
- package/models/trace/extras/FetchNodes.js +54 -2
- package/models/trace/extras/FetchNodes.js.map +1 -1
- package/models/trace/handlers/ImagePaintingHandler.d.ts +8 -0
- package/models/trace/handlers/ImagePaintingHandler.js +108 -0
- package/models/trace/handlers/ImagePaintingHandler.js.map +1 -0
- package/models/trace/handlers/ModelHandlers.d.ts +2 -0
- package/models/trace/handlers/ModelHandlers.js +2 -0
- package/models/trace/handlers/ModelHandlers.js.map +1 -1
- package/models/trace/handlers/PageFramesHandler.d.ts +7 -0
- package/models/trace/handlers/PageFramesHandler.js +41 -0
- package/models/trace/handlers/PageFramesHandler.js.map +1 -0
- package/models/trace/handlers/handlers-tsconfig.json +2 -0
- package/models/trace/helpers/Trace.js.map +1 -1
- package/models/trace/types/TraceEvents.d.ts +50 -1
- package/models/trace/types/TraceEvents.js +15 -0
- package/models/trace/types/TraceEvents.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// Copyright 2024 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
import * as Types from '../types/types.js';
|
|
5
|
+
/**
|
|
6
|
+
* This handler is responsible for the relationships between:
|
|
7
|
+
* DecodeImage/ResizeImage, PaintImage and DrawLazyPixelRef events.
|
|
8
|
+
*
|
|
9
|
+
* When we get a DecodeImage event, we want to associate it to a PaintImage
|
|
10
|
+
* event, primarily so we can determine the NodeID of the image that was
|
|
11
|
+
* decoded.
|
|
12
|
+
* We can do this in two ways:
|
|
13
|
+
*
|
|
14
|
+
* 1. If there is a PaintImage event on the same thread, use that
|
|
15
|
+
* (if there are multiple, use the latest one).
|
|
16
|
+
*
|
|
17
|
+
* 2. If not, we can find the DecodeLazyPixelRef event on the same thread, and
|
|
18
|
+
* use the PaintImage event associated with it via the `LazyPixelRef` key.
|
|
19
|
+
*/
|
|
20
|
+
// Track paintImageEvents across threads.
|
|
21
|
+
const paintImageEvents = new Map();
|
|
22
|
+
const decodeLazyPixelRefEvents = new Map();
|
|
23
|
+
// A DrawLazyPixelRef event will contain a numerical reference in
|
|
24
|
+
// args.LazyPixelRef. As we parse each DrawLazyPixelRef, we can assign it to a
|
|
25
|
+
// paint event. Later we want to look up paint events by this reference, so we
|
|
26
|
+
// store them in this map.
|
|
27
|
+
const paintImageByLazyPixelRef = new Map();
|
|
28
|
+
// When we find events that we want to tie to a particular PaintImage event, we add them to this map.
|
|
29
|
+
// These are currently only DecodeImage and ResizeImage events, but the type is
|
|
30
|
+
// deliberately generic as in the future we might want to add more events that
|
|
31
|
+
// have a relationship to a individual PaintImage event.
|
|
32
|
+
const eventToPaintImage = new Map();
|
|
33
|
+
export function reset() {
|
|
34
|
+
paintImageEvents.clear();
|
|
35
|
+
decodeLazyPixelRefEvents.clear();
|
|
36
|
+
paintImageByLazyPixelRef.clear();
|
|
37
|
+
eventToPaintImage.clear();
|
|
38
|
+
}
|
|
39
|
+
export function handleEvent(event) {
|
|
40
|
+
if (Types.TraceEvents.isTraceEventPaintImage(event)) {
|
|
41
|
+
const forProcess = paintImageEvents.get(event.pid) ||
|
|
42
|
+
new Map();
|
|
43
|
+
const forThread = forProcess.get(event.tid) || [];
|
|
44
|
+
forThread.push(event);
|
|
45
|
+
forProcess.set(event.tid, forThread);
|
|
46
|
+
paintImageEvents.set(event.pid, forProcess);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (Types.TraceEvents.isTraceEventDecodeLazyPixelRef(event) && typeof event.args?.LazyPixelRef !== 'undefined') {
|
|
50
|
+
// Store these because we use them to tie DecodeImage to a PaintEvent.
|
|
51
|
+
const forProcess = decodeLazyPixelRefEvents.get(event.pid) ||
|
|
52
|
+
new Map();
|
|
53
|
+
const forThread = forProcess.get(event.tid) || [];
|
|
54
|
+
forThread.push(event);
|
|
55
|
+
forProcess.set(event.tid, forThread);
|
|
56
|
+
decodeLazyPixelRefEvents.set(event.pid, forProcess);
|
|
57
|
+
}
|
|
58
|
+
// If we see a DrawLazyPixelRef event, we need to find the last PaintImage
|
|
59
|
+
// event on the thread and associate it to the LazyPixelRef that is supplied
|
|
60
|
+
// in the DrawLazyPixelRef event.
|
|
61
|
+
// This means that later on if we see a DecodeLazyPixelRef event with the
|
|
62
|
+
// same LazyPixelRef key, we can find its associated PaintImage event by
|
|
63
|
+
// looking it up.
|
|
64
|
+
if (Types.TraceEvents.isTraceEventDrawLazyPixelRef(event) && typeof event.args?.LazyPixelRef !== 'undefined') {
|
|
65
|
+
const lastPaintEvent = paintImageEvents.get(event.pid)?.get(event.tid)?.at(-1);
|
|
66
|
+
if (!lastPaintEvent) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
paintImageByLazyPixelRef.set(event.args.LazyPixelRef, lastPaintEvent);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (Types.TraceEvents.isTraceEventDecodeImage(event)) {
|
|
73
|
+
// When we see a DecodeImage, we want to associate it to a PaintImage
|
|
74
|
+
// event. We try two approaches:
|
|
75
|
+
//
|
|
76
|
+
// 1. If the thread of the DecodeImage event has a previous PaintImage
|
|
77
|
+
// event, that is the associated event.
|
|
78
|
+
//
|
|
79
|
+
// 2. If that is false, we then look on the thread for a DecodeLazyPixelRef
|
|
80
|
+
// event. If we find that, we then look for its associated PaintImage
|
|
81
|
+
// event, which we associate via DrawLazyPixelRef events (the code block
|
|
82
|
+
// above this one)
|
|
83
|
+
//
|
|
84
|
+
// 1. Find a PaintImage event on the same thread. If we find it, that's our association done.
|
|
85
|
+
const lastPaintImageEventOnThread = paintImageEvents.get(event.pid)?.get(event.tid)?.at(-1);
|
|
86
|
+
if (lastPaintImageEventOnThread) {
|
|
87
|
+
eventToPaintImage.set(event, lastPaintImageEventOnThread);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
// 2. Find the last DecodeLazyPixelRef event and, if we find it, find its associated PaintImage event.
|
|
91
|
+
const lastDecodeLazyPixelRef = decodeLazyPixelRefEvents.get(event.pid)?.get(event.tid)?.at(-1);
|
|
92
|
+
if (!lastDecodeLazyPixelRef || typeof lastDecodeLazyPixelRef.args?.LazyPixelRef === 'undefined') {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const paintEvent = paintImageByLazyPixelRef.get(lastDecodeLazyPixelRef.args.LazyPixelRef);
|
|
96
|
+
if (!paintEvent) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
eventToPaintImage.set(event, paintEvent);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export function data() {
|
|
103
|
+
return {
|
|
104
|
+
paintImageByDrawLazyPixelRef: paintImageByLazyPixelRef,
|
|
105
|
+
paintImageForEvent: eventToPaintImage,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=ImagePaintingHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImagePaintingHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/ImagePaintingHandler.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C;;;;;;;;;;;;;;GAcG;AAEH,yCAAyC;AACzC,MAAM,gBAAgB,GAEd,IAAI,GAAG,EAAE,CAAC;AAClB,MA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CAAC,CAAC,CAAC;QAC5F,IAAI,2BAA2B,EAAE,CAAC;YAChC,iBAAiB,CAAC,GAAG,CAAC,KAAK,EAAE,2BAA2B,CAAC,CAAC;YAC1D,OAAO;QACT,CAAC;QAED,sGAAsG;QACtG,MAAM,sBAAsB,GAAG,wBAAwB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/F,IAAI,CAAC,sBAAsB,IAAI,OAAO,sBAAsB,CAAC,IAAI,EAAE,YAAY,KAAK,WAAW,EAAE,CAAC;YAChG,OAAO;QACT,CAAC;QAED,MAAM,UAAU,GAAG,wBAAwB,CAAC,GAAG,CAAC,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC1F,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QACD,iBAAiB,CAAC,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC;AAOD,MAAM,UAAU,IAAI;IAClB,OAAO;QACL,4BAA4B,EAAE,wBAAwB;QACtD,kBAAkB,EAAE,iBAAiB;KACtC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Types from '../types/types.js';\n\n/**\n * This handler is responsible for the relationships between:\n * DecodeImage/ResizeImage, PaintImage and DrawLazyPixelRef events.\n *\n * When we get a DecodeImage event, we want to associate it to a PaintImage\n * event, primarily so we can determine the NodeID of the image that was\n * decoded.\n * We can do this in two ways:\n *\n * 1. If there is a PaintImage event on the same thread, use that\n * (if there are multiple, use the latest one).\n *\n * 2. If not, we can find the DecodeLazyPixelRef event on the same thread, and\n * use the PaintImage event associated with it via the `LazyPixelRef` key.\n */\n\n// Track paintImageEvents across threads.\nconst paintImageEvents:\n Map<Types.TraceEvents.ProcessID, Map<Types.TraceEvents.ThreadID, Types.TraceEvents.TraceEventPaintImage[]>> =\n new Map();\nconst decodeLazyPixelRefEvents:\n Map<Types.TraceEvents.ProcessID,\n Map<Types.TraceEvents.ThreadID, Types.TraceEvents.TraceEventDecodeLazyPixelRef[]>> = new Map();\n\n// A DrawLazyPixelRef event will contain a numerical reference in\n// args.LazyPixelRef. As we parse each DrawLazyPixelRef, we can assign it to a\n// paint event. Later we want to look up paint events by this reference, so we\n// store them in this map.\nconst paintImageByLazyPixelRef: Map<number, Types.TraceEvents.TraceEventPaintImage> = new Map();\n\n// When we find events that we want to tie to a particular PaintImage event, we add them to this map.\n// These are currently only DecodeImage and ResizeImage events, but the type is\n// deliberately generic as in the future we might want to add more events that\n// have a relationship to a individual PaintImage event.\nconst eventToPaintImage: Map<Types.TraceEvents.TraceEventData, Types.TraceEvents.TraceEventPaintImage> = new Map();\n\nexport function reset(): void {\n paintImageEvents.clear();\n decodeLazyPixelRefEvents.clear();\n paintImageByLazyPixelRef.clear();\n eventToPaintImage.clear();\n}\n\nexport function handleEvent(event: Types.TraceEvents.TraceEventData): void {\n if (Types.TraceEvents.isTraceEventPaintImage(event)) {\n const forProcess = paintImageEvents.get(event.pid) ||\n new Map<Types.TraceEvents.ThreadID, Types.TraceEvents.TraceEventPaintImage[]>();\n const forThread = forProcess.get(event.tid) || [];\n forThread.push(event);\n forProcess.set(event.tid, forThread);\n paintImageEvents.set(event.pid, forProcess);\n return;\n }\n\n if (Types.TraceEvents.isTraceEventDecodeLazyPixelRef(event) && typeof event.args?.LazyPixelRef !== 'undefined') {\n // Store these because we use them to tie DecodeImage to a PaintEvent.\n const forProcess = decodeLazyPixelRefEvents.get(event.pid) ||\n new Map<Types.TraceEvents.ThreadID, Types.TraceEvents.TraceEventDecodeLazyPixelRef[]>();\n const forThread = forProcess.get(event.tid) || [];\n forThread.push(event);\n forProcess.set(event.tid, forThread);\n decodeLazyPixelRefEvents.set(event.pid, forProcess);\n }\n\n // If we see a DrawLazyPixelRef event, we need to find the last PaintImage\n // event on the thread and associate it to the LazyPixelRef that is supplied\n // in the DrawLazyPixelRef event.\n // This means that later on if we see a DecodeLazyPixelRef event with the\n // same LazyPixelRef key, we can find its associated PaintImage event by\n // looking it up.\n if (Types.TraceEvents.isTraceEventDrawLazyPixelRef(event) && typeof event.args?.LazyPixelRef !== 'undefined') {\n const lastPaintEvent = paintImageEvents.get(event.pid)?.get(event.tid)?.at(-1);\n if (!lastPaintEvent) {\n return;\n }\n paintImageByLazyPixelRef.set(event.args.LazyPixelRef, lastPaintEvent);\n return;\n }\n\n if (Types.TraceEvents.isTraceEventDecodeImage(event)) {\n // When we see a DecodeImage, we want to associate it to a PaintImage\n // event. We try two approaches:\n //\n // 1. If the thread of the DecodeImage event has a previous PaintImage\n // event, that is the associated event.\n //\n // 2. If that is false, we then look on the thread for a DecodeLazyPixelRef\n // event. If we find that, we then look for its associated PaintImage\n // event, which we associate via DrawLazyPixelRef events (the code block\n // above this one)\n //\n // 1. Find a PaintImage event on the same thread. If we find it, that's our association done.\n const lastPaintImageEventOnThread = paintImageEvents.get(event.pid)?.get(event.tid)?.at(-1);\n if (lastPaintImageEventOnThread) {\n eventToPaintImage.set(event, lastPaintImageEventOnThread);\n return;\n }\n\n // 2. Find the last DecodeLazyPixelRef event and, if we find it, find its associated PaintImage event.\n const lastDecodeLazyPixelRef = decodeLazyPixelRefEvents.get(event.pid)?.get(event.tid)?.at(-1);\n if (!lastDecodeLazyPixelRef || typeof lastDecodeLazyPixelRef.args?.LazyPixelRef === 'undefined') {\n return;\n }\n\n const paintEvent = paintImageByLazyPixelRef.get(lastDecodeLazyPixelRef.args.LazyPixelRef);\n if (!paintEvent) {\n return;\n }\n eventToPaintImage.set(event, paintEvent);\n }\n}\n\nexport interface ImagePaintData {\n paintImageByDrawLazyPixelRef: Map<number, Types.TraceEvents.TraceEventPaintImage>;\n paintImageForEvent: Map<Types.TraceEvents.TraceEventData, Types.TraceEvents.TraceEventPaintImage>;\n}\n\nexport function data(): ImagePaintData {\n return {\n paintImageByDrawLazyPixelRef: paintImageByLazyPixelRef,\n paintImageForEvent: eventToPaintImage,\n };\n}\n"]}
|
|
@@ -3,6 +3,7 @@ export * as AuctionWorklets from './AuctionWorkletsHandler.js';
|
|
|
3
3
|
export * as ExtensionTraceData from './ExtensionTraceDataHandler.js';
|
|
4
4
|
export * as Frames from './FramesHandler.js';
|
|
5
5
|
export * as GPU from './GPUHandler.js';
|
|
6
|
+
export * as ImagePainting from './ImagePaintingHandler.js';
|
|
6
7
|
export * as Initiators from './InitiatorsHandler.js';
|
|
7
8
|
export * as Invalidations from './InvalidationsHandler.js';
|
|
8
9
|
export * as LargestImagePaint from './LargestImagePaintHandler.js';
|
|
@@ -12,6 +13,7 @@ export * as LayoutShifts from './LayoutShiftsHandler.js';
|
|
|
12
13
|
export * as Memory from './MemoryHandler.js';
|
|
13
14
|
export * as Meta from './MetaHandler.js';
|
|
14
15
|
export * as NetworkRequests from './NetworkRequestsHandler.js';
|
|
16
|
+
export * as PageFrames from './PageFramesHandler.js';
|
|
15
17
|
export * as PageLoadMetrics from './PageLoadMetricsHandler.js';
|
|
16
18
|
export * as Renderer from './RendererHandler.js';
|
|
17
19
|
export * as Samples from './SamplesHandler.js';
|
|
@@ -6,6 +6,7 @@ export * as AuctionWorklets from './AuctionWorkletsHandler.js';
|
|
|
6
6
|
export * as ExtensionTraceData from './ExtensionTraceDataHandler.js';
|
|
7
7
|
export * as Frames from './FramesHandler.js';
|
|
8
8
|
export * as GPU from './GPUHandler.js';
|
|
9
|
+
export * as ImagePainting from './ImagePaintingHandler.js';
|
|
9
10
|
export * as Initiators from './InitiatorsHandler.js';
|
|
10
11
|
export * as Invalidations from './InvalidationsHandler.js';
|
|
11
12
|
export * as LargestImagePaint from './LargestImagePaintHandler.js';
|
|
@@ -15,6 +16,7 @@ export * as LayoutShifts from './LayoutShiftsHandler.js';
|
|
|
15
16
|
export * as Memory from './MemoryHandler.js';
|
|
16
17
|
export * as Meta from './MetaHandler.js';
|
|
17
18
|
export * as NetworkRequests from './NetworkRequestsHandler.js';
|
|
19
|
+
export * as PageFrames from './PageFramesHandler.js';
|
|
18
20
|
export * as PageLoadMetrics from './PageLoadMetricsHandler.js';
|
|
19
21
|
export * as Renderer from './RendererHandler.js';
|
|
20
22
|
export * as Samples from './SamplesHandler.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelHandlers.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/ModelHandlers.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,kBAAkB,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,gBAAgB,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,gBAAgB,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport * as Animations from './AnimationHandler.js';\nexport * as AuctionWorklets from './AuctionWorkletsHandler.js';\nexport * as ExtensionTraceData from './ExtensionTraceDataHandler.js';\nexport * as Frames from './FramesHandler.js';\nexport * as GPU from './GPUHandler.js';\nexport * as Initiators from './InitiatorsHandler.js';\nexport * as Invalidations from './InvalidationsHandler.js';\nexport * as LargestImagePaint from './LargestImagePaintHandler.js';\nexport * as LargestTextPaint from './LargestTextPaintHandler.js';\nexport * as LayerTree from './LayerTreeHandler.js';\nexport * as LayoutShifts from './LayoutShiftsHandler.js';\nexport * as Memory from './MemoryHandler.js';\nexport * as Meta from './MetaHandler.js';\nexport * as NetworkRequests from './NetworkRequestsHandler.js';\nexport * as PageLoadMetrics from './PageLoadMetricsHandler.js';\nexport * as Renderer from './RendererHandler.js';\nexport * as Samples from './SamplesHandler.js';\nexport * as Screenshots from './ScreenshotsHandler.js';\nexport * as UserInteractions from './UserInteractionsHandler.js';\nexport * as UserTimings from './UserTimingsHandler.js';\nexport * as Warnings from './WarningsHandler.js';\nexport * as Workers from './WorkersHandler.js';\n"]}
|
|
1
|
+
{"version":3,"file":"ModelHandlers.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/ModelHandlers.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,kBAAkB,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,gBAAgB,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,gBAAgB,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport * as Animations from './AnimationHandler.js';\nexport * as AuctionWorklets from './AuctionWorkletsHandler.js';\nexport * as ExtensionTraceData from './ExtensionTraceDataHandler.js';\nexport * as Frames from './FramesHandler.js';\nexport * as GPU from './GPUHandler.js';\nexport * as ImagePainting from './ImagePaintingHandler.js';\nexport * as Initiators from './InitiatorsHandler.js';\nexport * as Invalidations from './InvalidationsHandler.js';\nexport * as LargestImagePaint from './LargestImagePaintHandler.js';\nexport * as LargestTextPaint from './LargestTextPaintHandler.js';\nexport * as LayerTree from './LayerTreeHandler.js';\nexport * as LayoutShifts from './LayoutShiftsHandler.js';\nexport * as Memory from './MemoryHandler.js';\nexport * as Meta from './MetaHandler.js';\nexport * as NetworkRequests from './NetworkRequestsHandler.js';\nexport * as PageFrames from './PageFramesHandler.js';\nexport * as PageLoadMetrics from './PageLoadMetricsHandler.js';\nexport * as Renderer from './RendererHandler.js';\nexport * as Samples from './SamplesHandler.js';\nexport * as Screenshots from './ScreenshotsHandler.js';\nexport * as UserInteractions from './UserInteractionsHandler.js';\nexport * as UserTimings from './UserTimingsHandler.js';\nexport * as Warnings from './WarningsHandler.js';\nexport * as Workers from './WorkersHandler.js';\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as Types from '../types/types.js';
|
|
2
|
+
export declare function reset(): void;
|
|
3
|
+
export declare function handleEvent(event: Types.TraceEvents.TraceEventData): void;
|
|
4
|
+
export interface PageFrameData {
|
|
5
|
+
frames: Map<string, Types.TraceEvents.TraceFrame>;
|
|
6
|
+
}
|
|
7
|
+
export declare function data(): PageFrameData;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright 2024 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
import * as Types from '../types/types.js';
|
|
5
|
+
const frames = new Map();
|
|
6
|
+
export function reset() {
|
|
7
|
+
frames.clear();
|
|
8
|
+
}
|
|
9
|
+
export function handleEvent(event) {
|
|
10
|
+
if (Types.TraceEvents.isTraceEventTracingStartedInBrowser(event)) {
|
|
11
|
+
for (const frame of event.args.data?.frames ?? []) {
|
|
12
|
+
// The ID of a frame is stored under the `frame` key.
|
|
13
|
+
frames.set(frame.frame, frame);
|
|
14
|
+
}
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
// CommitLoad events can contain an updated URL or Name for a frame.
|
|
18
|
+
if (Types.TraceEvents.isTraceEventCommitLoad(event)) {
|
|
19
|
+
const frameData = event.args.data;
|
|
20
|
+
if (!frameData) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
// We don't want to mutate the original object, hence why
|
|
24
|
+
// we set a new object from the new and existing values.
|
|
25
|
+
const frame = frames.get(frameData.frame);
|
|
26
|
+
if (!frame) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
frames.set(frameData.frame, {
|
|
30
|
+
...frame,
|
|
31
|
+
url: frameData.url || frame.url,
|
|
32
|
+
name: frameData.name || frameData.name,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function data() {
|
|
37
|
+
return {
|
|
38
|
+
frames,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=PageFramesHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageFramesHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/PageFramesHandler.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAwC,CAAC;AAE/D,MAAM,UAAU,KAAK;IACnB,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAuC;IACjE,IAAI,KAAK,CAAC,WAAW,CAAC,mCAAmC,CAAC,KAAK,CAAC,EAAE,CAAC;QACjE,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,EAAE,CAAC;YAClD,qDAAqD;YACrD,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACjC,CAAC;QACD,OAAO;IACT,CAAC;IAED,oEAAoE;IACpE,IAAI,KAAK,CAAC,WAAW,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE,CAAC;QACpD,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QAClC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO;QACT,CAAC;QACD,yDAAyD;QACzD,wDAAwD;QACxD,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO;QACT,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE;YAC1B,GAAG,KAAK;YACR,GAAG,EAAE,SAAS,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG;YAC/B,IAAI,EAAE,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI;SACvC,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAKD,MAAM,UAAU,IAAI;IAClB,OAAO;QACL,MAAM;KACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Types from '../types/types.js';\n\nconst frames = new Map<string, Types.TraceEvents.TraceFrame>();\n\nexport function reset(): void {\n frames.clear();\n}\n\nexport function handleEvent(event: Types.TraceEvents.TraceEventData): void {\n if (Types.TraceEvents.isTraceEventTracingStartedInBrowser(event)) {\n for (const frame of event.args.data?.frames ?? []) {\n // The ID of a frame is stored under the `frame` key.\n frames.set(frame.frame, frame);\n }\n return;\n }\n\n // CommitLoad events can contain an updated URL or Name for a frame.\n if (Types.TraceEvents.isTraceEventCommitLoad(event)) {\n const frameData = event.args.data;\n if (!frameData) {\n return;\n }\n // We don't want to mutate the original object, hence why\n // we set a new object from the new and existing values.\n const frame = frames.get(frameData.frame);\n if (!frame) {\n return;\n }\n frames.set(frameData.frame, {\n ...frame,\n url: frameData.url || frame.url,\n name: frameData.name || frameData.name,\n });\n }\n}\n\nexport interface PageFrameData {\n frames: Map<string, Types.TraceEvents.TraceFrame>;\n}\nexport function data(): PageFrameData {\n return {\n frames,\n };\n}\n"]}
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"../../../../../../../front_end/models/trace/handlers/ExtensionTraceDataHandler.ts",
|
|
35
35
|
"../../../../../../../front_end/models/trace/handlers/FramesHandler.ts",
|
|
36
36
|
"../../../../../../../front_end/models/trace/handlers/GPUHandler.ts",
|
|
37
|
+
"../../../../../../../front_end/models/trace/handlers/ImagePaintingHandler.ts",
|
|
37
38
|
"../../../../../../../front_end/models/trace/handlers/InitiatorsHandler.ts",
|
|
38
39
|
"../../../../../../../front_end/models/trace/handlers/InvalidationsHandler.ts",
|
|
39
40
|
"../../../../../../../front_end/models/trace/handlers/LargestImagePaintHandler.ts",
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
"../../../../../../../front_end/models/trace/handlers/MetaHandler.ts",
|
|
45
46
|
"../../../../../../../front_end/models/trace/handlers/ModelHandlers.ts",
|
|
46
47
|
"../../../../../../../front_end/models/trace/handlers/NetworkRequestsHandler.ts",
|
|
48
|
+
"../../../../../../../front_end/models/trace/handlers/PageFramesHandler.ts",
|
|
47
49
|
"../../../../../../../front_end/models/trace/handlers/PageLoadMetricsHandler.ts",
|
|
48
50
|
"../../../../../../../front_end/models/trace/handlers/RendererHandler.ts",
|
|
49
51
|
"../../../../../../../front_end/models/trace/handlers/SamplesHandler.ts",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trace.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/helpers/Trace.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,KAAK,MAAM,mBAAmB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AAE;YACf,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,EAAE;YACF,wEAAwE;YACxE,yBAAyB;YACzB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;YAC3D,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,IAAI,EAAE;gBACJ,IAAI,EAAE,IAAI;aACX;SACF,CAAC;QAEF,IAAI,KAAK,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC;YAClB,kEAAkE;YAClE,2EAA2E;YAC3E,oEAAoE;YACpE,oBAAoB;YACpB,SAAS;QACX,CAAC;QACD,sBAAsB,EAAE,CAAC,KAAK,CAAC,CAAC;QAChC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,kCAAkC,CAC9C,mBAAwB,EACxB,sBAAqE;IACvE,MAAM,YAAY,GAAG,0BAA0B,CAAC,mBAAmB,CAAC,CAAC;IACrE,MAAM,eAAe,GAAG,2BAA2B,CAAI,YAAY,EAAE,sBAAsB,CAAC,CAAC;IAC7F,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport type * as CPUProfile from '../../cpu_profile/cpu_profile.js';\nimport * as Types from '../types/types.js';\n\ntype MatchedPairType<T extends Types.TraceEvents.TraceEventPairableAsync> = Types.TraceEvents.SyntheticEventPair<T>;\nexport function stackTraceForEvent(event: Types.TraceEvents.TraceEventData): Types.TraceEvents.TraceEventCallFrame[]|\n null {\n if (Types.TraceEvents.isSyntheticInvalidation(event)) {\n return event.stackTrace || null;\n }\n if (event.args?.data?.stackTrace) {\n return event.args.data.stackTrace;\n }\n if (Types.TraceEvents.isTraceEventUpdateLayoutTree(event)) {\n return event.args.beginData?.stackTrace || null;\n }\n return null;\n}\n\nexport function extractOriginFromTrace(firstNavigationURL: string): string|null {\n const url = new URL(firstNavigationURL);\n if (url) {\n // We do this to save some space in the toolbar - seeing the `www` is less\n // useful than seeing `foo.com` if it's truncated at narrow widths\n if (url.host.startsWith('www.')) {\n return url.host.slice(4);\n }\n return url.host;\n }\n return null;\n}\n\nexport type EventsInThread<T extends Types.TraceEvents.TraceEventData> = Map<Types.TraceEvents.ThreadID, T[]>;\n// Each thread contains events. Events indicate the thread and process IDs, which are\n// used to store the event in the correct process thread entry below.\nexport function addEventToProcessThread<T extends Types.TraceEvents.TraceEventData>(\n event: T,\n eventsInProcessThread: Map<Types.TraceEvents.ProcessID, EventsInThread<T>>,\n ): void {\n const {tid, pid} = event;\n let eventsInThread = eventsInProcessThread.get(pid);\n if (!eventsInThread) {\n eventsInThread = new Map<Types.TraceEvents.ThreadID, T[]>();\n }\n\n let events = eventsInThread.get(tid);\n if (!events) {\n events = [];\n }\n\n events.push(event);\n eventsInThread.set(event.tid, events);\n eventsInProcessThread.set(event.pid, eventsInThread);\n}\n\ntype TimeSpan = {\n ts: Types.Timing.MicroSeconds,\n dur?: Types.Timing.MicroSeconds,\n};\nfunction eventTimeComparator(a: TimeSpan, b: TimeSpan): -1|0|1 {\n const aBeginTime = a.ts;\n const bBeginTime = b.ts;\n if (aBeginTime < bBeginTime) {\n return -1;\n }\n if (aBeginTime > bBeginTime) {\n return 1;\n }\n const aDuration = a.dur ?? 0;\n const bDuration = b.dur ?? 0;\n const aEndTime = aBeginTime + aDuration;\n const bEndTime = bBeginTime + bDuration;\n if (aEndTime > bEndTime) {\n return -1;\n }\n if (aEndTime < bEndTime) {\n return 1;\n }\n return 0;\n}\n/**\n * Sorts all the events in place, in order, by their start time. If they have\n * the same start time, orders them by longest first.\n */\nexport function sortTraceEventsInPlace(events: {ts: Types.Timing.MicroSeconds, dur?: Types.Timing.MicroSeconds}[]):\n void {\n events.sort(eventTimeComparator);\n}\n\n/**\n * Returns an array of ordered events that results after merging the two\n * ordered input arrays.\n */\nexport function\nmergeEventsInOrder<T1 extends Types.TraceEvents.TraceEventData, T2 extends Types.TraceEvents.TraceEventData>(\n eventsArray1: readonly T1[], eventsArray2: readonly T2[]): (T1|T2)[] {\n const result = [];\n let i = 0;\n let j = 0;\n while (i < eventsArray1.length && j < eventsArray2.length) {\n const event1 = eventsArray1[i];\n const event2 = eventsArray2[j];\n const compareValue = eventTimeComparator(event1, event2);\n if (compareValue <= 0) {\n result.push(event1);\n i++;\n }\n if (compareValue === 1) {\n result.push(event2);\n j++;\n }\n }\n while (i < eventsArray1.length) {\n result.push(eventsArray1[i++]);\n }\n while (j < eventsArray2.length) {\n result.push(eventsArray2[j++]);\n }\n return result;\n}\n\nexport function getNavigationForTraceEvent(\n event: Types.TraceEvents.TraceEventData,\n eventFrameId: string,\n navigationsByFrameId: Map<string, Types.TraceEvents.TraceEventNavigationStart[]>,\n ): Types.TraceEvents.TraceEventNavigationStart|null {\n const navigations = navigationsByFrameId.get(eventFrameId);\n if (!navigations || eventFrameId === '') {\n // This event's navigation has been filtered out by the meta handler as a noise event\n // or contains an empty frameId.\n return null;\n }\n\n const eventNavigationIndex =\n Platform.ArrayUtilities.nearestIndexFromEnd(navigations, navigation => navigation.ts <= event.ts);\n\n if (eventNavigationIndex === null) {\n // This event's navigation has been filtered out by the meta handler as a noise event.\n return null;\n }\n return navigations[eventNavigationIndex];\n}\n\nexport function extractId(event: Types.TraceEvents.TraceEventPairableAsync|\n MatchedPairType<Types.TraceEvents.TraceEventPairableAsync>): string|undefined {\n return event.id ?? event.id2?.global ?? event.id2?.local;\n}\n\nexport function activeURLForFrameAtTime(\n frameId: string, time: Types.Timing.MicroSeconds,\n rendererProcessesByFrame:\n Map<string,\n Map<Types.TraceEvents.ProcessID,\n {frame: Types.TraceEvents.TraceFrame, window: Types.Timing.TraceWindowMicroSeconds}[]>>): string|null {\n const processData = rendererProcessesByFrame.get(frameId);\n if (!processData) {\n return null;\n }\n for (const processes of processData.values()) {\n for (const processInfo of processes) {\n if (processInfo.window.min > time || processInfo.window.max < time) {\n continue;\n }\n return processInfo.frame.url;\n }\n }\n return null;\n}\n\nexport function makeProfileCall(\n node: CPUProfile.ProfileTreeModel.ProfileNode, ts: Types.Timing.MicroSeconds, pid: Types.TraceEvents.ProcessID,\n tid: Types.TraceEvents.ThreadID): Types.TraceEvents.SyntheticProfileCall {\n return {\n cat: '',\n name: 'ProfileCall',\n nodeId: node.id,\n args: {},\n ph: Types.TraceEvents.Phase.COMPLETE,\n pid,\n tid,\n ts,\n dur: Types.Timing.MicroSeconds(0),\n selfTime: Types.Timing.MicroSeconds(0),\n callFrame: node.callFrame,\n };\n}\n\nexport function makeSyntheticTraceEntry(\n name: string, ts: Types.Timing.MicroSeconds, pid: Types.TraceEvents.ProcessID,\n tid: Types.TraceEvents.ThreadID): Types.TraceEvents.SyntheticTraceEntry {\n return {\n cat: '',\n name,\n args: {},\n ph: Types.TraceEvents.Phase.COMPLETE,\n pid,\n tid,\n ts,\n dur: Types.Timing.MicroSeconds(0),\n selfTime: Types.Timing.MicroSeconds(0),\n };\n}\n\nexport function matchBeginningAndEndEvents(unpairedEvents: Types.TraceEvents.TraceEventPairableAsync[]): Map<string, {\n begin: Types.TraceEvents.TraceEventPairableAsyncBegin | null,\n end: Types.TraceEvents.TraceEventPairableAsyncEnd | null,\n}> {\n // map to store begin and end of the event\n const matchedPairs: Map<string, {\n begin: Types.TraceEvents.TraceEventPairableAsyncBegin | null,\n end: Types.TraceEvents.TraceEventPairableAsyncEnd | null,\n }> = new Map();\n\n // looking for start and end\n for (const event of unpairedEvents) {\n const syntheticId = getSyntheticId(event);\n if (syntheticId === undefined) {\n continue;\n }\n // Create a synthetic id to prevent collisions across categories.\n // Console timings can be dispatched with the same id, so use the\n // event name as well to generate unique ids.\n const otherEventsWithID = Platform.MapUtilities.getWithDefault(matchedPairs, syntheticId, () => {\n return {begin: null, end: null};\n });\n\n const isStartEvent = event.ph === Types.TraceEvents.Phase.ASYNC_NESTABLE_START;\n const isEndEvent = event.ph === Types.TraceEvents.Phase.ASYNC_NESTABLE_END;\n\n if (isStartEvent) {\n otherEventsWithID.begin = event as Types.TraceEvents.TraceEventPairableAsyncBegin;\n } else if (isEndEvent) {\n otherEventsWithID.end = event as Types.TraceEvents.TraceEventPairableAsyncEnd;\n }\n }\n\n return matchedPairs;\n}\n\nfunction getSyntheticId(event: Types.TraceEvents.TraceEventPairableAsync): string|undefined {\n const id = extractId(event);\n return id && `${event.cat}:${id}:${event.name}`;\n}\n\nexport function createSortedSyntheticEvents<T extends Types.TraceEvents.TraceEventPairableAsync>(\n matchedPairs: Map<string, {\n begin: Types.TraceEvents.TraceEventPairableAsyncBegin | null,\n end: Types.TraceEvents.TraceEventPairableAsyncEnd | null,\n }>,\n syntheticEventCallback?: (syntheticEvent: MatchedPairType<T>) => void,\n ): MatchedPairType<T>[] {\n const syntheticEvents: MatchedPairType<T>[] = [];\n for (const [id, eventsPair] of matchedPairs.entries()) {\n const beginEvent = eventsPair.begin;\n const endEvent = eventsPair.end;\n if (!beginEvent || !endEvent) {\n // This should never happen, the backend only creates the events once it\n // has them both, so we should never get into this state.\n // If we do, something is very wrong, so let's just drop that problematic event.\n continue;\n }\n const pair = {beginEvent, endEvent};\n function eventsArePairable(data: {\n beginEvent: Types.TraceEvents.TraceEventPairableAsyncBegin,\n endEvent: Types.TraceEvents.TraceEventPairableAsyncEnd,\n }): data is MatchedPairType<T>['args']['data'] {\n return Boolean(getSyntheticId(data.beginEvent)) &&\n getSyntheticId(data.beginEvent) === getSyntheticId(data.endEvent);\n }\n if (!eventsArePairable(pair)) {\n continue;\n }\n const event: MatchedPairType<T> = {\n cat: endEvent.cat,\n ph: endEvent.ph,\n pid: endEvent.pid,\n tid: endEvent.tid,\n id,\n // Both events have the same name, so it doesn't matter which we pick to\n // use as the description\n name: beginEvent.name,\n dur: Types.Timing.MicroSeconds(endEvent.ts - beginEvent.ts),\n ts: beginEvent.ts,\n args: {\n data: pair,\n },\n };\n\n if (event.dur < 0) {\n // We have seen in the backend that sometimes animation events get\n // generated with multiple begin entries, or multiple end entries, and this\n // can cause invalid data on the performance panel, so we drop them.\n // crbug.com/1472375\n continue;\n }\n syntheticEventCallback?.(event);\n syntheticEvents.push(event);\n }\n return syntheticEvents.sort((a, b) => a.ts - b.ts);\n}\n\nexport function createMatchedSortedSyntheticEvents<T extends Types.TraceEvents.TraceEventPairableAsync>(\n unpairedAsyncEvents: T[],\n syntheticEventCallback?: (syntheticEvent: MatchedPairType<T>) => void): MatchedPairType<T>[] {\n const matchedPairs = matchBeginningAndEndEvents(unpairedAsyncEvents);\n const syntheticEvents = createSortedSyntheticEvents<T>(matchedPairs, syntheticEventCallback);\n return syntheticEvents;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Trace.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/helpers/Trace.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAI3C,MAAM,UAAU,kBAAkB,CAAC,KAAuC;IAExE,IAAI,KAAK,CAAC,WAAW,CAAC,uBAAuB,CAAC,KAAK,CAAC,EAAE,CAAC;QACrD,OAAO,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC;IAClC,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;IACpC,CAAC;IACD,IA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AAE,IAAI;aACX;SACF,CAAC;QAEF,IAAI,KAAK,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC;YAClB,kEAAkE;YAClE,2EAA2E;YAC3E,oEAAoE;YACpE,oBAAoB;YACpB,SAAS;QACX,CAAC;QACD,sBAAsB,EAAE,CAAC,KAAK,CAAC,CAAC;QAChC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,kCAAkC,CAC9C,mBAAwB,EACxB,sBAAqE;IACvE,MAAM,YAAY,GAAG,0BAA0B,CAAC,mBAAmB,CAAC,CAAC;IACrE,MAAM,eAAe,GAAG,2BAA2B,CAAI,YAAY,EAAE,sBAAsB,CAAC,CAAC;IAC7F,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport type * as CPUProfile from '../../cpu_profile/cpu_profile.js';\nimport * as Types from '../types/types.js';\n\ntype MatchedPairType<T extends Types.TraceEvents.TraceEventPairableAsync> = Types.TraceEvents.SyntheticEventPair<T>;\n\nexport function stackTraceForEvent(event: Types.TraceEvents.TraceEventData): Types.TraceEvents.TraceEventCallFrame[]|\n null {\n if (Types.TraceEvents.isSyntheticInvalidation(event)) {\n return event.stackTrace || null;\n }\n if (event.args?.data?.stackTrace) {\n return event.args.data.stackTrace;\n }\n if (Types.TraceEvents.isTraceEventUpdateLayoutTree(event)) {\n return event.args.beginData?.stackTrace || null;\n }\n return null;\n}\n\nexport function extractOriginFromTrace(firstNavigationURL: string): string|null {\n const url = new URL(firstNavigationURL);\n if (url) {\n // We do this to save some space in the toolbar - seeing the `www` is less\n // useful than seeing `foo.com` if it's truncated at narrow widths\n if (url.host.startsWith('www.')) {\n return url.host.slice(4);\n }\n return url.host;\n }\n return null;\n}\n\nexport type EventsInThread<T extends Types.TraceEvents.TraceEventData> = Map<Types.TraceEvents.ThreadID, T[]>;\n// Each thread contains events. Events indicate the thread and process IDs, which are\n// used to store the event in the correct process thread entry below.\nexport function addEventToProcessThread<T extends Types.TraceEvents.TraceEventData>(\n event: T,\n eventsInProcessThread: Map<Types.TraceEvents.ProcessID, EventsInThread<T>>,\n ): void {\n const {tid, pid} = event;\n let eventsInThread = eventsInProcessThread.get(pid);\n if (!eventsInThread) {\n eventsInThread = new Map<Types.TraceEvents.ThreadID, T[]>();\n }\n\n let events = eventsInThread.get(tid);\n if (!events) {\n events = [];\n }\n\n events.push(event);\n eventsInThread.set(event.tid, events);\n eventsInProcessThread.set(event.pid, eventsInThread);\n}\n\ntype TimeSpan = {\n ts: Types.Timing.MicroSeconds,\n dur?: Types.Timing.MicroSeconds,\n};\nfunction eventTimeComparator(a: TimeSpan, b: TimeSpan): -1|0|1 {\n const aBeginTime = a.ts;\n const bBeginTime = b.ts;\n if (aBeginTime < bBeginTime) {\n return -1;\n }\n if (aBeginTime > bBeginTime) {\n return 1;\n }\n const aDuration = a.dur ?? 0;\n const bDuration = b.dur ?? 0;\n const aEndTime = aBeginTime + aDuration;\n const bEndTime = bBeginTime + bDuration;\n if (aEndTime > bEndTime) {\n return -1;\n }\n if (aEndTime < bEndTime) {\n return 1;\n }\n return 0;\n}\n/**\n * Sorts all the events in place, in order, by their start time. If they have\n * the same start time, orders them by longest first.\n */\nexport function sortTraceEventsInPlace(events: {ts: Types.Timing.MicroSeconds, dur?: Types.Timing.MicroSeconds}[]):\n void {\n events.sort(eventTimeComparator);\n}\n\n/**\n * Returns an array of ordered events that results after merging the two\n * ordered input arrays.\n */\nexport function\nmergeEventsInOrder<T1 extends Types.TraceEvents.TraceEventData, T2 extends Types.TraceEvents.TraceEventData>(\n eventsArray1: readonly T1[], eventsArray2: readonly T2[]): (T1|T2)[] {\n const result = [];\n let i = 0;\n let j = 0;\n while (i < eventsArray1.length && j < eventsArray2.length) {\n const event1 = eventsArray1[i];\n const event2 = eventsArray2[j];\n const compareValue = eventTimeComparator(event1, event2);\n if (compareValue <= 0) {\n result.push(event1);\n i++;\n }\n if (compareValue === 1) {\n result.push(event2);\n j++;\n }\n }\n while (i < eventsArray1.length) {\n result.push(eventsArray1[i++]);\n }\n while (j < eventsArray2.length) {\n result.push(eventsArray2[j++]);\n }\n return result;\n}\n\nexport function getNavigationForTraceEvent(\n event: Types.TraceEvents.TraceEventData,\n eventFrameId: string,\n navigationsByFrameId: Map<string, Types.TraceEvents.TraceEventNavigationStart[]>,\n ): Types.TraceEvents.TraceEventNavigationStart|null {\n const navigations = navigationsByFrameId.get(eventFrameId);\n if (!navigations || eventFrameId === '') {\n // This event's navigation has been filtered out by the meta handler as a noise event\n // or contains an empty frameId.\n return null;\n }\n\n const eventNavigationIndex =\n Platform.ArrayUtilities.nearestIndexFromEnd(navigations, navigation => navigation.ts <= event.ts);\n\n if (eventNavigationIndex === null) {\n // This event's navigation has been filtered out by the meta handler as a noise event.\n return null;\n }\n return navigations[eventNavigationIndex];\n}\n\nexport function extractId(event: Types.TraceEvents.TraceEventPairableAsync|\n MatchedPairType<Types.TraceEvents.TraceEventPairableAsync>): string|undefined {\n return event.id ?? event.id2?.global ?? event.id2?.local;\n}\n\nexport function activeURLForFrameAtTime(\n frameId: string, time: Types.Timing.MicroSeconds,\n rendererProcessesByFrame:\n Map<string,\n Map<Types.TraceEvents.ProcessID,\n {frame: Types.TraceEvents.TraceFrame, window: Types.Timing.TraceWindowMicroSeconds}[]>>): string|null {\n const processData = rendererProcessesByFrame.get(frameId);\n if (!processData) {\n return null;\n }\n for (const processes of processData.values()) {\n for (const processInfo of processes) {\n if (processInfo.window.min > time || processInfo.window.max < time) {\n continue;\n }\n return processInfo.frame.url;\n }\n }\n return null;\n}\n\nexport function makeProfileCall(\n node: CPUProfile.ProfileTreeModel.ProfileNode, ts: Types.Timing.MicroSeconds, pid: Types.TraceEvents.ProcessID,\n tid: Types.TraceEvents.ThreadID): Types.TraceEvents.SyntheticProfileCall {\n return {\n cat: '',\n name: 'ProfileCall',\n nodeId: node.id,\n args: {},\n ph: Types.TraceEvents.Phase.COMPLETE,\n pid,\n tid,\n ts,\n dur: Types.Timing.MicroSeconds(0),\n selfTime: Types.Timing.MicroSeconds(0),\n callFrame: node.callFrame,\n };\n}\n\nexport function makeSyntheticTraceEntry(\n name: string, ts: Types.Timing.MicroSeconds, pid: Types.TraceEvents.ProcessID,\n tid: Types.TraceEvents.ThreadID): Types.TraceEvents.SyntheticTraceEntry {\n return {\n cat: '',\n name,\n args: {},\n ph: Types.TraceEvents.Phase.COMPLETE,\n pid,\n tid,\n ts,\n dur: Types.Timing.MicroSeconds(0),\n selfTime: Types.Timing.MicroSeconds(0),\n };\n}\n\nexport function matchBeginningAndEndEvents(unpairedEvents: Types.TraceEvents.TraceEventPairableAsync[]): Map<string, {\n begin: Types.TraceEvents.TraceEventPairableAsyncBegin | null,\n end: Types.TraceEvents.TraceEventPairableAsyncEnd | null,\n}> {\n // map to store begin and end of the event\n const matchedPairs: Map<string, {\n begin: Types.TraceEvents.TraceEventPairableAsyncBegin | null,\n end: Types.TraceEvents.TraceEventPairableAsyncEnd | null,\n }> = new Map();\n\n // looking for start and end\n for (const event of unpairedEvents) {\n const syntheticId = getSyntheticId(event);\n if (syntheticId === undefined) {\n continue;\n }\n // Create a synthetic id to prevent collisions across categories.\n // Console timings can be dispatched with the same id, so use the\n // event name as well to generate unique ids.\n const otherEventsWithID = Platform.MapUtilities.getWithDefault(matchedPairs, syntheticId, () => {\n return {begin: null, end: null};\n });\n\n const isStartEvent = event.ph === Types.TraceEvents.Phase.ASYNC_NESTABLE_START;\n const isEndEvent = event.ph === Types.TraceEvents.Phase.ASYNC_NESTABLE_END;\n\n if (isStartEvent) {\n otherEventsWithID.begin = event as Types.TraceEvents.TraceEventPairableAsyncBegin;\n } else if (isEndEvent) {\n otherEventsWithID.end = event as Types.TraceEvents.TraceEventPairableAsyncEnd;\n }\n }\n\n return matchedPairs;\n}\n\nfunction getSyntheticId(event: Types.TraceEvents.TraceEventPairableAsync): string|undefined {\n const id = extractId(event);\n return id && `${event.cat}:${id}:${event.name}`;\n}\n\nexport function createSortedSyntheticEvents<T extends Types.TraceEvents.TraceEventPairableAsync>(\n matchedPairs: Map<string, {\n begin: Types.TraceEvents.TraceEventPairableAsyncBegin | null,\n end: Types.TraceEvents.TraceEventPairableAsyncEnd | null,\n }>,\n syntheticEventCallback?: (syntheticEvent: MatchedPairType<T>) => void,\n ): MatchedPairType<T>[] {\n const syntheticEvents: MatchedPairType<T>[] = [];\n for (const [id, eventsPair] of matchedPairs.entries()) {\n const beginEvent = eventsPair.begin;\n const endEvent = eventsPair.end;\n if (!beginEvent || !endEvent) {\n // This should never happen, the backend only creates the events once it\n // has them both, so we should never get into this state.\n // If we do, something is very wrong, so let's just drop that problematic event.\n continue;\n }\n const pair = {beginEvent, endEvent};\n function eventsArePairable(data: {\n beginEvent: Types.TraceEvents.TraceEventPairableAsyncBegin,\n endEvent: Types.TraceEvents.TraceEventPairableAsyncEnd,\n }): data is MatchedPairType<T>['args']['data'] {\n return Boolean(getSyntheticId(data.beginEvent)) &&\n getSyntheticId(data.beginEvent) === getSyntheticId(data.endEvent);\n }\n if (!eventsArePairable(pair)) {\n continue;\n }\n const event: MatchedPairType<T> = {\n cat: endEvent.cat,\n ph: endEvent.ph,\n pid: endEvent.pid,\n tid: endEvent.tid,\n id,\n // Both events have the same name, so it doesn't matter which we pick to\n // use as the description\n name: beginEvent.name,\n dur: Types.Timing.MicroSeconds(endEvent.ts - beginEvent.ts),\n ts: beginEvent.ts,\n args: {\n data: pair,\n },\n };\n\n if (event.dur < 0) {\n // We have seen in the backend that sometimes animation events get\n // generated with multiple begin entries, or multiple end entries, and this\n // can cause invalid data on the performance panel, so we drop them.\n // crbug.com/1472375\n continue;\n }\n syntheticEventCallback?.(event);\n syntheticEvents.push(event);\n }\n return syntheticEvents.sort((a, b) => a.ts - b.ts);\n}\n\nexport function createMatchedSortedSyntheticEvents<T extends Types.TraceEvents.TraceEventPairableAsync>(\n unpairedAsyncEvents: T[],\n syntheticEventCallback?: (syntheticEvent: MatchedPairType<T>) => void): MatchedPairType<T>[] {\n const matchedPairs = matchBeginningAndEndEvents(unpairedAsyncEvents);\n const syntheticEvents = createSortedSyntheticEvents<T>(matchedPairs, syntheticEventCallback);\n return syntheticEvents;\n}\n"]}
|
|
@@ -551,6 +551,7 @@ export interface TraceEventMarkDOMContent extends TraceEventInstant {
|
|
|
551
551
|
data?: TraceEventArgsData & {
|
|
552
552
|
frame: string;
|
|
553
553
|
isMainFrame: boolean;
|
|
554
|
+
isOutermostMainFrame?: boolean;
|
|
554
555
|
page: string;
|
|
555
556
|
};
|
|
556
557
|
};
|
|
@@ -562,6 +563,7 @@ export interface TraceEventMarkLoad extends TraceEventInstant {
|
|
|
562
563
|
frame: string;
|
|
563
564
|
isMainFrame: boolean;
|
|
564
565
|
page: string;
|
|
566
|
+
isOutermostMainFrame?: boolean;
|
|
565
567
|
};
|
|
566
568
|
};
|
|
567
569
|
}
|
|
@@ -1118,6 +1120,27 @@ export interface SyntheticInvalidation extends TraceEventInstant {
|
|
|
1118
1120
|
stackTrace?: TraceEventCallFrame[];
|
|
1119
1121
|
}
|
|
1120
1122
|
export declare function isSyntheticInvalidation(event: TraceEventData): event is SyntheticInvalidation;
|
|
1123
|
+
export interface TraceEventDrawLazyPixelRef extends TraceEventInstant {
|
|
1124
|
+
name: KnownEventName.DrawLazyPixelRef;
|
|
1125
|
+
args?: TraceEventArgs & {
|
|
1126
|
+
LazyPixelRef: number;
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
export declare function isTraceEventDrawLazyPixelRef(event: TraceEventData): event is TraceEventDrawLazyPixelRef;
|
|
1130
|
+
export interface TraceEventDecodeLazyPixelRef extends TraceEventInstant {
|
|
1131
|
+
name: KnownEventName.DecodeLazyPixelRef;
|
|
1132
|
+
args?: TraceEventArgs & {
|
|
1133
|
+
LazyPixelRef: number;
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1136
|
+
export declare function isTraceEventDecodeLazyPixelRef(event: TraceEventData): event is TraceEventDecodeLazyPixelRef;
|
|
1137
|
+
export interface TraceEventDecodeImage extends TraceEventComplete {
|
|
1138
|
+
name: KnownEventName.DecodeImage;
|
|
1139
|
+
args: TraceEventArgs & {
|
|
1140
|
+
imageType: string;
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1143
|
+
export declare function isTraceEventDecodeImage(event: TraceEventData): event is TraceEventDecodeImage;
|
|
1121
1144
|
export interface SelectorTiming {
|
|
1122
1145
|
'elapsed (us)': number;
|
|
1123
1146
|
'fast_reject_count': number;
|
|
@@ -1266,11 +1289,37 @@ export interface TraceEventPaint extends TraceEventComplete {
|
|
|
1266
1289
|
clip: number[];
|
|
1267
1290
|
frame: string;
|
|
1268
1291
|
layerId: number;
|
|
1269
|
-
nodeId
|
|
1292
|
+
nodeId?: Protocol.DOM.BackendNodeId;
|
|
1270
1293
|
};
|
|
1271
1294
|
};
|
|
1272
1295
|
}
|
|
1273
1296
|
export declare function isTraceEventPaint(event: TraceEventData): event is TraceEventPaint;
|
|
1297
|
+
export interface TraceEventPaintImage extends TraceEventComplete {
|
|
1298
|
+
name: KnownEventName.PaintImage;
|
|
1299
|
+
args: TraceEventArgs & {
|
|
1300
|
+
data: TraceEventData & {
|
|
1301
|
+
height: number;
|
|
1302
|
+
width: number;
|
|
1303
|
+
x: number;
|
|
1304
|
+
y: number;
|
|
1305
|
+
url?: string;
|
|
1306
|
+
srcHeight: number;
|
|
1307
|
+
srcWidth: number;
|
|
1308
|
+
nodeId?: Protocol.DOM.BackendNodeId;
|
|
1309
|
+
};
|
|
1310
|
+
};
|
|
1311
|
+
}
|
|
1312
|
+
export declare function isTraceEventPaintImage(event: TraceEventData): event is TraceEventPaintImage;
|
|
1313
|
+
export interface TraceEventScrollLayer extends TraceEventComplete {
|
|
1314
|
+
name: KnownEventName.ScrollLayer;
|
|
1315
|
+
args: TraceEventArgs & {
|
|
1316
|
+
data: TraceEventData & {
|
|
1317
|
+
frame: string;
|
|
1318
|
+
nodeId?: Protocol.DOM.BackendNodeId;
|
|
1319
|
+
};
|
|
1320
|
+
};
|
|
1321
|
+
}
|
|
1322
|
+
export declare function isTraceEventScrollLayer(event: TraceEventData): event is TraceEventScrollLayer;
|
|
1274
1323
|
export interface TraceEventSetLayerTreeId extends TraceEventInstant {
|
|
1275
1324
|
name: KnownEventName.SetLayerTreeId;
|
|
1276
1325
|
args: TraceEventArgs & {
|
|
@@ -104,6 +104,15 @@ export function isTraceEventActivateLayerTree(event) {
|
|
|
104
104
|
export function isSyntheticInvalidation(event) {
|
|
105
105
|
return event.name === 'SyntheticInvalidation';
|
|
106
106
|
}
|
|
107
|
+
export function isTraceEventDrawLazyPixelRef(event) {
|
|
108
|
+
return event.name === "Draw LazyPixelRef" /* KnownEventName.DrawLazyPixelRef */;
|
|
109
|
+
}
|
|
110
|
+
export function isTraceEventDecodeLazyPixelRef(event) {
|
|
111
|
+
return event.name === "Decode LazyPixelRef" /* KnownEventName.DecodeLazyPixelRef */;
|
|
112
|
+
}
|
|
113
|
+
export function isTraceEventDecodeImage(event) {
|
|
114
|
+
return event.name === "Decode Image" /* KnownEventName.DecodeImage */;
|
|
115
|
+
}
|
|
107
116
|
export function isStyleRecalcSelectorStats(event) {
|
|
108
117
|
return event.name === "SelectorStats" /* KnownEventName.SelectorStats */;
|
|
109
118
|
}
|
|
@@ -346,6 +355,12 @@ export function isProfileCall(event) {
|
|
|
346
355
|
export function isTraceEventPaint(event) {
|
|
347
356
|
return event.name === "Paint" /* KnownEventName.Paint */;
|
|
348
357
|
}
|
|
358
|
+
export function isTraceEventPaintImage(event) {
|
|
359
|
+
return event.name === "PaintImage" /* KnownEventName.PaintImage */;
|
|
360
|
+
}
|
|
361
|
+
export function isTraceEventScrollLayer(event) {
|
|
362
|
+
return event.name === "ScrollLayer" /* KnownEventName.ScrollLayer */;
|
|
363
|
+
}
|
|
349
364
|
export function isTraceEventSetLayerId(event) {
|
|
350
365
|
return event.name === "SetLayerTreeId" /* KnownEventName.SetLayerTreeId */;
|
|
351
366
|
}
|