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_0My 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
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,
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:
RTOS prints the addresses when it boots in the simulator:
Compared to gprof, I cannot get the function call graph from the packet_analyze.json. Do you know any way to get that also?