зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1435091 - p4. Use profiler_thread_is_being_profiled() instead of profiler_is_active() around profiler_add_marker()s - r=mstange
(Unless there were other profiler actions, as I'm not sure yet whether it would be safe to skip them when the profiler is paused; another bug should investigate that.) Differential Revision: https://phabricator.services.mozilla.com/D11308 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
bd8d839a26
Коммит
1bd6a1fd4e
|
@ -864,7 +864,7 @@ Accessible::HandleAccEvent(AccEvent* aEvent)
|
|||
NS_ENSURE_ARG_POINTER(aEvent);
|
||||
|
||||
#ifdef MOZ_GECKO_PROFILER
|
||||
if (profiler_is_active()) {
|
||||
if (profiler_thread_is_being_profiled()) {
|
||||
nsAutoCString strEventType;
|
||||
GetAccService()->GetStringEventType(aEvent->GetEventType(), strEventType);
|
||||
nsAutoCString strMarker;
|
||||
|
|
|
@ -387,7 +387,7 @@ nsDOMNavigationTiming::NotifyNonBlankPaintForRootContentDocument()
|
|||
mNonBlankPaint = TimeStamp::Now();
|
||||
|
||||
#ifdef MOZ_GECKO_PROFILER
|
||||
if (profiler_is_active()) {
|
||||
if (profiler_thread_is_being_profiled()) {
|
||||
TimeDuration elapsed = mNonBlankPaint - mNavigationStart;
|
||||
nsAutoCString spec;
|
||||
if (mLoadedURI) {
|
||||
|
@ -466,7 +466,7 @@ nsDOMNavigationTiming::NotifyDOMContentFlushedForRootContentDocument()
|
|||
mDOMContentFlushed = TimeStamp::Now();
|
||||
|
||||
#ifdef MOZ_GECKO_PROFILER
|
||||
if (profiler_is_active()) {
|
||||
if (profiler_thread_is_being_profiled()) {
|
||||
TimeDuration elapsed = mDOMContentFlushed - mNavigationStart;
|
||||
nsAutoCString spec;
|
||||
if (mLoadedURI) {
|
||||
|
|
|
@ -292,7 +292,7 @@ LoggingHelper(bool aUseProfiler, const char* aFmt, ...)
|
|||
|
||||
if (MOZ_LOG_TEST(logModule, logLevel) ||
|
||||
#ifdef MOZ_GECKO_PROFILER
|
||||
(aUseProfiler && profiler_is_active())
|
||||
(aUseProfiler && profiler_thread_is_being_profiled())
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
|
|
|
@ -86,7 +86,7 @@ static void
|
|||
PrintUniformityInfo(Layer* aLayer)
|
||||
{
|
||||
#if defined(MOZ_GECKO_PROFILER)
|
||||
if (!profiler_is_active()) {
|
||||
if (!profiler_thread_is_being_profiled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -2076,9 +2076,11 @@ static void
|
|||
InsertVsyncProfilerMarker(TimeStamp aVsyncTimestamp)
|
||||
{
|
||||
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
|
||||
profiler_add_marker(
|
||||
"VsyncTimestamp",
|
||||
MakeUnique<VsyncMarkerPayload>(aVsyncTimestamp));
|
||||
if (profiler_thread_is_being_profiled()) {
|
||||
profiler_add_marker(
|
||||
"VsyncTimestamp",
|
||||
MakeUnique<VsyncMarkerPayload>(aVsyncTimestamp));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ using namespace mozilla;
|
|||
|
||||
void ProfilerIOInterposeObserver::Observe(Observation& aObservation)
|
||||
{
|
||||
if (!IsMainThread()) {
|
||||
if (!IsMainThread() || !profiler_thread_is_being_profiled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -839,7 +839,7 @@ CycleCollectedJSRuntime::GCSliceCallback(JSContext* aContext,
|
|||
MOZ_ASSERT(CycleCollectedJSContext::Get()->Context() == aContext);
|
||||
|
||||
#ifdef MOZ_GECKO_PROFILER
|
||||
if (profiler_is_active()) {
|
||||
if (profiler_thread_is_being_profiled()) {
|
||||
if (aProgress == JS::GC_CYCLE_END) {
|
||||
profiler_add_marker(
|
||||
"GCMajor",
|
||||
|
@ -940,7 +940,7 @@ CycleCollectedJSRuntime::GCNurseryCollectionCallback(JSContext* aContext,
|
|||
}
|
||||
#ifdef MOZ_GECKO_PROFILER
|
||||
else if (aProgress == JS::GCNurseryProgress::GC_NURSERY_COLLECTION_END &&
|
||||
profiler_is_active())
|
||||
profiler_thread_is_being_profiled())
|
||||
{
|
||||
profiler_add_marker(
|
||||
"GCMinor",
|
||||
|
|
|
@ -1255,7 +1255,7 @@ nsThread::ProcessNextEvent(bool aMayWait, bool* aResult)
|
|||
}
|
||||
mLastLongTaskEnd = now;
|
||||
#ifdef MOZ_GECKO_PROFILER
|
||||
if (profiler_is_active()) {
|
||||
if (profiler_thread_is_being_profiled()) {
|
||||
profiler_add_marker(
|
||||
(priority != EventPriority::Idle) ? "LongTask" : "LongIdleTask",
|
||||
MakeUnique<LongTaskMarkerPayload>(mCurrentEventStart, now));
|
||||
|
|
Загрузка…
Ссылка в новой задаче