Bug 1354961 - Disable main thread asserts and some other main thread stuff when serializing the profile.
MozReview-Commit-ID: 4huZbbPRjiY
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -1172,43 +1172,41 @@ StreamTaskTracer(PS::LockRef aLock, Spli
aWriter.DoubleProperty(
"start", static_cast<double>(mozilla::tasktracer::GetStartTime()));
#endif
}
static void
StreamMetaJSCustomObject(PS::LockRef aLock, SpliceableJSONWriter& aWriter)
{
- MOZ_RELEASE_ASSERT(NS_IsMainThread());
-
aWriter.IntProperty("version", 5);
aWriter.DoubleProperty("interval", gPS->Interval(aLock));
aWriter.IntProperty("stackwalk", gPS->FeatureStackWalk(aLock));
#ifdef DEBUG
aWriter.IntProperty("debug", 1);
#else
aWriter.IntProperty("debug", 0);
#endif
- aWriter.IntProperty("gcpoison", JS::IsGCPoisoning() ? 1 : 0);
-
- bool asyncStacks = Preferences::GetBool("javascript.options.asyncstack");
- aWriter.IntProperty("asyncstack", asyncStacks);
+ // aWriter.IntProperty("gcpoison", JS::IsGCPoisoning() ? 1 : 0);
+
+ // bool asyncStacks = Preferences::GetBool("javascript.options.asyncstack");
+ // aWriter.IntProperty("asyncstack", asyncStacks);
// The "startTime" field holds the number of milliseconds since midnight
// January 1, 1970 GMT. This grotty code computes (Now - (Now - StartTime))
// to convert gPS->StartTime() into that form.
mozilla::TimeDuration delta =
mozilla::TimeStamp::Now() - gPS->StartTime(aLock);
aWriter.DoubleProperty(
"startTime", static_cast<double>(PR_Now()/1000.0 - delta.ToMilliseconds()));
aWriter.IntProperty("processType", XRE_GetProcessType());
-
+/*
nsresult res;
nsCOMPtr<nsIHttpProtocolHandler> http =
do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &res);
if (!NS_FAILED(res)) {
nsAutoCString string;
res = http->GetPlatform(string);
@@ -1243,17 +1241,17 @@ StreamMetaJSCustomObject(PS::LockRef aLo
nsCOMPtr<nsIXULAppInfo> appInfo =
do_GetService("@mozilla.org/xre/app-info;1");
if (appInfo) {
nsAutoCString string;
res = appInfo->GetName(string);
if (!NS_FAILED(res))
aWriter.StringProperty("product", string.Data());
- }
+ }*/
}
#if defined(PROFILE_JAVA)
static void
BuildJavaThreadJSObject(SpliceableJSONWriter& aWriter)
{
aWriter.StringProperty("name", "Java Main Thread");
@@ -1306,17 +1304,16 @@ BuildJavaThreadJSObject(SpliceableJSONWr
}
#endif
static void
locked_profiler_stream_json_for_this_process(PS::LockRef aLock, SpliceableJSONWriter& aWriter, double aSinceTime)
{
LOG("locked_profiler_stream_json_for_this_process");
- MOZ_RELEASE_ASSERT(NS_IsMainThread());
MOZ_RELEASE_ASSERT(gPS && gPS->IsActive(aLock));
// Put shared library info
aWriter.StartArrayProperty("libs");
AppendSharedLibraries(aWriter);
aWriter.EndArray();
// Put meta data
@@ -1374,17 +1371,16 @@ locked_profiler_stream_json_for_this_pro
aWriter.EndArray();
}
bool
profiler_stream_json_for_this_process(SpliceableJSONWriter& aWriter, double aSinceTime)
{
LOG("locked_profiler_stream_json_for_this_process");
- MOZ_RELEASE_ASSERT(NS_IsMainThread());
MOZ_RELEASE_ASSERT(gPS);
PS::AutoLock lock(gPSMutex);
if (!gPS->IsActive(lock)) {
return false;
}