Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node with --prof option creating multiple log files instead of one v8.log

I am trying to profile my Node app with "--prof" option but I see that instead of one single v8.log file there are multiple files created with prefix like isolate-0x9582b40-v8.log, isolate-0xa1cab78-v8-6049.log, isolate-0xa7ffb40-v8.log, isolate-0xb5900468-v8.log, isolate-0xb6200468-v8-6049.log .

I am having difficulty processing this files with Linux-tick-processor as I don't know which file to use for processing.

I am running with following config Ubuntu 12.4 Lts on Vm VirtualBox. Node version 0.12.0

Output of uname -a

Linux ubuntu 3.8.0-44-generic #66~precise1-Ubuntu SMP Tue Jul 15 04:04:23 UTC 2014 i686 i686 i386 GNU/Linux

Output of node -v

v0.12.0

like image 495
Vipresh Avatar asked May 26 '15 14:05

Vipresh


1 Answers

I'm late to the party on this one, but if you invoke the profiler like this:

node --prof --no-logfile-per-isolate example.js

You will get a single file called v8.log. Then you can do stuff like this:

node --prof --no-logfile-per-isolate example.js && node --prof-process v8.log > example.v8log.txt

Note: this will result in a single output file, so if you need a file per isolate, you can use the --logfile option:

node --prof --logfile=foo.log example.js

This will still put the hexadecimal isolate identifier in the file name, but append the value you provided with the --logfile option, resulting in file that look like this: isolate-0x103801e00-foo.log, isolate-0x104000000-foo.log and so on.

If you don't like the v8.log file name, combine the --logfile and --no-logfile-per-isolate options:

node --prof --logfile=foo.log --no-logfile-per-isolate example.js

This will result in a single file called foo.log.

HTH. Enjoy!

--jsp

like image 186
J Steven Perry Avatar answered Sep 22 '22 12:09

J Steven Perry