Using kcachegrind to debug javascript scripts: Difference between revisions
Jump to navigation
Jump to search
Created page with "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. == Config..." |
|||
| Line 24: | Line 24: | ||
kcachegrind cachegrind.out.filename | kcachegrind cachegrind.out.filename | ||
Note! kcachegrind is a GUI so if you are using ssh | Note! kcachegrind is a GUI so if you are using ssh to connect to that server, disconnect and reconnect with "ssh -X" | ||
Latest revision as of 14:02, 7 June 2016
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.
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"