Bug 1598992 - Use same thread names in Base Profiler filter as in Gecko, and suffix with "(pre-xul)" in JSON - r=gregtatum

The Base Profiler originally named the main thread "Main Thread", which is
friendlier than "GeckoMain". However this makes it more difficult to combine the
controls for both profilers if they use different names.

So now both profilers use "GeckoMain", so filters can be exactly the same.
Base Profiler adds "(pre-xul)" to the name to distinguish tracks in the
frontend -- This distinction is actually necessary so the frontend doesn't get
confused by threads with the exact same name, but eventually tracks will get
combined in the frontend as well.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gerald Squelart 2019-11-26 11:27:45 +00:00
Родитель 0311154503
Коммит 65a045f543
2 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -94,7 +94,17 @@ void StreamSamplesAndMarkers(const char* aName, int aThreadId,
"processType",
"(unknown)" /* XRE_GeckoProcessTypeToString(XRE_GetProcessType()) */);
aWriter.StringProperty("name", aName);
{
std::string name = aName;
// We currently need to distinguish threads output by Base Profiler from
// those in Gecko Profiler, as the frontend could get confused and lose
// tracks with the same name.
// TODO: As part of the profilers de-duplication, thread data from both
// profilers should end up in the same track, at which point this won't be
// necessary anymore. See meta bug 1557566.
name += " (pre-xul)";
aWriter.StringProperty("name", name.c_str());
}
// Use given process name (if any).
if (!aProcessName.empty()) {

Просмотреть файл

@ -1047,7 +1047,7 @@ ProfilingStack* AutoProfilerLabel::GetProfilingStack() {
MOZ_THREAD_LOCAL(ProfilingStack*) AutoProfilerLabel::sProfilingStack;
// The name of the main thread.
static const char* const kMainThreadName = "Main Thread (Base Profiler)";
static const char* const kMainThreadName = "GeckoMain";
////////////////////////////////////////////////////////////////////////
// BEGIN sampling/unwinding code