Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add --profile flag to configure script, enables gprof profiling.

  • Loading branch information...
commit 8d578df4b6b4878d3995bba947986458fcb743e4 1 parent e006eda
@bnoordhuis bnoordhuis authored ry committed
Showing with 11 additions and 0 deletions.
  1. +11 −0 wscript
View
11 wscript
@@ -31,6 +31,12 @@ def set_options(opt):
, help='Build debug variant [Default: False]'
, dest='debug'
)
+ opt.add_option( '--profile'
+ , action='store_true'
+ , default=False
+ , help='Enable profiling [Default: False]'
+ , dest='profile'
+ )
opt.add_option( '--efence'
, action='store_true'
, default=False
@@ -138,6 +144,7 @@ def configure(conf):
conf.env["USE_DEBUG"] = o.debug
conf.env["SNAPSHOT_V8"] = not o.without_snapshot
+ conf.env["USE_PROFILING"] = o.profile
conf.env["USE_SHARED_V8"] = o.shared_v8 or o.shared_v8_includes or o.shared_v8_libpath or o.shared_v8_libname
conf.env["USE_SHARED_CARES"] = o.shared_cares or o.shared_cares_includes or o.shared_cares_libpath
@@ -291,6 +298,10 @@ def configure(conf):
# platform
conf.env.append_value('CPPFLAGS', '-DPLATFORM="' + conf.env['DEST_OS'] + '"')
+ if conf.env['USE_PROFILING'] == True:
+ conf.env.append_value('CPPFLAGS', '-pg')
+ conf.env.append_value('LINKFLAGS', '-pg')
+
# Split off debug variant before adding variant specific defines
debug_env = conf.env.copy()
conf.set_env_name('debug', debug_env)
Please sign in to comment.
Something went wrong with that request. Please try again.