Using kcachegrind to debug javascript scripts

From Yate Documentation
(Difference between revisions)
Jump to: navigation, 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...")
 
(Running cachegrind)
 
Line 24: Line 24:
 
  kcachegrind cachegrind.out.filename
 
  kcachegrind cachegrind.out.filename
  
  Note! kcachegrind is a GUI so if you are using ssh to to connect to that server, disconnect and reconnect with "ssh -X"
+
  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 16: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.

Contents

[edit] Configuration

javascript.conf

[general]
allow_trace=yes

[edit] 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

[edit] 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.

[edit] 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"
Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers