mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add a few more DTrace probes to the backend.
Robert Lor
This commit is contained in:
@ -26,7 +26,7 @@
|
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/clog.c,v 1.46 2008/01/01 19:45:46 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/clog.c,v 1.47 2008/08/01 13:16:08 alvherre Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -35,6 +35,7 @@
|
||||
#include "access/clog.h"
|
||||
#include "access/slru.h"
|
||||
#include "access/transam.h"
|
||||
#include "pg_trace.h"
|
||||
#include "postmaster/bgwriter.h"
|
||||
|
||||
/*
|
||||
@ -313,7 +314,9 @@ void
|
||||
ShutdownCLOG(void)
|
||||
{
|
||||
/* Flush dirty CLOG pages to disk */
|
||||
TRACE_POSTGRESQL_CLOG_CHECKPOINT_START(false);
|
||||
SimpleLruFlush(ClogCtl, false);
|
||||
TRACE_POSTGRESQL_CLOG_CHECKPOINT_DONE(false);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -323,7 +326,9 @@ void
|
||||
CheckPointCLOG(void)
|
||||
{
|
||||
/* Flush dirty CLOG pages to disk */
|
||||
TRACE_POSTGRESQL_CLOG_CHECKPOINT_START(true);
|
||||
SimpleLruFlush(ClogCtl, true);
|
||||
TRACE_POSTGRESQL_CLOG_CHECKPOINT_DONE(true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.27 2008/01/01 19:45:46 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.28 2008/08/01 13:16:08 alvherre Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -53,10 +53,11 @@
|
||||
#include "access/transam.h"
|
||||
#include "access/xact.h"
|
||||
#include "miscadmin.h"
|
||||
#include "pg_trace.h"
|
||||
#include "storage/backendid.h"
|
||||
#include "storage/lmgr.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "storage/procarray.h"
|
||||
#include "utils/memutils.h"
|
||||
|
||||
|
||||
/*
|
||||
@ -1497,8 +1498,10 @@ void
|
||||
ShutdownMultiXact(void)
|
||||
{
|
||||
/* Flush dirty MultiXact pages to disk */
|
||||
TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_START(false);
|
||||
SimpleLruFlush(MultiXactOffsetCtl, false);
|
||||
SimpleLruFlush(MultiXactMemberCtl, false);
|
||||
TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_DONE(false);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1526,6 +1529,8 @@ MultiXactGetCheckptMulti(bool is_shutdown,
|
||||
void
|
||||
CheckPointMultiXact(void)
|
||||
{
|
||||
TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_START(true);
|
||||
|
||||
/* Flush dirty MultiXact pages to disk */
|
||||
SimpleLruFlush(MultiXactOffsetCtl, true);
|
||||
SimpleLruFlush(MultiXactMemberCtl, true);
|
||||
@ -1540,6 +1545,8 @@ CheckPointMultiXact(void)
|
||||
*/
|
||||
if (!InRecovery)
|
||||
TruncateMultiXact();
|
||||
|
||||
TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_DONE(true);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -22,7 +22,7 @@
|
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/subtrans.c,v 1.22 2008/03/26 18:48:59 alvherre Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/subtrans.c,v 1.23 2008/08/01 13:16:08 alvherre Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -31,6 +31,7 @@
|
||||
#include "access/slru.h"
|
||||
#include "access/subtrans.h"
|
||||
#include "access/transam.h"
|
||||
#include "pg_trace.h"
|
||||
#include "utils/snapmgr.h"
|
||||
|
||||
|
||||
@ -265,7 +266,9 @@ ShutdownSUBTRANS(void)
|
||||
* This is not actually necessary from a correctness point of view. We do
|
||||
* it merely as a debugging aid.
|
||||
*/
|
||||
TRACE_POSTGRESQL_SUBTRANS_CHECKPOINT_START(false);
|
||||
SimpleLruFlush(SubTransCtl, false);
|
||||
TRACE_POSTGRESQL_SUBTRANS_CHECKPOINT_DONE(false);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -281,7 +284,9 @@ CheckPointSUBTRANS(void)
|
||||
* it merely to improve the odds that writing of dirty pages is done by
|
||||
* the checkpoint process and not by backends.
|
||||
*/
|
||||
TRACE_POSTGRESQL_SUBTRANS_CHECKPOINT_START(true);
|
||||
SimpleLruFlush(SubTransCtl, true);
|
||||
TRACE_POSTGRESQL_SUBTRANS_CHECKPOINT_DONE(true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.43 2008/05/19 18:16:26 heikki Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.44 2008/08/01 13:16:08 alvherre Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Each global transaction is associated with a global transaction
|
||||
@ -51,6 +51,7 @@
|
||||
#include "catalog/pg_type.h"
|
||||
#include "funcapi.h"
|
||||
#include "miscadmin.h"
|
||||
#include "pg_trace.h"
|
||||
#include "pgstat.h"
|
||||
#include "storage/fd.h"
|
||||
#include "storage/procarray.h"
|
||||
@ -1387,6 +1388,9 @@ CheckPointTwoPhase(XLogRecPtr redo_horizon)
|
||||
*/
|
||||
if (max_prepared_xacts <= 0)
|
||||
return; /* nothing to do */
|
||||
|
||||
TRACE_POSTGRESQL_TWOPHASE_CHECKPOINT_START();
|
||||
|
||||
xids = (TransactionId *) palloc(max_prepared_xacts * sizeof(TransactionId));
|
||||
nxids = 0;
|
||||
|
||||
@ -1444,6 +1448,8 @@ CheckPointTwoPhase(XLogRecPtr redo_horizon)
|
||||
}
|
||||
|
||||
pfree(xids);
|
||||
|
||||
TRACE_POSTGRESQL_TWOPHASE_CHECKPOINT_DONE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user