Using kcachegrind to debug javascript scripts
From Yate Documentation
If you notice that your scripts take a lot of time to handle specific requests(messages) it might be time for a little profiling. You can use kchachegrind for this.
Contents |
Configuration
javascript.conf
[general] allow_trace=yes
In code
At the start of the main js file add:
#pragma trace "cachegrind.out.filename"
Make sure you don't add this in any of the included files
Run test in yate
Start Yate, make the test you wanted and then stop Yate. After stopping you will find a file called "cachegrind.out.filename" in the directory where yate was started from.
Running cachegrind
The command to use kcachegrind:
kcachegrind cachegrind.out.filename
Note! kcachegrind is a GUI so if you are using ssh to connect to that server, disconnect and reconnect with "ssh -X"