void stats_display_memp(struct stats_mem *mem, int index) { if (index < MEMP_MAX) { stats_display_mem(mem, memp_names[index]); } }
void stats_display(void) { s16_t i; char * memp_names[] = {"PBUF", "RAW_PCB", "UDP_PCB", "TCP_PCB", "TCP_PCB_LISTEN", "TCP_SEG", "NETBUF", "NETCONN", "API_MSG", "TCP_MSG", "TIMEOUT"}; stats_display_proto(&lwip_stats.link, "LINK"); stats_display_proto(&lwip_stats.ip_frag, "IP_FRAG"); stats_display_proto(&lwip_stats.ip, "IP"); stats_display_proto(&lwip_stats.icmp, "ICMP"); stats_display_proto(&lwip_stats.udp, "UDP"); stats_display_proto(&lwip_stats.tcp, "TCP"); stats_display_pbuf(&lwip_stats.pbuf); stats_display_mem(&lwip_stats.mem, "HEAP"); for (i = 0; i < MEMP_MAX; i++) { stats_display_mem(&lwip_stats.memp[i], memp_names[i]); } }
void stats_display_memp(struct stats_mem *mem, int index) { char * memp_names[] = { #define LWIP_MEMPOOL(name,num,size,desc) desc, #include "lwip/memp_std.h" }; if(index < MEMP_MAX) { stats_display_mem(mem, memp_names[index]); } }