I have the following code in one of the drivers :
cycles_t first, second;
first = get_cycles();
second = get_cycles();
printk("get_cycles first 0x%llu second 0x%llu\n", first, second);
I expected the difference between first and second to be in order of few cycles (<10 cycles). However, I see it to be in order of 200+ cycles.
Also, the value differs for each execution.
Any idea why is it so ? (I am using 2.6.9 kernel)
ul 30 18:06:31 localhost kernel: get_cycles first 0x26253752826126 second 0x26253752826210
Jul 30 18:06:46 localhost kernel: get_cycles first 0x26289045037726 second 0x26289045037810
Jul 30 18:07:01 localhost kernel: get_cycles first 0x26324119480698 second 0x26324119480794
Jul 30 18:07:15 localhost kernel: get_cycles first 0x26359244054558 second 0x26359244054650