Generate profiling data

From dreamcast.wiki
Revision as of 12:16, 30 May 2020 by Unknown user (talk) (Created page with "== How to enable Simulant's profiler == Every Simulant application allows the user to change various parameters in the AppConfig struct. In order to enable the profiler, the...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

How to enable Simulant's profiler

Every Simulant application allows the user to change various parameters in the AppConfig struct. In order to enable the profiler, the following lines should be added to

int main()
#ifndef NDEBUG
       config.log_level = smlt::LOG_LEVEL_DEBUG;
       config.development.force_profiling = true;
#endif

How to generate the actual profiling data

Once the user decides to run the application via dcload-ip, e.g.

sudo dc-tool -t 192.168.0.123 -x myCoolGame.elf -c ./assets

a file named gmon.out will be created in ./build/dreamcast-sh4-gcc/debug/assets

The file must not be opened while the application is running!

During the profiling process the terminal will display how many arcs haven been processed. The output will look like this:

-- 1000 arcs recorded...
-- 2000 arcs recorded...
-- 3000 arcs recorded...

Best profiling results can be achieved, if the amount of arcs reaches about 6000 - 7000 entries.

IMPORTANT: To flush the profiling data into gmon.out, the application needs to be properly terminated (e.g. ESC key). Shutting down the console or terminal prematurely will NOT WORK.

The profiling was successful, if the terminal displays something like this:

Stopping profiling...
-- Writing 6750 arcs
-- Profiler thread finished!