[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE : [lwip-devel] SYS_STATS ?
From: |
Frédéric BERNON |
Subject: |
RE : [lwip-devel] SYS_STATS ? |
Date: |
Thu, 22 Mar 2007 14:28:08 +0100 |
It is used in some ports (coldfire & unix). But it would be better to name it
SYS_ARCH_STATS and to use SYS_STATS for sys.c operations... But in a first
time, I will let like that to not break the ports...
I will also found usefull to change stats.h/.c to only declare & display
counters if the matching define is set to 1. I will reduce the footprint, and
stats_display will only show usefull informations (and not list with 0).
It will look like :
struct stats_ {
#if LINK_STATS
struct stats_proto link;
#endif
#if IPFRAG_STATS
struct stats_proto ip_frag;
#endif
#if IP_STATS
struct stats_proto ip;
#endif
#if ICMP_STATS
struct stats_proto icmp;
#endif
#if UDP_STATS
struct stats_proto udp;
#endif
#if TCP_STATS
struct stats_proto tcp;
#endif
#if PBUF_STATS
struct stats_pbuf pbuf;
#endif
#if MEM_STATS
struct stats_mem mem;
#endif
#if MEMP_STATS
struct stats_mem memp[MEMP_MAX];
#endif
#define SYS_STATS
struct stats_sys sys;
#endif
};
void
stats_display(void)
{
s16_t i;
#if MEMP_STATS
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"
};
#endif
#if LINK_STATS
stats_display_proto(&lwip_stats.link, "LINK");
#endif
#if IPFRAG_STATS
stats_display_proto(&lwip_stats.ip_frag, "IP_FRAG");
#endif
#if IP_STATS
stats_display_proto(&lwip_stats.ip, "IP");
#endif
#if ICMP_STATS
stats_display_proto(&lwip_stats.icmp, "ICMP");
#endif
#if UDP_STATS
stats_display_proto(&lwip_stats.udp, "UDP");
#endif
#if TCP_STATS
stats_display_proto(&lwip_stats.tcp, "TCP");
#endif
#if PBUF_STATS
stats_display_pbuf(&lwip_stats.pbuf);
#endif
#if MEM_STATS
stats_display_mem(&lwip_stats.mem, "HEAP");
#endif
#if MEMP_STATS
for (i = 0; i < MEMP_MAX; i++) {
stats_display_mem(&lwip_stats.memp[i], memp_names[i]);
}
#endif
}
Agree for this last change (and I commit)?
====================================
Frédéric BERNON
HYMATOM SA
Chef de projet informatique
Microsoft Certified Professional
Tél. : +33 (0)4-67-87-61-10
Fax. : +33 (0)4-67-70-85-44
Email : address@hidden
Web Site : http://www.hymatom.fr
====================================
P Avant d'imprimer, penser à l'environnement
-----Message d'origine-----
De : address@hidden [mailto:address@hidden De la part de Goldschmidt Simon
Envoyé : jeudi 22 mars 2007 14:02
À : lwip-devel
Objet : RE: [lwip-devel] SYS_STATS ?
> -----Original Message-----
> From:
> address@hidden
> g
> [mailto:address@hidden
> ongnu.org] On Behalf Of Frédéric BERNON
> Sent: Thursday, March 22, 2007 11:58 AM
> To: lwip-devel
> Subject: [lwip-devel] SYS_STATS ?
>
> Is someone use SYS_STATS ? It's define but never used.
> Perhaps in some ports? But, if it's true, why it is define in opt.h ?
>
> I propose to remove it...
Now that you mention it... I have and #if LWIP_STATS around my lwip_stats.sys.*
statements. Seems like this should be an #if SYS_STATS...
As is is now, it does nothing, but I'd rather change it to do something than
throw it away!
_______________________________________________
lwip-devel mailing list
address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-devel
Frédéric BERNON.vcf
Description: Frédéric BERNON.vcf
- RE : [lwip-devel] SYS_STATS ?,
Frédéric BERNON <=