same behavior if you strip away the function call and call syscall() directly inside the for() loop:

for (i = 0; i < qtd; i++) {
start = RDTSC();
syscall(SYS_getpid);
end = RDTSC();
printf("%lld\n",  (end - start));
}

I do not have the source code for syscall() available ATM but I would look into that to see if something there looks like it may be caching information

Enrico Granata
Computer Science & Engineering Department (EBU3B) - Room 3240
office phone 858 534 9914
University of California, San Diego

On Feb 25, 2011, at 2:06 PM, Daniel Baluta wrote:

On Sat, Feb 26, 2011 at 12:03 AM, Mauro Romano Trajber
<trajber@gmail.com> wrote:
Same behavior for a new syscall created from scratch.

Instruction caching?