Add debugging info to ipchaninfo()
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 22 Mar 2016 19:43:08 +0000 (15:43 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 22 Mar 2016 19:47:38 +0000 (15:47 -0400)
Reports nonblock status and whether or not the conv is tapped.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/net/devip.c

index 3a9da79..0865941 100644 (file)
@@ -626,8 +626,10 @@ static char *ipchaninfo(struct chan *ch, char *ret, size_t ret_l)
                case Qdata:
                        proto = f->p[PROTO(ch->qid)];
                        conv = proto->conv[CONV(ch->qid)];
-                       snprintf(ret, ret_l, "Qdata, proto %s, conv idx %d", proto->name,
-                                        conv->x);
+                       snprintf(ret, ret_l, "Qdata, %s %s proto %s, conv idx %d",
+                                conv->nonblock ? "nonblock" : "block",
+                                SLIST_EMPTY(&conv->data_taps) ? "untapped" : "tapped",
+                                proto->name, conv->x);
                        break;
                case Qarp:
                        ret = "Qarp";
@@ -638,8 +640,10 @@ static char *ipchaninfo(struct chan *ch, char *ret, size_t ret_l)
                case Qlisten:
                        proto = f->p[PROTO(ch->qid)];
                        conv = proto->conv[CONV(ch->qid)];
-                       snprintf(ret, ret_l, "Qlisten, proto %s, conv idx %d", proto->name,
-                                        conv->x);
+                       snprintf(ret, ret_l, "Qlisten, %s %s proto %s, conv idx %d",
+                                conv->nonblock ? "nonblock" : "block",
+                                SLIST_EMPTY(&conv->data_taps) ? "untapped" : "tapped",
+                                proto->name, conv->x);
                        break;
                case Qlog:
                        ret = "Qlog";