Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdea6ed2

Browse files
committed
Fix build with LWLOCK_STATS or dtrace.
Also fix the name of the dtrace probe for LWLockAcquireOrWait(). Thefunction was renamed from LWLockWaitUntilFree to LWLockAqcuireOrWait, butthe dtrace probe was neglected.Pointed out by Andres Freund and the buildfarm.
1 parent1494931 commitdea6ed2

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

‎src/backend/storage/lmgr/lwlock.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -859,13 +859,13 @@ LWLockAcquireOrWait(LWLock *l, LWLockMode mode)
859859
/* Failed to get lock, so release interrupt holdoff */
860860
RESUME_INTERRUPTS();
861861
LOG_LWDEBUG("LWLockAcquireOrWait",T_NAME(l),T_ID(l),"failed");
862-
TRACE_POSTGRESQL_LWLOCK_WAIT_UNTIL_FREE_FAIL(T_NAME(l),T_ID(l),mode);
862+
TRACE_POSTGRESQL_LWLOCK_ACQUIRE_OR_WAIT_FAIL(T_NAME(l),T_ID(l),mode);
863863
}
864864
else
865865
{
866866
/* Add lock to list of locks held by this backend */
867867
held_lwlocks[num_held_lwlocks++]=l;
868-
TRACE_POSTGRESQL_LWLOCK_WAIT_UNTIL_FREE(T_NAME(l),T_ID(l),mode);
868+
TRACE_POSTGRESQL_LWLOCK_ACQUIRE_OR_WAIT(T_NAME(l),T_ID(l),mode);
869869
}
870870

871871
return !mustwait;
@@ -897,6 +897,15 @@ LWLockWaitForVar(LWLock *l, uint64 *valptr, uint64 oldval, uint64 *newval)
897897
PGPROC*proc=MyProc;
898898
intextraWaits=0;
899899
boolresult= false;
900+
#ifdefLWLOCK_STATS
901+
lwlock_stats*lwstats;
902+
#endif
903+
904+
PRINT_LWDEBUG("LWLockWaitForVar",lock);
905+
906+
#ifdefLWLOCK_STATS
907+
lwstats=get_lwlock_stats_entry(l);
908+
#endif/* LWLOCK_STATS */
900909

901910
/*
902911
* Quick test first to see if it the slot is free right now.
@@ -986,7 +995,7 @@ LWLockWaitForVar(LWLock *l, uint64 *valptr, uint64 oldval, uint64 *newval)
986995
lwstats->block_count++;
987996
#endif
988997

989-
TRACE_POSTGRESQL_LWLOCK_WAIT_START(T_NAME(l),T_ID(l),mode);
998+
TRACE_POSTGRESQL_LWLOCK_WAIT_START(T_NAME(l),T_ID(l),LW_EXCLUSIVE);
990999

9911000
for (;;)
9921001
{
@@ -997,7 +1006,7 @@ LWLockWaitForVar(LWLock *l, uint64 *valptr, uint64 oldval, uint64 *newval)
9971006
extraWaits++;
9981007
}
9991008

1000-
TRACE_POSTGRESQL_LWLOCK_WAIT_DONE(T_NAME(l),T_ID(l),mode);
1009+
TRACE_POSTGRESQL_LWLOCK_WAIT_DONE(T_NAME(l),T_ID(l),LW_EXCLUSIVE);
10011010

10021011
LOG_LWDEBUG("LWLockWaitForVar",T_NAME(l),T_ID(l),"awakened");
10031012

@@ -1007,7 +1016,7 @@ LWLockWaitForVar(LWLock *l, uint64 *valptr, uint64 oldval, uint64 *newval)
10071016
/* We are done updating shared state of the lock itself. */
10081017
SpinLockRelease(&lock->mutex);
10091018

1010-
TRACE_POSTGRESQL_LWLOCK_ACQUIRE(T_NAME(l),T_ID(l),mode);
1019+
TRACE_POSTGRESQL_LWLOCK_ACQUIRE(T_NAME(l),T_ID(l),LW_EXCLUSIVE);
10111020

10121021
/*
10131022
* Fix the process wait semaphore's count for any absorbed wakeups.

‎src/backend/utils/probes.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ provider postgresql {
3434
probelwlock__wait__done(constchar*,int,LWLockMode);
3535
probelwlock__condacquire(constchar*,int,LWLockMode);
3636
probelwlock__condacquire__fail(constchar*,int,LWLockMode);
37-
probelwlock__wait__until__free(constchar*,int,LWLockMode);
38-
probelwlock__wait__until__free__fail(constchar*,int,LWLockMode);
37+
probelwlock__acquire__or__wait(constchar*,int,LWLockMode);
38+
probelwlock__acquire__or__wait__fail(constchar*,int,LWLockMode);
3939

4040
probelock__wait__start(unsignedint,unsignedint,unsignedint,unsignedint,unsignedint,LOCKMODE);
4141
probelock__wait__done(unsignedint,unsignedint,unsignedint,unsignedint,unsignedint,LOCKMODE);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp