Skip to content

Commit

Permalink
Bug 1615546 - Remove the optimizations field from profiler frame tabl…
Browse files Browse the repository at this point in the history
…e r=julienw

This requires firefox-devtools/profiler#4432 to be
landed and deployed. We bump the profile version in this patch.

Afaik we never used the optimizations field of the frame table in the profiler
frontend and this pfield was null for more than 3 years (since Bug 1614622).
We don't have any plans to make use of it any time soon. It's good to cleanup
this field so it doesn't clutter the profile data and we can reduce the profile
data size.

Differential Revision: https://phabricator.services.mozilla.com/D167290
  • Loading branch information
canova committed Jan 24, 2023
1 parent 6ce716e commit 6cb27ee
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 29 deletions.
9 changes: 4 additions & 5 deletions mozglue/baseprofiler/core/ProfileBufferEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,10 @@ void UniqueStacks::StreamNonJITFrame(const FrameKey& aFrame) {
RELEVANT_FOR_JS = 1,
INNER_WINDOW_ID = 2,
IMPLEMENTATION = 3,
OPTIMIZATIONS = 4,
LINE = 5,
COLUMN = 6,
CATEGORY = 7,
SUBCATEGORY = 8
LINE = 4,
COLUMN = 5,
CATEGORY = 6,
SUBCATEGORY = 7
};

AutoArraySchemaWithStringsWriter writer(mFrameTableWriter, *mUniqueStrings);
Expand Down
9 changes: 4 additions & 5 deletions mozglue/baseprofiler/core/ProfileBufferEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,10 @@ class UniqueStacks {
// "relevantForJS": 1, /* bool */
// "innerWindowID": 2, /* inner window ID of global JS `window` object */
// "implementation": 3, /* index into stringTable */
// "optimizations": 4, /* arbitrary JSON */
// "line": 5, /* number */
// "column": 6, /* number */
// "category": 7, /* index into profile.meta.categories */
// "subcategory": 8 /* index into
// "line": 4, /* number */
// "column": 5, /* number */
// "category": 6, /* index into profile.meta.categories */
// "subcategory": 7 /* index into
// profile.meta.categories[category].subcategories */
// },
// "data":
Expand Down
1 change: 0 additions & 1 deletion mozglue/baseprofiler/core/ProfiledThreadData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ void ProfiledThreadData::StreamJSON(const ProfileBuffer& aBuffer,
schema.WriteField("relevantForJS");
schema.WriteField("innerWindowID");
schema.WriteField("implementation");
schema.WriteField("optimizations");
schema.WriteField("line");
schema.WriteField("column");
schema.WriteField("category");
Expand Down
2 changes: 1 addition & 1 deletion mozglue/baseprofiler/core/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1841,7 +1841,7 @@ static void StreamMetaJSCustomObject(PSLockRef aLock,
bool aIsShuttingDown) {
MOZ_RELEASE_ASSERT(CorePS::Exists() && ActivePS::Exists(aLock));

aWriter.IntProperty("version", 26);
aWriter.IntProperty("version", 27);

// The "startTime" field holds the number of milliseconds since midnight
// January 1, 1970 GMT. This grotty code computes (Now - (Now -
Expand Down
18 changes: 8 additions & 10 deletions tools/profiler/core/ProfileBufferEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,10 @@ void UniqueStacks::StreamNonJITFrame(const FrameKey& aFrame) {
RELEVANT_FOR_JS = 1,
INNER_WINDOW_ID = 2,
IMPLEMENTATION = 3,
OPTIMIZATIONS = 4,
LINE = 5,
COLUMN = 6,
CATEGORY = 7,
SUBCATEGORY = 8
LINE = 4,
COLUMN = 5,
CATEGORY = 6,
SUBCATEGORY = 7
};

AutoArraySchemaWithStringsWriter writer(mFrameTableWriter, *mUniqueStrings);
Expand Down Expand Up @@ -538,11 +537,10 @@ static void StreamJITFrame(JSContext* aContext, SpliceableJSONWriter& aWriter,
RELEVANT_FOR_JS = 1,
INNER_WINDOW_ID = 2,
IMPLEMENTATION = 3,
OPTIMIZATIONS = 4,
LINE = 5,
COLUMN = 6,
CATEGORY = 7,
SUBCATEGORY = 8
LINE = 4,
COLUMN = 5,
CATEGORY = 6,
SUBCATEGORY = 7
};

AutoArraySchemaWithStringsWriter writer(aWriter, aUniqueStrings);
Expand Down
9 changes: 4 additions & 5 deletions tools/profiler/core/ProfileBufferEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,10 @@ class UniqueStacks final : public mozilla::FailureLatch {
// "relevantForJS": 1, /* bool */
// "innerWindowID": 2, /* inner window ID of global JS `window` object */
// "implementation": 3, /* index into stringTable */
// "optimizations": 4, /* arbitrary JSON */
// "line": 5, /* number */
// "column": 6, /* number */
// "category": 7, /* index into profile.meta.categories */
// "subcategory": 8 /* index into
// "line": 4, /* number */
// "column": 5, /* number */
// "category": 6, /* index into profile.meta.categories */
// "subcategory": 7 /* index into
// profile.meta.categories[category].subcategories */
// },
// "data":
Expand Down
1 change: 0 additions & 1 deletion tools/profiler/core/ProfiledThreadData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ static void StreamTables(UniqueStacks&& aUniqueStacks, JSContext* aCx,
schema.WriteField("relevantForJS");
schema.WriteField("innerWindowID");
schema.WriteField("implementation");
schema.WriteField("optimizations");
schema.WriteField("line");
schema.WriteField("column");
schema.WriteField("category");
Expand Down
2 changes: 1 addition & 1 deletion tools/profiler/core/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2810,7 +2810,7 @@ static void StreamMetaJSCustomObject(
const PreRecordedMetaInformation& aPreRecordedMetaInformation) {
MOZ_RELEASE_ASSERT(CorePS::Exists() && ActivePS::Exists(aLock));

aWriter.IntProperty("version", 26);
aWriter.IntProperty("version", 27);

// The "startTime" field holds the number of milliseconds since midnight
// January 1, 1970 GMT. This grotty code computes (Now - (Now -
Expand Down

0 comments on commit 6cb27ee

Please sign in to comment.