[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
PureData.

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.

Krzysztof
-------------- next part --------------
--- configure.in~	Sun Sep  2 20:49:19 2001
+++ configure.in	Fri Sep 21 19:42:08 2001
@@ -7,6 +7,7 @@
 AC_SUBST(DEFINES)
 AC_SUBST(EXT)
 AC_SUBST(OPT_CFLAGS)
+AC_SUBST(DBG_CFLAGS)
 
 dnl other defaults
 
@@ -19,7 +20,11 @@
 AC_ARG_ENABLE(rme,     [  --enable-rme            compile RME support],
     rme="yes")
 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.
 AC_PROG_CC
-------------- 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
 LIB =  @PDLIB@
 
-#select either the DBG and OPT compiler flags below:
-OPT_CFLAGS = @OPT_CFLAGS@
+DBG_CFLAGS = @DBG_CFLAGS@
+OPT_CFLAGS = @OPT_CFLAGS@ @DBG_CFLAGS@
 WARN_CFLAGS = -Wall -W -Wstrict-prototypes  -Werror \
     -Wno-unused -Wno-parentheses -Wno-switch
 ARCH_CFLAGS = -DPD -DUNIX 


More information about the Pd-list mailing list