diff --git a/docs-developer/CHANGELOG-formats.md b/docs-developer/CHANGELOG-formats.md index 7bac269d65..5effbce356 100644 --- a/docs-developer/CHANGELOG-formats.md +++ b/docs-developer/CHANGELOG-formats.md @@ -6,6 +6,10 @@ Note that this is not an exhaustive list. Processed profile format upgraders can ## Processed profile format +### Version 69 + +A new marker schema display location, `timeline-network`, was added. A marker schema can list `timeline-network` in its `display` array to have markers of that type surfaced in the Network track. + ### Version 68 The `startTime` and `endTime` columns of the raw marker table (`thread.markers`) can now optionally be stored as `Float64Array`, for profiles loaded from [JsonSlabs](https://github.com/mstange/json-slabs/) files (.jslb, .jslb.gz). Regular JS / JSON arrays are still accepted. diff --git a/src/app-logic/constants.ts b/src/app-logic/constants.ts index e775888590..0022ed01bf 100644 --- a/src/app-logic/constants.ts +++ b/src/app-logic/constants.ts @@ -12,7 +12,7 @@ export const GECKO_PROFILE_VERSION = 35; // The current version of the "processed" profile format. // Please don't forget to update the processed profile format changelog in // `docs-developer/CHANGELOG-formats.md`. -export const PROCESSED_PROFILE_VERSION = 68; +export const PROCESSED_PROFILE_VERSION = 69; // The following are the margin sizes for the left and right of the timeline. Independent // components need to share these values. diff --git a/src/profile-logic/marker-schema.ts b/src/profile-logic/marker-schema.ts index f71db57577..59454a280d 100644 --- a/src/profile-logic/marker-schema.ts +++ b/src/profile-logic/marker-schema.ts @@ -68,7 +68,7 @@ export const markerSchemaFrontEndOnly: MarkerSchema[] = [ // `display` property is used to decide where to display these markers, and // we need it to hide them from the marker chart. name: 'Network', - display: ['marker-table', 'marker-chart'], + display: ['marker-table', 'marker-chart', 'timeline-network'], chartLabel: '{marker.data.URI}', fields: [ { diff --git a/src/profile-logic/processed-profile-versioning.ts b/src/profile-logic/processed-profile-versioning.ts index 1e690b4233..0999f5c078 100644 --- a/src/profile-logic/processed-profile-versioning.ts +++ b/src/profile-logic/processed-profile-versioning.ts @@ -3297,6 +3297,19 @@ const _upgraders: { // are still accepted. All valid v67 profiles are valid v68 profiles, so // no upgrader is needed. }, + [69]: (profile: any) => { + // A new marker schema display location, "timeline-network", was added. + // Add it to any "Network" marker schema already present in the profile. + for (const schema of profile.meta.markerSchema ?? []) { + if ( + schema.name === 'Network' && + schema.display && + !schema.display.includes('timeline-network') + ) { + schema.display.push('timeline-network'); + } + } + }, // If you add a new upgrader here, please document the change in // `docs-developer/CHANGELOG-formats.md`. }; diff --git a/src/profile-logic/tracks.ts b/src/profile-logic/tracks.ts index 32dd6ebb8f..4d1fe7ff09 100644 --- a/src/profile-logic/tracks.ts +++ b/src/profile-logic/tracks.ts @@ -338,6 +338,10 @@ export function computeLocalTracksByPid( markerSchema, 'timeline-ipc' ); + const networkTimelineMarkerTypes = getMarkerTypesForDisplay( + markerSchema, + 'timeline-network' + ); for ( let threadIndex = 0; @@ -362,7 +366,11 @@ export function computeLocalTracksByPid( tracks.push({ type: 'thread', threadIndex }); } - if (markers.data.some((datum) => datum && datum.type === 'Network')) { + if ( + markers.data.some( + (datum) => datum && networkTimelineMarkerTypes.has(datum.type) + ) + ) { // This thread has network markers. tracks.push({ type: 'network', threadIndex }); } diff --git a/src/test/integration/profiler-edit/__snapshots__/profiler-edit.test.ts.snap b/src/test/integration/profiler-edit/__snapshots__/profiler-edit.test.ts.snap index 5410c2b927..8df0ad49ac 100644 --- a/src/test/integration/profiler-edit/__snapshots__/profiler-edit.test.ts.snap +++ b/src/test/integration/profiler-edit/__snapshots__/profiler-edit.test.ts.snap @@ -87,7 +87,7 @@ Object { "markerSchema": Array [], "oscpu": "macOS 14.6.1", "pausedRanges": Array [], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "processType": 0, "product": "a.out", "sampleUnits": Object { @@ -1452,7 +1452,7 @@ Object { "markerSchema": Array [], "oscpu": "macOS 14.6.1", "pausedRanges": Array [], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "processType": 0, "product": "a.out", "sampleUnits": Object { @@ -2817,7 +2817,7 @@ Object { "markerSchema": Array [], "oscpu": "macOS 14.6.1", "pausedRanges": Array [], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "processType": 0, "product": "a.out", "sampleUnits": Object { @@ -4182,7 +4182,7 @@ Object { "markerSchema": Array [], "oscpu": "macOS 14.6.1", "pausedRanges": Array [], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "processType": 0, "product": "a.out", "sampleUnits": Object { diff --git a/src/test/store/__snapshots__/profile-view.test.ts.snap b/src/test/store/__snapshots__/profile-view.test.ts.snap index 409c516cca..50a5655d83 100644 --- a/src/test/store/__snapshots__/profile-view.test.ts.snap +++ b/src/test/store/__snapshots__/profile-view.test.ts.snap @@ -423,7 +423,7 @@ Object { "oscpu": "", "physicalCPUs": 0, "platform": "", - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "processType": 0, "product": "Firefox", "sourceURL": "", diff --git a/src/test/unit/__snapshots__/profile-conversion.test.ts.snap b/src/test/unit/__snapshots__/profile-conversion.test.ts.snap index 309eadb92d..1a055fe268 100644 --- a/src/test/unit/__snapshots__/profile-conversion.test.ts.snap +++ b/src/test/unit/__snapshots__/profile-conversion.test.ts.snap @@ -42,7 +42,7 @@ Object { "RefreshDriverTick", "Network", ], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "ART Trace (Android)", "symbolicated": true, "version": 35, @@ -1022,7 +1022,7 @@ Object { "RefreshDriverTick", "Network", ], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "ART Trace (Android)", "symbolicated": true, "version": 35, @@ -2305,7 +2305,7 @@ Object { "markerSchemaNames": Array [ "EventDispatch", ], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "Chrome Trace", "symbolicated": true, "version": 35, @@ -2697,7 +2697,7 @@ Object { "markerSchemaNames": Array [ "EventDispatch", ], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "Chrome Trace", "symbolicated": true, "version": 35, @@ -3086,7 +3086,7 @@ Object { "markerSchemaNames": Array [ "EventDispatch", ], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "Chrome Trace", "symbolicated": true, "version": 35, @@ -3187,7 +3187,7 @@ Object { "markerSchemaNames": Array [ "EventDispatch", ], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "Chrome Trace", "symbolicated": true, "version": 35, @@ -3540,7 +3540,7 @@ Object { "markerSchemaNames": Array [ "EventDispatch", ], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "Chrome Trace", "symbolicated": true, "version": 35, @@ -3605,7 +3605,7 @@ Object { "markerSchemaNames": Array [ "EventDispatch", ], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "Chrome Trace", "symbolicated": true, "version": 35, @@ -3759,7 +3759,7 @@ Object { "markerSchemaNames": Array [ "EventDispatch", ], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "Chrome Trace", "symbolicated": true, "version": 35, @@ -3817,7 +3817,7 @@ Object { "importedFrom": undefined, "interval": 1, "markerSchemaNames": Array [], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "Firefox", "symbolicated": true, "version": 35, @@ -4207,7 +4207,7 @@ Object { "importedFrom": undefined, "interval": 1, "markerSchemaNames": Array [], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "Firefox", "symbolicated": true, "version": 35, @@ -4265,7 +4265,7 @@ Object { "importedFrom": undefined, "interval": 1, "markerSchemaNames": Array [], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "Firefox", "symbolicated": true, "version": 35, @@ -4323,7 +4323,7 @@ Object { "importedFrom": undefined, "interval": 1, "markerSchemaNames": Array [], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "Firefox", "symbolicated": true, "version": 35, @@ -4643,7 +4643,7 @@ Object { "importedFrom": "Simpleperf", "interval": 0, "markerSchemaNames": Array [], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "com.example.sampleapplication", "symbolicated": undefined, "version": 30, @@ -5019,7 +5019,7 @@ Object { "importedFrom": "Simpleperf", "interval": 0, "markerSchemaNames": Array [], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "com.example.sampleapplication", "symbolicated": undefined, "version": 30, @@ -5319,7 +5319,7 @@ Object { "importedFrom": "dhat", "interval": 1, "markerSchemaNames": Array [], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "target/debug/examples/work_log (dhat)", "symbolicated": true, "version": 35, @@ -5452,7 +5452,7 @@ Object { "importedFrom": undefined, "interval": 1, "markerSchemaNames": Array [], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "Flamegraph", "symbolicated": true, "version": 35, @@ -5510,7 +5510,7 @@ Object { "importedFrom": undefined, "interval": 1, "markerSchemaNames": Array [], - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "product": "Flamegraph", "symbolicated": true, "version": 35, diff --git a/src/test/unit/__snapshots__/profile-upgrading.test.ts.snap b/src/test/unit/__snapshots__/profile-upgrading.test.ts.snap index 7ff096cc87..ec917f4f3b 100644 --- a/src/test/unit/__snapshots__/profile-upgrading.test.ts.snap +++ b/src/test/unit/__snapshots__/profile-upgrading.test.ts.snap @@ -40,7 +40,7 @@ Object { "oscpu": undefined, "physicalCPUs": undefined, "platform": undefined, - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "processType": 0, "product": "Firefox", "sampleUnits": undefined, @@ -7620,6 +7620,7 @@ Object { Object { "display": Array [ "marker-table", + "timeline-network", ], "fields": Array [], "name": "Network", @@ -7643,7 +7644,7 @@ Object { "misc": "rv:48.0", "oscpu": "Intel Mac OS X 10.11", "platform": "Macintosh", - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "processType": 0, "product": "Firefox", "stackwalk": 1, @@ -8996,6 +8997,7 @@ Object { Object { "display": Array [ "marker-table", + "timeline-network", ], "fields": Array [], "name": "Network", @@ -9019,7 +9021,7 @@ Object { "misc": "rv:48.0", "oscpu": "Intel Mac OS X 10.11", "platform": "Macintosh", - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "processType": 0, "product": "Firefox", "stackwalk": 1, @@ -10540,6 +10542,7 @@ Object { Object { "display": Array [ "marker-table", + "timeline-network", ], "fields": Array [], "name": "Network", @@ -10563,7 +10566,7 @@ Object { "misc": "rv:48.0", "oscpu": "Intel Mac OS X 10.11", "platform": "Macintosh", - "preprocessedProfileVersion": 68, + "preprocessedProfileVersion": 69, "processType": 0, "product": "Firefox", "stackwalk": 1, diff --git a/src/types/markers.ts b/src/types/markers.ts index 8653ead3ed..e3eb9217b5 100644 --- a/src/types/markers.ts +++ b/src/types/markers.ts @@ -116,6 +116,8 @@ export type MarkerDisplayLocation = | 'timeline-ipc' // This adds markers to the FileIO timeline area in the header. | 'timeline-fileio' + // This adds markers to the Network track. + | 'timeline-network' // TODO - This is not supported yet. | 'stack-chart';