c++ - Time Short Functions with cpu time using RTEMS operating system -


i looking profile code in real time operating system, rtems. essentially, rtems has bunch of functions read time, useful of rtems_clock_get_ticks_since_boot.

the problem here whatever reason clock ticks reported synchronized our state machine loop rate, 5khz whereas processor running @ around 200mhz (embedded system). know because recorded clock time, waited 1 sec , 5000 ticks had gone by.

so question is:

how can actual cpu ticks rtems?

ps. clock() gnu c (has same problem)

there guide have been looking here, impossible constraint in asm indicates need use different assembler keywords. maybe can point me similar?


context

i want profile code, essentially:

start = cpu_clock_ticks()     //some code time = cpu_clock_ticks() - start; 

the code runs in less 0.125ms 8khz counter clock() , other rtems functions get, wont cut it.

accurate performance measurements can made using oscilloscope, provided there gpio, test point or pin software can write (and oscilloscope probe can attach to).

the method here send pulse pin. o'scope can set trigger on pulse. smarter o'scopes can perform statistics on pulse width, such mean time , maximum time.

on our embedded system, h/w team nice enough bring out 8 test points use. initialize pin zero. @ start of code profile, write 1 pin. @ end of profiling code, write 0 pin. produces pulse or square wave.

the o'scope set trigger on rising edge. probe connected pin , program run. adjust o'scope the entire pulse visible on screen. re-run program. when o'scope triggers, measure width of pulse. actual time of execution.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -