mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1726657 - Only record sampling overheads if MOZ_PROFILER_RECORD_OVERHEADS is set - r=florian
Sampling overheads are very rarely useful, but they occupy some space during profiling, but also a lot of space in the final JSON profile. So now they will only be recorded if the environment variable "MOZ_PROFILER_RECORD_OVERHEADS" is set to any non-empty value. Differential Revision: https://phabricator.services.mozilla.com/D123303
This commit is contained in:
parent
8d7a78b944
commit
1cf3bc392a
@ -161,12 +161,18 @@ void ProfileBuffer::CollectOverheadStats(TimeDuration aSamplingTime,
|
||||
mCountersUs.Count(countersUs);
|
||||
mThreadsUs.Count(threadsUs);
|
||||
|
||||
// Record details in buffer.
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadTime(timeUs));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(lockingUs));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(cleaningUs));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(countersUs));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(threadsUs));
|
||||
// Record details in buffer, if requested.
|
||||
static const bool sRecordSamplingOverhead = []() {
|
||||
const char* recordOverheads = getenv("MOZ_PROFILER_RECORD_OVERHEADS");
|
||||
return recordOverheads && recordOverheads[0] != '\0';
|
||||
}();
|
||||
if (sRecordSamplingOverhead) {
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadTime(timeUs));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(lockingUs));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(cleaningUs));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(countersUs));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(threadsUs));
|
||||
}
|
||||
}
|
||||
|
||||
ProfilerBufferInfo ProfileBuffer::GetProfilerBufferInfo() const {
|
||||
|
@ -156,11 +156,17 @@ void ProfileBuffer::CollectOverheadStats(double aSamplingTimeMs,
|
||||
mCountersUs.Count(counters);
|
||||
mThreadsUs.Count(threads);
|
||||
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadTime(aSamplingTimeMs));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(locking));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(cleaning));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(counters));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(threads));
|
||||
static const bool sRecordSamplingOverhead = []() {
|
||||
const char* recordOverheads = getenv("MOZ_PROFILER_RECORD_OVERHEADS");
|
||||
return recordOverheads && recordOverheads[0] != '\0';
|
||||
}();
|
||||
if (sRecordSamplingOverhead) {
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadTime(aSamplingTimeMs));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(locking));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(cleaning));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(counters));
|
||||
AddEntry(ProfileBufferEntry::ProfilerOverheadDuration(threads));
|
||||
}
|
||||
}
|
||||
|
||||
ProfilerBufferInfo ProfileBuffer::GetProfilerBufferInfo() const {
|
||||
|
Loading…
Reference in New Issue
Block a user