123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #ifndef CHSTATS_H
- #define CHSTATS_H
- #if (CH_DBG_STATISTICS == TRUE) || defined(__DOXYGEN__)
- #if CH_CFG_USE_TM == FALSE
- #error "CH_DBG_STATISTICS requires CH_CFG_USE_TM"
- #endif
- typedef struct {
- ucnt_t n_irq;
- ucnt_t n_ctxswc;
- time_measurement_t m_crit_thd;
- time_measurement_t m_crit_isr;
- } kernel_stats_t;
- #ifdef __cplusplus
- extern "C" {
- #endif
- void _stats_init(void);
- void _stats_increase_irq(void);
- void _stats_ctxswc(thread_t *ntp, thread_t *otp);
- void _stats_start_measure_crit_thd(void);
- void _stats_stop_measure_crit_thd(void);
- void _stats_start_measure_crit_isr(void);
- void _stats_stop_measure_crit_isr(void);
- #ifdef __cplusplus
- }
- #endif
- #else
- #define _stats_increase_irq()
- #define _stats_ctxswc(old, new)
- #define _stats_start_measure_crit_thd()
- #define _stats_stop_measure_crit_thd()
- #define _stats_start_measure_crit_isr()
- #define _stats_stop_measure_crit_isr()
- #endif
- #endif
|