From: VMware, Inc <> Date: Mon, 26 Jul 2010 18:11:20 +0000 (-0700) Subject: lib/lock: report MXUserSemaphore timed wait success/failure X-Git-Tag: 2010.07.25-280253~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8645f5074c3e66b80df9a0bfcf600041142fe1e7;p=thirdparty%2Fopen-vm-tools.git lib/lock: report MXUserSemaphore timed wait success/failure Only successes were being reported for statistics. We can now properly handle success and failure reporting. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/lock/ulSema.c b/open-vm-tools/lib/lock/ulSema.c index e063a7a15..b6698cca9 100644 --- a/open-vm-tools/lib/lock/ulSema.c +++ b/open-vm-tools/lib/lock/ulSema.c @@ -699,17 +699,18 @@ MXUser_TimedDownSemaphore(MXUserSemaphore *sema, // IN/OUT: &downOccurred); } - if (LIKELY(err == 0) && downOccurred) { - MXUserHisto *histo; + if (LIKELY(err == 0)) { VmTimeType value = Hostinfo_SystemTimerNS() - begin; MXUserAcquisitionSample(&sema->acquisitionStats, downOccurred, !tryDownSuccess, value); - histo = Atomic_ReadPtr(&sema->acquisitionHisto); + if (downOccurred) { + MXUserHisto *histo = Atomic_ReadPtr(&sema->acquisitionHisto); - if (UNLIKELY(histo != NULL)) { - MXUserHistoSample(histo, value); + if (UNLIKELY(histo != NULL)) { + MXUserHistoSample(histo, value); + } } } }