]> Joshua Wise's Git repositories - netwatch.git/commitdiff
some better debugging output from lwip
authorJacob Potter <jdpotter@andrew.cmu.edu>
Sun, 14 Dec 2008 01:27:32 +0000 (20:27 -0500)
committerJacob Potter <jdpotter@andrew.cmu.edu>
Sun, 14 Dec 2008 01:27:32 +0000 (20:27 -0500)
lwip/src/core/stats.c
lwip/src/include/arch/cc.h
lwip/src/include/lwipopts.h

index 0604468dd4d531373c70233fc0a80e39c3c5ea51..2d5c1e3a076f775517a00c0e132276a71460b3cd 100644 (file)
@@ -52,45 +52,45 @@ struct stats_ lwip_stats;
 void
 stats_display_proto(struct stats_proto *proto, char *name)
 {
-  LWIP_PLATFORM_DIAG(("\n%s\n\t", name));
-  LWIP_PLATFORM_DIAG(("xmit: %"STAT_COUNTER_F"\n\t", proto->xmit)); 
-  LWIP_PLATFORM_DIAG(("rexmit: %"STAT_COUNTER_F"\n\t", proto->rexmit)); 
-  LWIP_PLATFORM_DIAG(("recv: %"STAT_COUNTER_F"\n\t", proto->recv)); 
-  LWIP_PLATFORM_DIAG(("fw: %"STAT_COUNTER_F"\n\t", proto->fw)); 
-  LWIP_PLATFORM_DIAG(("drop: %"STAT_COUNTER_F"\n\t", proto->drop)); 
-  LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", proto->chkerr)); 
-  LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", proto->lenerr)); 
-  LWIP_PLATFORM_DIAG(("memerr: %"STAT_COUNTER_F"\n\t", proto->memerr)); 
-  LWIP_PLATFORM_DIAG(("rterr: %"STAT_COUNTER_F"\n\t", proto->rterr)); 
-  LWIP_PLATFORM_DIAG(("proterr: %"STAT_COUNTER_F"\n\t", proto->proterr)); 
-  LWIP_PLATFORM_DIAG(("opterr: %"STAT_COUNTER_F"\n\t", proto->opterr)); 
-  LWIP_PLATFORM_DIAG(("err: %"STAT_COUNTER_F"\n\t", proto->err)); 
-  LWIP_PLATFORM_DIAG(("cachehit: %"STAT_COUNTER_F"\n", proto->cachehit)); 
+  LWIP_PLATFORM_DIAG(("%s", name));
+  LWIP_PLATFORM_DIAG(("  xmit: %"STAT_COUNTER_F, proto->xmit)); 
+  LWIP_PLATFORM_DIAG(("  rexmit: %"STAT_COUNTER_F, proto->rexmit)); 
+  LWIP_PLATFORM_DIAG(("  recv: %"STAT_COUNTER_F, proto->recv)); 
+  LWIP_PLATFORM_DIAG(("  fw: %"STAT_COUNTER_F, proto->fw)); 
+  LWIP_PLATFORM_DIAG(("  drop: %"STAT_COUNTER_F, proto->drop)); 
+  LWIP_PLATFORM_DIAG(("  chkerr: %"STAT_COUNTER_F, proto->chkerr)); 
+  LWIP_PLATFORM_DIAG(("  lenerr: %"STAT_COUNTER_F, proto->lenerr)); 
+  LWIP_PLATFORM_DIAG(("  memerr: %"STAT_COUNTER_F, proto->memerr)); 
+  LWIP_PLATFORM_DIAG(("  rterr: %"STAT_COUNTER_F, proto->rterr)); 
+  LWIP_PLATFORM_DIAG(("  proterr: %"STAT_COUNTER_F, proto->proterr)); 
+  LWIP_PLATFORM_DIAG(("  opterr: %"STAT_COUNTER_F, proto->opterr)); 
+  LWIP_PLATFORM_DIAG(("  err: %"STAT_COUNTER_F, proto->err)); 
+  LWIP_PLATFORM_DIAG(("  cachehit: %"STAT_COUNTER_F, proto->cachehit)); 
 }
 
 void
 stats_display_igmp(struct stats_igmp *igmp)
 {
-  LWIP_PLATFORM_DIAG(("\nIGMP\n\t"));
-  LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", igmp->lenerr)); 
-  LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", igmp->chkerr)); 
-  LWIP_PLATFORM_DIAG(("v1_rxed: %"STAT_COUNTER_F"\n\t", igmp->v1_rxed)); 
-  LWIP_PLATFORM_DIAG(("join_sent: %"STAT_COUNTER_F"\n\t", igmp->join_sent)); 
-  LWIP_PLATFORM_DIAG(("leave_sent: %"STAT_COUNTER_F"\n\t", igmp->leave_sent)); 
-  LWIP_PLATFORM_DIAG(("unicast_query: %"STAT_COUNTER_F"\n\t", igmp->unicast_query)); 
-  LWIP_PLATFORM_DIAG(("report_sent: %"STAT_COUNTER_F"\n\t", igmp->report_sent)); 
-  LWIP_PLATFORM_DIAG(("report_rxed: %"STAT_COUNTER_F"\n\t", igmp->report_rxed)); 
-  LWIP_PLATFORM_DIAG(("group_query_rxed: %"STAT_COUNTER_F"\n", igmp->group_query_rxed));
+  LWIP_PLATFORM_DIAG(("IGMP"));
+  LWIP_PLATFORM_DIAG(("  lenerr: %"STAT_COUNTER_F, igmp->lenerr)); 
+  LWIP_PLATFORM_DIAG(("  chkerr: %"STAT_COUNTER_F, igmp->chkerr)); 
+  LWIP_PLATFORM_DIAG(("  v1_rxed: %"STAT_COUNTER_F, igmp->v1_rxed)); 
+  LWIP_PLATFORM_DIAG(("  join_sent: %"STAT_COUNTER_F, igmp->join_sent)); 
+  LWIP_PLATFORM_DIAG(("  leave_sent: %"STAT_COUNTER_F, igmp->leave_sent)); 
+  LWIP_PLATFORM_DIAG(("  unicast_query: %"STAT_COUNTER_F, igmp->unicast_query)); 
+  LWIP_PLATFORM_DIAG(("  report_sent: %"STAT_COUNTER_F, igmp->report_sent)); 
+  LWIP_PLATFORM_DIAG(("  report_rxed: %"STAT_COUNTER_F, igmp->report_rxed)); 
+  LWIP_PLATFORM_DIAG(("  group_query_rxed: %"STAT_COUNTER_F, igmp->group_query_rxed));
 }
 
 void
 stats_display_mem(struct stats_mem *mem, char *name)
 {
-  LWIP_PLATFORM_DIAG(("\nMEM %s\n\t", name));
-  LWIP_PLATFORM_DIAG(("avail: %"U32_F"\n\t", (u32_t)mem->avail)); 
-  LWIP_PLATFORM_DIAG(("used: %"U32_F"\n\t", (u32_t)mem->used)); 
-  LWIP_PLATFORM_DIAG(("max: %"U32_F"\n\t", (u32_t)mem->max)); 
-  LWIP_PLATFORM_DIAG(("err: %"U32_F"\n", (u32_t)mem->err));
+  LWIP_PLATFORM_DIAG(("MEM %s", name));
+  LWIP_PLATFORM_DIAG(("  avail: %"U32_F, (u32_t)mem->avail)); 
+  LWIP_PLATFORM_DIAG(("  used: %"U32_F, (u32_t)mem->used)); 
+  LWIP_PLATFORM_DIAG(("  max: %"U32_F, (u32_t)mem->max)); 
+  LWIP_PLATFORM_DIAG(("  err: %"U32_F, (u32_t)mem->err));
 }
 
 void
