How to run a CPU profile on a CS:GO server

counter-strike-global-offensivesourcemod

I remember a few months ago running a profile on a CS:GO server I run. Even going so far as to create a program to automatically parse the results for a better view.

However, now I have similar CPU issues to last time and am trying to find out which of my Sourcemod plugins is causing it, I cannot find a single reference to profiling online at all.

Does anyone know the commands used to start & stop a profile, preferably logging it to a file?

Best Answer

For Sourcemod compiling:

sm prof start // starts the profiler
sm prof dump // dumps output to console
sm prof stop // stops the profiler

Since it dumps to a console, you'll likely want to set up the con_logfile CVAR so it also goes to a file.

This actually uses the base CS:GO vprof profiler, which is also accessible although less user friendly. You can list relevant commands with:

find vprof

The main ones being:

vprof_on // starts the profiler
vprof_generate_report // dumps output to console
vprof_off // stops the profiler