Fix a few debugging tools
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 4 Oct 2016 19:35:18 +0000 (15:35 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 6 Oct 2016 19:41:48 +0000 (15:41 -0400)
These are minor changes that helped with debugging.  The asserts in qio are
an attempt to debug I panic I got only once.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/monitor.c
kern/src/ns/qio.c
kern/src/ns/sysfile.c
kern/src/trap.c

index ba0e46b..218b872 100644 (file)
@@ -768,6 +768,7 @@ int mon_trace(int argc, char **argv, struct hw_trapframe *hw_tf)
                        for (int i = 0; i < num_cores; i++) {
                                _PERCPU_VAR(mon_nmi_trace, i) = TRUE;
                                send_nmi(i);
+                               udelay(1000000);
                        }
                } else {
                        printk("Sending NMI core %d:\n", core);
index 7f9b3ef..40309c0 100644 (file)
@@ -1344,6 +1344,9 @@ static size_t read_all_blocks(struct block *b, void *va, size_t len)
        do {
                /* We should be draining every block completely. */
                assert(BLEN(b) <= len - sofar);
+               assert(va);
+               assert(va + sofar);
+               assert(b->rp);
                sofar += read_from_block(b, va + sofar, len - sofar);
                next = b->next;
                freeb(b);
index e47a81a..0011513 100644 (file)
@@ -1262,7 +1262,7 @@ int sysiounit(int fd)
 void print_chaninfo(struct chan *c)
 {
 
-       char buf[64] = { 0 };
+       char buf[128] = { 0 };
        bool has_dev = c->type != -1;
        bool has_chaninfo = has_dev && devtab[c->type].chaninfo;
 
index 83d4a58..4a6f494 100644 (file)
@@ -265,8 +265,9 @@ void print_kmsgs(uint32_t coreid)
                struct kernel_message *kmsg_i;
                STAILQ_FOREACH(kmsg_i, list, link) {
                        fn_name = get_fn_name((long)kmsg_i->pc);
-                       printk("%s KMSG on %d from %d to run %p(%s)\n", type,
-                              kmsg_i->dstid, kmsg_i->srcid, kmsg_i->pc, fn_name);
+                       printk("%s KMSG on %d from %d to run %p(%s)(%p, %p, %p)\n", type,
+                              kmsg_i->dstid, kmsg_i->srcid, kmsg_i->pc, fn_name,
+                              kmsg_i->arg0, kmsg_i->arg1, kmsg_i->arg2);
                        kfree(fn_name);
                }
        }