Community
cancel
Showing results for 
Search instead for 
Did you mean: 
78 Views

Intel Vtune hotspot can not see source code (for analysis)

(i am refering this)

i can do source analysis with Callgrind (a different profiler)

 

Vtune Version:

 

[master-andreas@master-pc ~]$ ls /opt/intel/oneapi/vtune
2021.2.0 latest

 

GCC version

 

[master-andreas@master-pc ~]$ gcc --version
gcc (GCC) 10.2.0

 

my program was complied with:

 

set(CMAKE_CXX_FLAGS "-g3")
set(CMAKE_CXX_FLAGS "-shared-libgcc")
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo

 

and run with:

vtune -collect hotspots

my cpu:

 

[master-andreas@master-pc ~]$ lscpu
Model name: Intel(R) Core(TM) i3-6006U CPU @ 2.00GHz

 

if you need more info i can provide anything

0 Kudos
3 Replies
RaeesaM_Intel
Moderator
52 Views

Hi ,

Thank you for posting in Intel Analyzers Forum.

 

Intel® VTune™ Profiler provides accurate source analysis if your code is compiled with the debug information and debug information is written correctly in the binary file (for Linux* targets). We could see that you have given the -g3 flag.

We tried running sample matrix application in our linux machine and was able to view the source code. Please follow the below steps and see if source code is showing or not.

1.      cd /opt/intel/oneapi

2.      source setvars.sh

3.      cd vtune/2021.1.1/samples/en/C++/matrix/linux

4.      Run make all

5.      cd ..

6.      You will find matrix executable there If the compilation was successful

7.      Vtune -collect hotspots ./matrix

8.      Result folder r00XX will be created after the execution

9.      Open the result .vtune file in gui and see whether you can see the source code by right clicking on the function under “bottom-up” tab and select “view source code” [ screenshot attached ]

Open the Makefile and edit the part where they have given -g as flag and change it to -g3. Try the above same steps and see whether you are getting the source code.

Could you please confirm whether you are trying this is linux machine and launching vtune in same machine. Have you copied the result folder to somewhere else and opened that in vtune gui ? In such cases , you might face this issue of not seeing source code.

 

Also, please share the screenshot of you vtune-gui result window.

 

Hope this helps.

Regards,

Raeesa

 

42 Views

1)
i run what you told and it worked (with a couple of minor modification that should not matter)

3.      cd vtune/2021.2.0/samples/en/C++/matrix/linux
7.     vtune -collect hotspots ./matrix

it also worked with '-g3' instead of '-g'

 

 


@RaeesaM_Intel wrote:

 

Have you copied the result folder to somewhere else and opened that in vtune gui ? In such cases , you might face this issue of not seeing source code.


i have never used 'cp' or 'mv'

 

i have tried the 2 following things:

1) run the executable from the vtune-gui
2) run the executable directly with vtune from the directory of the executable

update: i have cleaned my build folder and tried again

and this time view_source is malfunctioning

ie i select view source on a file it give me back a different source file from the one i have picked (usally from libc++) e.g.  stl_vector.h
i have uploaded the zip of that run ('r002hs.zip')


you can try my code with

 

 

 

 

sudo apt install libboost-dev libyaml-cpp-dev #if you are on ubuntu
git clone git@github.com:stavrosgreece/multiagentlearning.git
cd multiagentlearning
wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-latest%2Bcpu.zip
unzip libtorch-cxx11-abi-shared-with-deps-latest+cpu.zip
rm libtorch-cxx11-abi-shared-with-deps-latest+cpu.zip
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. && make #this may take a few mins

 

 

 

 

you will wanna modify the default config.yaml  (vim ../config.yaml) to make it finish in less that one minute
ES/Epoch and set it to 1 (line 17)

finnaly (assuming you are still in ./build) run it with:

 

 

 

 

vtune -collect hotspots ./testWarehouse -c ../config.yaml -t 6 

 

 

 

 

 (-t specifies number of threads)

RaeesaM_Intel
Moderator
10 Views

Hi,


Thank you for sharing all the necessary details and steps. We are trying to reproduce your issue from our end. Could you please confirm the boost library version. We are facing some issue in the cmake step. Also, you please share the entire folder which has the executable files and result folder.


Regards,

Raeesa


Reply