4 * Definitions for the PostgreSQL tracing framework
6 * Copyright (c) 2006-2008, PostgreSQL Global Development Group
8 * $PostgreSQL: pgsql/src/include/pg_trace.h,v 1.3 2008/01/02 02:42:06 momjian Exp $
20 * The PG_TRACE macros are mapped to the appropriate macros used by DTrace.
22 * Only one DTrace provider called "postgresql" will be used for PostgreSQL,
23 * so the name is hard-coded here to avoid having to specify it in the
27 #define PG_TRACE(name) \
28 DTRACE_PROBE(postgresql, name)
29 #define PG_TRACE1(name, arg1) \
30 DTRACE_PROBE1(postgresql, name, arg1)
31 #define PG_TRACE2(name, arg1, arg2) \
32 DTRACE_PROBE2(postgresql, name, arg1, arg2)
33 #define PG_TRACE3(name, arg1, arg2, arg3) \
34 DTRACE_PROBE3(postgresql, name, arg1, arg2, arg3)
35 #define PG_TRACE4(name, arg1, arg2, arg3, arg4) \
36 DTRACE_PROBE4(postgresql, name, arg1, arg2, arg3, arg4)
37 #define PG_TRACE5(name, arg1, arg2, arg3, arg4, arg5) \
38 DTRACE_PROBE5(postgresql, name, arg1, arg2, arg3, arg4, arg5)
39 #else /* not ENABLE_DTRACE */
42 * Unless DTrace is explicitly enabled with --enable-dtrace, the PG_TRACE
43 * macros will expand to no-ops.
46 #define PG_TRACE(name)
47 #define PG_TRACE1(name, arg1)
48 #define PG_TRACE2(name, arg1, arg2)
49 #define PG_TRACE3(name, arg1, arg2, arg3)
50 #define PG_TRACE4(name, arg1, arg2, arg3, arg4)
51 #define PG_TRACE5(name, arg1, arg2, arg3, arg4, arg5)
52 #endif /* not ENABLE_DTRACE */
54 #endif /* PG_TRACE_H */