diff --git a/tools/profiler/core/ProfiledThreadData.cpp b/tools/profiler/core/ProfiledThreadData.cpp index 47abf1efcd83..67980b9603cb 100644 --- a/tools/profiler/core/ProfiledThreadData.cpp +++ b/tools/profiler/core/ProfiledThreadData.cpp @@ -6,6 +6,8 @@ #include "ProfiledThreadData.h" +#include "mozilla/dom/ContentChild.h" + #if defined(GP_OS_darwin) #include #endif @@ -124,6 +126,18 @@ StreamSamplesAndMarkers(const char* aName, XRE_ChildProcessTypeToString(XRE_GetProcessType())); aWriter.StringProperty("name", aName); + + if (XRE_IsParentProcess()) { + aWriter.StringProperty("processName", "Parent Process"); + } else if (dom::ContentChild* cc = dom::ContentChild::GetSingleton()) { + // Try to get the process name from ContentChild. + nsAutoCString processName; + cc->GetProcessName(processName); + if (!processName.IsEmpty()) { + aWriter.StringProperty("processName", processName.Data()); + } + } + aWriter.IntProperty("tid", static_cast(aThreadId)); aWriter.IntProperty("pid", static_cast(getpid()));