From 5e760150c229c63d7fcea7252a41ad72b84d8755 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sun, 8 Jun 2008 00:23:17 +0000 Subject: [PATCH] * Add read, write and total count to the ports KDL command so one can see what the ports of a team are up to without having to go through each port individually. * Enlarge the port id column so even large ids fit nicely. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25857 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/port.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/port.cpp b/src/system/kernel/port.cpp index 2e372cc167..0a0b6154e2 100644 --- a/src/system/kernel/port.cpp +++ b/src/system/kernel/port.cpp @@ -95,7 +95,7 @@ dump_port_list(int argc, char **argv) } else if (argc > 1) owner = strtoul(argv[1], NULL, 0); - kprintf("port id cap r-sem w-sem team name\n"); + kprintf("port id cap r-sem r-cnt w-sem w-cnt total team name\n"); for (i = 0; i < sMaxPorts; i++) { struct port_entry *port = &sPorts[i]; @@ -104,8 +104,12 @@ dump_port_list(int argc, char **argv) || (name != NULL && strstr(port->name, name) == NULL)) continue; - kprintf("%p %6ld %4ld %6ld %6ld %6ld %s\n", port, port->id, - port->capacity, port->read_sem, port->write_sem, port->owner, + int32 readCount, writeCount; + get_sem_count(port->read_sem, &readCount); + get_sem_count(port->write_sem, &writeCount); + kprintf("%p %8ld %4ld %6ld %6ld %6ld %6ld %8ld %6ld %s\n", port, + port->id, port->capacity, port->read_sem, readCount, + port->write_sem, writeCount, port->total_count, port->owner, port->name); } return 0;