Difference between revisions of "ProfilingWesnoth"
From The Battle for Wesnoth Wiki
Pentarctagon (talk | contribs) (Created page with "== Linux == When using either scons or cmake to build, there are four options available for profiling which are listed below. For cmake use <code>-DPROFILER=<name></code>, for...") |
Pentarctagon (talk | contribs) |
||
Line 17: | Line 17: | ||
=== gprof === | === gprof === | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 02:56, 9 June 2021
Contents
Linux
When using either scons or cmake to build, there are four options available for profiling which are listed below. For cmake use -DPROFILER=<name>
, for scons use profiler=<name>
.
gperftools
To use gperftools:
- Install the packages
google-perftools
(needed later for running google-pprof) andlibgoogle-perftools-dev
(needed in order to use the -lprofiler linker option). - In a terminal, export the
CPUPROFILE
variable, such asexport CPUPROFILE=./wesnoth-prof
. - Build any executable while setting either
-DPROFILER=gperftools
(cmake) orprofiler=gperftools
(scons). - Run the executable and have it do any task(s) as needed to get relevant profiling information.
- Generate the human-readable profiling output using the command
google-pprof <executable> <profiling info> > prof.txt
for a text file, orgoogle-pprof -gif <executable> <profiling info> > prof.gif
for a viewable gif image.