Bug 1196845 - Fix invalid JSON in saved Java thread profile; r=BenWa
authorJim Chen <nchen@mozilla.com>
Tue, 25 Aug 2015 14:52:16 -0400
changeset 259309 55f940d8b0f287f43fa87d0cfbd567227991b84f
parent 259301 d09ccffbeb17c033e9a235cd508a6352f48fd14c
child 259310 e25900da1968b1d1ba047245f6b97ecd11a30b6d
push id29277
push userryanvm@gmail.com
push dateWed, 26 Aug 2015 18:32:23 +0000
treeherdermozilla-central@fea87cbeaa6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa
bugs1196845
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1196845 - Fix invalid JSON in saved Java thread profile; r=BenWa Saved Java thread profiles are missing a pair of braces. As a result, the output is invalid JSON.
tools/profiler/core/GeckoSampler.cpp
--- a/tools/profiler/core/GeckoSampler.cpp
+++ b/tools/profiler/core/GeckoSampler.cpp
@@ -544,17 +544,21 @@ void GeckoSampler::StreamJSON(Spliceable
           os->NotifyObservers(pse, "profiler-subprocess", nullptr);
         }
       }
 
   #if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
       if (ProfileJava()) {
         mozilla::widget::GeckoJavaSampler::PauseJavaProfiling();
 
-        BuildJavaThreadJSObject(aWriter);
+        aWriter.Start();
+        {
+          BuildJavaThreadJSObject(aWriter);
+        }
+        aWriter.End();
 
         mozilla::widget::GeckoJavaSampler::UnpauseJavaProfiling();
       }
   #endif
 #endif
 
       SetPaused(false);
     }