Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Issue 2498223004: [build] Add build options for uftrace support

Created:
4 years, 1 month ago by honggyu.kim
Modified:
3 years, 12 months ago
Reviewers:
Yang, Michael Achenbach
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -0 lines) Patch
M BUILD.gn View 1 2 chunks +21 lines, -0 lines 0 comments Download
M Makefile View 1 1 chunk +6 lines, -0 lines 0 comments Download
M gypfiles/standalone.gypi View 1 3 chunks +35 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
honggyu.kim
Hi Yang and machenbach, This patch is to support a new function tracing tool called ...
4 years, 1 month ago (2016-11-15 14:53:05 UTC) #1
Yang
On 2016/11/15 14:53:05, honggyu.kim wrote: > Hi Yang and machenbach, > > This patch is ...
4 years, 1 month ago (2016-11-15 14:55:10 UTC) #2
honggyu.kim
On 2016/11/15 14:55:10, Yang wrote: > On 2016/11/15 14:53:05, honggyu.kim wrote: > > Hi Yang ...
4 years, 1 month ago (2016-11-15 15:01:17 UTC) #3
Michael Achenbach
On 2016/11/15 15:01:17, honggyu.kim wrote: > On 2016/11/15 14:55:10, Yang wrote: > > On 2016/11/15 ...
4 years, 1 month ago (2016-11-16 10:43:28 UTC) #4
honggyu.kim
Sorry for posting the reply twice. I thought if I put a message in code ...
4 years, 1 month ago (2016-11-18 12:08:18 UTC) #5
Michael Achenbach
On 2016/11/18 12:08:18, honggyu.kim wrote: > Sorry for posting the reply twice. I thought if ...
4 years, 1 month ago (2016-11-18 14:38:02 UTC) #6
honggyu.kim
On 2016/11/18 14:38:02, machenbach (slow) wrote: > On 2016/11/18 12:08:18, honggyu.kim wrote: > > Sorry ...
4 years, 1 month ago (2016-11-23 04:05:28 UTC) #7
honggyu.kim
4 years ago (2016-11-24 01:53:42 UTC) #8
On 2016/11/23 04:05:28, honggyu.kim wrote:
> On 2016/11/18 14:38:02, machenbach (slow) wrote:
> > If this has general-purpose usage, the best would be to add a gn arg
upstream
> in
> > e.g.:
> > https://cs.chromium.org/chromium/src/build/config/compiler/BUILD.gn
> > 
> > But you'd need to get support from owners there to change the code.
> > 
> > Otherwise the place for v8 standalone would be in:
> > https://cs.chromium.org/chromium/src/v8/build_overrides/v8.gni to add an arg
> and
> > then add the conditional code to the toolchain config in the main BUILD.gn.
> > 
> > Is this a standalone v8 feature?
> 
> Sorry for the late response. This is a standalone v8 feature so I just updated
> it with GN script change as of now. You can test it with d8 console shell.
> To be honest, I'm not familiar with the BUILD.gn script in build git. Should I
> also update it as well?
> I appreciate your help!

I modified commit the message before running 'git cl upload' but I found that
the commit message is not updated for some reasons.  Can I ask you how to change
the commit message with a new patchset?

Powered by Google App Engine
This is Rietveld 408576698