提交 471913a6 编写于 作者: T 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.
上级 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">
<title><![%standalone-include[<productname>PostgreSQL</>]]>
......@@ -1305,9 +1305,10 @@ su - postgres
<indexterm>
<primary>DTrace</primary>
</indexterm>
Compiles with support for the dynamic tracing tool DTrace.
Operating system support for DTrace is currently available in
Solaris and Mac OS X Leopard.
Compiles <productname>PostgreSQL</productname> with support for the
dynamic tracing tool DTrace.
<![%standalone-ignore[See <xref linkend="dynamic-trace">
for more information.]]>
</para>
<para>
......@@ -1315,21 +1316,21 @@ su - postgres
environment variable <envar>DTRACE</envar> can be set. This
will often be necessary because <command>dtrace</command> is
typically installed under <filename>/usr/sbin</filename>,
which might not be in the path. Additional command-line
options for the <command>dtrace</command> program can be
specified in the environment variable
<envar>DTRACEFLAGS</envar>.
which might not be in the path.
</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,
using the GCC compiler:
<screen>
./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ...
</screen>
</screen>
Using Sun's compiler:
<screen>
<screen>
./configure CC='/opt/SUNWspro/bin/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64' ...
</screen>
</para>
......@@ -2942,7 +2943,7 @@ LIBOBJS = snprintf.o
<para>
Yes, using DTrace is possible. See <![%standalone-include[the
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
article: <ulink url="http://blogs.sun.com/robertlor/entry/user_level_dtrace_probes_in"></ulink>.
</para>
......
此差异已折叠。
......@@ -8,7 +8,7 @@
*
*
* 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,
ReadLocalBufferCount++;
bufHdr = LocalBufferAlloc(smgr, forkNum, blockNum, &found);
if (found)
{
LocalBufferHitCount++;
TRACE_POSTGRESQL_BUFFER_HIT(true); /* true = local buffer */
}
else
{
TRACE_POSTGRESQL_BUFFER_MISS(true); /* ditto */
}
}
else
{
......@@ -291,14 +284,7 @@ ReadBuffer_common(SMgrRelation smgr, bool isLocalBuf, ForkNumber forkNum,
*/
bufHdr = BufferAlloc(smgr, forkNum, blockNum, strategy, &found);
if (found)
{
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. */
......
......@@ -8,7 +8,7 @@
*
*
* 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
* A lock table is a shared memory hash table. When
......@@ -787,11 +787,21 @@ LockAcquire(const LOCKTAG *locktag,
* 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);
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
......
......@@ -3,7 +3,7 @@
*
* 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 {
probe lwlock__condacquire(LWLockId, LWLockMode);
probe lwlock__condacquire__fail(LWLockId, LWLockMode);
probe lock__wait__start(unsigned int, LOCKMODE);
probe lock__wait__done(unsigned int, LOCKMODE);
probe lock__wait__start(unsigned int, unsigned int, unsigned int, unsigned int, 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__done(const char *);
......@@ -59,8 +59,6 @@ provider postgresql {
probe buffer__flush__start(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__sync__start();
probe buffer__checkpoint__done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册