[m-rev.] for review: install deep profiling grades with stack segments by default

Julien Fischer jfischer at opturion.com
Wed Apr 1 13:56:18 AEDT 2015


For review by anyone.

(As discussed on the developers list; the request for review is mainly for
the documentation changes as the changes to configure are trivial.)

----------------------------------

Install deep profiling grades with stack segments by default.

configure.ac:
 	As above.

doc/user_guide.texi:
 	Update the section on the impacts of deep profiling: it does
 	not currently preserve tail recursion.

compiler/options.m:
 	Update the comment describing why the --deep-profile-tail-recursion
 	option is not enabled.

Julien.

diff --git a/compiler/options.m b/compiler/options.m
index 495aa0c..3f809b8 100644
--- a/compiler/options.m
+++ b/compiler/options.m
@@ -376,10 +376,12 @@
      ;       use_zeroing_for_ho_cycles
      ;       use_lots_of_ho_specialization

-            % We should always handle tail recursion specially in deep
-            % profiling; the option is only for benchmarks for the paper,
-            % except that this is currently broken, and not supported with
-            % coverage profiling.
+            % We do not currently enable (or publicly document) this option
+            % because its use results in significant overheads.  Also, it is
+            % not compatible with coverage profiling, which is enabled by
+            % default.  By default, all deep profiling grades are also built
+            % with --stack-segments in order to avoid problems caused by the
+            % lack of tail recursion.
      ;       deep_profile_tail_recursion
      ;       record_term_sizes_as_words
      ;       record_term_sizes_as_cells
diff --git a/configure.ac b/configure.ac
index 0616641..dfd1609 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3761,10 +3761,10 @@ if test "$enable_prof_grades" = yes; then
          LIBGRADES="$LIBGRADES $DEFAULT_BASE_GRADE.gc.memprof"
      fi

-    # Add a `.profdeep' (--deep-profiling) grade,
-    # if deep profiling is enabled.
+    # Add a `.profdeep' (--deep-profiling) grade, if deep profiling is enabled.
+    # By default, we also use stack segments with deep profiling.
      if test $mercury_cv_enable_deep_profiler = yes; then
-        LIBGRADES="$LIBGRADES $BEST_LLDS_BASE_GRADE.gc.profdeep"
+        LIBGRADES="$LIBGRADES $BEST_LLDS_BASE_GRADE.gc.profdeep.stseg"
      fi
  fi

@@ -3859,11 +3859,6 @@ then
      then
          LIBGRADES="$LIBGRADES $BEST_LLDS_BASE_GRADE.gc.trseg.stseg"
      fi
-
-    if test "$mercury_cv_enable_deep_profiler" = "yes"
-    then
-        LIBGRADES="$LIBGRADES $BEST_LLDS_BASE_GRADE.gc.profdeep.stseg"
-    fi
  fi

  # Add .NET back-end grades.
diff --git a/doc/user_guide.texi b/doc/user_guide.texi
index 2551c39..e7f5e7c 100644
--- a/doc/user_guide.texi
+++ b/doc/user_guide.texi
@@ -5778,10 +5778,10 @@ Enabling @samp{mprof} or @samp{mdprof} profiling has several effects.
  First, it causes the compiler to generate slightly modified code,
  which counts the number of times each predicate or function is called,
  and for every call, records the caller and callee.
-With deep profiling, there are other modifications as well,
-the most important impact of which is the loss of tail-recursion
-for groups of mutually tail-recursive predicates
-(self-tail-recursive predicates stay tail-recursive).
+With deep profiling, there are other modifications as well, the most important
+impact of which is the loss of tail-recursion.
+(By default, the deep profiling versions of the library and runtime are built
+with @samp{--stack-segments} in order to minimize this impact.)
  Second, your program will be linked with versions of the library and runtime
  that were compiled with the same kind of profiling enabled.
  Third, if you enable graph profiling,



More information about the reviews mailing list