diff options
| author | Peter Eisentraut | 2008-03-17 19:44:41 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2008-03-17 19:44:41 +0000 |
| commit | a7b7b07af340c73adee9959edf260695591a9496 (patch) | |
| tree | ed5c5cfd965970a04dcd597f2eb11c4e3895f8fd /src/include | |
| parent | e7115a224a3f43764ce31fc4ed4dcb19d73b668f (diff) | |
Enable probes to work with Mac OS X Leopard and other OSes that will
support DTrace in the future.
Switch from using DTRACE_PROBEn macros to the dynamically generated macros.
Use "dtrace -h" to create a header file that contains the dynamically
generated macros to be used in the source code instead of the DTRACE_PROBEn
macros. A dummy header file is generated for builds without DTrace support.
Author: Robert Lor <Robert.Lor@sun.com>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/Makefile | 4 | ||||
| -rw-r--r-- | src/include/c.h | 3 | ||||
| -rw-r--r-- | src/include/pg_trace.h | 41 |
3 files changed, 5 insertions, 43 deletions
diff --git a/src/include/Makefile b/src/include/Makefile index e21dc576416..01a046f4fcc 100644 --- a/src/include/Makefile +++ b/src/include/Makefile @@ -4,7 +4,7 @@ # # 'make install' installs whole contents of src/include. # -# $PostgreSQL: pgsql/src/include/Makefile,v 1.23 2007/10/14 17:07:51 tgl Exp $ +# $PostgreSQL: pgsql/src/include/Makefile,v 1.24 2008/03/17 19:44:41 petere Exp $ # #------------------------------------------------------------------------- @@ -60,7 +60,7 @@ uninstall: clean: - rm -f utils/fmgroids.h parser/parse.h + rm -f utils/fmgroids.h parser/parse.h utils/probes.h distclean maintainer-clean: clean rm -f pg_config.h dynloader.h pg_config_os.h stamp-h diff --git a/src/include/c.h b/src/include/c.h index 07a29d9cdf4..f9b0acf9571 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/c.h,v 1.223 2008/02/23 19:11:45 tgl Exp $ + * $PostgreSQL: pgsql/src/include/c.h,v 1.224 2008/03/17 19:44:41 petere Exp $ * *------------------------------------------------------------------------- */ @@ -57,7 +57,6 @@ #include "pg_config_os.h" /* must be before any system header files */ #endif #include "postgres_ext.h" -#include "pg_trace.h" #if _MSC_VER >= 1400 #define errcode __msvc_errcode diff --git a/src/include/pg_trace.h b/src/include/pg_trace.h index 28b6e8ead64..bc5fc7563e7 100644 --- a/src/include/pg_trace.h +++ b/src/include/pg_trace.h @@ -5,50 +5,13 @@ * * Copyright (c) 2006-2008, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/pg_trace.h,v 1.3 2008/01/02 02:42:06 momjian Exp $ + * $PostgreSQL: pgsql/src/include/pg_trace.h,v 1.4 2008/03/17 19:44:41 petere Exp $ * ---------- */ #ifndef PG_TRACE_H #define PG_TRACE_H -#ifdef ENABLE_DTRACE - -#include <sys/sdt.h> - -/* - * The PG_TRACE macros are mapped to the appropriate macros used by DTrace. - * - * Only one DTrace provider called "postgresql" will be used for PostgreSQL, - * so the name is hard-coded here to avoid having to specify it in the - * source code. - */ - -#define PG_TRACE(name) \ - DTRACE_PROBE(postgresql, name) -#define PG_TRACE1(name, arg1) \ - DTRACE_PROBE1(postgresql, name, arg1) -#define PG_TRACE2(name, arg1, arg2) \ - DTRACE_PROBE2(postgresql, name, arg1, arg2) -#define PG_TRACE3(name, arg1, arg2, arg3) \ - DTRACE_PROBE3(postgresql, name, arg1, arg2, arg3) -#define PG_TRACE4(name, arg1, arg2, arg3, arg4) \ - DTRACE_PROBE4(postgresql, name, arg1, arg2, arg3, arg4) -#define PG_TRACE5(name, arg1, arg2, arg3, arg4, arg5) \ - DTRACE_PROBE5(postgresql, name, arg1, arg2, arg3, arg4, arg5) -#else /* not ENABLE_DTRACE */ - -/* - * Unless DTrace is explicitly enabled with --enable-dtrace, the PG_TRACE - * macros will expand to no-ops. - */ - -#define PG_TRACE(name) -#define PG_TRACE1(name, arg1) -#define PG_TRACE2(name, arg1, arg2) -#define PG_TRACE3(name, arg1, arg2, arg3) -#define PG_TRACE4(name, arg1, arg2, arg3, arg4) -#define PG_TRACE5(name, arg1, arg2, arg3, arg4, arg5) -#endif /* not ENABLE_DTRACE */ +#include "utils/probes.h" #endif /* PG_TRACE_H */ |
