diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-03-22 22:39:05 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-03-22 22:39:05 +0000 |
commit | 44023dc5f58168bebd28a6d804bd3fc1dfaa3d11 (patch) | |
tree | f695b99c13fa6348ad77cbb6e4994df1ab6176f8 /src/backend/storage/buffer/bufmgr.c | |
parent | f04ee7043bc5a187932c2fc647abe41d3ac1d0ba (diff) | |
download | postgresql-44023dc5f58168bebd28a6d804bd3fc1dfaa3d11.tar.gz postgresql-44023dc5f58168bebd28a6d804bd3fc1dfaa3d11.zip |
Add isExtend to the parameters of the buffer_read_start and buffer_read_done
DTrace probes, so that ordinary reads can be distinguished from relation
extension operations. Move buffer_read_start probe to before the
smgrnblocks() call that's needed in the isExtend case, since really that step
should be charged as part of the time needed for the extension operation.
(This makes it slightly harder to match the read_start with the associated
read_done, since now you can't match them on blockNumber, but it should still
be possible since isExtend operations on the same relation can never be
interleaved.) Per recent discussion.
In passing, add the page identity (forkNum/blockNum) to the parameters of the
buffer_flush_start/buffer_flush_done probes, which were unaccountably lacking
the info.
Diffstat (limited to 'src/backend/storage/buffer/bufmgr.c')
-rw-r--r-- | src/backend/storage/buffer/bufmgr.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 59e61decc01..eac98734286 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.247 2009/03/13 17:46:21 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.248 2009/03/22 22:39:05 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -256,15 +256,16 @@ ReadBuffer_common(SMgrRelation smgr, bool isLocalBuf, ForkNumber forkNum, isExtend = (blockNum == P_NEW); - /* Substitute proper block number if caller asked for P_NEW */ - if (isExtend) - blockNum = smgrnblocks(smgr, forkNum); - TRACE_POSTGRESQL_BUFFER_READ_START(forkNum, blockNum, smgr->smgr_rnode.spcNode, smgr->smgr_rnode.dbNode, smgr->smgr_rnode.relNode, - isLocalBuf); + isLocalBuf, + isExtend); + + /* Substitute proper block number if caller asked for P_NEW */ + if (isExtend) + blockNum = smgrnblocks(smgr, forkNum); if (isLocalBuf) { @@ -318,6 +319,7 @@ ReadBuffer_common(SMgrRelation smgr, bool isLocalBuf, ForkNumber forkNum, smgr->smgr_rnode.dbNode, smgr->smgr_rnode.relNode, isLocalBuf, + isExtend, found); return BufferDescriptorGetBuffer(bufHdr); @@ -447,6 +449,7 @@ ReadBuffer_common(SMgrRelation smgr, bool isLocalBuf, ForkNumber forkNum, smgr->smgr_rnode.dbNode, smgr->smgr_rnode.relNode, isLocalBuf, + isExtend, found); return BufferDescriptorGetBuffer(bufHdr); @@ -1865,7 +1868,9 @@ FlushBuffer(volatile BufferDesc *buf, SMgrRelation reln) if (reln == NULL) reln = smgropen(buf->tag.rnode); - TRACE_POSTGRESQL_BUFFER_FLUSH_START(reln->smgr_rnode.spcNode, + TRACE_POSTGRESQL_BUFFER_FLUSH_START(buf->tag.forkNum, + buf->tag.blockNum, + reln->smgr_rnode.spcNode, reln->smgr_rnode.dbNode, reln->smgr_rnode.relNode); @@ -1902,7 +1907,9 @@ FlushBuffer(volatile BufferDesc *buf, SMgrRelation reln) */ TerminateBufferIO(buf, true, 0); - TRACE_POSTGRESQL_BUFFER_FLUSH_DONE(reln->smgr_rnode.spcNode, + TRACE_POSTGRESQL_BUFFER_FLUSH_DONE(buf->tag.forkNum, + buf->tag.blockNum, + reln->smgr_rnode.spcNode, reln->smgr_rnode.dbNode, reln->smgr_rnode.relNode); |