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.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33614 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+11
-2
@@ -37,6 +37,9 @@ struct io_handler {
|
|||||||
void *data;
|
void *data;
|
||||||
bool use_enable_counter;
|
bool use_enable_counter;
|
||||||
bool no_handled_info;
|
bool no_handled_info;
|
||||||
|
#if DEBUG_INTERRUPTS
|
||||||
|
int64 handled_count;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct io_vector {
|
struct io_vector {
|
||||||
@@ -86,8 +89,8 @@ dump_int_statistics(int argc, char **argv)
|
|||||||
if (strchr(imageName, '/') != NULL)
|
if (strchr(imageName, '/') != NULL)
|
||||||
imageName = strrchr(imageName, '/') + 1;
|
imageName = strrchr(imageName, '/') + 1;
|
||||||
|
|
||||||
kprintf("\t%s:%s (%p), data %p\n", imageName, symbol, io->func,
|
kprintf("\t%s:%s (%p), data %p, handled %8lld\n", imageName, symbol, io->func,
|
||||||
io->data);
|
io->data, io->handled_count);
|
||||||
} else
|
} else
|
||||||
kprintf("\t%p, data %p\n", io->func, io->data);
|
kprintf("\t%p, data %p\n", io->func, io->data);
|
||||||
}
|
}
|
||||||
@@ -195,6 +198,9 @@ int_io_interrupt_handler(int vector, bool levelTriggered)
|
|||||||
handled = true;
|
handled = true;
|
||||||
else if (status == B_INVOKE_SCHEDULER)
|
else if (status == B_INVOKE_SCHEDULER)
|
||||||
invokeScheduler = true;
|
invokeScheduler = true;
|
||||||
|
#if DEBUG_INTERRUPTS
|
||||||
|
io->handled_count++;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG_INTERRUPTS
|
#if DEBUG_INTERRUPTS
|
||||||
@@ -300,6 +306,9 @@ install_io_interrupt_handler(long vector, interrupt_handler handler, void *data,
|
|||||||
io->data = data;
|
io->data = data;
|
||||||
io->use_enable_counter = (flags & B_NO_ENABLE_COUNTER) == 0;
|
io->use_enable_counter = (flags & B_NO_ENABLE_COUNTER) == 0;
|
||||||
io->no_handled_info = (flags & B_NO_HANDLED_INFO) != 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
|
// Disable the interrupts, get the spinlock for this irq only
|
||||||
// and then insert the handler
|
// and then insert the handler
|
||||||
|
|||||||
Reference in New Issue
Block a user