mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Bug 819819 (part 1) - Remove DMDV. r=khuey.
--HG-- extra : rebase_source : af193a276409e33f0099d256cdfcd0f11917ea25
This commit is contained in:
parent
5b171dd30f
commit
efaf0192cb
21
configure.in
21
configure.in
@ -1713,21 +1713,6 @@ if test -n "$MOZ_VALGRIND"; then
|
||||
fi
|
||||
AC_SUBST(MOZ_VALGRIND)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Enable DMDV
|
||||
dnl ========================================================
|
||||
MOZ_ARG_ENABLE_BOOL(dmdv,
|
||||
[ --enable-dmdv Enable DMDV; also disables jemalloc (default=no)],
|
||||
MOZ_DMDV=1,
|
||||
MOZ_DMDV= )
|
||||
if test -n "$MOZ_DMDV"; then
|
||||
MOZ_CHECK_HEADER([valgrind/valgrind.h], [],
|
||||
AC_MSG_ERROR(
|
||||
[--enable-dmdv specified but Valgrind is not installed]))
|
||||
AC_DEFINE(MOZ_DMDV)
|
||||
fi
|
||||
AC_SUBST(MOZ_DMDV)
|
||||
|
||||
dnl ========================================================
|
||||
dnl jprof
|
||||
dnl ========================================================
|
||||
@ -7043,7 +7028,7 @@ dnl = Enable DMD
|
||||
dnl ========================================================
|
||||
|
||||
MOZ_ARG_ENABLE_BOOL(dmd,
|
||||
[ --enable-dmd Enable DMD; also enables jemalloc and replace-malloc and disables DMDV],
|
||||
[ --enable-dmd Enable DMD; also enables jemalloc and replace-malloc],
|
||||
MOZ_DMD=1,
|
||||
MOZ_DMD= )
|
||||
|
||||
@ -7061,7 +7046,6 @@ if test "$MOZ_DMD"; then
|
||||
|
||||
MOZ_MEMORY=1 # DMD enables jemalloc
|
||||
MOZ_REPLACE_MALLOC=1 # DMD enables replace-malloc
|
||||
MOZ_DMDV= # DMD disables DMDV
|
||||
fi
|
||||
AC_SUBST(MOZ_DMD)
|
||||
|
||||
@ -7076,9 +7060,6 @@ MOZ_ARG_ENABLE_BOOL(jemalloc,
|
||||
if test "$NS_TRACE_MALLOC"; then
|
||||
MOZ_MEMORY=
|
||||
fi
|
||||
if test "$MOZ_DMDV"; then
|
||||
MOZ_MEMORY=
|
||||
fi
|
||||
|
||||
if test "${OS_TARGET}" = "Android"; then
|
||||
dnl On Android, we use WRAP_LDFLAGS to link everything to mozglue
|
||||
|
@ -2792,32 +2792,6 @@ static JSFunctionSpec JProfFunctions[] = {
|
||||
|
||||
#endif /* defined(MOZ_JPROF) */
|
||||
|
||||
#ifdef MOZ_DMDV
|
||||
|
||||
// See https://wiki.mozilla.org/Performance/MemShrink/DMD for instructions on
|
||||
// how to use DMDV.
|
||||
|
||||
namespace mozilla {
|
||||
namespace dmdv {
|
||||
|
||||
static JSBool
|
||||
ReportAndDump(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
mozilla::dmd::RunReporters();
|
||||
mozilla::dmdv::Dump();
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
} // namespace dmdv
|
||||
} // namespace mozilla
|
||||
|
||||
static JSFunctionSpec DMDVFunctions[] = {
|
||||
JS_FS("DMDVReportAndDump", dmdv::ReportAndDump, 0, 0),
|
||||
JS_FS_END
|
||||
};
|
||||
|
||||
#endif /* defined(MOZ_DMDV) */
|
||||
|
||||
nsresult
|
||||
nsJSContext::InitClasses(JSObject* aGlobalObj)
|
||||
{
|
||||
@ -2846,11 +2820,6 @@ nsJSContext::InitClasses(JSObject* aGlobalObj)
|
||||
::JS_DefineFunctions(mContext, aGlobalObj, JProfFunctions);
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_DMDV
|
||||
// Attempt to initialize DMDV functions
|
||||
::JS_DefineFunctions(mContext, aGlobalObj, DMDVFunctions);
|
||||
#endif
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -3493,7 +3493,7 @@ dnl = Enable DMD
|
||||
dnl ========================================================
|
||||
|
||||
MOZ_ARG_ENABLE_BOOL(dmd,
|
||||
[ --enable-dmd Enable DMD; also enables jemalloc and replace-malloc and disables DMDV],
|
||||
[ --enable-dmd Enable DMD; also enables jemalloc and replace-malloc],
|
||||
MOZ_DMD=1,
|
||||
MOZ_DMD= )
|
||||
|
||||
|
@ -1577,12 +1577,6 @@ if [ ! "$MOZ_NATIVE_PNG" ]; then
|
||||
"
|
||||
fi
|
||||
|
||||
if [ "$MOZ_DMDV" ]; then
|
||||
add_makefiles "
|
||||
tools/dmdv/Makefile
|
||||
"
|
||||
fi
|
||||
|
||||
if [ "$MOZ_JPROF" ]; then
|
||||
add_makefiles "
|
||||
tools/jprof/Makefile
|
||||
|
@ -23,11 +23,6 @@ ifdef MOZ_TREE_FREETYPE
|
||||
tier_platform_staticdirs += modules/freetype2
|
||||
endif
|
||||
|
||||
# this must precede xpcom
|
||||
ifdef MOZ_DMDV
|
||||
tier_platform_dirs += tools/dmdv
|
||||
endif
|
||||
|
||||
tier_platform_dirs += xpcom
|
||||
|
||||
tier_platform_dirs += \
|
||||
|
@ -1,18 +0,0 @@
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
DEPTH = @DEPTH@
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
EXPORTS = \
|
||||
dmdv.h \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -1,4 +0,0 @@
|
||||
dmdv.patch is a patch for Valgrind that adds DMDV to it. See
|
||||
https://wiki.mozilla.org/Performance/MemShrink/DMD for details.
|
||||
|
||||
dmdv.h is #include by Firefox, to allow it to interact with DMDV.
|
@ -1,83 +0,0 @@
|
||||
/*
|
||||
----------------------------------------------------------------
|
||||
The following BSD-style license applies to this one file (dmdv.h) only.
|
||||
----------------------------------------------------------------
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
the Mozilla Foundation.
|
||||
Portions created by the Initial Developer are Copyright (C) 2011
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Nicholas Nethercote <nnethercote@mozilla.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
3. Altered source versions must be plainly marked as such, and must
|
||||
not be misrepresented as being the original software.
|
||||
|
||||
4. The name of the author may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __DMDV_H
|
||||
#define __DMDV_H
|
||||
|
||||
#include "valgrind/valgrind.h"
|
||||
|
||||
/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !!
|
||||
This enum comprises an ABI exported by Valgrind to programs
|
||||
which use client requests. DO NOT CHANGE THE ORDER OF THESE
|
||||
ENTRIES, NOR DELETE ANY -- add new ones at the end. */
|
||||
typedef
|
||||
enum {
|
||||
VG_USERREQ__DMDV_REPORT = VG_USERREQ_TOOL_BASE('D','M'),
|
||||
VG_USERREQ__DMDV_UNREPORT,
|
||||
VG_USERREQ__DMDV_CHECK_REPORTING
|
||||
} Vg_DMDVClientRequest;
|
||||
|
||||
|
||||
/* Mark heap block at _qzz_addr as reported for _qzz_len bytes.
|
||||
* _qzz_name is the name of the reporter. */
|
||||
#define VALGRIND_DMDV_REPORT(_qzz_addr,_qzz_len,_qzz_name) \
|
||||
VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */, \
|
||||
VG_USERREQ__DMDV_REPORT, \
|
||||
(_qzz_addr), (_qzz_len), (_qzz_name), 0, 0)
|
||||
|
||||
/* Mark heap block at _qzz_addr as not reported. */
|
||||
#define VALGRIND_DMDV_UNREPORT(_qzz_addr) \
|
||||
VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */, \
|
||||
VG_USERREQ__DMDV_UNREPORT, \
|
||||
(_qzz_addr), 0, 0, 0, 0)
|
||||
|
||||
/* Do a reporting check. */
|
||||
#define VALGRIND_DMDV_CHECK_REPORTING \
|
||||
VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */, \
|
||||
VG_USERREQ__DMDV_CHECK_REPORTING, \
|
||||
0, 0, 0, 0, 0)
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -358,39 +358,17 @@ nsresult NS_RegisterMemoryMultiReporter(nsIMemoryMultiReporter *reporter);
|
||||
nsresult NS_UnregisterMemoryReporter(nsIMemoryReporter *reporter);
|
||||
nsresult NS_UnregisterMemoryMultiReporter(nsIMemoryMultiReporter *reporter);
|
||||
|
||||
#if defined(MOZ_DMDV) || defined(MOZ_DMD)
|
||||
#if defined(MOZ_DMD)
|
||||
namespace mozilla {
|
||||
namespace dmd {
|
||||
// This runs all the memory reporters but does nothing with the results; i.e.
|
||||
// it does the minimal amount of work possible for DMD/DMDV to do its thing.
|
||||
// it does the minimal amount of work possible for DMD to do its thing.
|
||||
void RunReporters();
|
||||
}
|
||||
}
|
||||
#endif // defined(MOZ_DMDV) || defined(MOZ_DMD)
|
||||
#endif // defined(MOZ_DMD)
|
||||
|
||||
#ifdef MOZ_DMDV
|
||||
|
||||
#if defined(MOZ_MEMORY)
|
||||
#error "MOZ_DMDV precludes MOZ_MEMORY"
|
||||
#endif
|
||||
|
||||
// Because DMDV is not a tool that comes with the standard Valgrind
|
||||
// distribution, we have to #include our own local copy of dmdv.h. Ugly but
|
||||
// unavoidable.
|
||||
#include "dmdv.h"
|
||||
|
||||
#define MOZ_REPORT(ptr, usable, name) VALGRIND_DMDV_REPORT(ptr, usable, name)
|
||||
#define MOZ_REPORT_ON_ALLOC(ptr, usable, name) VALGRIND_DMDV_REPORT(ptr, usable, name)
|
||||
|
||||
namespace mozilla {
|
||||
namespace dmdv {
|
||||
// This dumps the DMDV output to stderr (or somewhere else, if one of
|
||||
// DMDV/Valgrind's logging options was used).
|
||||
void Dump();
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(MOZ_DMD)
|
||||
#if defined(MOZ_DMD)
|
||||
|
||||
#if !defined(MOZ_MEMORY)
|
||||
#error "MOZ_DMD requires MOZ_MEMORY"
|
||||
@ -406,7 +384,7 @@ void Dump();
|
||||
#define MOZ_REPORT(ptr, usable, name)
|
||||
#define MOZ_REPORT_ON_ALLOC(ptr, usable, name)
|
||||
|
||||
#endif /* defined(MOZ_DMDV) || defined(MOZ_DMD) */
|
||||
#endif // defined(MOZ_DMD)
|
||||
|
||||
// Functions generated via this macro should be used by all traversal-based
|
||||
// memory reporters. Such functions return |moz_malloc_size_of(ptr)|; this
|
||||
@ -414,7 +392,7 @@ void Dump();
|
||||
//
|
||||
// You might be wondering why we have a macro that creates multiple
|
||||
// functions distinguished only by |name|, instead of a single
|
||||
// MemoryReporterMallocSizeOf function. It's mostly to help with DMDV/DMD
|
||||
// MemoryReporterMallocSizeOf function. It's mostly to help with DMD
|
||||
// integration, though it sometimes also helps with debugging and temporary
|
||||
// ad hoc profiling. The |name| chosen doesn't matter greatly, but it's
|
||||
// best to make it similar to the path used by the relevant memory
|
||||
|
@ -1118,7 +1118,7 @@ NS_UnregisterMemoryMultiReporter (nsIMemoryMultiReporter *reporter)
|
||||
return mgr->UnregisterMultiReporter(reporter);
|
||||
}
|
||||
|
||||
#if defined(MOZ_DMDV) || defined(MOZ_DMD)
|
||||
#if defined(MOZ_DMD)
|
||||
|
||||
namespace mozilla {
|
||||
namespace dmd {
|
||||
@ -1133,7 +1133,7 @@ public:
|
||||
const nsACString &aDescription,
|
||||
nsISupports *aData)
|
||||
{
|
||||
// Do nothing; the reporter has already reported to DMDV.
|
||||
// Do nothing; the reporter has already reported to DMD.
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
@ -1176,7 +1176,7 @@ RunReporters()
|
||||
path.Find("explicit") == 0)
|
||||
{
|
||||
// Just getting the amount is enough for the reporter to report to
|
||||
// DMDV.
|
||||
// DMD.
|
||||
int64_t amount;
|
||||
(void)r->GetAmount(&amount);
|
||||
}
|
||||
@ -1196,20 +1196,5 @@ RunReporters()
|
||||
} // namespace dmd
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // defined(MOZ_DMDV) || defined(MOZ_DMD)
|
||||
|
||||
#ifdef MOZ_DMDV
|
||||
namespace mozilla {
|
||||
namespace dmdv {
|
||||
|
||||
void
|
||||
Dump()
|
||||
{
|
||||
VALGRIND_DMDV_CHECK_REPORTING;
|
||||
}
|
||||
|
||||
} // namespace dmdv
|
||||
} // namespace mozilla
|
||||
|
||||
#endif /* defined(MOZ_DMDV) */
|
||||
#endif // defined(MOZ_DMD)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user