Chromium Code Reviews
Description[build] Add build options for uftrace support
This patch adds build options to enable -finstrument-functions and -pg
builds. It can be used for uftrace function tracing tool.
The usage is as follows:
$ make finstrument=on x64.release
or
$ make pg=on x64.debug
If d8 binary is built with one of the above options, it can be executed
with uftrace tool to see the function execution traces.
The output of uftrace tracing d8 running fibonacci example is as follows:
$ make finstrument=on x64.release
$ ./out/x64.release/d8 fib-20.js
fib(20) = 6765
$ uftrace -t 40ms -F main ./out/x64.release/d8 fib-20.js
fib(20) = 6765
# DURATION TID FUNCTION
[ 3452] | main() {
[ 3452] | v8::Shell::Main() {
[ 3452] | v8::V8::InitializeICUDefaultLocation() {
[ 3452] | v8::internal::InitializeICUDefaultLocation() {
[ 3452] | v8::internal::InitializeICU() {
92.415 ms [ 3452] | fread();
92.485 ms [ 3452] | } /* v8::internal::InitializeICU */
92.493 ms [ 3452] | } /* v8::internal::InitializeICUDefaultLocation */
92.496 ms [ 3452] | } /* v8::V8::InitializeICUDefaultLocation */
[ 3452] | v8::Isolate::New() {
[ 3452] | v8::internal::Snapshot::Initialize() {
[ 3452] | v8::internal::Isolate::Init() {
40.058 ms [ 3452] | v8::internal::Deserializer::Deserialize();
45.748 ms [ 3452] | } /* v8::internal::Isolate::Init */
45.772 ms [ 3452] | } /* v8::internal::Snapshot::Initialize */
46.213 ms [ 3452] | } /* v8::Isolate::New */
[ 3452] | v8::Shell::RunMain() {
[ 3452] | v8::Shell::CreateEvaluationContext() {
[ 3452] | v8::Context::New() {
[ 3452] | v8::NewContext() {
[ 3452] | v8::CreateEnvironment() {
[ 3452] | v8::InvokeBootstrapper::Invoke() {
[ 3452] | v8::internal::Bootstrapper::CreateEnvironment() {
57.126 ms [ 3452] | v8::internal::Genesis::Genesis();
57.423 ms [ 3452] | } /* v8::internal::Bootstrapper::CreateEnvironment */
57.424 ms [ 3452] | } /* v8::InvokeBootstrapper::Invoke */
57.502 ms [ 3452] | } /* v8::CreateEnvironment */
57.506 ms [ 3452] | } /* v8::NewContext */
57.507 ms [ 3452] | } /* v8::Context::New */
60.977 ms [ 3452] | } /* v8::Shell::CreateEvaluationContext */
[ 3452] | v8::SourceGroup::Execute() {
[ 3452] | v8::Shell::ExecuteString() {
[ 3452] | v8::Script::Run() {
[ 3452] | v8::internal::Execution::Call() {
44.009 ms [ 3452] | v8::internal::_GLOBAL__N_1::Invoke();
44.011 ms [ 3452] | } /* v8::internal::Execution::Call */
44.027 ms [ 3452] | } /* v8::Script::Run */
53.626 ms [ 3452] | } /* v8::Shell::ExecuteString */
53.668 ms [ 3452] | } /* v8::SourceGroup::Execute */
114.797 ms [ 3452] | } /* v8::Shell::RunMain */
256.926 ms [ 3452] | } /* v8::Shell::Main */
256.926 ms [ 3452] | } /* main */
The above example only traces main function and hides small functions
that spent less than 40 milli-seconds so that we can only focus on the
big picture of function execution trace.
uftrace function tracing tool can be downloaded from the link below:
https://github.com/namhyung/uftrace
The default build without -finstrument-functions or -pg option is not
changed as before.
BUG=
R=machenbach@chromium.org, yangguo@chromium.org
Patch Set 1 #Patch Set 2 : build: Add build options for uftrace support #
Messages
Total messages: 10 (2 generated)
|
|||||||||||||||||||||||||||||||||||||