Bug 1337189 (part 21) - Remove Sampler::SizeOfIncludingThis(). r=mstange.

This commit is contained in:
Nicholas Nethercote 2017-02-09 15:00:29 +11:00
Родитель 7976b574cf
Коммит ead0668be5
4 изменённых файлов: 23 добавлений и 38 удалений

Просмотреть файл

@ -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);
};