On Fri, Oct 26, 2012 at 11:31 PM, Andrew Spyker <[email protected]> wrote:
> Just re-ran with --log instead of --log-all and as you suggested, it didn't
> change much about nprof.  Results:
>
> v8-lazystartprofiling-ganode.nprof.txt:Statistical profiling result from
> v8-lazystartprofiling-ganode.log, (9781 ticks, 7212 unaccounted, 0
> excluded).
> v8-lazystartprofiling-patchednode.nprof.txt:Statistical profiling result
> from v8-lazystartprofiling-patchednode.log, (8799 ticks, 3398 unaccounted, 0
> excluded).
> v8-standardprofiling.nprof.txt:Statistical profiling result from
> v8-standardprofiling.log, (18120 ticks, 0 unaccounted, 0 excluded).

Okay, unaccounted ticks need some explaining.

The profiler takes samples at 1000 Hz, meaning it logs the instruction
pointer every millisecond.  The tick processor takes those samples and
tries to match them to C/C++ or (compiled) JS code.  When no matching
function is found, the tick is unaccounted for.

The unknown addresses nearly always correspond with the slabs of
executable memory where V8 stores generated code.  (I say "nearly"
because stack trampolines, for example, also cause unaccounted ticks -
but those are rare.)

What happens is that --prof_lazy disables some crucial log events that
the tick processor needs.  The problem is that I haven't quite figured
out yet what those events are. :-)  The patch below improves but
doesn't quite fix the situation.

diff --git a/deps/v8/src/log.h b/deps/v8/src/log.h
index 33f359a..5c64136 100644
--- a/deps/v8/src/log.h
+++ b/deps/v8/src/log.h
@@ -284,7 +284,7 @@ class Logger {
   void LogRuntime(Vector<const char> format, JSArray* args);

   bool is_logging() {
-    return logging_nesting_ > 0;
+    return logging_nesting_ > 0 || FLAG_prof_lazy;
   }

   bool is_logging_code_events() {

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to