Skip to content

Commit

Permalink
Bug 1609674 - Add innerWindowID param to AUTO_PROFILER_TEXT_MARKER_CA…
Browse files Browse the repository at this point in the history
…USE and use that macro for setTimeout callback marker. r=gerald

Differential Revision: https://phabricator.services.mozilla.com/D60270

--HG--
extra : moz-landing-system : lando
  • Loading branch information
canova committed Jan 20, 2020
1 parent f76aad2 commit f70859c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
7 changes: 3 additions & 4 deletions dom/base/nsGlobalWindowInner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5873,7 +5873,6 @@ bool nsGlobalWindowInner::RunTimeoutHandler(Timeout* aTimeout,

#ifdef MOZ_GECKO_PROFILER
if (profiler_can_accept_markers()) {
nsCOMPtr<nsIDocShell> docShell = GetDocShell();
nsCString str;
TimeDuration originalInterval = timeout->When() - timeout->SubmitTime();
str.Append(reason);
Expand All @@ -5883,9 +5882,9 @@ bool nsGlobalWindowInner::RunTimeoutHandler(Timeout* aTimeout,
nsCString handlerDescription;
timeout->mScriptHandler->GetDescription(handlerDescription);
str.Append(handlerDescription);
AUTO_PROFILER_TEXT_MARKER_DOCSHELL_CAUSE("setTimeout callback", str, JS,
docShell,
timeout->TakeProfilerBacktrace());
AUTO_PROFILER_TEXT_MARKER_CAUSE("setTimeout callback", str, JS,
Some(mWindowID),
timeout->TakeProfilerBacktrace());
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions js/xpconnect/loader/mozJSComponentLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ const mozilla::Module* mozJSComponentLoader::LoadModule(FileLocation& aFile) {
}
}

AUTO_PROFILER_TEXT_MARKER_CAUSE("JS XPCOM", spec, JS,
AUTO_PROFILER_TEXT_MARKER_CAUSE("JS XPCOM", spec, JS, Nothing(),
profiler_get_backtrace());
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING("mozJSComponentLoader::LoadModule",
OTHER, spec);
Expand Down Expand Up @@ -1293,7 +1293,7 @@ nsresult mozJSComponentLoader::Import(JSContext* aCx,
}

AUTO_PROFILER_TEXT_MARKER_CAUSE("ChromeUtils.import", aLocation, JS,
profiler_get_backtrace());
Nothing(), profiler_get_backtrace());

ComponentLoaderInfo info(aLocation);

Expand Down
2 changes: 1 addition & 1 deletion js/xpconnect/loader/mozJSSubScriptLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ nsresult mozJSSubScriptLoader::DoLoadSubScriptWithOptions(
}

NS_LossyConvertUTF16toASCII asciiUrl(url);
AUTO_PROFILER_TEXT_MARKER_CAUSE("SubScript", asciiUrl, JS,
AUTO_PROFILER_TEXT_MARKER_CAUSE("SubScript", asciiUrl, JS, Nothing(),
profiler_get_backtrace());
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING_NONSENSITIVE(
"mozJSSubScriptLoader::DoLoadSubScriptWithOptions", OTHER, asciiUrl);
Expand Down
7 changes: 4 additions & 3 deletions tools/profiler/public/GeckoProfiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
# define AUTO_PROFILER_TRACING_MARKER(categoryString, markerName, categoryPair)
# define AUTO_PROFILER_TRACING_MARKER_DOCSHELL(categoryString, markerName, \
categoryPair, docShell)
# define AUTO_PROFILER_TEXT_MARKER_CAUSE(markerName, text, categoryPair, cause)
# define AUTO_PROFILER_TEXT_MARKER_CAUSE(markerName, text, categoryPair, \
innerWindowID, cause)
# define AUTO_PROFILER_TEXT_MARKER_DOCSHELL(markerName, text, categoryPair, \
docShell)
# define AUTO_PROFILER_TEXT_MARKER_DOCSHELL_CAUSE( \
Expand Down Expand Up @@ -933,10 +934,10 @@ class MOZ_RAII AutoProfilerTextMarker {
};

# define AUTO_PROFILER_TEXT_MARKER_CAUSE(markerName, text, categoryPair, \
cause) \
innerWindowID, cause) \
AutoProfilerTextMarker PROFILER_RAII( \
markerName, text, JS::ProfilingCategoryPair::categoryPair, \
mozilla::Nothing(), cause)
innerWindowID, cause)

# define AUTO_PROFILER_TEXT_MARKER_DOCSHELL(markerName, text, categoryPair, \
docShell) \
Expand Down
2 changes: 1 addition & 1 deletion xpcom/ds/nsObserverService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ NS_IMETHODIMP nsObserverService::NotifyObservers(nsISupports* aSubject,
mozilla::TimeStamp start = TimeStamp::Now();

AUTO_PROFILER_TEXT_MARKER_CAUSE("NotifyObservers", nsDependentCString(aTopic),
OTHER, profiler_get_backtrace());
OTHER, Nothing(), profiler_get_backtrace());
AUTO_PROFILER_LABEL_DYNAMIC_CSTR_NONSENSITIVE(
"nsObserverService::NotifyObservers", OTHER, aTopic);

Expand Down

0 comments on commit f70859c

Please sign in to comment.