/*
- * Copyright (c) 1998-2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1998-2010 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#include <mach/sync_policy.h>
+#if IOKITSTATS
+
+#define IOStatisticsInitializeCounter() \
+ IOStatistics::setCounterType(reserved->counter, kIOStatisticsCommandQueueCounter)
+
+#define IOStatisticsActionCall() \
+ IOStatistics::countCommandQueueActionCall(reserved->counter)
+
+#else
+
+#define IOStatisticsInitializeCounter()
+#define IOStatisticsActionCall()
+
+#endif /* IOKITSTATS */
#define NUM_FIELDS_IN_COMMAND 4
typedef struct commandEntryTag {
producerIndex = consumerIndex = 0;
+ IOStatisticsInitializeCounter();
+
return true;
}
bool IOCommandQueue::checkForWork()
{
- void *field0, *field1, *field2, *field3;
+ void *field0, *field1, *field2, *field3;
bool trace = ( gIOKitTrace & kIOTraceCommandGates ) ? true : false;
if (!enabled || consumerIndex == producerIndex)
if (trace)
IOTimeStampStartConstant(IODBG_CMDQ(IOCMDQ_ACTION),
- (uintptr_t) action, (uintptr_t) owner);
-
+ (uintptr_t) action, (uintptr_t) owner);
+
+ IOStatisticsActionCall();
(*(IOCommandQueueAction) action)(owner, field0, field1, field2, field3);
-
+
if (trace)
IOTimeStampEndConstant(IODBG_CMDQ(IOCMDQ_ACTION),
(uintptr_t) action, (uintptr_t) owner);