diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/documentation-index.md | 1 | ||||
| -rw-r--r-- | docs/how-to-use-gperftool.md | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/docs/documentation-index.md b/docs/documentation-index.md index 059bacc..e4c2174 100644 --- a/docs/documentation-index.md +++ b/docs/documentation-index.md @@ -48,6 +48,7 @@ redirect_from: /documentation_index * [How to import DBC data into SQL](how-to-import-dbc-data-in-db.md) * [Run Worldserver and Authserver in Visual Studio](run-worldserver-and-authserver-in-visual-studio.md) * [Useful SQL Snippets](useful-sql.md) +* [How to use gperftool to analyse your app](how-to-use-gperftool.md) ## External resources diff --git a/docs/how-to-use-gperftool.md b/docs/how-to-use-gperftool.md new file mode 100644 index 0000000..f966c94 --- /dev/null +++ b/docs/how-to-use-gperftool.md @@ -0,0 +1,27 @@ +# GOOGLE PERF TOOLS + +AzerothCore integrates the google performance tools library that allows you to analyse the code execution of your application when it comes to CPU and Memory. +In short: thread-friendly heap-checker, heap-profiler, and cpu-profiler. + +* [Repository](https://github.com/gperftools/gperftools#readme) +* [Documentation](https://gperftools.github.io/gperftools/) + +## Install (Ubuntu): + +Run in a terminal: `sudo apt-get install google-perftools libgoogle-perftools-dev` + +Note: dependencies above are already installed in our docker file + +## Usage (with the AzerothCore dashboard): + +1. To enable the gperftools you need to compile with the `-DWITH_PERFTOOLS=ON` compiler flag. You can use CUSTOMOPTIONS in `config.sh` to set it for the dashboard compiler. You also need to set the `CTYPE` conf to at least `RelWithDebInfo` (faster but less info) or `Debug` (slower but more info). +2. Configure the variables inside the `config.sh`, at the ` GOOGLE PERF TOOLS` section, accordingly to your needs. +3. run the worldserver with the `./acore.sh run-worldserver` +4. run `killall -12 worldserver` This command will start the monitoring process. +5. Run `killall -12 worldserver` again to stop the process when you want. At this time you will have the .prof file ready in the folder configured below. +6. Run "google-pprof--callgrind <path/of/worldserver/bin> </path/of/prof/file>" This will generate a callgrind file that can be read with +[QCacheGrind](https://sourceforge.net/projects/qcachegrindwin/), [KCacheGrind](http://kcachegrind.sourceforge.net/html/Home.html) or any other compatible tools + +This is what you will see (screenshot of KCacheGrind): + + |
