Bug 1526508 - add profiler markers for importing a JS module, loading a JS XPCOM component or a subscript r=mstange

Bug 1526508 - add profiler markers for importing a JS module, loading a JS XPCOM component or a subscript

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Florian Quèze 2019-02-11 17:53:22 +00:00
parent 8a104d860e
commit 5de09797c0
3 changed files with 14 additions and 2 deletions

View File

@ -395,6 +395,8 @@ const mozilla::Module* mozJSComponentLoader::LoadModule(FileLocation& aFile) {
}
}
AUTO_PROFILER_TEXT_MARKER_CAUSE("JS XPCOM", spec, JS,
profiler_get_backtrace());
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING("mozJSComponentLoader::LoadModule",
OTHER, spec);
@ -1268,8 +1270,9 @@ nsresult mozJSComponentLoader::Import(JSContext* aCx,
NS_ENSURE_SUCCESS(rv, rv);
}
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING("mozJSComponentLoader::Import", JS,
aLocation);
AUTO_PROFILER_TEXT_MARKER_CAUSE("ChromeUtils.import", aLocation, JS,
profiler_get_backtrace());
ComponentLoaderInfo info(aLocation);
rv = info.EnsureKey();

View File

@ -590,6 +590,8 @@ nsresult mozJSSubScriptLoader::DoLoadSubScriptWithOptions(
}
NS_LossyConvertUTF16toASCII asciiUrl(url);
AUTO_PROFILER_TEXT_MARKER_CAUSE("SubScript", asciiUrl, JS,
profiler_get_backtrace());
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING(
"mozJSSubScriptLoader::DoLoadSubScriptWithOptions", OTHER, asciiUrl);

View File

@ -60,6 +60,7 @@
# define AUTO_PROFILER_TRACING(categoryString, markerName, category)
# define AUTO_PROFILER_TRACING_DOCSHELL(categoryString, markerName, category, \
docShell)
# define AUTO_PROFILER_TEXT_MARKER_CAUSE(markerName, text, category, cause)
# define AUTO_PROFILER_TEXT_MARKER_DOCSHELL(markerName, text, category, \
docShell)
# define AUTO_PROFILER_TEXT_MARKER_DOCSHELL_CAUSE(markerName, text, category, \
@ -749,6 +750,12 @@ class MOZ_RAII AutoProfilerTextMarker {
const mozilla::Maybe<uint32_t> mDocShellHistoryId;
};
# define AUTO_PROFILER_TEXT_MARKER_CAUSE(markerName, text, category, \
cause) \
AutoProfilerTextMarker PROFILER_RAII( \
markerName, text, js::ProfilingStackFrame::Category::category, \
Nothing(), Nothing(), cause)
# define AUTO_PROFILER_TEXT_MARKER_DOCSHELL(markerName, text, category, \
docShell) \
DECLARE_DOCSHELL_AND_HISTORY_ID(docShell); \