- uint64_t quantum_deadline = pp->quantum_timer_deadline;
- /* is it the quantum timer expiration? */
- if ((quantum_deadline <= abstime) && (quantum_deadline > 0)) {
- pp->quantum_timer_deadline = 0;
- quantum_timer_expire(abstime);
+ /*
+ * Log the timer latency *before* the power management events.
+ */
+ if (__probable(timer_processed)) {
+ /*
+ * Log the maximum interrupt service latency experienced by a timer.
+ */
+ int64_t latency = min_deadline == EndOfAllTime ? 0 :
+ (int64_t)(abstime - min_deadline);
+ /*
+ * Log interrupt service latency (-ve value expected by tool)
+ * a non-PM event is expected next.
+ * The requested deadline may be earlier than when it was set
+ * - use MAX to avoid reporting bogus latencies.
+ */
+ KDBG_RELEASE(DECR_TRAP_LATENCY, -latency,
+ user_mode != 0 ? rip : VM_KERNEL_UNSLIDE(rip), user_mode);