Remove the Dark Matter Detector (DMD) Memeory debugger component.

This resolves #376.
This commit is contained in:
wolfbeast 2018-05-23 16:31:42 +02:00 committed by Roy Tam
commit 92fbd042f5
55 changed files with 6 additions and 6544 deletions

View file

@ -42,11 +42,6 @@
#include <dlfcn.h>
#endif
#ifdef MOZ_DMD
#include "base/process_util.h"
#include "nsMemoryInfoDumper.h"
#endif
////////////////////////////////////////////////////////////////////////////////
#include "plhash.h"
@ -936,39 +931,6 @@ NS_LogTerm()
mozilla::LogTerm();
}
#ifdef MOZ_DMD
// If MOZ_DMD_SHUTDOWN_LOG is set, dump a DMD report to a file.
// The value of this environment variable is used as the prefix
// of the file name, so you probably want something like "/tmp/".
// By default, this is run in all processes, but you can record a
// log only for a specific process type by setting MOZ_DMD_LOG_PROCESS
// to the process type you want to log, such as "default" or "tab".
// This method can't use the higher level XPCOM file utilities
// because it is run very late in shutdown to avoid recording
// information about refcount logging entries.
static void
LogDMDFile()
{
const char* dmdFilePrefix = PR_GetEnv("MOZ_DMD_SHUTDOWN_LOG");
if (!dmdFilePrefix) {
return;
}
const char* logProcessEnv = PR_GetEnv("MOZ_DMD_LOG_PROCESS");
if (logProcessEnv && !!strcmp(logProcessEnv, XRE_ChildProcessTypeToString(XRE_GetProcessType()))) {
return;
}
nsPrintfCString fileName("%sdmd-%d.log.gz", dmdFilePrefix, base::GetCurrentProcId());
FILE* logFile = fopen(fileName.get(), "w");
if (NS_WARN_IF(!logFile)) {
return;
}
nsMemoryInfoDumper::DumpDMDToFile(logFile);
}
#endif // MOZ_DMD
namespace mozilla {
void
LogTerm()
@ -1000,10 +962,6 @@ LogTerm()
nsTraceRefcnt::Shutdown();
nsTraceRefcnt::SetActivityIsLegal(false);
gActivityTLS = BAD_TLS_INDEX;
#ifdef MOZ_DMD
LogDMDFile();
#endif
}
}