Bug 592923 - Add --enable-profiling configure option r=ted, a2.0=bz

This commit is contained in:
Justin Lebar 2010-09-10 11:57:12 -07:00
parent 1e91d0253e
commit a3298dd3ca
5 changed files with 83 additions and 14 deletions

View File

@ -107,6 +107,7 @@ MOZ_IPC = @MOZ_IPC@
MOZ_IPDL_TESTS = @MOZ_IPDL_TESTS@ MOZ_IPDL_TESTS = @MOZ_IPDL_TESTS@
MOZ_LEAKY = @MOZ_LEAKY@ MOZ_LEAKY = @MOZ_LEAKY@
MOZ_MEMORY = @MOZ_MEMORY@ MOZ_MEMORY = @MOZ_MEMORY@
MOZ_PROFILING = @MOZ_PROFILING@
MOZ_JPROF = @MOZ_JPROF@ MOZ_JPROF = @MOZ_JPROF@
MOZ_SHARK = @MOZ_SHARK@ MOZ_SHARK = @MOZ_SHARK@
MOZ_CALLGRIND = @MOZ_CALLGRIND@ MOZ_CALLGRIND = @MOZ_CALLGRIND@

View File

@ -1826,6 +1826,14 @@ MOZ_ARG_DISABLE_BOOL(os2-high-mem,
MOZ_OS2_HIGH_MEMORY=1 ) MOZ_OS2_HIGH_MEMORY=1 )
AC_SUBST(MOZ_OS2_HIGH_MEMORY) AC_SUBST(MOZ_OS2_HIGH_MEMORY)
dnl ========================================================
dnl = Use profiling compile flags
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(profiling,
[ --enable-profiling Set compile flags necessary for using sampling profilers (e.g. shark, perf)],
MOZ_PROFILING=1,
MOZ_PROFILING= )
dnl ======================================================== dnl ========================================================
dnl System overrides of the defaults for host dnl System overrides of the defaults for host
dnl ======================================================== dnl ========================================================
@ -2034,7 +2042,12 @@ case "$target" in
*-darwin*) *-darwin*)
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@' MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@' MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
# If we're building with --enable-profiling, we need a frame pointer.
if test -z "$MOZ_PROFILING"; then
MOZ_OPTIMIZE_FLAGS="-O3 -fomit-frame-pointer" MOZ_OPTIMIZE_FLAGS="-O3 -fomit-frame-pointer"
else
MOZ_OPTIMIZE_FLAGS="-O3 -fno-omit-frame-pointer"
fi
_PEDANTIC= _PEDANTIC=
CFLAGS="$CFLAGS -fpascal-strings -fno-common" CFLAGS="$CFLAGS -fpascal-strings -fno-common"
CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common" CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
@ -2193,7 +2206,12 @@ ia64*-hpux*)
# -Os is broken on gcc 4.1.x 4.2.x, 4.5.x we need to tweak it to get good results. # -Os is broken on gcc 4.1.x 4.2.x, 4.5.x we need to tweak it to get good results.
MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50" MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
esac esac
# If we're building with --enable-profiling, we need a frame pointer.
if test -z "$MOZ_PROFILING"; then
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fomit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK" MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fomit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK"
else
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-omit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK"
fi
MOZ_DEBUG_FLAGS="-g" MOZ_DEBUG_FLAGS="-g"
fi fi
@ -2385,7 +2403,12 @@ ia64*-hpux*)
MOZ_DEBUG_FLAGS='-Zi' MOZ_DEBUG_FLAGS='-Zi'
MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV' MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
WARNINGS_AS_ERRORS='-WX' WARNINGS_AS_ERRORS='-WX'
# If we're building with --enable-profiling, we need -Oy-, which forces a frame pointer.
if test -z "$MOZ_PROFILING"; then
MOZ_OPTIMIZE_FLAGS='-O1' MOZ_OPTIMIZE_FLAGS='-O1'
else
MOZ_OPTIMIZE_FLAGS='-O1 -Oy-'
fi
MOZ_JS_STATIC_LIBS='$(LIBXUL_DIST)/lib/js_static.lib' MOZ_JS_STATIC_LIBS='$(LIBXUL_DIST)/lib/js_static.lib'
MOZ_JS_SHARED_LIBS='$(LIBXUL_DIST)/lib/mozjs.lib' MOZ_JS_SHARED_LIBS='$(LIBXUL_DIST)/lib/mozjs.lib'
MOZ_FIX_LINK_PATHS= MOZ_FIX_LINK_PATHS=
@ -2827,7 +2850,12 @@ alpha*-*-osf*)
TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"' TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
MOZ_GFX_OPTIMIZE_MOBILE=1 MOZ_GFX_OPTIMIZE_MOBILE=1
# If we're building with --enable-profiling, we need a frame pointer.
if test -z "$MOZ_PROFILING"; then
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer" MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer"
else
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fno-omit-frame-pointer"
fi
;; ;;
esac esac
@ -7429,10 +7457,11 @@ dnl ========================================================
dnl jprof dnl jprof
dnl ======================================================== dnl ========================================================
MOZ_ARG_ENABLE_BOOL(jprof, MOZ_ARG_ENABLE_BOOL(jprof,
[ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)], [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof). Implies --enable-profiling.],
MOZ_JPROF=1, MOZ_JPROF=1,
MOZ_JPROF= ) MOZ_JPROF= )
if test -n "$MOZ_JPROF"; then if test -n "$MOZ_JPROF"; then
MOZ_PROFILING=1
AC_DEFINE(MOZ_JPROF) AC_DEFINE(MOZ_JPROF)
fi fi
@ -7440,10 +7469,11 @@ dnl ========================================================
dnl shark dnl shark
dnl ======================================================== dnl ========================================================
MOZ_ARG_ENABLE_BOOL(shark, MOZ_ARG_ENABLE_BOOL(shark,
[ --enable-shark Enable shark remote profiling (needs CHUD framework)], [ --enable-shark Enable shark remote profiling (needs CHUD framework). Implies --enable-profiling.],
MOZ_SHARK=1, MOZ_SHARK=1,
MOZ_SHARK= ) MOZ_SHARK= )
if test -n "$MOZ_SHARK"; then if test -n "$MOZ_SHARK"; then
MOZ_PROFILING=1
AC_DEFINE(MOZ_SHARK) AC_DEFINE(MOZ_SHARK)
fi fi
@ -7462,10 +7492,11 @@ dnl ========================================================
dnl vtune dnl vtune
dnl ======================================================== dnl ========================================================
MOZ_ARG_ENABLE_BOOL(vtune, MOZ_ARG_ENABLE_BOOL(vtune,
[ --enable-vtune Enable vtune profiling], [ --enable-vtune Enable vtune profiling. Implies --enable-profiling.],
MOZ_VTUNE=1, MOZ_VTUNE=1,
MOZ_VTUNE= ) MOZ_VTUNE= )
if test -n "$MOZ_VTUNE"; then if test -n "$MOZ_VTUNE"; then
MOZ_PROFILING=1
AC_DEFINE(MOZ_VTUNE) AC_DEFINE(MOZ_VTUNE)
fi fi

View File

@ -87,7 +87,17 @@ else
MODULE_OPTIMIZE_FLAGS = -O2 -ip MODULE_OPTIMIZE_FLAGS = -O2 -ip
endif endif
else # not INTEL_CXX else # not INTEL_CXX
MODULE_OPTIMIZE_FLAGS = -O3 -fstrict-aliasing -fomit-frame-pointer
MODULE_OPTIMIZE_FLAGS = -O3 -fstrict-aliasing
# We normally want -fomit-frame-pointer, but we want an explicit
# -fno-omit-frame-pointer if we're using a sampling profiler.
ifndef MOZ_PROFILING
MODULE_OPTIMIZE_FLAGS += -fomit-frame-pointer
else
MODULE_OPTIMIZE_FLAGS += -fno-omit-frame-pointer
endif
endif endif
else # not GNU_CXX else # not GNU_CXX
ifeq ($(OS_ARCH),SunOS) ifeq ($(OS_ARCH),SunOS)

View File

@ -86,6 +86,7 @@ MOZ_IMG_ENCODERS= @MOZ_IMG_ENCODERS@
MOZ_JSDEBUGGER = @MOZ_JSDEBUGGER@ MOZ_JSDEBUGGER = @MOZ_JSDEBUGGER@
MOZ_LEAKY = @MOZ_LEAKY@ MOZ_LEAKY = @MOZ_LEAKY@
MOZ_MEMORY = @MOZ_MEMORY@ MOZ_MEMORY = @MOZ_MEMORY@
MOZ_PROFILING = @MOZ_PROFILING@
MOZ_JPROF = @MOZ_JPROF@ MOZ_JPROF = @MOZ_JPROF@
MOZ_SHARK = @MOZ_SHARK@ MOZ_SHARK = @MOZ_SHARK@
MOZ_CALLGRIND = @MOZ_CALLGRIND@ MOZ_CALLGRIND = @MOZ_CALLGRIND@

View File

