Hi Dmitry,
void f (int n)
{
rdtscll (t);
void g (int n)
{
gettimeofday (&tv, 0);
int main (int argc, char *argv[])
{
int n;
for (n = 0; n < 200; n++) {
if (n % 2)
f (n);
else
g (n);
My typical results are:
$ gcc -O2 -g -pg -o test test.c
I've observed a strange results while profiling the following program:
$ cat test.c
#include
#define rdtscll(val) asm volatile("rdtsc" : "=A" (val))
struct timeval tv;
unsigned long long t;
void f (int n)
{
int x, y, z = 0;
for (x = 0; x < n; x++)
for (y = 0; y < n; y++) {
z +=