MXUserAcquisitionStats acquisitionStats;
Atomic_Ptr acquisitionHisto;
- void *holder;
VmTimeType holdStart;
MXUserBasicStats heldStats;
Atomic_Ptr heldHisto;
MXUserDumpExclLock(MXUserHeader *header) // IN:
{
MXUserExclLock *lock = (MXUserExclLock *) header;
- MXUserStats *stats = (MXUserStats *) Atomic_ReadPtr(&lock->statsMem);
Warning("%s: Exclusive lock @ 0x%p\n", __FUNCTION__, lock);
Warning("\taddress of owner data 0x%p\n",
&lock->recursiveLock.nativeThreadID);
-
- if (stats && (stats->holder != NULL)) {
- Warning("\tholder 0x%p\n", stats->holder);
- }
}
value != 0, // True if contended
value);
- stats->holder = GetReturnAddress();
-
histo = Atomic_ReadPtr(&stats->acquisitionHisto);
if (UNLIKELY(histo != NULL)) {
- MXUserHistoSample(histo, value, stats->holder);
+ MXUserHistoSample(histo, value, GetReturnAddress());
}
+
+ stats->holdStart = Hostinfo_SystemTimerNS();
} else {
MXRecLockAcquire(&lock->recursiveLock,
NULL); // non-stats
"%s: Acquire on an acquired exclusive lock\n",
__FUNCTION__);
}
-
- if (stats) {
- stats->holdStart = Hostinfo_SystemTimerNS();
- }
}
histo = Atomic_ReadPtr(&stats->heldHisto);
if (UNLIKELY(histo != NULL)) {
- MXUserHistoSample(histo, value, stats->holder);
- stats->holder = NULL;
+ MXUserHistoSample(histo, value, GetReturnAddress());
}
}
if (success) {
MXUserAcquisitionTracking(&lock->header, FALSE);
- if (MXRecLockCount(&lock->recursiveLock) > 1) {
+ if (vmx86_debug && (MXRecLockCount(&lock->recursiveLock) > 1)) {
MXUserDumpAndPanic(&lock->header,
"%s: Acquire on an acquired exclusive lock\n",
__FUNCTION__);
typedef struct {
HolderState state;
- void *holder;
VmTimeType holdStart;
} HolderContext;
HolderContext *newContext = Util_SafeMalloc(sizeof(HolderContext));
newContext->holdStart = 0;
- newContext->holder = NULL;
newContext->state = RW_UNLOCKED;
result = HashTable_LookupOrInsert(lock->holderTable, threadID,
if (forRead && lock->useNative) {
MXRecLockRelease(&lock->recursiveLock);
}
+
+ myContext->holdStart = Hostinfo_SystemTimerNS();
} else {
if (LIKELY(lock->useNative)) {
int err = 0;
Atomic_Inc(&lock->holderCount);
myContext->state = forRead ? RW_LOCKED_FOR_READ : RW_LOCKED_FOR_WRITE;
-
- if (stats) {
- myContext->holder = GetReturnAddress();
- myContext->holdStart = Hostinfo_SystemTimerNS();
- }
}
histo = Atomic_ReadPtr(&stats->heldHisto);
if (UNLIKELY(histo != NULL)) {
- MXUserHistoSample(histo, duration, myContext->holder);
- myContext->holder = NULL;
+ MXUserHistoSample(histo, duration, GetReturnAddress());
}
if ((myContext->state == RW_LOCKED_FOR_READ) && lock->useNative) {
MXUserAcquisitionStats acquisitionStats;
Atomic_Ptr acquisitionHisto;
- void *holder;
uint64 holdStart;
MXUserBasicStats heldStats;
Atomic_Ptr heldHisto;
Warning("\treference count %u\n", Atomic_Read(&lock->refCount));
if (lock->vmmLock == NULL) {
- MXUserStats *stats = (MXUserStats *) Atomic_ReadPtr(&lock->statsMem);
-
Warning("\tcount %u\n", lock->recursiveLock.referenceCount);
Warning("\taddress of owner data 0x%p\n",
&lock->recursiveLock.nativeThreadID);
-
- if (stats && (stats->holder != NULL)) {
- Warning("\tholder 0x%p\n", stats->holder);
- }
} else {
Warning("\tvmmLock 0x%p\n", lock->vmmLock);
}
value != 0, // True if contended
value);
- stats->holder = GetReturnAddress();
-
histo = Atomic_ReadPtr(&stats->acquisitionHisto);
if (UNLIKELY(histo != NULL)) {
- MXUserHistoSample(histo, value, stats->holder);
+ MXUserHistoSample(histo, value, GetReturnAddress());
}
stats->holdStart = Hostinfo_SystemTimerNS();
MXUserBasicStatsSample(&stats->heldStats, value);
if (UNLIKELY(histo != NULL)) {
- MXUserHistoSample(histo, value, stats->holder);
- stats->holder = NULL;
+ MXUserHistoSample(histo, value, GetReturnAddress());
}
}
}