@ -1546,6 +1546,14 @@ MOZ_ARG_DISABLE_BOOL(os2-high-mem,
MOZ_OS2_HIGH_MEMORY=1 ) MOZ_OS2_HIGH_MEMORY=1 )
AC_SUBST(MOZ_OS2_HIGH_MEMORY) AC_SUBST(MOZ_OS2_HIGH_MEMORY)
dnl ========================================================
dnl = Use profiling compile flags
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(profiling,
[ --enable-profiling Set compile flags necessary for using sampling profilers (e.g. shark, perf)],
MOZ_PROFILING=1,
MOZ_PROFILING= )
dnl ======================================================== dnl ========================================================
dnl System overrides of the defaults for host dnl System overrides of the defaults for host
dnl ======================================================== dnl ========================================================
@ -1725,7 +1733,12 @@ case "$target" in
*-darwin*) *-darwin*)
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@' MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@' MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
# If we're building with --enable-profiling, we need a frame pointer.
if test -z "$MOZ_PROFILING"; then
MOZ_OPTIMIZE_FLAGS="-O3 -fomit-frame-pointer" MOZ_OPTIMIZE_FLAGS="-O3 -fomit-frame-pointer"
else
MOZ_OPTIMIZE_FLAGS="-O3 -fno-omit-frame-pointer"
fi
_PEDANTIC= _PEDANTIC=
CFLAGS="$CFLAGS -fpascal-strings -fno-common" CFLAGS="$CFLAGS -fpascal-strings -fno-common"
CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common" CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
@ -1884,7 +1897,12 @@ ia64*-hpux*)
# -Os is broken on gcc 4.1.x 4.2.x, 4.5.x we need to tweak it to get good results. # -Os is broken on gcc 4.1.x 4.2.x, 4.5.x we need to tweak it to get good results.
MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50" MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
esac esac
# If we're building with --enable-profiling, we need a frame pointer.
if test -z "$MOZ_PROFILING"; then
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK" MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK"
else
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fno-omit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK"
fi
MOZ_DEBUG_FLAGS="-g" MOZ_DEBUG_FLAGS="-g"
fi fi
@ -2091,7 +2109,12 @@ ia64*-hpux*)
MOZ_DEBUG_FLAGS='-Zi' MOZ_DEBUG_FLAGS='-Zi'
MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV' MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
WARNINGS_AS_ERRORS='-WX' WARNINGS_AS_ERRORS='-WX'
# If we're building with --enable-profiling, we need -Oy-, which forces a frame pointer.
if test -z "$MOZ_PROFILING"; then
MOZ_OPTIMIZE_FLAGS='-O1' MOZ_OPTIMIZE_FLAGS='-O1'
else
MOZ_OPTIMIZE_FLAGS='-O1 -Oy-'
fi
MOZ_JS_LIBS='$(libdir)/mozjs.lib' MOZ_JS_LIBS='$(libdir)/mozjs.lib'
MOZ_FIX_LINK_PATHS= MOZ_FIX_LINK_PATHS=
DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib' DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
@ -4473,10 +4496,11 @@ dnl ========================================================
dnl jprof dnl jprof
dnl ======================================================== dnl ========================================================
MOZ_ARG_ENABLE_BOOL(jprof, MOZ_ARG_ENABLE_BOOL(jprof,
[ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)], [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof). Implies --enable-profiling.],
MOZ_JPROF=1, MOZ_JPROF=1,
MOZ_JPROF= ) MOZ_JPROF= )
if test -n "$MOZ_JPROF"; then if test -n "$MOZ_JPROF"; then
MOZ_PROFILING=1
AC_DEFINE(MOZ_JPROF) AC_DEFINE(MOZ_JPROF)
fi fi
@ -4484,10 +4508,11 @@ dnl ========================================================
dnl shark dnl shark
dnl ======================================================== dnl ========================================================
MOZ_ARG_ENABLE_BOOL(shark, MOZ_ARG_ENABLE_BOOL(shark,
[ --enable-shark Enable shark remote profiling (needs CHUD framework)], [ --enable-shark Enable shark remote profiling (needs CHUD framework). Implies --enable-profiling.],
MOZ_SHARK=1, MOZ_SHARK=1,
MOZ_SHARK= ) MOZ_SHARK= )
if test -n "$MOZ_SHARK"; then if test -n "$MOZ_SHARK"; then
MOZ_PROFILING=1
AC_DEFINE(MOZ_SHARK) AC_DEFINE(MOZ_SHARK)
fi fi
@ -4506,10 +4531,11 @@ dnl ========================================================
dnl vtune dnl vtune
dnl ======================================================== dnl ========================================================
MOZ_ARG_ENABLE_BOOL(vtune, MOZ_ARG_ENABLE_BOOL(vtune,
[ --enable-vtune Enable vtune profiling], [ --enable-vtune Enable vtune profiling. Implies --enable-profiling.],
MOZ_VTUNE=1, MOZ_VTUNE=1,
MOZ_VTUNE= ) MOZ_VTUNE= )
if test -n "$MOZ_VTUNE"; then if test -n "$MOZ_VTUNE"; then
MOZ_PROFILING=1
AC_DEFINE(MOZ_VTUNE) AC_DEFINE(MOZ_VTUNE)
fi fi