Provide a macro to read rimestats when enabled

This commit is contained in:
George Oikonomou 2013-03-20 21:05:19 +00:00
parent 12860ce5d4
commit 62366813b0

View file

@ -55,12 +55,15 @@ struct rimestats {
unsigned long lltx, llrx;
};
#if RIMESTATS_CONF_ENABLED
/* Don't access this variable directly, use RIMESTATS_ADD and RIMESTATS_GET */
extern struct rimestats rimestats;
#if RIMESTATS_CONF_ENABLED
#define RIMESTATS_ADD(x) rimestats.x++
#define RIMESTATS_GET(x) rimestats.x
#else /* RIMESTATS_CONF_ENABLED */
#define RIMESTATS_ADD(x)
#define RIMESTATS_GET(x) 0
#endif /* RIMESTATS_CONF_ENABLED */
#endif /* __RIMESTATS_H__ */