Author: mmu_man Date: 2009-10-17 14:05:02 +0200 (Sat, 17 Oct 2009) New Revision: 33614 Changeset: http://dev.haiku-os.org/changeset/33614/haiku Modified: haiku/trunk/src/system/kernel/int.c Log: When debugging interrupt handlers is enabled, keep count of handled irq for each handler, to ease tracking which driver is unfriendly to others for shared irqs. Modified: haiku/trunk/src/system/kernel/int.c =================================================================== --- haiku/trunk/src/system/kernel/int.c 2009-10-17 12:02:31 UTC (rev 33613) +++ haiku/trunk/src/system/kernel/int.c 2009-10-17 12:05:02 UTC (rev 33614) @@ -37,6 +37,9 @@ void *data; bool use_enable_counter; bool no_handled_info; +#if DEBUG_INTERRUPTS + int64 handled_count; +#endif }; struct io_vector { @@ -86,8 +89,8 @@ if (strchr(imageName, '/') != NULL) imageName = strrchr(imageName, '/') + 1; - kprintf("\t%s:%s (%p), data %p\n", imageName, symbol, io->func, - io->data); + kprintf("\t%s:%s (%p), data %p, handled %8lld\n", imageName, symbol, io->func, + io->data, io->handled_count); } else kprintf("\t%p, data %p\n", io->func, io->data); } @@ -195,6 +198,9 @@ handled = true; else if (status == B_INVOKE_SCHEDULER) invokeScheduler = true; +#if DEBUG_INTERRUPTS + io->handled_count++; +#endif } #if DEBUG_INTERRUPTS @@ -300,6 +306,9 @@ io->data = data; io->use_enable_counter = (flags & B_NO_ENABLE_COUNTER) == 0; io->no_handled_info = (flags & B_NO_HANDLED_INFO) != 0; +#if DEBUG_INTERRUPTS + io->handled_count = 0LL; +#endif // Disable the interrupts, get the spinlock for this irq only // and then insert the handler