1
- <!-- $PostgreSQL: pgsql/doc/src/sgml/monitoring.sgml,v 1.40 2006/12/02 00:42:54 tgl Exp $ -->
1
+ <!-- $PostgreSQL: pgsql/doc/src/sgml/monitoring.sgml,v 1.41 2006/12/02 09:29:51 petere Exp $ -->
2
2
3
3
<chapter id="monitoring">
4
4
<title>Monitoring Database Activity</title>
@@ -824,29 +824,14 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS procpid,
824
824
</para>
825
825
826
826
<sect2 id="compiling-for-trace">
827
- <title>Compiling for Dynamic Trace </title>
827
+ <title>Compiling for Dynamic Tracing </title>
828
828
829
829
<para>
830
830
By default, trace points are disabled, so you will need to
831
831
explicitly tell the configure script to make the probes available
832
832
in <productname>PostgreSQL</productname>. To include DTrace support
833
- in a 32-bit binary, specify <option>--enable-dtrace</> to configure.
834
- For example:
835
- <programlisting>
836
- $ ./configure --enable-dtrace ...
837
- </programlisting>
838
- To include DTrace support in a 64-bit binary, specify
839
- <option>--enable-dtrace</>
840
- and <literal>DTRACEFLAGS="-64"</> to configure. For example,
841
- using the gcc compiler:
842
- <programlisting>
843
- $ ./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ...
844
- </programlisting>
845
- Using Sun's compiler:
846
- <programlisting>
847
- $ ./configure CC='/path_to_sun_compiler/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64' ...
848
- </programlisting>
849
- </para>
833
+ specify <option>--enable-dtrace</> to configure. See <xref
834
+ linkend="install-procedure"> for further information.
850
835
</sect2>
851
836
852
837
<sect2 id="trace-points">
@@ -855,7 +840,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS procpid,
855
840
<para>
856
841
A few standard trace points are provided in the source code
857
842
(of course, more can be added as needed for a particular problem).
858
- These are:
843
+ These are shown in <xref linkend="trace-point-table">.
859
844
</para>
860
845
861
846
<table id="trace-point-table">
@@ -974,15 +959,14 @@ postgresql$1:::transaction-commit
974
959
Note how the double underline in trace point names needs to
975
960
be replaced by a hyphen when using D script.
976
961
When executed, the example D script gives output such as:
977
- <programlisting >
962
+ <screen >
978
963
# ./txn_count.d `pgrep -n postgres`
979
964
^C
980
965
981
966
Start 71
982
967
Commit 70
983
- Abort 1
984
968
Total time (ns) 2312105013
985
- </programlisting >
969
+ </screen >
986
970
</para>
987
971
<para>
988
972
You should remember that trace programs need to be carefully written and
@@ -999,7 +983,7 @@ Total time (ns) 2312105013
999
983
1000
984
<para>
1001
985
New trace points can be defined within the code wherever the developer
1002
- desires, though this will require a re-compile .
986
+ desires, though this will require a recompilation .
1003
987
</para>
1004
988
1005
989
<para>
@@ -1009,14 +993,14 @@ Total time (ns) 2312105013
1009
993
occurrence of an event can be achieved with a single line, using
1010
994
just the trace point name, e.g.
1011
995
<programlisting>
1012
- PG_TRACE (my__new__trace__point);
996
+ PG_TRACE (my__new__trace__point);
1013
997
</programlisting>
1014
998
More complex trace points can be provided with one or more variables
1015
999
for inspection by the dynamic tracing utility by using the
1016
1000
<literal>PG_TRACE</><replaceable>n</> macro that corresponds to the number
1017
1001
of parameters after the trace point name:
1018
1002
<programlisting>
1019
- PG_TRACE3 (my__complex__event, varX, varY, varZ);
1003
+ PG_TRACE3 (my__complex__event, varX, varY, varZ);
1020
1004
</programlisting>
1021
1005
The definition of the transaction__start trace point is shown below:
1022
1006
<programlisting>
@@ -1055,7 +1039,7 @@ provider postgresql {
1055
1039
</para>
1056
1040
1057
1041
<para>
1058
- You should take care that the datatypes specified for the probe arguments
1042
+ You should take care that the data types specified for the probe arguments
1059
1043
match the datatypes of the variables used in the <literal>PG_TRACE</>
1060
1044
macro. This is not checked at compile time. You can check that your newly
1061
1045
added trace point is available by recompiling, then running the new binary,
0 commit comments