summaryrefslogtreecommitdiff
path: root/conf
diff options
context:
space:
mode:
Diffstat (limited to 'conf')
-rw-r--r--conf/dist/config.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/conf/dist/config.sh b/conf/dist/config.sh
index 38730109f0..93f04861fc 100644
--- a/conf/dist/config.sh
+++ b/conf/dist/config.sh
@@ -88,6 +88,47 @@ CCUSTOMOPTIONS=${CCUSTOMOPTIONS:-''}
AC_CCACHE=${AC_CCACHE:-false}
export CCACHE_DIR=${CCACHE_DIR:-"$AC_PATH_VAR/ccache"}
+##############################################
+#
+# GOOGLE PERF TOOLS
+#
+# Repository: https://github.com/gperftools/gperftools#readme
+# Documentation: https://gperftools.github.io/gperftools/
+#
+# Install (Ubuntu):
+# sudo apt-get install google-perftools libgoogle-perftools-dev
+# Note: dependencies above are already installed in docker
+#
+# Usage:
+# 1. To enable the gperftools you need to compile with the -DWITH_PERFTOOLS=ON compiler flag. You can use CCUSTOMOPTIONS above to set it for the dashboard compiler
+# 2. Configure the variable below 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. Run "killall -12 worldserver" again to stop the process when you want
+# 5. At this time you will have the .prof file ready in the folder configured below.
+# Run "google-pprof --callgrind <path/of/worldserver/bin> </path/of/prof/file>" This will generate a callgrind file that can be read with
+# QCacheGrind, KCacheGrind and any other compatible tools
+#
+##############################################
+
+# files used by gperftools to store monitored information
+export CPUPROFILE=${CPUPROFILE:-"$BINPATH/logs/worldserver-cpu.prof"}
+# heap profile is disabled by default. Uncomment this line to enable it
+# export HEAPPROFILE=${HEAPPROFILE:-"$BINPATH/logs/worldserver-heap.prof"}
+
+# signal to send to the kill command to start/stop the profiling process. kill -12
+export CPUPROFILESIGNAL=${CPUPROFILESIGNAL:-12}
+
+# How many interrupts/second the cpu-profiler samples.
+#export CPUPROFILE_FREQUENCY=${CPUPROFILESIGNAL:-100}
+
+# If set to any value (including 0 or the empty string), use ITIMER_REAL instead of ITIMER_PROF to gather profiles.
+# In general, ITIMER_REAL is not as accurate as ITIMER_PROF, and also interacts badly with use of alarm(),
+# so prefer ITIMER_PROF unless you have a reason prefer ITIMER_REAL.
+#export CPUPROFILE_REALTIME=${CPUPROFILE_REALTIME}
+
+# Other values for HEAPCHECK: minimal, normal (equivalent to "1"), strict, draconian
+#export HEAPCHECK=${HEAPCHECK:-normal}
+
##############################################
#