Changes between Version 23 and Version 24 of EngineProfiling


Ignore:
Timestamp:
Jul 31, 2022, 10:09:22 AM (21 months ago)
Author:
Vladislav Belov
Comment:

Fix the order of instruments, universal/builtin first.

Legend:

Unmodified
Added
Removed
Modified
  • EngineProfiling

    v23 v24  
    4747
    4848Additional information on Profiler2 such as screenshots and explanations of the HTML interface can be found at [wiki:Profiler2 Profiler2]
    49 
    50 == Profiling with google-perf or pprof
    51 
    52 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:
    53 
    54 ```sudo apt-get install google-perftools graphviz```
    55 
    56 On arch-based systems, the package is called gperftools.
    57 
    58 To start profiling, run
    59 
    60 ```LD_PRELOAD=/usr/lib/libprofiler.so CPUPROFILE=/tmp/0ad.prof 0ad```
    61 
    62 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.
    63 
    64 Do whatever you want to profile in 0ad. When finished, close 0ad.
    65 
    66 At this point, /tmp/0ad.prof contains the CPU profile information. To view it graphically, run
    67 
    68 ```google-pprof --web /usr/bin/0ad /tmp/0ad.prof```
    69 
    70 (Note the absolute path to 0ad must be used here.) T
    71 
    72 On arch-based systems, use `pprof` instead of `google-pprof`.
    73 
    74 After several minutes, your default web browser will open and display the graphical profile in the svg format.
    75 
    76 It will look similar to this:[[BR]]
    77 [[Image(0ad_pprof_example.png, 25%)]]
    7849
    7950== Low-overhead timer ==
     
    190161To view the data, copy server.py from the website directory to /path/to/output/. Start the script so the data gets fed automatically to the tracelogging tool, then open tracelogger.html in a browser and select the desired file. Finally, select a thread from the list.
    191162
     163== Profiling with google-perf or pprof
     164
     165On 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
     169On arch-based systems, the package is called gperftools.
     170
     171To start profiling, run
     172
     173```LD_PRELOAD=/usr/lib/libprofiler.so CPUPROFILE=/tmp/0ad.prof 0ad```
     174
     175LD_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
     177Do whatever you want to profile in 0ad. When finished, close 0ad.
     178
     179At 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.) T
     184
     185On arch-based systems, use `pprof` instead of `google-pprof`.
     186
     187After several minutes, your default web browser will open and display the graphical profile in the svg format.
     188
     189It will look similar to this:[[BR]]
     190[[Image(0ad_pprof_example.png, 25%)]]
    192191
    193192== Valgrind ==