Bug 1692934 - Record meta.profilingEndTime in each process - r=canaltinova

This profilingEndTime is the time when this property is actually written, which
corresponds to the end of the profiling session.
If it's a shutdown profile, the exact same time is used for the existing
`meta.shutdownTime` property.

Depends on D151355

Differential Revision: https://phabricator.services.mozilla.com/D151356
This commit is contained in:
Gerald Squelart 2022-07-08 14:23:37 +00:00
parent 29a5385f1e
commit 12a671a4c4
3 changed files with 9 additions and 2 deletions

View file

@ -1871,8 +1871,11 @@ static void StreamMetaJSCustomObject(PSLockRef aLock,
aWriter.NullProperty("contentEarliestTime");
}
const double profilingEndTime = profiler_time();
aWriter.DoubleProperty("profilingEndTime", profilingEndTime);
if (aIsShuttingDown) {
aWriter.DoubleProperty("shutdownTime", profiler_time());
aWriter.DoubleProperty("shutdownTime", profilingEndTime);
} else {
aWriter.NullProperty("shutdownTime");
}

View file

@ -2805,8 +2805,11 @@ static void StreamMetaJSCustomObject(
aWriter.NullProperty("contentEarliestTime");
}
const double profilingEndTime = profiler_time();
aWriter.DoubleProperty("profilingEndTime", profilingEndTime);
if (aIsShuttingDown) {
aWriter.DoubleProperty("shutdownTime", profiler_time());
aWriter.DoubleProperty("shutdownTime", profilingEndTime);
} else {
aWriter.NullProperty("shutdownTime");
}

View file

@ -1380,6 +1380,7 @@ static void JSONRootCheck(const Json::Value& aRoot,
EXPECT_HAS_JSON(meta["startTime"], Double);
EXPECT_HAS_JSON(meta["profilingStartTime"], Double);
EXPECT_HAS_JSON(meta["contentEarliestTime"], Double);
EXPECT_HAS_JSON(meta["profilingEndTime"], Double);
EXPECT_HAS_JSON(aRoot["pages"], Array);