ProfilingWesnoth: Difference between revisions

From The Battle for Wesnoth Wiki
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..."
 
No edit summary
Line 17: Line 17:


=== gprof ===
=== gprof ===
== macOS ==
== Windows ==

Revision as of 02:56, 9 June 2021

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:

  1. Install the packages google-perftools (needed later for running google-pprof) and libgoogle-perftools-dev (needed in order to use the -lprofiler linker option).
  2. In a terminal, export the CPUPROFILE variable, such as export CPUPROFILE=./wesnoth-prof.
  3. Build any executable while setting either -DPROFILER=gperftools (cmake) or profiler=gperftools (scons).
  4. Run the executable and have it do any task(s) as needed to get relevant profiling information.
  5. Generate the human-readable profiling output using the command google-pprof <executable> <profiling info> > prof.txt for a text file, or google-pprof -gif <executable> <profiling info> > prof.gif for a viewable gif image.

perf

gcov

gprof

This page was last edited on 9 June 2021, at 02:56.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.