From faf59c6da9be12342cd7c2ebbabed601ffee7a69 Mon Sep 17 00:00:00 2001 From: "ramiro%eazel.com" Date: Fri, 20 Oct 2000 14:59:13 +0000 Subject: [PATCH] Bug 56795. Adding support for corel/eazel profiler. Build changes approved and reviewed by cls. r=cls a=cls. --- config/autoconf.mk.in | 6 ++++-- config/config.mk | 18 ++++++++++++------ config/rules.mk | 10 +++++----- configure.in | 28 ++++++++++++++++++---------- embedding/tests/gtkEmbed/Makefile.in | 1 + webshell/tests/viewer/Makefile.in | 10 ++++++---- 6 files changed, 46 insertions(+), 27 deletions(-) diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index e77769e35f6..7cd2f9efb14 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -49,17 +49,19 @@ MOZ_WIDGET_TOOLKIT_LDFLAGS = @MOZ_WIDGET_TOOLKIT_LDFLAGS@ MOZ_SECURITY = @MOZ_SECURITY@ MOZ_DEBUG = @MOZ_DEBUG@ MOZ_DEBUG_MODULES = @MOZ_DEBUG_MODULES@ +MOZ_PROFILE_MODULES = @MOZ_PROFILE_MODULES@ MOZ_DEBUG_ENABLE_DEFS = @MOZ_DEBUG_ENABLE_DEFS@ MOZ_DEBUG_DISABLE_DEFS = @MOZ_DEBUG_DISABLE_DEFS@ MOZ_DEBUG_FLAGS = @MOZ_DEBUG_FLAGS@ MOZ_DBGRINFO_MODULES = @MOZ_DBGRINFO_MODULES@ MOZ_EXTENSIONS = @MOZ_EXTENSIONS@ -MOZILLA_GPROF = @MOZILLA_GPROF@ MOZ_PERF_METRICS = @MOZ_PERF_METRICS@ MOZ_LEAKY = @MOZ_LEAKY@ MOZ_JPROF = @MOZ_JPROF@ +ENABLE_EAZEL_PROFILER=@ENABLE_EAZEL_PROFILER@ +EAZEL_PROFILER_CFLAGS=@EAZEL_PROFILER_CFLAGS@ +EAZEL_PROFILER_LIBS=@EAZEL_PROFILER_LIBS@ DETECT_WEBSHELL_LEAKS = @DETECT_WEBSHELL_LEAKS@ -BUILD_PROFILE = @MOZILLA_GPROF@ GC_LEAK_DETECTOR = @GC_LEAK_DETECTOR@ NS_TRACE_MALLOC = @NS_TRACE_MALLOC@ USE_ELF_DYNSTR_GC = @USE_ELF_DYNSTR_GC@ diff --git a/config/config.mk b/config/config.mk index 6f8cff49713..8feee67c81b 100644 --- a/config/config.mk +++ b/config/config.mk @@ -329,8 +329,8 @@ endif CFLAGS = $(OS_CFLAGS) CXXFLAGS = $(OS_CXXFLAGS) -COMPILE_CFLAGS = $(DEFINES) $(INCLUDES) $(XCFLAGS) $(PROF_FLAGS) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CFLAGS) $(OS_COMPILE_CFLAGS) -COMPILE_CXXFLAGS = $(DEFINES) $(INCLUDES) $(XCFLAGS) $(PROF_FLAGS) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CXXFLAGS) $(OS_COMPILE_CXXFLAGS) +COMPILE_CFLAGS = $(DEFINES) $(INCLUDES) $(XCFLAGS) $(PROFILER_CFLAGS) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CFLAGS) $(OS_COMPILE_CFLAGS) +COMPILE_CXXFLAGS = $(DEFINES) $(INCLUDES) $(XCFLAGS) $(PROFILER_CFLAGS) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CXXFLAGS) $(OS_COMPILE_CXXFLAGS) LDFLAGS = $(OS_LDFLAGS) @@ -444,10 +444,14 @@ DEFINES += -DFORTEZZA endif # For profiling -ifdef MOZILLA_GPROF -# Don't want profiling on build tools.. -ifneq ($(shell echo $(srcdir) | sed 's:\.\./::g'),config) -PROF_FLAGS = $(OS_GPROF_FLAGS) -DMOZILLA_GPROF +ifdef ENABLE_EAZEL_PROFILER +ifndef INTERNAL_TOOLS +ifneq ($(LIBRARY_NAME), xpt) +ifneq (, $(findstring $(shell $(topsrcdir)/build/unix/print-depth-path.sh | awk -F/ '{ print $$2; }'), $(MOZ_PROFILE_MODULES))) +PROFILER_CFLAGS = $(EAZEL_PROFILER_CFLAGS) -DENABLE_EAZEL_PROFILER +PROFILER_LIBS = $(EAZEL_PROFILER_LIBS) +endif +endif endif endif @@ -551,3 +555,5 @@ else JAVA_DEFINES += -DAWT_102 endif +#caca: +# @echo $(PROFILER_CFLAGS) diff --git a/config/rules.mk b/config/rules.mk index fe7c8284c34..90ebf9892a6 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -575,7 +575,7 @@ ifdef OS2_PROGRAM_RESOURCE endif # os2_prog_rsrc else ifeq ($(CPP_PROG_LINK),1) - $(CCC) -o $@ $(CXXFLAGS) $(WRAP_MALLOC_CFLAGS) $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(WRAP_MALLOC_LIB) + $(CCC) -o $@ $(CXXFLAGS) $(WRAP_MALLOC_CFLAGS) $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(MOZ_POST_PROGRAM_COMMAND) $@ ifeq ($(OS_ARCH),BeOS) ifdef BEOS_PROGRAM_RESOURCE @@ -608,16 +608,16 @@ $(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_EXTRA_DEPS) Makefile Makefile.in $(SIMPLE_PROGRAMS): %$(BIN_SUFFIX): %.o $(EXTRA_DEPS) Makefile Makefile.in ifeq ($(CPP_PROG_LINK),1) ifeq ($(MOZ_OS2_TOOLS),VACPP) - $(LD) /Out:$@ $< $(LDFLAGS) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(OS_LFLAGS) + $(LD) /Out:$@ $< $(LDFLAGS) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(OS_LFLAGS) $(PROFILER_LIBS) else - $(CCC) $(WRAP_MALLOC_CFLAGS) $(CXXFLAGS) -o $@ $< $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) + $(CCC) $(WRAP_MALLOC_CFLAGS) $(CXXFLAGS) -o $@ $< $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) endif $(MOZ_POST_PROGRAM_COMMAND) $@ else ifeq ($(MOZ_OS2_TOOLS),VACPP) - $(LD) /Out:$@ $< $(LDFLAGS) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(OS_LFLAGS) + $(LD) /Out:$@ $< $(LDFLAGS) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(OS_LFLAGS) else - $(CC) $(WRAP_MALLOC_CFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) + $(CC) $(WRAP_MALLOC_CFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) endif $(MOZ_POST_PROGRAM_COMMAND) $@ endif diff --git a/configure.in b/configure.in index 1f604ed5d1a..5b41036878a 100644 --- a/configure.in +++ b/configure.in @@ -3272,9 +3272,20 @@ dnl = dnl ======================================================== MOZ_ARG_HEADER(Profiling and Instrumenting) -MOZ_ARG_ENABLE_BOOL(gprof, -[ --enable-gprof Enable gprof symbols], - [ _GPROF_CFLAGS="-pg" ]) +MOZ_ARG_ENABLE_BOOL(eazel-profiler, +[ --enable-eazel-profiler Enable Corel/Eazel profiler], + [ ENABLE_EAZEL_PROFILER=1 + AC_DEFINE(ENABLE_EAZEL_PROFILER) + USE_ELF_DYNSTR_GC= + MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS= + EAZEL_PROFILER_CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + EAZEL_PROFILER_LIBS="-lprofiler -lpthread"]) + +MOZ_ARG_WITH_STRING(profile-modules, +[ --with-profile-modules Enable/disable profile for specific modules only], + [ MOZ_PROFILE_MODULES=`echo $withval | sed 's/,/ /g'` ] ) +dnl ======================================================== +dnl ======================================================== dnl Enable performance metrics. MOZ_ARG_ENABLE_BOOL(perf-metrics, @@ -3296,10 +3307,6 @@ MOZ_ARG_WITH_STRING(insure-exclude-dirs, Dirs to not instrument ], MOZ_INSURE_EXCLUDE_DIRS="config $withval" ) -MOZ_ARG_ENABLE_BOOL(profile, -[ --enable-profile Enable profiling (solaris only)], - MOZILLA_GPROF=1) - MOZ_ARG_ENABLE_BOOL(boehm, [ --enable-boehm Enable the Boehm Garbage Collector], AC_DEFINE(GC_LEAK_DETECTOR) @@ -3593,12 +3600,15 @@ dnl AC_SUBST(MOZ_NETCAST) AC_SUBST(BUILD_MODULES) AC_SUBST(MOZ_DEBUG) AC_SUBST(MOZ_DEBUG_MODULES) +AC_SUBST(MOZ_PROFILE_MODULES) AC_SUBST(MOZ_DEBUG_ENABLE_DEFS) AC_SUBST(MOZ_DEBUG_DISABLE_DEFS) AC_SUBST(MOZ_DEBUG_FLAGS) AC_SUBST(MOZ_DBGRINFO_MODULES) AC_SUBST(MOZ_EXTENSIONS) -AC_SUBST(MOZILLA_GPROF) +AC_SUBST(ENABLE_EAZEL_PROFILER) +AC_SUBST(EAZEL_PROFILER_CFLAGS) +AC_SUBST(EAZEL_PROFILER_LIBS) AC_SUBST(MOZ_PERF_METRICS) AC_SUBST(GC_LEAK_DETECTOR) AC_SUBST(MOZ_LOG_REFCNT) @@ -3812,14 +3822,12 @@ AC_SUBST(FULLCIRCLE_LIBS) dnl Echo the CFLAGS to remove extra whitespace. CFLAGS=`echo \ $_WARNINGS_CFLAGS \ - $_GPROF_CFLAGS \ $CFLAGS` CXXFLAGS=`echo \ $_MOZ_RTTI_FLAGS \ $_MOZ_EXCEPTIONS_FLAGS \ $_WARNINGS_CXXFLAGS \ - $_GPROF_CFLAGS \ $CXXFLAGS` COMPILE_CFLAGS=`echo \ diff --git a/embedding/tests/gtkEmbed/Makefile.in b/embedding/tests/gtkEmbed/Makefile.in index 3e72cbe2073..27e1f9bc7df 100644 --- a/embedding/tests/gtkEmbed/Makefile.in +++ b/embedding/tests/gtkEmbed/Makefile.in @@ -35,6 +35,7 @@ LIBS= \ $(DIST)/lib/libxpfelocation_s.$(LIB_SUFFIX) \ $(MOZ_COMPONENT_LIBS) \ -lgtksuperwin \ + $(PROFILE_LIBS) \ $(NULL) LIBS += $(TK_LIBS) diff --git a/webshell/tests/viewer/Makefile.in b/webshell/tests/viewer/Makefile.in index 077b1f2c9c9..07b3dbba131 100644 --- a/webshell/tests/viewer/Makefile.in +++ b/webshell/tests/viewer/Makefile.in @@ -138,6 +138,7 @@ LIBS = \ $(GTK_GLUE) \ $(XP_LIBS) \ $(TK_LIBS) \ + $(PROFILER_LIBS) \ $(NULL) MOTIF_LIBS = -lviewer_motif_s $(XP_LIBS) $(MOZ_MOTIF_LDFLAGS) @@ -201,19 +202,20 @@ unix/xlib/libviewer_xlib_s.a: @$(MAKE) -C $(@D) $(@F) $(PROGRAM)_gtk: $(PROGOBJS) $(EXTRA_DEPS) Makefile Makefile.in unix/gtk/libviewer_gtk_s.a - $(CCC) $(CXXFLAGS) -o $@ $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(GTK_LIBS) $(OS_LIBS) + $(CCC) $(CXXFLAGS) -o $@ $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(GTK_LIBS) $(OS_LIBS) $(PROFILER_LIBS) + $(MOZ_POST_PROGRAM_COMMAND) $@ $(PROGRAM)_motif: $(PROGOBJS) $(EXTRA_DEPS) Makefile Makefile.in unix/motif/libviewer_motif_s.a - $(CCC) $(CXXFLAGS) -o $@ $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(MOTIF_LIBS) $(OS_LIBS) + $(CCC) $(CXXFLAGS) -o $@ $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(MOTIF_LIBS) $(OS_LIBS) $(PROFILER_LIBS) $(MOZ_POST_PROGRAM_COMMAND) $@ $(PROGRAM)_qt: $(PROGOBJS) $(EXTRA_DEPS) Makefile Makefile.in unix/qt/libviewer_qt_s.a - $(CCC) $(CXXFLAGS) -o $@ $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(QT_LIBS) $(OS_LIBS) + $(CCC) $(CXXFLAGS) -o $@ $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(QT_LIBS) $(OS_LIBS) $(PROFILER_LIBS) $(MOZ_POST_PROGRAM_COMMAND) $@ $(PROGRAM)_xlib: $(PROGOBJS) $(EXTRA_DEPS) Makefile Makefile.in unix/xlib/libviewer_xlib_s.a - $(CCC) $(CXXFLAGS) -o $@ $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(XLIB_LIBS) $(OS_LIBS) + $(CCC) $(CXXFLAGS) -o $@ $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(XLIB_LIBS) $(OS_LIBS) $(PROFILER_LIBS) $(MOZ_POST_PROGRAM_COMMAND) $@ ifdef MOZ_ENABLE_GTK