Skip to content

Commit 8e0b8c8

Browse files
committed
Remove searchable from the processed format.
Now all marker fields are searchable. Fixes #5517.
1 parent 0c2562c commit 8e0b8c8

File tree

20 files changed

+168
-254
lines changed

20 files changed

+168
-254
lines changed

docs-developer/CHANGELOG-formats.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Note that this is not an exhaustive list. Processed profile format upgraders can
66

77
## Processed profile format
88

9+
### Version 57
10+
11+
The `searchable` property in marker schemas, originally added in version 44, is now removed again. Now all marker fields are searchable.
12+
913
### Version 56
1014

1115
The `stringArray` is now shared across threads. The shared array is stored at `profile.shared.stringArray`.

docs-user/guide-ui-tour-panels.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ can be a substring to match, `key:substring` to match more specifically,
8080
or `-key:substring` to drop anything matching. (`-substring` will not work;
8181
negative matches require a `key`.) Valid `key` values are: `name`, `cat` (for
8282
marker category), `type` (for markers with payload objects), and any marker
83-
payload field key that is searchable according to the marker's schema.
83+
payload field key declared in the marker's schema.
8484

8585
Example: `DOM,cat:GC,-name:CSS` will match anything with DOM in its category,
86-
name, type, or searchable field, plus anything with "GC" in its category,
86+
name, type, or any field, plus anything with "GC" in its category,
8787
but omitting markers with "CSS" anywhere in their names.
8888

8989
## The Marker Table

src/app-logic/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const GECKO_PROFILE_VERSION = 31;
1414
// The current version of the "processed" profile format.
1515
// Please don't forget to update the processed profile format changelog in
1616
// `docs-developer/CHANGELOG-formats.md`.
17-
export const PROCESSED_PROFILE_VERSION = 56;
17+
export const PROCESSED_PROFILE_VERSION = 57;
1818

1919
// The following are the margin sizes for the left and right of the timeline. Independent
2020
// components need to share these values.

src/profile-logic/import/chrome.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,6 @@ function extractMarkers(
945945
key: 'type2',
946946
label: 'Event Type',
947947
format: 'string',
948-
searchable: true,
949948
},
950949
],
951950
},

src/profile-logic/marker-data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function positiveFilterMarker(
223223
return true;
224224
}
225225

