зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1337189 (part 21) - Remove Sampler::SizeOfIncludingThis(). r=mstange.
This commit is contained in:
Родитель
7976b574cf
Коммит
ead0668be5
|
@ -67,6 +67,7 @@ ProfileBuffer::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
|||
|
||||
// Measurement of the following members may be added later if DMD finds it
|
||||
// is worthwhile:
|
||||
// - memory pointed to by the elements within mEntries
|
||||
// - mStoredMarkers
|
||||
|
||||
return n;
|
||||
|
|
|
@ -569,27 +569,3 @@ Sampler::RegisterThread(ThreadInfo* aInfo)
|
|||
aInfo->SetProfile(gBuffer);
|
||||
}
|
||||
|
||||
size_t
|
||||
Sampler::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
|
||||
{
|
||||
StaticMutexAutoLock lock(sRegisteredThreadsMutex);
|
||||
|
||||
for (uint32_t i = 0; i < sRegisteredThreads->size(); i++) {
|
||||
ThreadInfo* info = sRegisteredThreads->at(i);
|
||||
|
||||
n += info->SizeOfIncludingThis(aMallocSizeOf);
|
||||
}
|
||||
}
|
||||
|
||||
// Measurement of the following members may be added later if DMD finds it
|
||||
// is worthwhile:
|
||||
// - memory pointed to by the elements within mBuffer
|
||||
// - sRegisteredThreads
|
||||
// - mThreadNameFilters
|
||||
// - mFeatures
|
||||
|
||||
return n;
|
||||
}
|
||||
|
|
|
@ -1116,29 +1116,39 @@ GeckoProfilerReporter::CollectReports(nsIHandleReportCallback* aHandleReport,
|
|||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (gSampler) {
|
||||
size_t n = gSampler->SizeOfIncludingThis(GeckoProfilerMallocSizeOf);
|
||||
MOZ_COLLECT_REPORT(
|
||||
"explicit/profiler/sampler", KIND_HEAP, UNITS_BYTES, n,
|
||||
"Memory used by the Gecko Profiler's Sampler object.");
|
||||
size_t n = 0;
|
||||
{
|
||||
StaticMutexAutoLock lock(sRegisteredThreadsMutex);
|
||||
|
||||
for (uint32_t i = 0; i < sRegisteredThreads->size(); i++) {
|
||||
ThreadInfo* info = sRegisteredThreads->at(i);
|
||||
|
||||
n += info->SizeOfIncludingThis(GeckoProfilerMallocSizeOf);
|
||||
}
|
||||
}
|
||||
MOZ_COLLECT_REPORT(
|
||||
"explicit/profiler/thread-info", KIND_HEAP, UNITS_BYTES, n,
|
||||
"Memory used by the Gecko Profiler's ThreadInfo objects.");
|
||||
|
||||
if (gBuffer) {
|
||||
size_t n = gBuffer->SizeOfIncludingThis(GeckoProfilerMallocSizeOf);
|
||||
n = gBuffer->SizeOfIncludingThis(GeckoProfilerMallocSizeOf);
|
||||
MOZ_COLLECT_REPORT(
|
||||
"explicit/profiler/profile-buffer", KIND_HEAP, UNITS_BYTES, n,
|
||||
"Memory used by the Gecko Profiler's ProfileBuffer object.");
|
||||
}
|
||||
|
||||
#if defined(USE_LUL_STACKWALK)
|
||||
{
|
||||
size_t n = sLUL ? sLUL->SizeOfIncludingThis(GeckoProfilerMallocSizeOf) : 0;
|
||||
MOZ_COLLECT_REPORT(
|
||||
"explicit/profiler/lul", KIND_HEAP, UNITS_BYTES, n,
|
||||
"Memory used by LUL, a stack unwinder used by the Gecko Profiler.");
|
||||
}
|
||||
n = sLUL ? sLUL->SizeOfIncludingThis(GeckoProfilerMallocSizeOf) : 0;
|
||||
MOZ_COLLECT_REPORT(
|
||||
"explicit/profiler/lul", KIND_HEAP, UNITS_BYTES, n,
|
||||
"Memory used by LUL, a stack unwinder used by the Gecko Profiler.");
|
||||
#endif
|
||||
|
||||
// Measurement of the following things may be added later if DMD finds it
|
||||
// is worthwhile:
|
||||
// - gThreadNameFilters
|
||||
// - gFeatures
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -243,8 +243,6 @@ public:
|
|||
void StreamMetaJSCustomObject(SpliceableJSONWriter& aWriter);
|
||||
void StreamTaskTracer(SpliceableJSONWriter& aWriter);
|
||||
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
void StreamJSON(SpliceableJSONWriter& aWriter, double aSinceTime);
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче