[PD] [devel] profiling

Krzysztof Czaja czaja at chopin.edu.pl
Fri Sep 21 20:50:18 CEST 2001

I also wonder, if Pd gurus out there ever considered profiling

Since there is a debug option to ./configure under linux, maybe
there could also be a profiling option.  The necessary changes
to configure.in and makefile.in are very simple, such as in two
attached diffs.  If they are applied, one will be able to pass
--enable-gprof to ./configure to enable gprof-ready compilation
(-pg option to gcc), and also to add another profiling option
to gcc with, for example, --enable-gprof=-ax.

I was forced to introduce one nasty (temporary?) hack of
-D_exit=exit (see my previous post), however it is used
exclusively for -enable-gprof.

-------------- next part --------------
--- configure.in~	Sun Sep  2 20:49:19 2001
+++ configure.in	Fri Sep 21 19:42:08 2001
@@ -7,6 +7,7 @@
 dnl other defaults
@@ -19,7 +20,11 @@
 AC_ARG_ENABLE(rme,     [  --enable-rme            compile RME support],
 AC_ARG_ENABLE(debug,   [  --enable-debug          debugging support],
-    OPT_CFLAGS="-g", OPT_CFLAGS="-O6 -funroll-loops -fomit-frame-pointer")
+    DBG_CFLAGS="-g", OPT_CFLAGS="-O6 -funroll-loops -fomit-frame-pointer")
+AC_ARG_ENABLE(gprof,   [  --enable-gprof[=<opt>]  profiling support],
+    OPT_CFLAGS=""
+    if test $enableval = yes; then DBG_CFLAGS="$DBG_CFLAGS -pg -D_exit=exit"
+    else DBG_CFLAGS="$DBG_CFLAGS -pg $enableval -D_exit=exit"; fi)
 dnl Checks for programs.
-------------- next part --------------
--- makefile.in~	Sun Sep  9 22:39:59 2001
+++ makefile.in	Fri Sep 21 17:12:47 2001
@@ -28,8 +28,8 @@
 LDFLAGS = -Wl,-export-dynamic
-#select either the DBG and OPT compiler flags below:
 WARN_CFLAGS = -Wall -W -Wstrict-prototypes  -Werror \
     -Wno-unused -Wno-parentheses -Wno-switch

More information about the Pd-list mailing list