diff options
| author | Peter Eisentraut <peter_e@gmx.net> | 2006-07-24 16:32:45 +0000 |
|---|---|---|
| committer | Peter Eisentraut <peter_e@gmx.net> | 2006-07-24 16:32:45 +0000 |
| commit | e9b49690627eb91106af3aa98d0fcc510de6538b (patch) | |
| tree | 2e878a58fbb23ace8f2cfe4758779a62869f1239 /src/backend/storage/lmgr/lwlock.c | |
| parent | 9dc34b5feb73615d7371ef1c1b7c05b3146cc9a9 (diff) | |
| download | postgresql-e9b49690627eb91106af3aa98d0fcc510de6538b.tar.gz | |
DTrace support, with a small initial set of probes
by Robert Lor
Diffstat (limited to 'src/backend/storage/lmgr/lwlock.c')
| -rw-r--r-- | src/backend/storage/lmgr/lwlock.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 077bec4a60..f10de0dca0 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -15,7 +15,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.41 2006/07/23 03:07:58 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.42 2006/07/24 16:32:45 petere Exp $ * *------------------------------------------------------------------------- */ @@ -420,6 +420,8 @@ LWLockAcquire(LWLockId lockid, LWLockMode mode) block_counts[lockid]++; #endif + PG_TRACE2(lwlock__startwait, lockid, mode); + for (;;) { /* "false" means cannot accept cancel/die interrupt here. */ @@ -429,6 +431,8 @@ LWLockAcquire(LWLockId lockid, LWLockMode mode) extraWaits++; } + PG_TRACE2(lwlock__endwait, lockid, mode); + LOG_LWDEBUG("LWLockAcquire", lockid, "awakened"); /* Now loop back and try to acquire lock again. */ @@ -438,6 +442,8 @@ LWLockAcquire(LWLockId lockid, LWLockMode mode) /* We are done updating shared state of the lock itself. */ SpinLockRelease(&lock->mutex); + PG_TRACE2(lwlock__acquire, lockid, mode); + /* Add lock to list of locks held by this backend */ held_lwlocks[num_held_lwlocks++] = lockid; @@ -507,11 +513,13 @@ LWLockConditionalAcquire(LWLockId lockid, LWLockMode mode) /* Failed to get lock, so release interrupt holdoff */ RESUME_INTERRUPTS(); LOG_LWDEBUG("LWLockConditionalAcquire", lockid, "failed"); + PG_TRACE2(lwlock__condacquire__fail, lockid, mode); } else { /* Add lock to list of locks held by this backend */ held_lwlocks[num_held_lwlocks++] = lockid; + PG_TRACE2(lwlock__condacquire, lockid, mode); } return !mustwait; @@ -596,6 +604,8 @@ LWLockRelease(LWLockId lockid) /* We are done updating shared state of the lock itself. */ SpinLockRelease(&lock->mutex); + PG_TRACE1(lwlock__release, lockid); + /* * Awaken any waiters I removed from the queue. */ |
