Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44023dc

Browse files
committed
Add isExtend to the parameters of the buffer_read_start and buffer_read_done
DTrace probes, so that ordinary reads can be distinguished from relationextension operations. Move buffer_read_start probe to before thesmgrnblocks() call that's needed in the isExtend case, since really that stepshould be charged as part of the time needed for the extension operation.(This makes it slightly harder to match the read_start with the associatedread_done, since now you can't match them on blockNumber, but it should stillbe possible since isExtend operations on the same relation can never beinterleaved.) Per recent discussion.In passing, add the page identity (forkNum/blockNum) to the parameters of thebuffer_flush_start/buffer_flush_done probes, which were unaccountably lackingthe info.
1 parentf04ee70 commit44023dc

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

‎src/backend/storage/buffer/bufmgr.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.247 2009/03/13 17:46:21 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.248 2009/03/22 22:39:05 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -256,15 +256,16 @@ ReadBuffer_common(SMgrRelation smgr, bool isLocalBuf, ForkNumber forkNum,
256256

257257
isExtend= (blockNum==P_NEW);
258258

259-
/* Substitute proper block number if caller asked for P_NEW */
260-
if (isExtend)
261-
blockNum=smgrnblocks(smgr,forkNum);
262-
263259
TRACE_POSTGRESQL_BUFFER_READ_START(forkNum,blockNum,
264260
smgr->smgr_rnode.spcNode,
265261
smgr->smgr_rnode.dbNode,
266262
smgr->smgr_rnode.relNode,
267-
isLocalBuf);
263+
isLocalBuf,
264+
isExtend);
265+
266+
/* Substitute proper block number if caller asked for P_NEW */
267+
if (isExtend)
268+
blockNum=smgrnblocks(smgr,forkNum);
268269

269270
if (isLocalBuf)
270271
{
@@ -318,6 +319,7 @@ ReadBuffer_common(SMgrRelation smgr, bool isLocalBuf, ForkNumber forkNum,
318319
smgr->smgr_rnode.dbNode,
319320
smgr->smgr_rnode.relNode,
320321
isLocalBuf,
322+
isExtend,
321323
found);
322324

323325
returnBufferDescriptorGetBuffer(bufHdr);
@@ -447,6 +449,7 @@ ReadBuffer_common(SMgrRelation smgr, bool isLocalBuf, ForkNumber forkNum,
447449
smgr->smgr_rnode.dbNode,
448450
smgr->smgr_rnode.relNode,
449451
isLocalBuf,
452+
isExtend,
450453
found);
451454

452455
returnBufferDescriptorGetBuffer(bufHdr);
@@ -1865,7 +1868,9 @@ FlushBuffer(volatile BufferDesc *buf, SMgrRelation reln)
18651868
if (reln==NULL)
18661869
reln=smgropen(buf->tag.rnode);
18671870

1868-
TRACE_POSTGRESQL_BUFFER_FLUSH_START(reln->smgr_rnode.spcNode,
1871+
TRACE_POSTGRESQL_BUFFER_FLUSH_START(buf->tag.forkNum,
1872+
buf->tag.blockNum,
1873+
reln->smgr_rnode.spcNode,
18691874
reln->smgr_rnode.dbNode,
18701875
reln->smgr_rnode.relNode);
18711876

@@ -1902,7 +1907,9 @@ FlushBuffer(volatile BufferDesc *buf, SMgrRelation reln)
19021907
*/
19031908
TerminateBufferIO(buf, true,0);
19041909

1905-
TRACE_POSTGRESQL_BUFFER_FLUSH_DONE(reln->smgr_rnode.spcNode,
1910+
TRACE_POSTGRESQL_BUFFER_FLUSH_DONE(buf->tag.forkNum,
1911+
buf->tag.blockNum,
1912+
reln->smgr_rnode.spcNode,
19061913
reln->smgr_rnode.dbNode,
19071914
reln->smgr_rnode.relNode);
19081915

‎src/backend/utils/probes.d

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
*Copyright (c) 2006-2009, PostgreSQL Global Development Group
55
*
6-
*$PostgreSQL: pgsql/src/backend/utils/probes.d,v 1.7 2009/03/11 23:19:25 tgl Exp $
6+
*$PostgreSQL: pgsql/src/backend/utils/probes.d,v 1.8 2009/03/22 22:39:05 tgl Exp $
77
* ----------
88
*/
99

@@ -54,10 +54,10 @@ provider postgresql {
5454
probesort__start(int,bool,int,int,bool);
5555
probesort__done(bool,long);
5656

57-
probebuffer__read__start(ForkNumber,BlockNumber,Oid,Oid,Oid,bool);
58-
probebuffer__read__done(ForkNumber,BlockNumber,Oid,Oid,Oid,bool,bool);
59-
probebuffer__flush__start(Oid,Oid,Oid);
60-
probebuffer__flush__done(Oid,Oid,Oid);
57+
probebuffer__read__start(ForkNumber,BlockNumber,Oid,Oid,Oid,bool,bool);
58+
probebuffer__read__done(ForkNumber,BlockNumber,Oid,Oid,Oid,bool,bool,bool);
59+
probebuffer__flush__start(ForkNumber,BlockNumber,Oid,Oid,Oid);
60+
probebuffer__flush__done(ForkNumber,BlockNumber,Oid,Oid,Oid);
6161

6262
probebuffer__hit(bool);
6363
probebuffer__miss(bool);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp