Using this program, with the original 'mystat' program:
> #include <stdlib.h>
> #include <stdio.h>
> #include <time.h>
>
> main ()
> {
> int i;
>
> fork();
> fork();
>
> for (i = 0; i < 100000000; i++) {
> asm("nop");
> asm("nop");
> asm("nop");
> asm("nop");
> asm("nop");
> asm("nop");
> asm("nop");
> }
> wait(NULL);
> wait(NULL);
> wait(NULL);
> wait(NULL);
> }
I consistently get a result of slightly over 1 billion instructions
(whereas perf stat gives the correct result of around 4 billion.) I
get the same results on several systems, including:
2.6.32-504.8.1.el6.x86_64 on a single-core Athlon
2.6.32-431.17.1.el6.x86_64 on an 8-core Xeon
3.10.0-123.13.2.el7.x86_64 on an 8-core Opteron
3.16.0-0.bpo.4-amd64 on a 2-core Athlon
Will try to test with a newer kernel when I have a chance.
Benjamin
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html