How to measure performance inside Kernel?

Peter Senna Tschudin peter.senna at gmail.com
Sat Feb 11 08:29:20 EST 2012


Hi Michi,

> Why don't you print the tv_sec part?

It is expected that tv_sec is always zero. But I'll fix the code to
check if it really is.

>
> You might also want to replace getnstimeofday with getrawmonotonic or any
> other monotonic time source. If ntp or something else decides to change system
> time during the measurement, you would probably get weird results.

I got the getnstimeofday() from line 333 of <linux/ktime.h>
/* Get the real (wall-) time in timespec format: */
#define ktime_get_real_ts(ts)	getnstimeofday(ts)

If the clock changes in the worst time possible, it may affect only
one result. But I'll check other functions.

Thanks!

Peter


-- 
Peter Senna Tschudin
peter.senna at gmail.com
gpg id: 48274C36



More information about the Kernelnewbies mailing list