Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
6765df91
Commit
6765df91
authored
Feb 21, 2007
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add configure --enable-profiling to enable GCC profiling. Patches from
Korry Douglas and Nikhil S
parent
879caf13
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
116 additions
and
4 deletions
+116
-4
configure
configure
+50
-1
configure.in
configure.in
+19
-1
doc/src/sgml/installation.sgml
doc/src/sgml/installation.sgml
+13
-1
src/backend/storage/ipc/ipc.c
src/backend/storage/ipc/ipc.c
+31
-1
src/include/pg_config.h.in
src/include/pg_config.h.in
+3
-0
No files found.
configure
View file @
6765df91
...
@@ -314,7 +314,7 @@ ac_includes_default="\
...
@@ -314,7 +314,7 @@ ac_includes_default="\
# include <unistd.h>
# include <unistd.h>
#endif"
#endif"
ac_subst_vars
=
'SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS configure_args build build_cpu build_vendor build_os host host_cpu host_vendor host_os PORTNAME docdir enable_nls WANTED_LANGUAGES default_port enable_shared enable_rpath enable_debug DTRACE DTRACEFLAGS enable_dtrace CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GCC TAS autodepend INCLUDES enable_thread_safety with_tcl with_perl with_python with_krb5 krb_srvtab with_pam with_ldap with_bonjour with_openssl XML2_CONFIG with_zlib EGREP ELF_SYS LDFLAGS_SL AWK FLEX FLEXFLAGS LN_S LD with_gnu_ld ld_R_works RANLIB ac_ct_RANLIB TAR STRIP ac_ct_STRIP STRIP_STATIC_LIB STRIP_SHARED_LIB YACC YFLAGS PERL perl_archlibexp perl_privlibexp perl_useshrplib perl_embed_ldflags PYTHON python_version python_configdir python_includespec python_libdir python_libspec python_additional_libs HAVE_IPV6 LIBOBJS acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS LDAP_LIBS_FE LDAP_LIBS_BE HAVE_POSIX_SIGNALS MSGFMT MSGMERGE XGETTEXT localedir TCLSH TCL_CONFIG_SH TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIBS TCL_LIB_SPEC TCL_SHARED_BUILD TCL_SHLIB_LD_LIBS NSGMLS JADE have_docbook DOCBOOKSTYLE COLLATEINDEX SGMLSPL vpath_build LTLIBOBJS'
ac_subst_vars
=
'SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS configure_args build build_cpu build_vendor build_os host host_cpu host_vendor host_os PORTNAME docdir enable_nls WANTED_LANGUAGES default_port enable_shared enable_rpath enable_debug
enable_profiling
DTRACE DTRACEFLAGS enable_dtrace CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GCC TAS autodepend INCLUDES enable_thread_safety with_tcl with_perl with_python with_krb5 krb_srvtab with_pam with_ldap with_bonjour with_openssl XML2_CONFIG with_zlib EGREP ELF_SYS LDFLAGS_SL AWK FLEX FLEXFLAGS LN_S LD with_gnu_ld ld_R_works RANLIB ac_ct_RANLIB TAR STRIP ac_ct_STRIP STRIP_STATIC_LIB STRIP_SHARED_LIB YACC YFLAGS PERL perl_archlibexp perl_privlibexp perl_useshrplib perl_embed_ldflags PYTHON python_version python_configdir python_includespec python_libdir python_libspec python_additional_libs HAVE_IPV6 LIBOBJS acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS LDAP_LIBS_FE LDAP_LIBS_BE HAVE_POSIX_SIGNALS MSGFMT MSGMERGE XGETTEXT localedir TCLSH TCL_CONFIG_SH TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIBS TCL_LIB_SPEC TCL_SHARED_BUILD TCL_SHLIB_LD_LIBS NSGMLS JADE have_docbook DOCBOOKSTYLE COLLATEINDEX SGMLSPL vpath_build LTLIBOBJS'
ac_subst_files
=
''
ac_subst_files
=
''
# Initialize some variables set by options.
# Initialize some variables set by options.
...
@@ -865,6 +865,7 @@ Optional Features:
...
@@ -865,6 +865,7 @@ Optional Features:
--disable-rpath do not embed shared library search path in executables
--disable-rpath do not embed shared library search path in executables
--disable-spinlocks do not use spinlocks
--disable-spinlocks do not use spinlocks
--enable-debug build with debugging symbols (-g)
--enable-debug build with debugging symbols (-g)
--enable-profiling build with profiling enabled
--enable-dtrace build with DTrace support
--enable-dtrace build with DTrace support
--enable-depend turn on automatic dependency tracking
--enable-depend turn on automatic dependency tracking
--enable-cassert enable assertion checks (for debugging)
--enable-cassert enable assertion checks (for debugging)
...
@@ -1948,6 +1949,37 @@ fi;
...
@@ -1948,6 +1949,37 @@ fi;
#
# --enable-profiling enables gcc profiling
#
pgac_args
=
"
$pgac_args
enable_profiling"
# Check whether --enable-profiling or --disable-profiling was given.
if
test
"
${
enable_profiling
+set
}
"
=
set
;
then
enableval
=
"
$enable_profiling
"
case
$enableval
in
yes
)
:
;;
no
)
:
;;
*
)
{
{
echo
"
$as_me
:
$LINENO
: error: no argument expected for --enable-profiling option"
>
&5
echo
"
$as_me
: error: no argument expected for --enable-profiling option"
>
&2
;
}
{
(
exit
1
)
;
exit
1
;
}
;
}
;;
esac
else
enable_profiling
=
no
fi
;
#
#
# DTrace
# DTrace
#
#
...
@@ -3149,6 +3181,22 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
...
@@ -3149,6 +3181,22 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
CFLAGS
=
"
$CFLAGS
-g"
CFLAGS
=
"
$CFLAGS
-g"
fi
fi
# enable profiling if --enable-profiling
if
test
"
$enable_profiling
"
=
yes
&&
test
"
$ac_cv_prog_cc_g
"
=
yes
;
then
if
test
"
$GCC
"
=
yes
;
then
cat
>>
confdefs.h
<<
\
_ACEOF
#define PROFILE_PID_DIR 1
_ACEOF
CFLAGS
=
"
$CFLAGS
-pg"
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
;
}
{
(
exit
1
)
;
exit
1
;
}
;
}
fi
fi
{
echo
"
$as_me
:
$LINENO
: using CFLAGS=
$CFLAGS
"
>
&5
{
echo
"
$as_me
:
$LINENO
: using CFLAGS=
$CFLAGS
"
>
&5
echo
"
$as_me
: using CFLAGS=
$CFLAGS
"
>
&6
;
}
echo
"
$as_me
: using CFLAGS=
$CFLAGS
"
>
&6
;
}
...
@@ -23975,6 +24023,7 @@ s,@default_port@,$default_port,;t t
...
@@ -23975,6 +24023,7 @@ s,@default_port@,$default_port,;t t
s,@enable_shared@,
$enable_shared
,;t t
s,@enable_shared@,
$enable_shared
,;t t
s,@enable_rpath@,
$enable_rpath
,;t t
s,@enable_rpath@,
$enable_rpath
,;t t
s,@enable_debug@,
$enable_debug
,;t t
s,@enable_debug@,
$enable_debug
,;t t
s,@enable_profiling@,
$enable_profiling
,;t t
s,@DTRACE@,
$DTRACE
,;t t
s,@DTRACE@,
$DTRACE
,;t t
s,@DTRACEFLAGS@,
$DTRACEFLAGS
,;t t
s,@DTRACEFLAGS@,
$DTRACEFLAGS
,;t t
s,@enable_dtrace@,
$enable_dtrace
,;t t
s,@enable_dtrace@,
$enable_dtrace
,;t t
...
...
configure.in
View file @
6765df91
dnl Process this file with autoconf to produce a configure script.
dnl Process this file with autoconf to produce a configure script.
dnl $PostgreSQL: pgsql/configure.in,v 1.50
1 2007/02/07 00:28:54 petere
Exp $
dnl $PostgreSQL: pgsql/configure.in,v 1.50
2 2007/02/21 15:12:39 momjian
Exp $
dnl
dnl
dnl Developers, please strive to achieve this order:
dnl Developers, please strive to achieve this order:
dnl
dnl
...
@@ -205,6 +205,13 @@ PGAC_ARG_BOOL(enable, debug, no,
...
@@ -205,6 +205,13 @@ PGAC_ARG_BOOL(enable, debug, no,
[ --enable-debug build with debugging symbols (-g)])
[ --enable-debug build with debugging symbols (-g)])
AC_SUBST(enable_debug)
AC_SUBST(enable_debug)
#
# --enable-profiling enables gcc profiling
#
PGAC_ARG_BOOL(enable, profiling, no,
[ --enable-profiling build with profiling enabled ])
AC_SUBST(enable_profiling)
#
#
# DTrace
# DTrace
#
#
...
@@ -297,6 +304,17 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
...
@@ -297,6 +304,17 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
CFLAGS="$CFLAGS -g"
CFLAGS="$CFLAGS -g"
fi
fi
# enable profiling if --enable-profiling
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"
else
AC_MSG_ERROR([--enable-profiling is supported only when using GCC])
fi
fi
AC_MSG_NOTICE([using CFLAGS=$CFLAGS])
AC_MSG_NOTICE([using CFLAGS=$CFLAGS])
# We already have this in Makefile.win32, but configure needs it too
# We already have this in Makefile.win32, but configure needs it too
...
...
doc/src/sgml/installation.sgml
View file @
6765df91
<
!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.28
4 2007/02/19 18:57:18
momjian Exp $ -->
<
!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.28
5 2007/02/21 15:12:39
momjian Exp $ -->
<
chapter
id
=
"installation"
>
<
chapter
id
=
"installation"
>
<
title
><
![%standalone-include[<productname>PostgreSQL</>]]>
<
title
><
![%standalone-include[<productname>PostgreSQL</>]]>
...
@@ -1040,6 +1040,18 @@ su - postgres
...
@@ -1040,6 +1040,18 @@ su - postgres
</
listitem
>
</
listitem
>
</
varlistentry
>
</
varlistentry
>
<
varlistentry
>
<
term
><
option
>--
enable
-
profiling
</
option
></
term
>
<
listitem
>
<
para
>
If
using
GCC
,
all
programs
and
libraries
are
compiled
so
they
can
be
profiled
.
On
backend
exit
,
a
subdirectory
will
be
created
that
contains
the
<
filename
>
gmon
.
out
</>
file
for
use
in
profiling
.
This
option
is
for
use
only
with
GCC
and
when
doing
development
work
.
</
para
>
</
listitem
>
</
varlistentry
>
<
varlistentry
>
<
varlistentry
>
<
term
><
option
>--
enable
-
cassert
</
option
></
term
>
<
term
><
option
>--
enable
-
cassert
</
option
></
term
>
<
listitem
>
<
listitem
>
...
...
src/backend/storage/ipc/ipc.c
View file @
6765df91
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/ipc/ipc.c,v 1.9
5 2007/01/05 22:19:37
momjian Exp $
* $PostgreSQL: pgsql/src/backend/storage/ipc/ipc.c,v 1.9
6 2007/02/21 15:12:39
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -110,6 +110,36 @@ proc_exit(int code)
...
@@ -110,6 +110,36 @@ proc_exit(int code)
on_proc_exit_list
[
on_proc_exit_index
].
arg
);
on_proc_exit_list
[
on_proc_exit_index
].
arg
);
elog
(
DEBUG3
,
"exit(%d)"
,
code
);
elog
(
DEBUG3
,
"exit(%d)"
,
code
);
#ifdef PROFILE_PID_DIR
{
/*
* If we are profiling ourself then gprof's mcleanup() is about
* to write out a profile to ./gmon.out. Since mcleanup() always
* uses a fixed file name, each backend will overwrite earlier
* profiles. To fix that, we create a separate subdirectory for
* each backend (./gprof/pid) and 'cd' to that subdirectory before
* we exit() - that forces mcleanup() to write each profile into
* its own directory. We end up with something like:
* $PGDATA/gprof/8829/gmon.out
* $PGDATA/gprof/8845/gmon.out
* ...
*
* Note that we do this here instead of in an on_proc_exit()
* callback because we want to ensure that this code executes
* last - we don't want to interfere with any other on_proc_exit()
* callback.
*/
char
gprofDirName
[
32
];
snprintf
(
gprofDirName
,
32
,
"gprof/%d"
,
(
int
)
getpid
());
mkdir
(
"gprof"
,
0777
);
mkdir
(
gprofDirName
,
0777
);
chdir
(
gprofDirName
);
}
#endif
exit
(
code
);
exit
(
code
);
}
}
...
...
src/include/pg_config.h.in
View file @
6765df91
...
@@ -602,6 +602,9 @@
...
@@ -602,6 +602,9 @@
/* A string containing the version number, platform, and C compiler */
/* A string containing the version number, platform, and C compiler */
#undef PG_VERSION_STR
#undef PG_VERSION_STR
/* Define to 1 to enable profiling. (--enable-profiling) */
#undef PROFILE_PID_DIR
/* Define to the necessary symbol if this constant uses a non-standard name on
/* Define to the necessary symbol if this constant uses a non-standard name on
your system. */
your system. */
#undef PTHREAD_CREATE_JOINABLE
#undef PTHREAD_CREATE_JOINABLE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment