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

Cannot generate hotspots report in source-line level

bofang_2012
Beginner
695 Views
Hi all,
I was using vtune to profile my C++ application on Linux. I can only use the command-line interface. I choose hotspots for my analysis but I can only get function level report. I tried to add -group-by source-line in report command but what I got was:
Executing actions 75 % Generating a report
Source File Source Line Module Source File Path CPU Time
--------------------- ----------- ------ ---------------- --------
[Unknown source file] [Unknown] test [Unknown] 0.130
It seems that there is a lack of source file information. I did use the debug version of the program. Is there any other info I need to provide to vtune? Thanks in advance.
Bo
0 Kudos
3 Replies
Peter_W_Intel
Employee
695 Views

You have to use option "/Zi" and "/DEBUG" to build on Windows, use "-g" option on Linux.

I have no problem to use "-group-by source-line": I ran program under directory where it has executable and source
(You may add "-search-dir all:rp=/home/your-exe-path" when data collecting?)

# source /opt/intel/vtune_amplifier_xe_2011/amplxe-vars.sh
Copyright (C) 2009-2012 Intel Corporation. All rights reserved.
Intel VTune Amplifier XE 2011 (build 221625)

# amplxe-cl -collect hotspots -- ./primes.icc
Determining primes from 1 - 100000
Found 9592 primes
Using result path `/home/peter/problem_report/r003hs'
Executing actions 75 % Generating a report
Summary
-------

Elapsed Time: 0.967
CPU Time: 2.370
Executing actions 100 % done

# amplxe-cl -report hotspots -group-by source-line -r r003hs
Using result path `/home/peter/problem_report/r003hs'
Executing actions 75 % Generating a report
Source File Source Line Module Source File Path CPU Time
----------- ----------- ---------- ------------------------------------- --------
primes.cpp 391 primes.icc /home/peter/problem_report/primes.cpp 2.360
primes.cpp 395 primes.icc /home/peter/problem_report/primes.cpp 0.010
Executing actions 100 % done

0 Kudos
bofang_2012
Beginner
695 Views
Hi Peter,
Thank you for your reply. Actually I did use -g for compilation. But I realized that there might be problems here because I cannot even look at some of my source files in gdb ( for example, for one particular .h file i cannot see the corresponding .cpp file in gdb). That may cause the problem in vtune.
Btw, do I have to use intel compiler? From your example I see that you are using intel compiler right?
Thanks
Bo
0 Kudos
Peter_W_Intel
Employee
695 Views
Bo,

Thanks for the update, this is NOT the VTune issue.

VTune Amplifier XE doesn't rely on compiler type, that means, the tool supports standard binary/symbolformat - i.e. PE2 , DWARF, etc.

However if you choose Intel compiler - which provides more advanced options to build executable for performance gain.

Regards, Peter
0 Kudos
Reply