Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2010-11-13 14:58:24 +0300
committerRyan Dahl <ry@tinyclouds.org>2010-11-14 01:34:45 +0300
commit5d80bdb6aed3729a654c9b5839b7e4944b542410 (patch)
treea85d37449bd18f9249e24568f0ded976cd739e9b /wscript
parente5a0fbe500fa3b5f3e0c15f8d17a5d8026fac919 (diff)
Add --profile flag to configure script, enables gprof profiling.
Diffstat (limited to 'wscript')
-rw-r--r--wscript11
1 files changed, 11 insertions, 0 deletions
diff --git a/wscript b/wscript
index 28addfb9b73..d2a517bb7d9 100644
--- a/wscript
+++ b/wscript
@@ -39,6 +39,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
@@ -163,6 +169,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
@@ -346,6 +353,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)