Re: DTrace probes patch

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Lor <Robert(dot)Lor(at)Sun(dot)COM>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DTrace probes patch
Date: 2008-12-24 20:41:34
Message-ID: 200812242041.mBOKfYw29583@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Thanks, applied.

---------------------------------------------------------------------------

Robert Lor wrote:
> Tom Lane wrote:
> > Robert Lor <Robert(dot)Lor(at)Sun(dot)COM> writes:
> >
> >> Tom Lane wrote:
> >>
> >>> I agree. If the probe is meant to track only *some* WAL writes
> >>> then it needs to be named something less generic than
> >>> TRACE_POSTGRESQL_WAL_BUFFER_WRITE.
> >>>
> >>>
> >> How about change it to TRACE_POSTGRESQL_WAL_BUFFER_WRITE_DIRTY similar to TRACE_POSTGRESQL_BUFFER_WRITE_DIRTY for shared buffers?
> >>
> >
> > Works for me...
> >
> >
> Attached is the patch for the above name change.
>
>
> -Robert

> Index: src/backend/access/transam/xlog.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql/src/backend/access/transam/xlog.c,v
> retrieving revision 1.324
> diff -u -3 -p -r1.324 xlog.c
> --- src/backend/access/transam/xlog.c 17 Dec 2008 01:39:03 -0000 1.324
> +++ src/backend/access/transam/xlog.c 22 Dec 2008 16:28:00 -0000
> @@ -1318,14 +1318,14 @@ AdvanceXLInsertBuffer(bool new_segment)
> * Have to write buffers while holding insert lock. This is
> * not good, so only write as much as we absolutely must.
> */
> - TRACE_POSTGRESQL_WAL_BUFFER_WRITE_START();
> + TRACE_POSTGRESQL_WAL_BUFFER_WRITE_DIRTY_START();
> WriteRqst.Write = OldPageRqstPtr;
> WriteRqst.Flush.xlogid = 0;
> WriteRqst.Flush.xrecoff = 0;
> XLogWrite(WriteRqst, false, false);
> LWLockRelease(WALWriteLock);
> Insert->LogwrtResult = LogwrtResult;
> - TRACE_POSTGRESQL_WAL_BUFFER_WRITE_DONE();
> + TRACE_POSTGRESQL_WAL_BUFFER_WRITE_DIRTY_DONE();
> }
> }
> }
> Index: src/backend/utils/probes.d
> ===================================================================
> RCS file: /projects/cvsroot/pgsql/src/backend/utils/probes.d,v
> retrieving revision 1.4
> diff -u -3 -p -r1.4 probes.d
> --- src/backend/utils/probes.d 17 Dec 2008 01:39:04 -0000 1.4
> +++ src/backend/utils/probes.d 22 Dec 2008 16:28:01 -0000
> @@ -89,6 +89,6 @@ provider postgresql {
>
> probe xlog__insert(unsigned char, unsigned char);
> probe xlog__switch();
> - probe wal__buffer__write__start();
> - probe wal__buffer__write__done();
> + probe wal__buffer__write__dirty__start();
> + probe wal__buffer__write__dirty__done();
> };

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Emmanuel Cecchet 2008-12-24 20:43:47 Re: incoherent view of serializable transactions
Previous Message Grzegorz Jaskiewicz 2008-12-24 20:11:56 merry christmas folks