Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
4995 Discussions

Regarding INST_RETIRED.ANY in Sampling Wizard

anandps
Beginner
275 Views
Hello,

I am using vtune to tune the performance of our code in Linux. I have two version of the code and trying to understand how slow the newer version (with new features) is compared to the old one. I see something strange. I have a function A which is common in both versions of my code (it is exactly the same function) and is called exactly the same number of time in both versions of the code. I verified this by printing everytime the function is executed in both versions. But when I look at the INST_RETIRED.ANY events in vtune, the newer version has approx two times the number of instructions retired for the same function. How can this be possible?

I used the same compile flags to compile both versions. Even when I drill down and view the source, I see same number of assembly instructions in both versions.

Can anyone throw some light why this could happen? I would highly appreciate any help in this regard.

Thanks
Anand
0 Kudos
4 Replies
Peter_W_Intel
Employee
275 Views
Quoting - anandps
Hello,

I am using vtune to tune the performance of our code in Linux. I have two version of the code and trying to understand how slow the newer version (with new features) is compared to the old one. I see something strange. I have a function A which is common in both versions of my code (it is exactly the same function) and is called exactly the same number of time in both versions of the code. I verified this by printing everytime the function is executed in both versions. But when I look at the INST_RETIRED.ANY events in vtune, the newer version has approx two times the number of instructions retired for the same function. How can this be possible?

I used the same compile flags to compile both versions. Even when I drill down and view the source, I see same number of assembly instructions in both versions.

Can anyone throw some light why this could happen? I would highly appreciate any help in this regard.

Thanks
Anand

I guess that the problem was caused by your using same module/file/function name forbothversions. VTune Analyzer will ask the user about modules' location, files' locationfor first time analysis, when the user tried to display profiling data again, the tool will retrievefirst time stored data - soit displayed yourprofiling data of new version butbased on old modules, files.

The quick workaround is to delete all under /opt/intel/vtune/global_data/ISM,then reenter VTune Analyzer which should ask you about new modules'& files' locations.

Hope it helps.

Regards, Peter
0 Kudos
anandps
Beginner
275 Views

I guess that the problem was caused by your using same module/file/function name forbothversions. VTune Analyzer will ask the user about modules' location, files' locationfor first time analysis, when the user tried to display profiling data again, the tool will retrievefirst time stored data - soit displayed yourprofiling data of new version butbased on old modules, files.

The quick workaround is to delete all under /opt/intel/vtune/global_data/ISM,then reenter VTune Analyzer which should ask you about new modules'& files' locations.

Hope it helps.

Regards, Peter
Hi Peter,

Thanks for a quick reply. I tried removing the ISM files and re-ran both versions of my code. Each time it creates a seperate ISM file. So I think may be its not reusing the same file eventhough both versions of my code use the same name file/module names. I still get similar numbers as before. One question is what does this number INST_RETIRED.ANY represent. I read the documentation and it mentions its the number of instructions completed. For example, if I can count the number of times a function is executed in my program and multiply it with the number of instructions in the function (assembly level as shown in Vtune) would it be equal to this number?

Please share your thoughts.

Thanks,
Anand
0 Kudos
Peter_W_Intel
Employee
275 Views
Quoting - anandps
Hi Peter,

Thanks for a quick reply. I tried removing the ISM files and re-ran both versions of my code. Each time it creates a seperate ISM file. So I think may be its not reusing the same file eventhough both versions of my code use the same name file/module names. I still get similar numbers as before. One question is what does this number INST_RETIRED.ANY represent. I read the documentation and it mentions its the number of instructions completed. For example, if I can count the number of times a function is executed in my program and multiply it with the number of instructions in the function (assembly level as shown in Vtune) would it be equal to this number?

Please share your thoughts.

Thanks,
Anand

Hi Anand,

It's really strange why the new versionof Function A costs 2 timesof instruction retiredthanold version! Is it possible that two versionsran on different path?

You said their dis-assembly codeare same, so I suggest to check:
1) Can you count event CPU_CLK_UNHALED.CORE number for two version? Ifevent number of new version is double of old version,that means new version of Function Awas called2 times than old version.
2) You can use call graph data collection toinspect the results of "count", "self time" of Function A - two version.

About Function A execution time, sampling data collectionhas less overheads - (interruption handling time)
Time of Function A = (CPU_CLK_UNHALED.COREevents / CPU_frequency) sec

Regards, Peter
0 Kudos
anandps
Beginner
275 Views
Quoting - anandps
Hi Peter,

Thanks for a quick reply. I tried removing the ISM files and re-ran both versions of my code. Each time it creates a seperate ISM file. So I think may be its not reusing the same file eventhough both versions of my code use the same name file/module names. I still get similar numbers as before. One question is what does this number INST_RETIRED.ANY represent. I read the documentation and it mentions its the number of instructions completed. For example, if I can count the number of times a function is executed in my program and multiply it with the number of instructions in the function (assembly level as shown in Vtune) would it be equal to this number?

Please share your thoughts.

Thanks,
Anand

Hi Anand,

It's really strange why the new versionof Function A costs 2 timesof instruction retiredthanold version! Is it possible that two versionsran on different path?

You said their dis-assembly codeare same, so I suggest to check:
1) Can you count event CPU_CLK_UNHALED.CORE number for two version? Ifevent number of new version is double of old version,that means new version of Function Awas called2 times than old version.
2) You can use call graph data collection toinspect the results of "count", "self time" of Function A - two version.

About Function A execution time, sampling data collectionhas less overheads - (interruption handling time)
Time of Function A = (CPU_CLK_UNHALED.CORE events / CPU_frequency) sec

Regards, Peter

Thanks for the reply Peter. I have been using Sampling analysis untill now. I will try the call graph procedure and see.

Thanks,
Anand
0 Kudos
Reply