Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name :
  4. iperfctr.hxx
  5. Abstract:
  6. This file defines macros to use for performance counters
  7. Author:
  8. Murali R. Krishnan ( MuraliK ) 28-Feb-1997
  9. Environment:
  10. User Mode - Win32
  11. Project:
  12. Internet Server DLL
  13. Revision History:
  14. Prefix:
  15. IP* - Internet Information Server Performance *
  16. --*/
  17. # ifndef _IPERFCTR_HXX_
  18. # define _IPERFCTR_HXX_
  19. /************************************************************
  20. * Include Headers
  21. ************************************************************/
  22. /************************************************************
  23. * Macro Definitions
  24. ************************************************************/
  25. // define the IP_ENABLE_COUNTERS if you need perf counters
  26. # ifdef IP_ENABLE_COUNTERS
  27. // Defines a counter object - in future I need to build a fan-out counters
  28. # define IP_DEFUN_COUNTER( name ) \
  29. LONG name
  30. # define IP_INCREMENT_COUNTER( name) \
  31. InterlockedIncrement( (LPLONG ) &name)
  32. # define IP_DECREMENT_COUNTER( name) \
  33. InterlockedDecrement( (LPLONG ) &name)
  34. # define IP_SET_COUNTER( name, val) \
  35. InterlockedExchange( (LPLONG ) &name, val)
  36. // return the value directly
  37. # define IP_COUNTER_VALUE( name) \
  38. (name)
  39. # else // IP_ENABLE_COUNTERS
  40. //
  41. // If the counters are disabled i.e., IP_ENABLE_COUNTERS == FALSE
  42. // => do not set these counters.
  43. // All the macros default to no work to be done.
  44. //
  45. # define IP_DEFUN_COUNTER( name ) /* do nothing */
  46. # define IP_INCREMENT_COUNTER( name) /* do nothing */
  47. # define IP_DECREMENT_COUNTER( name) /* do nothing */
  48. # define IP_SET_COUNTER( name, val) /* as usual do nothing! */
  49. # define IP_COUNTER_VALUE( name) ( 0) // return value as 0 => invalid
  50. # endif // IP_ENABLE_COUNTERS
  51. # endif // _IPERFCTR_HXX_
  52. /************************ End of File ***********************/