I'm using Vtune to profile a code (Python/C/C++) that is under CI. I would like to know whether it is possible to archive as part of the results the version of source code that was actually profiled.
That is, when I open an older profile, I would like that the links to the source code refer to the archived version rather than the current version located on the disk (which is obviously different from the one that was used in the older profiling runs).
You can configure source file caching in Options:
When caching is enabled then once you open a source file in VTune it will be cached in the result directory.
Thank you for the suggestion. It achieves what I'm looking for however it implies two things:
- that you manually open the files that you want to cache straight after completion of the profiling, and
- that you know in advance which files you will be revisiting in the future
which is not suitable for an automated pipeline with a large code base.
Is there a way to automate what you propose for a given source directory? I.e. that all sources contained in that directory would be automatically cached?
When you check the option of "Cache source files" the source code which is associated with the application at the time of profiling gets stored in cache.
The source files will get save in cache every time unless you manually uncheck the option.
So next time whenever you open the old report you will get the old source code associated with the application at the time of profiling.
Does this resolves your query? If you need any further clarification please let us know.
Yes, I understand that I cannot automatically cache all the source code that was profiled.
In our continuous integration pipeline (where we profile the code each time a change is pushed) we don't want/can't manually intervene to cache a selection of files as you suggested.
I would briefly explain it again.
Steps to activate cache source files option:
1. When you open VTune, click on Menu.
2. In Menu, click on Options a window will appear on your screen.
3. Now in that window click on Source/Assembly.
4. Now check the box in front of cache source files and click on Ok.
Menu-> Options-> Source/Assembly-> Cache source files -> Ok.
Once you activate cache source files option, the source code will get cached by default every time you do profiling of your code.
We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.