I really didn't know where to put this thread...
I have 3 functions, where first is called in second, and second is called in third. I want to profile my program so I use AMD CodeAnalyst. The problem is that it shows time duration only of the most inner (the first) function, whereas I would like also to see times of second and third functions call - I want absolute times for all functions. Does anyone know what should I switch to get that information?
Here's the code of my program:
#include "stdafx.h"
#include <cmath>
double inin(int x)
{
double res = 1.0;
for (int i = 1; i <= x; i++)
res *= sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt((double)i))))))))))))))));
return res;
}
double outout(int x)
{
double total = 0.0;
for (int i = 0; i < x; i++)
{
double res = inin(100000*i);
total += res;
printf("%f\n", res);
}
return total;
}
void doit()
{
for (int i = 10; i < 12; i++)
printf("\ntotal = %f\n\n\n", outout(i));
}
int _tmain(int argc, _TCHAR* argv[])
{
doit();
getchar();
return 0;
}
And all I get from CodeAnalyst is:
CS:EIP Symbol + Offset 64-bit Timer samples
0x401000 inin 63.95
0x401258 sqrt 36.05
2 functions, 33 instructions, Total: 233 samples, 100.00% of samples in the module, 1.67% of total session samples
.
So as you can see, I don't have times for outout and doit functions.