build: make systemtap probes work with gyp build

The following now works though the used approach is nothing to write
home about:

  $ ./gyp_uv -Duv_use_dtrace=true
  # <output elided>
  $ make -C out BUILDTYPE=Debug
  # <output elided>
  $ cd out/Debug && stap -L 'process("./run-tests").mark("*")'
  process("./run-tests").mark("tick__start") $arg1:long $arg2:long
  process("./run-tests").mark("tick__stop") $arg1:long $arg2:long
This commit is contained in:
Ben Noordhuis 2013-10-29 21:48:01 +01:00
parent 21c37a7db8
commit 3c172ea74c

25
uv.gyp
View File

@ -268,13 +268,17 @@
['library=="shared_library"', {
'defines': [ 'BUILDING_UV_SHARED=1' ]
}],
# FIXME(bnoordhuis or tjfontaine) Unify this, it's extremely ugly.
['uv_use_dtrace=="true"', {
'defines': [ 'HAVE_DTRACE=1' ],
'dependencies': [ 'uv_dtrace_header' ],
'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ],
'conditions': [
['OS != "mac"', {
'sources': ['src/unix/dtrace.c' ],
[ 'OS not in "mac linux"', {
'sources': [ 'src/unix/dtrace.c' ],
}],
[ 'OS=="linux"', {
'sources': [ '<(SHARED_INTERMEDIATE_DIR)/dtrace.o' ]
}],
],
}],
@ -480,11 +484,12 @@
],
},
# FIXME(bnoordhuis or tjfontaine) Unify this, it's extremely ugly.
{
'target_name': 'uv_dtrace_provider',
'type': 'none',
'conditions': [
[ 'uv_use_dtrace=="true" and OS!="mac"', {
[ 'uv_use_dtrace=="true" and OS not in "mac linux"', {
'actions': [
{
'action_name': 'uv_dtrace_o',
@ -499,7 +504,19 @@
'-o', '<@(_outputs)' ]
}
]
} ]
}],
[ 'uv_use_dtrace=="true" and OS=="linux"', {
'actions': [
{
'action_name': 'uv_dtrace_o',
'inputs': [ 'src/unix/uv-dtrace.d' ],
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/dtrace.o' ],
'action': [
'dtrace', '-C', '-G', '-s', '<@(_inputs)', '-o', '<@(_outputs)'
],
}
]
}],
]
},