index df50e8d0b5640bf779e12d4bbbf82b4096ed85a5..7878080fb64577bc2b6eabb743984c88f843d869 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <stdint.h>
 #include <vga-overlay.h>
+#include <output.h>
 #include <minilib.h>
 
 typedef uint8_t u8_t;
@@ -28,7 +29,7 @@ typedef uint32_t mem_ptr_t;
 #define LWIP_PLATFORM_HTONS(x) htons(x)
 #define LWIP_PLATFORM_HTONL(x) htonl(x)
 
-#define LWIP_PLATFORM_DIAG(x) dolog(x)
+#define LWIP_PLATFORM_DIAG(x) outputf x
 #define LWIP_PLATFORM_ASSERT(x) dologf("ASSERT FAILED: %s\n", (x));
 
 #endif
index 9c92b59e5c0d937fb370ef69b27fa85838fa18ab..368bf869f8cf821826049b73a0c25cfe9f843ebc 100644 (file)
@@ -28,5 +28,8 @@ extern void _memcpy(void *dest, const void *src, int bytes);
 #define PBUF_POOL_BUFSIZE 512
 
 #define LWIP_STATS 1
+#define LWIP_STATS_DISPLAY 1
+#define U16_F "d"
+#define U32_F "d"
 
 #endif
This page took 0.027856 seconds and 4 git commands to generate.