-
Notifications
You must be signed in to change notification settings - Fork 7.3k
node prof produce nothing: tool/linux-tick-processor v8.log #8088
Comments
What does |
It is google-chrome.js from jsbench, jsbench can be checkedout from http://code.google.com/p/jsbench/source/checkout. |
Could you please gist the file? |
I tried lots of js files and it produce the same results. one of them is: var sys = require('sys');
// simple timeout exapmle
var start_time = new Date();
sys.puts('String 2 second timer');
setTimeout(function(){
var end_time = new Date();
var difference = end_time.getTime() - start_time.getTime();
sys.puts('Stopped timer after : ' +
Math.round(difference / 1000) + 'seconds');
cleartimeout_example();
}, 2000);
function cleartimeout_example(){
var start_time = new Date();
sys.puts('\nStarting 30 second timer and stopping it immediately without triggering callback');
var timeout = setTimeout(function(){
var end_time = new Date();
var difference = end_time.getTime() - start_time.getTime();
sys.puts('Stoped timer after ' + Math.round(difference / 1000) + ' seconds');
}, 3000);
clearTimeout(timeout);
interval_example();
}
function interval_example(){
var start_time = new Date();
sys.puts('\nString 2 second interval, stopped after 5th tick');
var count = 1;
var interval = setInterval(function(){
if(count == 5) clearInterval(this);
var end_time = new Date();
var diffrence = end_time.getTime() -
start_time.getTime();
sys.puts('Tick no.' + count + 'after ' + Math.round(diffrence / 1000) + ' second');
count ++;
}, 2000);
} |
Hm... indeed, it isn't writing any ticks to the file. Thanks for a heads up! cc @trevnorris |
On my list. Thanks for the report. |
FWIW, V8's SIGPROF signal handler bails out because EDIT: The hack below makes V8 start logging tick events again. I still don't understand why it thinks the isolate is not in use... diff --git a/deps/v8/src/sampler.cc b/deps/v8/src/sampler.cc
index 3cb0b74..380d6a3 100644
--- a/deps/v8/src/sampler.cc
+++ b/deps/v8/src/sampler.cc
@@ -332,7 +332,7 @@ void SignalHandler::HandleProfilerSignal(int signal, siginfo_t* info,
USE(info);
if (signal != SIGPROF) return;
Isolate* isolate = Isolate::UncheckedCurrent();
- if (isolate == NULL || !isolate->IsInitialized() || !isolate->IsInUse()) {
+ if (isolate == NULL || !isolate->IsInitialized()) {
// We require a fully initialized and entered isolate.
return;
} |
@bnoordhuis sounds more like this is a bug in how Node starts up? For example |
Oh, that's it. The patch below trivially fixes it. Odd, I'm reasonably sure there was an diff --git a/src/node.cc b/src/node.cc
index f3409dc..b50ecdc 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -3610,6 +3610,7 @@ int Start(int argc, char** argv) {
V8::Initialize();
{
Locker locker(node_isolate);
+ Isolate::Scope isolate_scope(node_isolate);
HandleScope handle_scope(node_isolate);
Local<Context> context = Context::New(node_isolate);
Environment* env = CreateEnvironment( |
Thank you~! It works now ! |
Thanks @bnoordhuis. Fix committed 437c2f4, Ben as the author. |
The results are:
Test on ubuntu 12.04 with node version v0.11.14-pre and v8 version is 3.26.33
The text was updated successfully, but these errors were encountered: