Commit 471913a6 authored by Tom Lane's avatar Tom Lane

More fixes for 8.4 DTrace probes. Remove useless BUFFER_HIT/BUFFER_MISS

probes --- the BUFFER_READ_DONE probe provides the same information and more
besides.  Expand the LOCK_WAIT_START/DONE probe arguments so that there's
actually some chance of telling what is being waited for.  Update and
clean up the documentation.
parent c242e6b6
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.319 2009/02/04 21:30:41 alvherre Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.320 2009/03/23 01:52:38 tgl Exp $ -->
<chapter id="installation"> <chapter id="installation">
<title><![%standalone-include[<productname>PostgreSQL</>]]> <title><![%standalone-include[<productname>PostgreSQL</>]]>
...@@ -1305,9 +1305,10 @@ su - postgres ...@@ -1305,9 +1305,10 @@ su - postgres
<indexterm> <indexterm>
<primary>DTrace</primary> <primary>DTrace</primary>
</indexterm> </indexterm>
Compiles with support for the dynamic tracing tool DTrace. Compiles <productname>PostgreSQL</productname> with support for the
Operating system support for DTrace is currently available in dynamic tracing tool DTrace.
Solaris and Mac OS X Leopard. <![%standalone-ignore[See <xref linkend="dynamic-trace">
for more information.]]>
</para> </para>
<para> <para>
...@@ -1315,21 +1316,21 @@ su - postgres ...@@ -1315,21 +1316,21 @@ su - postgres
environment variable <envar>DTRACE</envar> can be set. This environment variable <envar>DTRACE</envar> can be set. This
will often be necessary because <command>dtrace</command> is will often be necessary because <command>dtrace</command> is
typically installed under <filename>/usr/sbin</filename>, typically installed under <filename>/usr/sbin</filename>,
which might not be in the path. Additional command-line which might not be in the path.
options for the <command>dtrace</command> program can be
specified in the environment variable
<envar>DTRACEFLAGS</envar>.
</para> </para>
<para> <para>
To include DTrace support in a 64-bit binary, specify Extra command-line options for the <command>dtrace</command> program
can be specified in the environment variable
<envar>DTRACEFLAGS</envar>. On Solaris,
to include DTrace support in a 64-bit binary, you must specify
<literal>DTRACEFLAGS="-64"</> to configure. For example, <literal>DTRACEFLAGS="-64"</> to configure. For example,
using the GCC compiler: using the GCC compiler:
<screen> <screen>
./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ... ./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ...
</screen> </screen>
Using Sun's compiler: Using Sun's compiler:
<screen> <screen>
./configure CC='/opt/SUNWspro/bin/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64' ... ./configure CC='/opt/SUNWspro/bin/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64' ...
</screen> </screen>
</para> </para>
...@@ -2942,7 +2943,7 @@ LIBOBJS = snprintf.o ...@@ -2942,7 +2943,7 @@ LIBOBJS = snprintf.o
<para> <para>
Yes, using DTrace is possible. See <![%standalone-include[the Yes, using DTrace is possible. See <![%standalone-include[the
documentation]]> documentation]]>
<![%standalone-ignore[<xref linkend="monitoring">]]> for further <![%standalone-ignore[<xref linkend="dynamic-trace">]]> for further
information. You can also find more information in this information. You can also find more information in this
article: <ulink url="http://blogs.sun.com/robertlor/entry/user_level_dtrace_probes_in"></ulink>. article: <ulink url="http://blogs.sun.com/robertlor/entry/user_level_dtrace_probes_in"></ulink>.
</para> </para>
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.248 2009/03/22 22:39:05 tgl Exp $ * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.249 2009/03/23 01:52:38 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -272,14 +272,7 @@ ReadBuffer_common(SMgrRelation smgr, bool isLocalBuf, ForkNumber forkNum, ...@@ -272,14 +272,7 @@ ReadBuffer_common(SMgrRelation smgr, bool isLocalBuf, ForkNumber forkNum,
ReadLocalBufferCount++; ReadLocalBufferCount++;
bufHdr = LocalBufferAlloc(smgr, forkNum, blockNum, &found); bufHdr = LocalBufferAlloc(smgr, forkNum, blockNum, &found);
if (found) if (found)
{
LocalBufferHitCount++; LocalBufferHitCount++;
TRACE_POSTGRESQL_BUFFER_HIT(true); /* true = local buffer */
}
else
{
TRACE_POSTGRESQL_BUFFER_MISS(true); /* ditto */
}
} }
else else
{ {
...@@ -291,14 +284,7 @@ ReadBuffer_common(SMgrRelation smgr, bool isLocalBuf, ForkNumber forkNum, ...@@ -291,14 +284,7 @@ ReadBuffer_common(SMgrRelation smgr, bool isLocalBuf, ForkNumber forkNum,
*/ */
bufHdr = BufferAlloc(smgr, forkNum, blockNum, strategy, &found); bufHdr = BufferAlloc(smgr, forkNum, blockNum, strategy, &found);
if (found) if (found)
{
BufferHitCount++; BufferHitCount++;
TRACE_POSTGRESQL_BUFFER_HIT(false); /* false = shared buffer */
}
else
{
TRACE_POSTGRESQL_BUFFER_MISS(false); /* ditto */
}
} }
/* At this point we do NOT hold any locks. */ /* At this point we do NOT hold any locks. */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lock.c,v 1.186 2009/01/01 17:23:47 momjian Exp $ * $PostgreSQL: pgsql/src/backend/storage/lmgr/lock.c,v 1.187 2009/03/23 01:52:38 tgl Exp $
* *
* NOTES * NOTES
* A lock table is a shared memory hash table. When * A lock table is a shared memory hash table. When
...@@ -787,11 +787,21 @@ LockAcquire(const LOCKTAG *locktag, ...@@ -787,11 +787,21 @@ LockAcquire(const LOCKTAG *locktag,
* Sleep till someone wakes me up. * Sleep till someone wakes me up.
*/ */
TRACE_POSTGRESQL_LOCK_WAIT_START(locktag->locktag_field2, lockmode); TRACE_POSTGRESQL_LOCK_WAIT_START(locktag->locktag_field1,
locktag->locktag_field2,
locktag->locktag_field3,
locktag->locktag_field4,
locktag->locktag_type,
lockmode);
WaitOnLock(locallock, owner); WaitOnLock(locallock, owner);
TRACE_POSTGRESQL_LOCK_WAIT_DONE(locktag->locktag_field2, lockmode); TRACE_POSTGRESQL_LOCK_WAIT_DONE(locktag->locktag_field1,
locktag->locktag_field2,
locktag->locktag_field3,
locktag->locktag_field4,
locktag->locktag_type,
lockmode);
/* /*
* NOTE: do not do any material change of state between here and * NOTE: do not do any material change of state between here and
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2006-2009, PostgreSQL Global Development Group * Copyright (c) 2006-2009, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/backend/utils/probes.d,v 1.8 2009/03/22 22:39:05 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/probes.d,v 1.9 2009/03/23 01:52:38 tgl Exp $
* ---------- * ----------
*/ */
...@@ -36,8 +36,8 @@ provider postgresql { ...@@ -36,8 +36,8 @@ provider postgresql {
probe lwlock__condacquire(LWLockId, LWLockMode); probe lwlock__condacquire(LWLockId, LWLockMode);
probe lwlock__condacquire__fail(LWLockId, LWLockMode); probe lwlock__condacquire__fail(LWLockId, LWLockMode);
probe lock__wait__start(unsigned int, LOCKMODE); probe lock__wait__start(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, LOCKMODE);
probe lock__wait__done(unsigned int, LOCKMODE); probe lock__wait__done(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, LOCKMODE);
probe query__parse__start(const char *); probe query__parse__start(const char *);
probe query__parse__done(const char *); probe query__parse__done(const char *);
...@@ -59,8 +59,6 @@ provider postgresql { ...@@ -59,8 +59,6 @@ provider postgresql {
probe buffer__flush__start(ForkNumber, BlockNumber, Oid, Oid, Oid); probe buffer__flush__start(ForkNumber, BlockNumber, Oid, Oid, Oid);
probe buffer__flush__done(ForkNumber, BlockNumber, Oid, Oid, Oid); probe buffer__flush__done(ForkNumber, BlockNumber, Oid, Oid, Oid);
probe buffer__hit(bool);
probe buffer__miss(bool);
probe buffer__checkpoint__start(int); probe buffer__checkpoint__start(int);
probe buffer__checkpoint__sync__start(); probe buffer__checkpoint__sync__start();
probe buffer__checkpoint__done(); probe buffer__checkpoint__done();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment