Stats and IRQs
Posted: Tue Jun 16, 2020 12:39 pm
I'm using the stats module on an F767. Chibi 19.1.3.
I have code in CH_CFG_IRQ_PROLOGUE_HOOK() and CH_CFG_IRQ_EPILOGUE_HOOK() (And CH_CFG_IDLE_ENTER_HOOK(), probably not relevant)
When I added a GPT interrupting every 10uS, the proportion of code spent in ISRs went down, which was not what I was expecting.
Looking at the generated code within OSAL_IRQ_PROLOGUE(), the CH_CFG_IRQ_PROLOGUE_HOOK() code precedes the stats handling code. Arguably these should be the opposite way round for best timing accuracy; but maybe there's a good reason not to swap them.
I have code in CH_CFG_IRQ_PROLOGUE_HOOK() and CH_CFG_IRQ_EPILOGUE_HOOK() (And CH_CFG_IDLE_ENTER_HOOK(), probably not relevant)
When I added a GPT interrupting every 10uS, the proportion of code spent in ISRs went down, which was not what I was expecting.
Looking at the generated code within OSAL_IRQ_PROLOGUE(), the CH_CFG_IRQ_PROLOGUE_HOOK() code precedes the stats handling code. Arguably these should be the opposite way round for best timing accuracy; but maybe there's a good reason not to swap them.