Skip to content

Commit 0668888

Browse files
committed
Bug 1734262 - Stop registering the async process monitor thread with the profiler. r=gerald
This thread waits on a syscall for the completion of an asynchronously-spawned process. Since there's no general guarantee that Gecko will outlive the proccesses it spawns, this thread can continue running all the way up until the process terminates. And while we generally endeavor to have teardown logic join any spawned threads, we don't have an easy way to interrupt the platform-specific routines that the thread might be waiting on. That leaves us with instrumenting the profiler code to handle APIs arbitrarily late during shutdown (i.e. after static destructors have run), or simply not registering the thread with the profiler. The latter is much simpler, and doesn't cost us much because these threads never do any interesting computation, and thus aren't likely to be relevant to the profiler. This registration was added in bug 1323100, which was just a grep-driven activity which didn't identify any particular need for profiling this thread. Differential Revision: https://phabricator.services.mozilla.com/D128532
1 parent e2e3b7d commit 0668888

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

xpcom/threads/nsProcessCommon.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "nsIObserverService.h"
2626
#include "nsXULAppAPI.h"
2727
#include "mozilla/Services.h"
28-
#include "GeckoProfiler.h"
2928

3029
#include <stdlib.h>
3130

@@ -113,12 +112,6 @@ nsProcess::Init(nsIFile* aExecutable) {
113112
void nsProcess::Monitor(void* aArg) {
114113
RefPtr<nsProcess> process = dont_AddRef(static_cast<nsProcess*>(aArg));
115114

116-
#ifdef MOZ_GECKO_PROFILER
117-
Maybe<AutoProfilerRegisterThread> registerThread;
118-
if (!process->mBlocking) {
119-
registerThread.emplace("RunProcess");
120-
}
121-
#endif
122115
if (!process->mBlocking) {
123116
NS_SetCurrentThreadName("RunProcess");
124117
}

0 commit comments

Comments
 (0)