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

Commit 740c9da

Browse files
committed
fixes to lock debugging macros from Massimo Dal Zotto
1 parent 00a420d commit 740c9da

File tree

1 file changed

+9
-6
lines changed
  • src/backend/storage/lmgr

1 file changed

+9
-6
lines changed

src/backend/storage/lmgr/lock.c

+9-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.39 1998/12/15 12:46:30 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.40 1999/01/17 20:59:56 tgl Exp $
1111
*
1212
* NOTES
1313
* Outside modules can create a lock table and acquire/release
@@ -79,7 +79,8 @@ static int WaitOnLock(LOCKMETHOD lockmethod, LOCK *lock, LOCKMODE lockmode,
7979
#define LOCK_PRINT(where,lock,type) \
8080
if (((LOCKDEBUG(LOCK_LOCKMETHOD(*(lock))) >= 1) \
8181
&& (lock->tag.relId >= lockDebugOidMin)) \
82-
|| (lock->tag.relId == lockDebugRelation)) \
82+
|| \
83+
(lockDebugRelation && (lock->tag.relId == lockDebugRelation))) \
8384
LOCK_PRINT_AUX(where,lock,type)
8485

8586
#define LOCK_PRINT_AUX(where,lock,type) \
@@ -113,8 +114,9 @@ static int WaitOnLock(LOCKMETHOD lockmethod, LOCK *lock, LOCKMODE lockmode,
113114
if (((LOCKDEBUG(XIDENT_LOCKMETHOD(*(xidentP))) >= 1) \
114115
&& (((LOCK *)MAKE_PTR(xidentP->tag.lock))->tag.relId \
115116
>= lockDebugOidMin)) \
116-
|| (((LOCK *)MAKE_PTR(xidentP->tag.lock))->tag.relId \
117-
== lockDebugRelation)) \
117+
|| (lockDebugRelation && \
118+
(((LOCK *)MAKE_PTR(xidentP->tag.lock))->tag.relId \
119+
== lockDebugRelation))) \
118120
XID_PRINT_AUX(where,xidentP)
119121

120122
#define XID_PRINT_AUX(where,xidentP) \
@@ -1206,7 +1208,8 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag, LOCKMODE lockmode)
12061208
{
12071209
if (((LOCKDEBUG(LOCK_LOCKMETHOD(*(lock))) >= 1) \
12081210
&& (lock->tag.relId >= lockDebugOidMin)) \
1209-
|| (lock->tag.relId == lockDebugRelation))
1211+
|| \
1212+
(lockDebugRelation && (lock->tag.relId == lockDebugRelation)))
12101213
TPRINTF(TRACE_ALL, "LockRelease: no wakeup needed");
12111214
}
12121215

@@ -1290,7 +1293,7 @@ LockReleaseAll(LOCKMETHOD lockmethod, SHM_QUEUE *lockQueue)
12901293
lock = (LOCK *) MAKE_PTR(xidLook->tag.lock);
12911294

12921295
xidtag_lockmethod = XIDENT_LOCKMETHOD(*xidLook);
1293-
if ((xidtag_lockmethod == lockmethod) || (trace_flag >= 2))
1296+
if ((xidtag_lockmethod == lockmethod) && pg_options[trace_flag])
12941297
{
12951298
XID_PRINT("LockReleaseAll", xidLook);
12961299
LOCK_PRINT("LockReleaseAll", lock, 0);

0 commit comments

Comments
 (0)