-
- if (numInts > 0) {
-
- IOTimeStampLatency();
- IOTimeTypeStampS(IOINTES_CLIENT);
- IOTimeStampConstant(IODBG_INTES(IOINTES_ACTION),
- (unsigned int) intAction, (unsigned int) owner);
- (*intAction)(owner, this, numInts);
- IOTimeTypeStampE(IOINTES_CLIENT);
-
- consumerCount = cacheProdCount;
- if (autoDisable && !explicitDisable)
- enable();
- }
- else if (numInts < 0) {
- IOTimeStampLatency();
- IOTimeTypeStampS(IOINTES_CLIENT);
- IOTimeStampConstant(IODBG_INTES(IOINTES_ACTION),
- (unsigned int) intAction, (unsigned int) owner);
- (*intAction)(owner, this, -numInts);
- IOTimeTypeStampE(IOINTES_CLIENT);
-
- consumerCount = cacheProdCount;
- if (autoDisable && !explicitDisable)
- enable();
- }
-
+ bool trace = (gIOKitTrace & kIOTraceIntEventSource) ? true : false;
+
+ IOStatisticsCheckForWork();
+
+ if ( numInts > 0 )
+ {
+ if (trace)
+ IOTimeStampStartConstant(IODBG_INTES(IOINTES_ACTION),
+ (uintptr_t) intAction, (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop);
+
+ // Call the handler
+ (*intAction)(owner, this, numInts);
+
+ if (trace)
+ IOTimeStampEndConstant(IODBG_INTES(IOINTES_ACTION),
+ (uintptr_t) intAction, (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop);
+
+ consumerCount = cacheProdCount;
+ if (autoDisable && !explicitDisable)
+ enable();
+ }
+
+ else if ( numInts < 0 )
+ {
+ if (trace)
+ IOTimeStampStartConstant(IODBG_INTES(IOINTES_ACTION),
+ (uintptr_t) intAction, (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop);
+
+ // Call the handler
+ (*intAction)(owner, this, -numInts);
+
+ if (trace)
+ IOTimeStampEndConstant(IODBG_INTES(IOINTES_ACTION),
+ (uintptr_t) intAction, (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop);
+
+ consumerCount = cacheProdCount;
+ if (autoDisable && !explicitDisable)
+ enable();
+ }
+