If we're gonna provide an --enable-profiling configure option, surely
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 21 Sep 2007 02:33:46 +0000 (02:33 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 21 Sep 2007 02:33:46 +0000 (02:33 +0000)
it ought to know that you need -DLINUX_PROFILE on Linux.

configure
configure.in
src/include/pg_config.h.in
src/template/linux

index 930ee945be40c2e9506debd75708f545a52e6353..5d502ddc46eb46ed913bfd17c768f66531fdaf01 100755 (executable)
--- a/configure
+++ b/configure
@@ -3244,7 +3244,7 @@ cat >>confdefs.h <<\_ACEOF
 #define PROFILE_PID_DIR 1
 _ACEOF
 
-    CFLAGS="$CFLAGS -pg"
+    CFLAGS="$CFLAGS -pg $PLATFORM_PROFILE_FLAGS"
   else
     { { echo "$as_me:$LINENO: error: --enable-profiling is supported only when using GCC" >&5
 echo "$as_me: error: --enable-profiling is supported only when using GCC" >&2;}
index 1e442a26c6b5ddd1ad005c8fe439bf793d62cd5a..4eae9023527549ce923699e1f6af84a28886398c 100644 (file)
@@ -307,8 +307,8 @@ fi
 if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
   if test "$GCC" = yes; then
     AC_DEFINE([PROFILE_PID_DIR], 1, 
-           [Define to 1 to enable profiling. (--enable-profiling)])
-    CFLAGS="$CFLAGS -pg"
+           [Define to 1 to allow profiling output to be saved separately for each process.])
+    CFLAGS="$CFLAGS -pg $PLATFORM_PROFILE_FLAGS"
   else
     AC_MSG_ERROR([--enable-profiling is supported only when using GCC])
   fi
index a0e451b0e0c5ff2bf6da24c2a49fb2741b1b1ec4..0f5839537691fcfacfb9b42174ffed6a7c362abc 100644 (file)
 /* A string containing the version number, platform, and C compiler */
 #undef PG_VERSION_STR
 
-/* Define to 1 to enable profiling. (--enable-profiling) */
+/* Define to 1 to allow profiling output to be saved separately for each
+   process. */
 #undef PROFILE_PID_DIR
 
 /* Define to the necessary symbol if this constant uses a non-standard name on
index 48e448716d008ccf0d788fd7fd0e51c885fd15e3..bbb04583837bf882ff2c3cf3566dcd973886b9af 100644 (file)
@@ -2,3 +2,6 @@
 
 # Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+
+# If --enable-profiling is specified, we need -DLINUX_PROFILE
+PLATFORM_PROFILE_FLAGS="-DLINUX_PROFILE"