Measuring Measure
I spent some time over the past few days measuring Measure. I wanted to see what sort of performance ceiling it had. I found there there are in fact two versions of Measure. The first did the actual measuring using an interrupt service routine. The foreground application code predominantly performed polled serial IO. The second version used the RTX real-time kernel and had a measure task that was called by an interval task. I decided to measure the RTX based version (since it was closest to what I think the LogStick application will look like).
The RealView Microcontroller Development Kit contains a Performance Analyzer which records and displays execution times for functions and program blocks. Bar graphs display the time spent in each part of the application and there is a column showing the percentage time spent function or program block. I ran the RTX based Measure application and opened the performance analyzer. I hoped to see most of the applications time being spent in the idle task (named os_idle_demon). However, what I saw was that 48% of the time was spent in os_idle_demo but another 48% of the time was spent in a module called Startup. Spending time in the startup code seemed odd, and I dug deeper to discover that it contains the interrupt table and what appeared to happening was that 48% of my time was being spent in the scheduler! This made no sense at all so I sent off a quick email to support.us@keil.com asking what I was doing wrong. The answer was "Nothing!" I had actually found a bug in the simulator and within 48 hours the bug was fixed and a knowledge base article has been placed here