226-
// Now check the schema for the marker payload for searchable
226+
// Now check the schema for the marker payload for field matches
227227
const markerSchema = getSchemaFromMarker(markerSchemaByName, marker.data);
228228
if (
229229
markerSchema &&
@@ -285,7 +285,7 @@ function negativeFilterMarker(
285285
return false;
286286
}
287287

288-
// Now check the schema for the marker payload for searchable
288+
// Now check the schema for the marker payload for field matches
289289
const markerSchema = getSchemaFromMarker(markerSchemaByName, marker.data);
290290

291291
if (

src/profile-logic/marker-schema.js

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ export const markerSchemaFrontEndOnly: MarkerSchema[] = [
5555
chartLabel: '{marker.data.messageType}',
5656
display: ['marker-chart', 'marker-table', 'timeline-ipc'],
5757
fields: [
58-
{ key: 'messageType', label: 'Type', format: 'string', searchable: true },
58+
{ key: 'messageType', label: 'Type', format: 'string' },
5959
{ key: 'sync', label: 'Sync', format: 'string' },
6060
{ key: 'sendThreadName', label: 'From', format: 'string' },
6161
{ key: 'recvThreadName', label: 'To', format: 'string' },
62-
{ key: 'otherPid', label: 'Other Pid', format: 'pid', searchable: true },
62+
{ key: 'otherPid', label: 'Other Pid', format: 'pid' },
6363
],
6464
},
6565
{
@@ -74,14 +74,12 @@ export const markerSchemaFrontEndOnly: MarkerSchema[] = [
7474
format: 'string',
7575
key: 'contentType',
7676
label: 'Content Type',
77-
searchable: true,
7877
hidden: true,
7978
},
8079
{
8180
format: 'integer',
8281
key: 'responseStatus',
8382
label: 'Response Status',
84-
searchable: true,
8583
hidden: true,
8684
},
8785
],
@@ -615,7 +613,7 @@ export function formatMarkupFromMarkerSchema(
615613
}
616614

617615
/**
618-
* Takes a marker and a RegExp and checks if any of its `searchable` marker
616+
* Takes a marker and a RegExp and checks if any of its marker
619617
* payload fields match the search regular expression.
620618
*/
621619
export function markerPayloadMatchesSearch(
@@ -629,39 +627,37 @@ export function markerPayloadMatchesSearch(
629627
return false;
630628
}
631629

632-
// Check if searchable fields match the search regular expression.
630+
// Check if fields match the search regular expression.
633631
for (const payloadField of markerSchema.fields) {
634-
if (payloadField.searchable) {
635-
let value = data[payloadField.key];
636-
if (value === undefined || value === null) {
637-
// The value is missing, but this is OK, values are optional.
632+
let value = data[payloadField.key];
633+
if (value === undefined || value === null) {
634+
// The value is missing, but this is OK, values are optional.
635+
continue;
636+
}
637+
638+
if (
639+
payloadField.format === 'unique-string' ||
640+
payloadField.format === 'flow-id' ||
641+
payloadField.format === 'terminating-flow-id'
642+
) {
643+
if (typeof value !== 'number') {
644+
console.warn(
645+
`In marker ${marker.name}, the key ${payloadField.key} has an invalid value "${value}" as a unique string, it isn't a number.`
646+
);
638647
continue;
639648
}
640649

641-
if (
642-
payloadField.format === 'unique-string' ||
643-
payloadField.format === 'flow-id' ||
644-
payloadField.format === 'terminating-flow-id'
645-
) {
646-
if (typeof value !== 'number') {
647-
console.warn(
648-
`In marker ${marker.name}, the key ${payloadField.key} has an invalid value "${value}" as a unique string, it isn't a number.`
649-
);
650-
continue;
651-
}
652-
653-
if (!stringTable.hasIndex(value)) {
654-
console.warn(
655-
`In marker ${marker.name}, the key ${payloadField.key} has an invalid index "${value}" as a unique string, as it's missing from the string table.`
656-
);
657-
continue;
658-
}
659-
value = stringTable.getString(value);
650+
if (!stringTable.hasIndex(value)) {
651+
console.warn(
652+
`In marker ${marker.name}, the key ${payloadField.key} has an invalid index "${value}" as a unique string, as it's missing from the string table.`
653+
);
654+
continue;
660655
}
656+
value = stringTable.getString(value);
657+
}
661658

662-
if (value !== '' && testFun(value, payloadField.key)) {
663-
return true;
664-
}
659+
if (value !== '' && testFun(value, payloadField.key)) {
660+
return true;
665661
}
666662
}
667663

src/profile-logic/process-profile.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ import type {
7373
GeckoThread,
7474
GeckoMetaMarkerSchema,
7575
GeckoStaticFieldSchemaData,
76-
GeckoDynamicFieldSchemaData,
7776
GeckoMarkers,
7877
GeckoMarkerStruct,
7978
GeckoMarkerTuple,
@@ -94,6 +93,7 @@ import type {
9493
PhaseTimes,
9594
ExternalMarkersData,
9695
MarkerSchema,
96+
MarkerSchemaField,
9797
ProfileMeta,
9898
PageList,
9999
ThreadIndex,
@@ -1460,11 +1460,12 @@ function _convertGeckoMarkerSchema(
14601460
isStackBased,
14611461
} = markerSchema;
14621462

1463-
const fields: GeckoDynamicFieldSchemaData[] = [];
1463+
const fields: MarkerSchemaField[] = [];
14641464
const staticFields: GeckoStaticFieldSchemaData[] = [];
14651465
for (const f of data) {
14661466
if (f.value === undefined) {
1467-
fields.push(f);
1467+
const { key, label, format, hidden } = f;
1468+
fields.push({ key, label, format, hidden });
14681469
} else if (f.key === undefined) {
14691470
// extra check to placate Flow
14701471
staticFields.push(f);

src/profile-logic/processed-profile-versioning.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,6 +2594,15 @@ const _upgraders = {
25942594
}
25952595
profile.shared = { stringArray };
25962596
},
2597+
[57]: (profile) => {
2598+
// The "searchable" property for fields in the marker schema was removed again.
2599+
// Now all marker fields are searchable.
2600+
for (const schema of profile.meta.markerSchema) {
2601+
for (const field of schema.fields) {
2602+
delete field.searchable;
2603+
}
2604+
}
2605+
},
25972606
// If you add a new upgrader here, please document the change in
25982607
// `docs-developer/CHANGELOG-formats.md`.
25992608
};

src/test/components/TrackCustomMarker.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ function setup() {
6060
name: 'Marker',
6161
display: ['marker-chart', 'marker-table', 'timeline-memory'],
6262
fields: [
63-
{ key: 'first', label: 'first', format: 'integer', searchable: true },
64-
{ key: 'second', label: 'second', format: 'integer', searchable: true },
63+
{ key: 'first', label: 'first', format: 'integer' },
64+
{ key: 'second', label: 'second', format: 'integer' },
6565
],
6666
graphs: [
6767
// multiple lines are supported

src/test/components/__snapshots__/MenuButtons.test.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`app/MenuButtons <MetaInfoPanel> deleting a profile clicking on the button shows the confirmation 1`] = `
44
<div
@@ -2211,7 +2211,7 @@ exports[`app/MenuButtons <Publish> matches the snapshot for the menu buttons and
22112211
class="menuButtonsDownloadSize"
22122212
>
22132213
(
2214-
1.63 kB
2214+
1.58 kB
22152215
)
22162216
</span>
22172217
</a>
@@ -2329,7 +2329,7 @@ exports[`app/MenuButtons <Publish> matches the snapshot for the opened panel for
23292329
class="menuButtonsDownloadSize"
23302330
>
23312331
(
2332-
1.61 kB
2332+
1.56 kB
23332333
)
23342334
</span>
23352335
</a>
@@ -2442,7 +2442,7 @@ exports[`app/MenuButtons <Publish> matches the snapshot for the opened panel for
24422442
class="menuButtonsDownloadSize"
24432443
>
24442444
(
2445-
1.63 kB
2445+
1.58 kB
24462446
)
24472447
</span>
24482448
</a>

0 commit comments

Comments
 (0)