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.
Stats and IRQs
Moderators: RoccoMarco, barthess
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Stats and IRQs
Hi,
Statistics don't measure time spent in IRQs, measure time spent in critical sections:
- Between chSysLock() and chSysUnlock().
- Between chSysLockFromISR() and chSysUnlockFromISR().
Time spent in IRQs is not doable easily because ISRs can be preempted, that would require a TM object for each IRQ vector and that is not reasonable. You may add measurement code in specific ISRs using the TM module, probably this is what you did.
The effect of GPT could depend on relative priorities, hard to tell without details.
Giovanni
Statistics don't measure time spent in IRQs, measure time spent in critical sections:
- Between chSysLock() and chSysUnlock().
- Between chSysLockFromISR() and chSysUnlockFromISR().
Time spent in IRQs is not doable easily because ISRs can be preempted, that would require a TM object for each IRQ vector and that is not reasonable. You may add measurement code in specific ISRs using the TM module, probably this is what you did.
The effect of GPT could depend on relative priorities, hard to tell without details.
Giovanni
Re: Stats and IRQs
I have the stats module enabled, and monitoring thread performance using a corruption of the code in this thread. Just hadn't looked at exactly what the "isr" value meant!
Who is online
Users browsing this forum: No registered users and 18 guests