Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 8d578df4b6b4878d3995bba947986458fcb743e4 1 parent e006eda
Ben Noordhuis bnoordhuis authored ry committed

Showing 1 changed file with 11 additions and 0 deletions. Show diff stats Hide diff stats

  1. +11 0 wscript
11 wscript
@@ -31,6 +31,12 @@ def set_options(opt):
31 31 , help='Build debug variant [Default: False]'
32 32 , dest='debug'
33 33 )
  34 + opt.add_option( '--profile'
  35 + , action='store_true'
  36 + , default=False
  37 + , help='Enable profiling [Default: False]'
  38 + , dest='profile'
  39 + )
34 40 opt.add_option( '--efence'
35 41 , action='store_true'
36 42 , default=False
@@ -138,6 +144,7 @@ def configure(conf):
138 144
139 145 conf.env["USE_DEBUG"] = o.debug
140 146 conf.env["SNAPSHOT_V8"] = not o.without_snapshot
  147 + conf.env["USE_PROFILING"] = o.profile
141 148
142 149 conf.env["USE_SHARED_V8"] = o.shared_v8 or o.shared_v8_includes or o.shared_v8_libpath or o.shared_v8_libname
143 150 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):
291 298 # platform
292 299 conf.env.append_value('CPPFLAGS', '-DPLATFORM="' + conf.env['DEST_OS'] + '"')
293 300
  301 + if conf.env['USE_PROFILING'] == True:
  302 + conf.env.append_value('CPPFLAGS', '-pg')
  303 + conf.env.append_value('LINKFLAGS', '-pg')
  304 +
294 305 # Split off debug variant before adding variant specific defines
295 306 debug_env = conf.env.copy()
296 307 conf.set_env_name('debug', debug_env)

0 comments on commit 8d578df

Please sign in to comment.
Something went wrong with that request. Please try again.