mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 1417976 - Part 3: Stream the DocShell list and DocShellId marker data to profile data r=mstange
MozReview-Commit-ID: G2s5H8i4p6E Depends on D4915 Differential Revision: https://phabricator.services.mozilla.com/D4916 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
ed3240c681
commit
5ea5fccd29
@ -25,6 +25,17 @@ return DocShellHistoryId() == aOtherPageInfo->DocShellHistoryId() &&
|
||||
IsSubFrame() == aOtherPageInfo->IsSubFrame();
|
||||
}
|
||||
|
||||
void
|
||||
PageInformation::StreamJSON(SpliceableJSONWriter& aWriter)
|
||||
{
|
||||
aWriter.StartObjectElement();
|
||||
aWriter.StringProperty("docshellId", nsIDToCString(DocShellId()).get());
|
||||
aWriter.DoubleProperty("historyId", DocShellHistoryId());
|
||||
aWriter.StringProperty("url", Url().get());
|
||||
aWriter.BoolProperty("isSubFrame", IsSubFrame());
|
||||
aWriter.EndObject();
|
||||
}
|
||||
|
||||
size_t
|
||||
PageInformation::SizeOfIncludingThis(
|
||||
mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
|
@ -30,6 +30,7 @@ public:
|
||||
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
bool Equals(PageInformation* aOtherDocShellInfo);
|
||||
void StreamJSON(SpliceableJSONWriter& aWriter);
|
||||
|
||||
uint32_t DocShellHistoryId() { return mDocShellHistoryId; }
|
||||
const nsID& DocShellId() { return mDocShellId; }
|
||||
|
@ -43,6 +43,12 @@ ProfilerMarkerPayload::StreamCommonProps(const char* aMarkerType,
|
||||
StreamType(aMarkerType, aWriter);
|
||||
WriteTime(aWriter, aProcessStartTime, mStartTime, "startTime");
|
||||
WriteTime(aWriter, aProcessStartTime, mEndTime, "endTime");
|
||||
if (mDocShellId) {
|
||||
aWriter.StringProperty("docShellId", nsIDToCString(*mDocShellId).get());
|
||||
}
|
||||
if (mDocShellHistoryId) {
|
||||
aWriter.DoubleProperty("docshellHistoryId", mDocShellHistoryId.ref());
|
||||
}
|
||||
if (mStack) {
|
||||
aWriter.StartObjectProperty("stack");
|
||||
{
|
||||
|
@ -1890,6 +1890,16 @@ StreamMetaJSCustomObject(PSLockRef aLock, SpliceableJSONWriter& aWriter,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
StreamPages(PSLockRef aLock, SpliceableJSONWriter& aWriter)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(CorePS::Exists());
|
||||
ActivePS::DiscardExpiredPages(aLock);
|
||||
for (const auto& page : ActivePS::ProfiledPages(aLock)) {
|
||||
page->StreamJSON(aWriter);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(GP_OS_android)
|
||||
static UniquePtr<ProfileBuffer>
|
||||
CollectJavaThreadProfileData()
|
||||
@ -1966,6 +1976,13 @@ locked_profiler_stream_json_for_this_process(PSLockRef aLock,
|
||||
}
|
||||
aWriter.EndObject();
|
||||
|
||||
// Put page data
|
||||
aWriter.StartArrayProperty("pages");
|
||||
{
|
||||
StreamPages(aLock, aWriter);
|
||||
}
|
||||
aWriter.EndArray();
|
||||
|
||||
buffer.StreamCountersToJSON(aWriter, CorePS::ProcessStartTime(), aSinceTime);
|
||||
buffer.StreamMemoryToJSON(aWriter, CorePS::ProcessStartTime(), aSinceTime);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user