From 9cbc59b328898f7a0966be5ec1665409f6aa836f Mon Sep 17 00:00:00 2001 From: dos-reis Date: Fri, 3 Jul 2009 02:48:59 +0000 Subject: Support ECL-based build profiling. * configure.ac.pamphlet: Support --enable-profiling. * config/var-def.mk (oa_yesno_to_lisp_boolean): New. (oa_enable_profiling): Likewise. (oa_enable_lisp_profiling): Likewise. src/ * lisp/Makefile.in (edit): Substitute for oa_enable_profiling. * lisp/core.lisp.in ($EnableLispProfiling): New. (compileLispFile): Use it. --- ChangeLog | 7 +++++++ config/var-def.mk | 6 ++++++ configure | 46 ++++++++++++++++++++++++++++++++-------------- configure.ac | 10 ++++++++++ configure.ac.pamphlet | 10 ++++++++++ src/ChangeLog | 7 +++++++ src/lisp/Makefile.in | 2 ++ src/lisp/core.lisp.in | 8 +++++++- 8 files changed, 81 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 42a0c0bd..fc6d5981 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-07-02 Gabriel Dos Reis + + * configure.ac.pamphlet: Support --enable-profiling. + * config/var-def.mk (oa_yesno_to_lisp_boolean): New. + (oa_enable_profiling): Likewise. + (oa_enable_lisp_profiling): Likewise. + 2009-05-17 Gabriel Dos Reis * configure.ac.pamphlet: Tidy Lisp systems invocation options. diff --git a/config/var-def.mk b/config/var-def.mk index 73b95dd6..2356193d 100644 --- a/config/var-def.mk +++ b/config/var-def.mk @@ -202,6 +202,12 @@ LDF=@LDF@ -lm LISP=@LISP@ oa_c_runtime_extra = @LIBS@ @axiom_c_runtime_extra@ -lm +oa_yesno_to_lisp_boolean = $(subst yes,t,$(subst no,nil,$(1))) + +oa_enable_profiling = @oa_enable_profiling@ +oa_enable_lisp_profiling = \ + $(call oa_yesno_to_lisp_boolean,$(oa_enable_profiling)) + axiom_use_x = @axiom_use_x@ AXIOM_X11_CFLAGS = @X_CFLAGS@ AXIOM_X11_LDFLAGS = @X_LIBS@ @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@ diff --git a/configure b/configure index 29d3632b..2da09a52 100755 --- a/configure +++ b/configure @@ -810,6 +810,7 @@ X_CFLAGS XMKMF axiom_c_runtime_extra axiom_c_runtime +oa_enable_profiling axiom_optimize_options axiom_enable_checking axiom_all_prerequisites @@ -936,6 +937,7 @@ enable_libtool_lock with_lisp enable_gcl enable_checking +enable_profiling with_x ' ac_precious_vars='build_alias @@ -1585,6 +1587,7 @@ Optional Features: --disable-libtool-lock avoid locking (might break parallel builds) --enable-gcl build GCL from OpenAxiom source --enable-checking turn runtime checking on + --enable-profiling turn profiling on Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -3734,13 +3737,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:3737: $ac_compile\"" >&5) + (eval echo "\"\$as_me:3740: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:3740: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:3743: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:3743: output\"" >&5) + (eval echo "\"\$as_me:3746: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -4943,7 +4946,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4946 "configure"' > conftest.$ac_ext + echo '#line 4949 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7091,11 +7094,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7094: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7097: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7098: \$? = $ac_status" >&5 + echo "$as_me:7101: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7430,11 +7433,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7433: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7436: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7437: \$? = $ac_status" >&5 + echo "$as_me:7440: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7535,11 +7538,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7538: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7541: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7542: \$? = $ac_status" >&5 + echo "$as_me:7545: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7590,11 +7593,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7593: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7596: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7597: \$? = $ac_status" >&5 + echo "$as_me:7600: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10390,7 +10393,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10393 "configure" +#line 10396 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10486,7 +10489,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10489 "configure" +#line 10492 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12945,6 +12948,21 @@ fi +## Parse args for profiling-enabled build. +oa_enable_profiling=no +# Check whether --enable-profiling was given. +if test "${enable_profiling+set}" = set; then + enableval=$enable_profiling; case $enableval in + yes|no) oa_enable_profiling=$enableval ;; + *) { { $as_echo "$as_me:$LINENO: error: erroneous value for --enable-profiling" >&5 +$as_echo "$as_me: error: erroneous value for --enable-profiling" >&2;} + { (exit 1); exit 1; }; } ;; + esac +fi + + + + # FIXME: Move this out of here. axiom_c_runtime= diff --git a/configure.ac b/configure.ac index d17c5a3a..d0de50d6 100644 --- a/configure.ac +++ b/configure.ac @@ -354,6 +354,16 @@ fi AC_SUBST(axiom_enable_checking) AC_SUBST(axiom_optimize_options) +## Parse args for profiling-enabled build. +oa_enable_profiling=no +AC_ARG_ENABLE([profiling], [ --enable-profiling turn profiling on], + [case $enableval in + yes|no) oa_enable_profiling=$enableval ;; + *) AC_MSG_ERROR([erroneous value for --enable-profiling]) ;; + esac]) + +AC_SUBST(oa_enable_profiling) + # FIXME: Move this out of here. axiom_c_runtime= AC_SUBST(axiom_c_runtime) diff --git a/configure.ac.pamphlet b/configure.ac.pamphlet index 69fdf684..db7b72f6 100644 --- a/configure.ac.pamphlet +++ b/configure.ac.pamphlet @@ -489,6 +489,16 @@ fi AC_SUBST(axiom_enable_checking) AC_SUBST(axiom_optimize_options) + +## Parse args for profiling-enabled build. +oa_enable_profiling=no +AC_ARG_ENABLE([profiling], [ --enable-profiling turn profiling on], + [case $enableval in + yes|no) oa_enable_profiling=$enableval ;; + *) AC_MSG_ERROR([erroneous value for --enable-profiling]) ;; + esac]) + +AC_SUBST(oa_enable_profiling) @ diff --git a/src/ChangeLog b/src/ChangeLog index 32c09675..b2570de0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2009-07-02 Gabriel Dos Reis + + Support ECL-based build profiling. + * lisp/Makefile.in (edit): Substitute for oa_enable_profiling. + * lisp/core.lisp.in ($EnableLispProfiling): New. + (compileLispFile): Use it. + 2009-07-02 Gabriel Dos Reis * interp/sys-macros.lisp (COLLECTV): Use setSimpleArrayEntry, not diff --git a/src/lisp/Makefile.in b/src/lisp/Makefile.in index 734d114d..4933e90b 100644 --- a/src/lisp/Makefile.in +++ b/src/lisp/Makefile.in @@ -148,6 +148,7 @@ edit = sed \ -e 's|@LIBEXT[@]|$(LIBEXT)|g' \ -e 's|@oa_c_runtime_extra[@]|$(patsubst %,"%",$(oa_c_runtime_extra))|g' \ -e 's|@oa_standard_linking[@]|$(oa_standard_linking)|g' \ + -e 's|@oa_enable_profiling[@]|$(oa_enable_lisp_profiling)|g' \ -e 's|@void_type[@]|$(void_type)|g' \ -e 's|@char_type[@]|$(char_type)|g' \ -e 's|@int_type[@]|$(int_type)|g' \ @@ -156,6 +157,7 @@ edit = sed \ -e 's|@string_type[@]|$(string_type)|g' core.lisp: $(srcdir)/core.lisp.in + @echo "oa_enable_lisp_profiling= ${oa_enable_lisp_profiling}" $(edit) $< > $@.tmp $(top_srcdir)/config/move-if-change $@.tmp $@ diff --git a/src/lisp/core.lisp.in b/src/lisp/core.lisp.in index 489b1db6..cbcf1724 100644 --- a/src/lisp/core.lisp.in +++ b/src/lisp/core.lisp.in @@ -136,6 +136,9 @@ (proclaim '(optimize @axiom_optimize_options@)) +;; Enablig profiling of generated Lisp codes. +(defconstant |$EnableLispProfiling| @oa_enable_profiling@) + ;; Return true if the full OpenAxiom algebra system is completed ;; built. (defun |%algebraSystemIsComplete| nil @@ -824,7 +827,10 @@ (|startCompileDuration|) (multiple-value-bind (result warning-p failure-p) #-:ecl (compile-file file :output-file out-file) - #+:ecl (compile-file file :output-file out-file :system-p t) + #+:ecl (if |$EnableLispProfiling| + (compile-file file :output-file out-file :system-p t + :c-file t :h-file t) + (compile-file file :output-file out-file :system-p t)) #+:ecl (if (and result (not failure-p) (null (c::build-fasl (compile-file-pathname out-file) :lisp-files `(,out-file) -- cgit v1.2.3