From 2388f50c53422ea8e05382e3109883d1c3327313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 10 Dec 2009 11:14:46 +0000 Subject: [PATCH] * The io_handler::handled_count was increased unconditionally, but in some cases not at all. * Tried to improve the readability of the "ints" command output. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34613 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/int.cpp | 40 +++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/system/kernel/int.cpp b/src/system/kernel/int.cpp index 61304fa263..d1f913ebc6 100644 --- a/src/system/kernel/int.cpp +++ b/src/system/kernel/int.cpp @@ -88,13 +88,21 @@ dump_int_statistics(int argc, char **argv) if (error == B_OK && exactMatch) { if (strchr(imageName, '/') != NULL) imageName = strrchr(imageName, '/') + 1; - - kprintf("\t%s:%s (%p), data %p, handled %8lld%s\n", imageName, - symbol, io->func, io->data, io->handled_count, - io->no_handled_info ? ", NO HANDLED INFO" : ""); + + int length = 4 + strlen(imageName); + kprintf(" %s:%-*s (%p)", imageName, 45 - length, symbol, + io->func); } else - kprintf("\t%p, data %p\n", io->func, io->data); + kprintf("\t\t\t\t\t func %p", io->func); + + kprintf(", data %p, handled ", io->data); + if (io->no_handled_info) + kprintf("\n"); + else + kprintf("%8lld\n", io->handled_count); } + + kprintf("\n"); } return 0; } @@ -180,18 +188,21 @@ int_io_interrupt_handler(int vector, bool levelTriggered) } #endif - /* For level-triggered interrupts, we actually handle the return - * value (ie. B_HANDLED_INTERRUPT) to decide wether or not we - * want to call another interrupt handler. - * For edge-triggered interrupts, however, we always need to call - * all handlers, as multiple interrupts cannot be identified. We - * still make sure the return code of this function will issue - * whatever the driver thought would be useful (ie. B_INVOKE_SCHEDULER) - */ + // For level-triggered interrupts, we actually handle the return + // value (ie. B_HANDLED_INTERRUPT) to decide wether or not we + // want to call another interrupt handler. + // For edge-triggered interrupts, however, we always need to call + // all handlers, as multiple interrupts cannot be identified. We + // still make sure the return code of this function will issue + // whatever the driver thought would be useful (ie. B_INVOKE_SCHEDULER) for (io = sVectors[vector].handler_list; io != NULL; io = io->next) { status = io->func(io->data); +#if DEBUG_INTERRUPTS + if (status != B_UNHANDLED_INTERRUPT) + io->handled_count++; +#endif if (levelTriggered && status != B_UNHANDLED_INTERRUPT) break; @@ -199,9 +210,6 @@ int_io_interrupt_handler(int vector, bool levelTriggered) handled = true; else if (status == B_INVOKE_SCHEDULER) invokeScheduler = true; -#if DEBUG_INTERRUPTS - io->handled_count++; -#endif } #if DEBUG_INTERRUPTS