Community
cancel
Showing results for 
Search instead for 
Did you mean: 
int_login_id
Beginner
43 Views

Call Stack Pane wrong number of stacks

Hi All!

There is a problem with Call Stack Pane wrong number of stacks.

I wrote a simple C++ program:

//simple_test.cpp

void func1()

{

for(int i = 0; i < 1000000; i++)

i++;

}

void func10()

{

func1();

func1();

func1();

func1();

func1();

func1();

func1();

func1();

func1();

func1();

}

void func100()

{

func10();

func10();

func10();

func10();

func10();

func10();

func10();

func10();

func10();

func10();

}

void func1000()

{

func100();

func100();

func100();

func100();

func100();

func100();

func100();

func100();

func100();

func100();

}

void func10000()

{

func1000();

func1000();

func1000();

func1000();

func1000();

func1000();

func1000();

func1000();

func1000();

func1000();

}

void func100000()

{

func10000();

func10000();

func10000();

func10000();

func10000();

func10000();

func10000();

func10000();

func10000();

func10000();

}

int _tmain(int argc, _TCHAR* argv[])

{

func1();

func10();

func100();

func1000();

func10000();

return 0;

}

I ran thisprogramtwo times and got the following results:

32403-vtune0.PNG

32404-vtune1.PNG

As you can see it shows 3310 and 3336 stacks for the func1, but it should show 11111 (10000+1000+100+10+1).

Which options do I need to set to get right number ofcall stacks?

Which options do I need to set to get the same results for thetwo consecutive runs of the same program?

I use:

Intel VTune Amplifier XE 2011 (build 119041)

Thanks,

Dzmitry

0 Kudos
1 Reply
Vladimir_T_Intel
Moderator
43 Views

Hi Dmitry,

Hotspot analysis provides the results that reflect the statistically significant CPU usage. Your example is quite subtle in terms of which stack the function func1() was called through when the sample hit the function, since it doesn't do anything significant. In addition, the compiler's optimization may affect the results as well.

Try to change the func1() to calculate something more CPU time consuming (and decrease the # of calls simultaneously in order to get the results today). You will see more accurate stack count then.

Reply