Bug 1447973 - Convert DOMEvent markers to tracing markers instead r?julienw
DOMEventMarkerPayload contains both start and end timestamps and we add it
once DOMEvent finishes. But if we take a snapshot while the event is still
running, we won't see it since we add DOMEventMarkerPayload only after event ends.
So we changed it to use tracing markers to be able to see running DOMEvents
in the profiler.
MozReview-Commit-ID: KOd9atsNQs9
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -1265,31 +1265,27 @@ EventListenerManager::HandleEventInterna
nsresult rv = NS_OK;
#ifdef MOZ_GECKO_PROFILER
if (profiler_is_active()) {
// Add a profiler label and a profiler marker for the actual
// dispatch of the event.
// This is a very hot code path, so we need to make sure not to
// do this extra work when we're not profiling.
- nsAutoString typeStr;
- (*aDOMEvent)->GetType(typeStr);
- AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING(
- "EventListenerManager::HandleEventInternal", EVENTS, typeStr);
- TimeStamp startTime = TimeStamp::Now();
+ profiler_add_marker(
+ "DOMEvent",
+ MakeUnique<TracingMarkerPayload>("EventListenerManager::HandleEventInternal",
+ TRACING_INTERVAL_START));
rv = HandleEventSubType(listener, *aDOMEvent, aCurrentTarget);
- TimeStamp endTime = TimeStamp::Now();
- uint16_t phase = (*aDOMEvent)->EventPhase();
profiler_add_marker(
"DOMEvent",
- MakeUnique<DOMEventMarkerPayload>(typeStr, phase,
- aEvent->mTimeStamp,
- startTime, endTime));
+ MakeUnique<TracingMarkerPayload>("EventListenerManager::HandleEventInternal",
+ TRACING_INTERVAL_END));
} else
#endif
{
rv = HandleEventSubType(listener, *aDOMEvent, aCurrentTarget);
}
if (NS_FAILED(rv)) {
aEvent->mFlags.mExceptionWasRaised = true;