Tue 20 Mar 2007 04:54:10 PM UTC, comment #2:
char * memp_names[] = {
"PBUF",
"RAW_PCB",
"UDP_PCB",
"TCP_PCB",
"TCP_PCB_LISTEN",
"TCP_SEG",
"NETBUF",
"NETCONN",
"TCPIP_MSG",
#if ARP_QUEUEING
"ARP_QUEUE",
#endif
"SYS_TIMEOUT"
};
And a little remark in memp.h to remember to synchronized memp_names, or a "extern const char* memp_names[MEMP_MAX];" in memp.h, and we move this table in memp.c?
What do you prefer?
|
Tue 20 Mar 2007 04:39:24 PM UTC, original submission:
Hi,
the stats_display use a char* table to get memp's names. But it doesn't to be "synchronised" with memp.h :
memp.h>
typedef enum {
MEMP_PBUF,
MEMP_RAW_PCB,
MEMP_UDP_PCB,
MEMP_TCP_PCB,
MEMP_TCP_PCB_LISTEN,
MEMP_TCP_SEG,
MEMP_NETBUF,
MEMP_NETCONN,
MEMP_TCPIP_MSG,
#if ARP_QUEUEING
MEMP_ARP_QUEUE,
#endif
MEMP_SYS_TIMEOUT,
MEMP_MAX
} memp_t;
stats.c>
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]);
}
}
So, stats_display() didn't display "good" names, and more, if ARP_QUEUEING is set to 1.
|