Bug 1642677 - Remove the unneeded java sampler pause/unpause during the serialization. r=gerald
authorNazım Can Altınova <canaltinova@gmail.com>
Thu, 04 Jun 2020 09:34:32 +0000
changeset 597943 06661f12888f6f02682d60b387769d81c35ccf78
parent 597942 080cd03c38fd6f070cbc258dc8bd3077a356aeef
child 597944 91da551351b59af72d6fc571cfa55bf3dfff3316
push id13310
push userffxbld-merge
push dateMon, 29 Jun 2020 14:50:06 +0000
treeherdermozilla-beta@15a59a0afa5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1642677
milestone79.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 1642677 - Remove the unneeded java sampler pause/unpause during the serialization. r=gerald Now we are pausing the profiler just before capturing the profile data. Android sampler will never be running when this code is being run Depends on D78037 Differential Revision: https://phabricator.services.mozilla.com/D78038
tools/profiler/core/platform.cpp
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -2540,18 +2540,16 @@ static void locked_profiler_stream_json_
       profiledThreadData->StreamJSON(
           buffer, cx, aWriter, CorePS::ProcessName(aLock),
           CorePS::ProcessStartTime(), aSinceTime,
           ActivePS::FeatureJSTracer(aLock), aService);
     }
 
 #if defined(GP_OS_android)
     if (ActivePS::FeatureJava(aLock)) {
-      java::GeckoJavaSampler::Pause();
-
       // We are allocating it chunk by chunk. So this will not allocate 64 MiB
       // at once. This size should be more than enough for java threads.
       // This buffer is being created for each process but Android has
       // relatively less processes compared to desktop, so it's okay here.
       mozilla::ProfileBufferChunkManagerWithLocalLimit chunkManager(
           64 * 1024 * 1024, 1024 * 1024);
       ProfileChunkedBuffer bufferManager(
           ProfileChunkedBuffer::ThreadSafety::WithoutMutex, chunkManager);
@@ -2562,18 +2560,16 @@ static void locked_profiler_stream_json_
       // java thread, we have to get thread id and name via JNI.
       RefPtr<ThreadInfo> threadInfo = new ThreadInfo(
           "Java Main Thread", 0, false, CorePS::ProcessStartTime());
       ProfiledThreadData profiledThreadData(threadInfo, nullptr);
       profiledThreadData.StreamJSON(javaBuffer, nullptr, aWriter,
                                     CorePS::ProcessName(aLock),
                                     CorePS::ProcessStartTime(), aSinceTime,
                                     ActivePS::FeatureJSTracer(aLock), nullptr);
-
-      java::GeckoJavaSampler::Unpause();
     }
 #endif
 
     UniquePtr<char[]> baseProfileThreads =
         ActivePS::MoveBaseProfileThreads(aLock);
     if (baseProfileThreads) {
       aWriter.Splice(baseProfileThreads.get());
     }