~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to lib/lock/ulStats.c

  • Committer: Package Import Robot
  • Author(s): Nate Muench
  • Date: 2012-06-20 15:59:51 UTC
  • mfrom: (1.4.8)
  • Revision ID: package-import@ubuntu.com-20120620155951-6rupmpb0f70b52zr
Tags: 2012.05.21-724730-0ubuntu1
* Merging upstream version 2012.05.21-724730.
  - Fixes building against the current Quantal kernel. (LP: #1000344)
  - Fixes Quantal installation issues. (LP: #1019031)

* Sync with Debian
  - Updating to debhelper version 9.
  - Updating to standards version 3.9.3.
  - Updating copyright file machine-readable format version 1.0.
  - Building without multiarch paths for now

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
   TopOwner  ownerArray[TOPOWNERS];  // List of top owners
57
57
};
58
58
 
 
59
static Bool    mxUserTrackHeldTimes = FALSE;
59
60
static char   *mxUserHistoLine = NULL;
60
61
static uint32  mxUserMaxLineLength = 0;
61
62
static void   *mxUserStatsContext = NULL;
87
88
 
88
89
   /* Tolerate a failure. This is too low down to log */
89
90
   if (listLock) {
90
 
      MXRecLockAcquire(listLock);
 
91
      MXRecLockAcquire(listLock,
 
92
                       NULL);  // non-stats
91
93
      LIST_QUEUE(&header->item, &mxUserLockList);
92
94
      MXRecLockRelease(listLock);
93
95
   }
117
119
 
118
120
   /* Tolerate a failure. This is too low down to log */
119
121
   if (listLock) {
120
 
      MXRecLockAcquire(listLock);
 
122
      MXRecLockAcquire(listLock,
 
123
                       NULL);  // non-stats
121
124
      LIST_DEL(&header->item, &mxUserLockList);
122
125
      MXRecLockRelease(listLock);
123
126
   }
902
905
   }
903
906
}
904
907
 
905
 
 
906
908
/*
907
909
 *-----------------------------------------------------------------------------
908
910
 *
909
 
 * MXUserStatsEnabled --
 
911
 * MXUserStatsMode --
910
912
 *
911
 
 *      Are statistics keeping enabled
 
913
 *      What's to be done with statistics?
912
914
 *
913
915
 * Results:
914
 
 *      TRUE   Yes
915
 
 *      FALSE  NO
 
916
 *      0  Statstics are disabled
 
917
 *      1  Collect statistics without tracking held times
 
918
 *      2  Collect statistics with track held times
916
919
 *
917
920
 * Side effects:
918
921
 *      None
920
923
 *-----------------------------------------------------------------------------
921
924
 */
922
925
 
923
 
Bool
924
 
MXUserStatsEnabled(void)
 
926
uint32
 
927
MXUserStatsMode(void)
925
928
{
926
 
   return (mxUserStatsFunc != NULL) && (mxUserMaxLineLength > 0);
 
929
   if (vmx86_stats && (mxUserStatsFunc != NULL) && (mxUserMaxLineLength > 0)) {
 
930
      return mxUserTrackHeldTimes ? 2 : 1;
 
931
   } else {
 
932
      return 0;
 
933
   }
927
934
}
928
935
 
929
936
 
950
957
void
951
958
MXUser_SetStatsFunc(void *context,                    // IN:
952
959
                    uint32 maxLineLength,             // IN:
 
960
                    Bool trackHeldTimes,              // IN:
953
961
                    void (*statsFunc)(void *context,  // IN:
954
962
                                      const char *fmt,
955
963
                                      va_list ap))
962
970
   mxUserStatsContext = context;
963
971
   mxUserMaxLineLength = maxLineLength;
964
972
   mxUserStatsFunc = statsFunc;
 
973
   mxUserTrackHeldTimes = trackHeldTimes;
965
974
}
966
975
 
967
976