Search code examples
node.jsprofilingv8

What is the structure of each line in a v8 profiler log file?


I would like to write my own tools for processing the v8 log files produced by node --prof. I have looked at some existing tools on GitHub, and been able to deduce some of the semantics of various fields from that, but it would be nice to have actual documentation of what all the different record types are, and what the fields of each record type mean. Does that exist anywhere? What do other tooling authors use for reference?


Solution

  • The v8 log entries are created in log.cc, specifically for --prof look at the Logger::TickEevent method.

    The easiest way to write custom tools is to have a look at the existing v8 tools like the tickprocessor. The tool has a list of all events that need to be parsed (see the LoagReader.call invocation) and the corresponding processing methods.

    The v8.log file is subject to arbitrary changes since it's used mostly internally and is not a public api.