Description
When debugging Nodejs application, it's very important and usefull that the developer can get the
JavaScript Source code line level profiling information. For example, which sentence of the JavaScript
source code is the most hot position, which sentence leads to cache miss etc. All other profiling tools
such as perf on linux system and the build-in profiling tools in V8 can profiling the C++ source code if
the symbol information is available. But for the the dynamic JITTed JavaScript code , they can not
provided such detailed Source Code Level profiling information.
V8 Javascript engine contains a component which can enable the JavaScript source code
level profiling for the powerful Intel Vtune Amplifier. And this functionality is already enabled by V8
embedder such as chrome and D8 shell. The basic idea is registering the code event handler in
Nodejs for V8. Then Vtune profiling tool will be used to do profiling when running NodeJS.
This functionality will be switched on /off by one runtime flag. And it will be enabled when developer
profiling / optimizing the applications. So it will not lead to any performance impact or correctness issue when running applications under offical senarios.