зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1807011 - Do not call TimeStamp::Now for text markers when profiler is not running r=julienw
Differential Revision: https://phabricator.services.mozilla.com/D166804
This commit is contained in:
Родитель
114a9dd6fc
Коммит
3894ab42c2
|
@ -203,17 +203,20 @@ class MOZ_RAII AutoProfilerTextMarker {
|
|||
mText(aText) {
|
||||
MOZ_ASSERT(mOptions.Timing().EndTime().IsNull(),
|
||||
"AutoProfilerTextMarker options shouldn't have an end time");
|
||||
if (mOptions.Timing().StartTime().IsNull()) {
|
||||
if (profiler_is_active_and_unpaused() &&
|
||||
mOptions.Timing().StartTime().IsNull()) {
|
||||
mOptions.Set(MarkerTiming::InstantNow());
|
||||
}
|
||||
}
|
||||
|
||||
~AutoProfilerTextMarker() {
|
||||
if (profiler_is_active_and_unpaused()) {
|
||||
mOptions.TimingRef().SetIntervalEnd();
|
||||
AUTO_PROFILER_STATS(AUTO_BASE_PROFILER_MARKER_TEXT);
|
||||
AddMarker(ProfilerString8View::WrapNullTerminatedString(mMarkerName),
|
||||
mCategory, std::move(mOptions), markers::TextMarker{}, mText);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
const char* mMarkerName;
|
||||
|
|
|
@ -216,12 +216,14 @@ class MOZ_RAII AutoProfilerTextMarker {
|
|||
mText(aText) {
|
||||
MOZ_ASSERT(mOptions.Timing().EndTime().IsNull(),
|
||||
"AutoProfilerTextMarker options shouldn't have an end time");
|
||||
if (mOptions.Timing().StartTime().IsNull()) {
|
||||
if (profiler_is_active_and_unpaused() &&
|
||||
mOptions.Timing().StartTime().IsNull()) {
|
||||
mOptions.Set(mozilla::MarkerTiming::InstantNow());
|
||||
}
|
||||
}
|
||||
|
||||
~AutoProfilerTextMarker() {
|
||||
if (profiler_is_active_and_unpaused()) {
|
||||
AUTO_PROFILER_LABEL("TextMarker", PROFILER);
|
||||
mOptions.TimingRef().SetIntervalEnd();
|
||||
AUTO_PROFILER_STATS(AUTO_PROFILER_MARKER_TEXT);
|
||||
|
@ -230,6 +232,7 @@ class MOZ_RAII AutoProfilerTextMarker {
|
|||
mCategory, std::move(mOptions), geckoprofiler::markers::TextMarker{},
|
||||
mText);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
const char* mMarkerName;
|
||||
|
|
Загрузка…
Ссылка в новой задаче