Forums - Profiling in hexagon-sim and rtos

3 posts / 0 new
Last post
Profiling in hexagon-sim and rtos
frol
Join Date: 28 Jan 19
Posts: 2
Posted: Thu, 2019-02-14 02:09

How is profiling of an RTOS application in hexagon-sim performed? Currently if I run hexagon-sim --profile only one gmon.t_Startup_0 file is created. As per the Simulator User Guide, I would expect one gmon file to be created for each software thread named gmon.name1, gmon.name2 etc. Example using benchmark_v65:

$ cd $HEXAGON_SDK_ROOT/examples/common/benchmark_v65
$ make tree V=hexagon_Debug_dynamic_toolv83_v65
... <snip> ...
$ hexagon-sim --profile -mv65 --simulated_returnval --usefs hexagon_Debug_dynamic_toolv83_v65 --pmu_statsfile hexagon_Debug_dynamic_toolv83_v65/pmu_stats.txt --cosim_file hexagon_Debug_dynamic_toolv83_v65/q6ss.cfg --l2tcm_base 0xd800 --rtos hexagon_Debug_dynamic_toolv83_v65/osam.cfg     $HEXAGON_SDK_ROOT/libs/common/qurt//computev65/sdksim_bin/runelf.pbn --  $HEXAGON_SDK_ROOT/libs/common/run_main_on_hexagon/ship/hexagon_Debug_dynamic_toolv83_v65/run_main_on_hexagon_sim  -- benchmark_q.so    -f epsilon -w 256 -h 64
hexagon-sim INFO: The rev_id used in the simulation is 0x00004065 (v65a_512)
... <snip> ...
Last iteration DSP-measured time (for 1 iterations): 1 pCycles, 
return value from epsilon: 0 
Checking for bit-exact errors... 
Number of bit-exact errors: 0 
- success
main() returned 0:  HIGH:0x5B:108:run_main_on_hexagon_dsp.c
Main() returned 0:  HIGH:0x5D:186:run_main_on_hexagon_dsp.c
Main() returned 0:  HIGH:0x5D:79:run_main_on_hexagon_sim.c

Done!
	T0: Insns=3037695 Packets=1384458
	T1: Insns=26635 Packets=11619
	T2: Insns=767820 Packets=534074
	T3: Insns=41686462 Packets=41577485
	Total: Insns=45518612 Pcycles=86978365
$ ls gmon*
gmon.t_Startup_0
My goal is to get accurate profiling information for the application I am running under rtos. Maybe there is some other way than --profile.. Thanks /Fredrik
  • Up0
  • Down0
maitreyi
Join Date: 21 Nov 18
Posts: 3
Posted: Thu, 2019-02-14 10:17

Hi 

You can use hexagon-profiler to generate the profiling information. Use the options "--packet_analyze <example>.json --timing" in the hexagon-sim command to generate the pakcet statistics file "<example>.json". Hexagon profiler can be invoked by using the command "hexagon-profiler --packet_analyze --elf=hexagon_Debug_dynamic_toolv83_v66\<example>_q.so --json=<example>.json -o <example>.html". The .html will contain the profiling information. 

Regards, 

  • Up0
  • Down0
frol
Join Date: 28 Jan 19
Posts: 2
Posted: Fri, 2019-02-15 01:36

Thanks for the help. This solves my problem for now :)

For completeness you also need to specify the address fo the .so files on the hexagon-profiler command line:

$ hexagon-profiler --packet_analyze --elf=hexagon_Debug_dynamic_toolv83_v66\example_q.so:0xADDRESS --json=example.json -o example.html

RTOS prints the addresses when it boots in the simulator:

$ hexagon-sim ...
... <snip> ...
try to load example_q.so from file:  HIGH:0x5B:121:search.c
try ./example_q.so:  HIGH:0x5B:81:search.c
read headers 0x0 -> ff901000 (0x1000 B):  HIGH:0x5B:468:map_object.c
Verification skipped, no function specified!!:  HIGH:0x5B:502:map_object.c
mapped  [ffde6000 - fff00000] (1155072 Bytes):  HIGH:0x5B:661:map_object.c
load 0x0 -> ffde6000 (0x1140C4 B):  HIGH:0x5B:752:map_object.c
zero    [ffeff9dc - ffeff9df] (0x4 B):  HIGH:0x5B:725:map_object.c
load 0x115000 -> ffefb000 (0x49DC B):  HIGH:0x5B:752:map_object.c

Compared to gprof, I cannot get the function call graph from the packet_analyze.json. Do you know any way to get that also?

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.