Changes between Version 25 and Version 26 of EngineProfiling


Ignore:
Timestamp:
Aug 2, 2022, 3:49:07 AM (21 months ago)
Author:
Langbart
Comment:

Readability; Fix formatting issues (don't use three backticks to format text, see https://trac.wildfiregames.com/wiki/WikiFormatting); Rephrasing informal sentences - Don't use sentences with "I have", it is a general text.

Legend:

Unmodified
Added
Removed
Modified
  • EngineProfiling

    v25 v26  
    163163== Profiling with google-perf or pprof
    164164
    165 On debian-based systems, [https://github.com/gperftools/gperftools gperftools] are packaged under the google-perftools package. For graphical output you also need graphviz installed:
    166 
    167 ```sudo apt-get install google-perftools graphviz```
    168 
    169 On arch-based systems, the package is called gperftools.
    170 
    171 To start profiling, run
    172 
    173 ```LD_PRELOAD=/usr/lib/libprofiler.so CPUPROFILE=/tmp/0ad.prof 0ad```
    174 
    175 LD_PRELOAD is used to preload the profiler's library, CPUPROFILE determines the location of the profiler's output, and in the above example, 0ad is the name of the binary to be executed. The path to the libprofiler library may differ distribution by distribution - I have also seen it under /usr/lib/libprofiler.so.0.
    176 
    177 Do whatever you want to profile in 0ad. When finished, close 0ad.
    178 
    179 At this point, /tmp/0ad.prof contains the CPU profile information. To view it graphically, run
    180 
    181 ```google-pprof --web /usr/bin/0ad /tmp/0ad.prof```
    182 
    183 (Note the absolute path to 0ad must be used here.)
    184 
    185 On arch-based systems, use `pprof` instead of `google-pprof`.
    186 
    187 After several minutes, your default web browser will open and display the graphical profile in the svg format.
    188 
    189 It will look similar to this:[[BR]]
     165On debian-based systems, [https://github.com/gperftools/gperftools gperftools] is packaged under `google-perftools`. For graphical output you also need to install `graphviz`.
     166
     167{{{
     168sudo apt-get install google-perftools graphviz
     169}}}
     170
     171On arch-based systems, the package is called `gperftools`.
     172
     173To start profiling, run:
     174
     175{{{
     176LD_PRELOAD=/usr/lib/libprofiler.so CPUPROFILE=/tmp/0ad.prof 0ad
     177}}}
     178
     179`LD_PRELOAD` pre-loads the profiler library, `CPUPROFILE` determines the location of the profiler output. `0ad` is the name of the binary file to be executed. The path to the `libprofiler` library may vary depending on the distribution, the path could also be `/usr/lib/libprofiler.so.0`. When you are finished profiling, close `0ad`.
     180
     181At this point, `/tmp/0ad.prof` contains the CPU profile information. To display it graphically, run the following command and ensure that you use the absolute path to `0ad`. On arch-based systems, use `pprof` rather than `google-pprof`.
     182
     183{{{
     184google-pprof --web /usr/bin/0ad /tmp/0ad.prof
     185}}}
     186
     187After a couple of minutes, your default web browser opens and displays the graphical profile in a svg format.
     188
     189It is going to look similar to this:
     190
    190191[[Image(0ad_pprof_example.png, 25%)]]
    191192