Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 23d7562

Browse files
committed
Remove PrintBufferDescs() and PrintPinnedBufs().
These have been #ifdef'd out for a long time, and in fact have been uncompilable since commit 4835458 of 2016-04-10. The fact that nobody noticed for so long demonstrates their lack of usefulness, so let's remove them rather than fix them. Author: Jacob Brazeal <jacob.brazeal@gmail.com> Discussion: https://postgr.es/m/CA+COZaB+9CN_f63PPRoVhHjYmCwwmb_9CWLxqCJdMWDqs1a-JA@mail.gmail.com
1 parent ea5ff58 commit 23d7562

File tree

2 files changed

+0
-62
lines changed

2 files changed

+0
-62
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4412,64 +4412,6 @@ DropDatabaseBuffers(Oid dbid)
44124412
}
44134413
}
44144414

4415-
/* -----------------------------------------------------------------
4416-
* PrintBufferDescs
4417-
*
4418-
* this function prints all the buffer descriptors, for debugging
4419-
* use only.
4420-
* -----------------------------------------------------------------
4421-
*/
4422-
#ifdef NOT_USED
4423-
void
4424-
PrintBufferDescs(void)
4425-
{
4426-
int i;
4427-
4428-
for (i = 0; i < NBuffers; ++i)
4429-
{
4430-
BufferDesc *buf = GetBufferDescriptor(i);
4431-
Buffer b = BufferDescriptorGetBuffer(buf);
4432-
4433-
/* theoretically we should lock the bufhdr here */
4434-
elog(LOG,
4435-
"[%02d] (freeNext=%d, rel=%s, "
4436-
"blockNum=%u, flags=0x%x, refcount=%u %d)",
4437-
i, buf->freeNext,
4438-
relpathbackend(BufTagGetRelFileLocator(&buf->tag),
4439-
INVALID_PROC_NUMBER, BufTagGetForkNum(&buf->tag)),
4440-
buf->tag.blockNum, buf->flags,
4441-
buf->refcount, GetPrivateRefCount(b));
4442-
}
4443-
}
4444-
#endif
4445-
4446-
#ifdef NOT_USED
4447-
void
4448-
PrintPinnedBufs(void)
4449-
{
4450-
int i;
4451-
4452-
for (i = 0; i < NBuffers; ++i)
4453-
{
4454-
BufferDesc *buf = GetBufferDescriptor(i);
4455-
Buffer b = BufferDescriptorGetBuffer(buf);
4456-
4457-
if (GetPrivateRefCount(b) > 0)
4458-
{
4459-
/* theoretically we should lock the bufhdr here */
4460-
elog(LOG,
4461-
"[%02d] (freeNext=%d, rel=%s, "
4462-
"blockNum=%u, flags=0x%x, refcount=%u %d)",
4463-
i, buf->freeNext,
4464-
relpathperm(BufTagGetRelFileLocator(&buf->tag),
4465-
BufTagGetForkNum(&buf->tag)),
4466-
buf->tag.blockNum, buf->flags,
4467-
buf->refcount, GetPrivateRefCount(b));
4468-
}
4469-
}
4470-
}
4471-
#endif
4472-
44734415
/* ---------------------------------------------------------------------
44744416
* FlushRelationBuffers
44754417
*

src/include/storage/bufmgr.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,6 @@ extern void DropDatabaseBuffers(Oid dbid);
275275

276276
extern bool BufferIsPermanent(Buffer buffer);
277277
extern XLogRecPtr BufferGetLSNAtomic(Buffer buffer);
278-
279-
#ifdef NOT_USED
280-
extern void PrintPinnedBufs(void);
281-
#endif
282278
extern void BufferGetTag(Buffer buffer, RelFileLocator *rlocator,
283279
ForkNumber *forknum, BlockNumber *blknum);
284280

0 commit comments

Comments
 (0)