Skip to content

Commit

Permalink
build: remove dtrace probes
Browse files Browse the repository at this point in the history
The existing probes, all two of them, cause a great deal of pain for
people trying to build libuv on Linux because of SystemTap's dtrace(1)
utilitity not understanding the -xnolibs flag.

We could hack around that but it's easier to just remove the probes:
they are largely useless and unused while still needing a lot of
supporting infrastructure.  This commit removes 200 lines of code
and configuration.

Refs joyent/libuv#1478.
  • Loading branch information
bnoordhuis authored and saghul committed Nov 10, 2014
1 parent f914721 commit cb51400
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 201 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ vgcore.*
Makefile
Makefile.in

# Generated by dtrace(1) when doing an in-tree build.
/include/uv-dtrace.h

# Generated by gyp for android
*.target.mk

Expand Down
39 changes: 0 additions & 39 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -307,46 +307,7 @@ libuv_la_CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
libuv_la_SOURCES += src/unix/sunos.c
endif

if HAVE_DTRACE
BUILT_SOURCES = include/uv-dtrace.h
CLEANFILES += include/uv-dtrace.h
if FREEBSD
libuv_la_LDFLAGS += -lelf
endif
endif

if DTRACE_NEEDS_OBJECTS
libuv_la_SOURCES += src/unix/uv-dtrace.d
libuv_la_DEPENDENCIES = src/unix/uv-dtrace.o
libuv_la_LIBADD = uv-dtrace.lo
CLEANFILES += src/unix/uv-dtrace.o src/unix/uv-dtrace.lo
endif

if HAVE_PKG_CONFIG
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = @[email protected]
endif

if HAVE_DTRACE
include/uv-dtrace.h: src/unix/uv-dtrace.d
$(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -h -xnolibs -s $< -o $(top_srcdir)/$@
endif

if DTRACE_NEEDS_OBJECTS
SUFFIXES = .d

src/unix/uv-dtrace.o: src/unix/uv-dtrace.d ${libuv_la_OBJECTS}

# It's ok to specify the output here, because we have 1 .d file, and we process
# every created .o, most projects don't need to include more than one .d
.d.o:
$(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -G -o $(top_builddir)/uv-dtrace.o -s $< \
`find ${top_builddir}/src -name "*.o"`
$(AM_V_GEN)printf %s\\n \
'# ${top_builddir}/uv-dtrace.lo - a libtool object file' \
'# Generated by libtool (GNU libtool) 2.4' \
'# libtool wants a .lo not a .o' \
"pic_object='uv-dtrace.o'" \
"non_pic_object='uv-dtrace.o'" \
> ${top_builddir}/uv-dtrace.lo
endif
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ AM_CONDITIONAL([NETBSD], [AS_CASE([$host_os],[netbsd*], [true], [false])
AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os],[openbsd*], [true], [false])])
AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])])
AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])])
PANDORA_ENABLE_DTRACE
AC_CHECK_PROG(PKG_CONFIG, pkg-config, yes)
AM_CONDITIONAL([HAVE_PKG_CONFIG], [test "x$PKG_CONFIG" != "x"])
AS_IF([test "x$PKG_CONFIG" != "x"], [
Expand Down
3 changes: 1 addition & 2 deletions m4/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Ignore libtoolize-generated files.
*.m4
!as_case.m4
!dtrace.m4
!libuv-check-flags.m4
!libuv-check-flags.m4
66 changes: 0 additions & 66 deletions m4/dtrace.m4

This file was deleted.

3 changes: 0 additions & 3 deletions src/unix/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,6 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) {
uv__update_time(loop);

while (r != 0 && loop->stop_flag == 0) {
UV_TICK_START(loop, mode);

uv__update_time(loop);
uv__run_timers(loop);
uv__run_pending(loop);
Expand Down Expand Up @@ -340,7 +338,6 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) {
}

r = uv__loop_alive(loop);
UV_TICK_STOP(loop, mode);

if (mode & (UV_RUN_ONCE | UV_RUN_NOWAIT))
break;
Expand Down
8 changes: 0 additions & 8 deletions src/unix/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,4 @@ UV_UNUSED(static char* uv__basename_r(const char* path)) {
return s + 1;
}


#ifdef HAVE_DTRACE
#include "uv-dtrace.h"
#else
#define UV_TICK_START(arg0, arg1)
#define UV_TICK_STOP(arg0, arg1)
#endif

#endif /* UV_UNIX_INTERNAL_H_ */
79 changes: 0 additions & 79 deletions uv.gyp
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
'variables': {
'uv_use_dtrace%': 'false',
# uv_parent_path is the relative path to libuv in the parent project
# this is only relevant when dtrace is enabled and libuv is a child project
# as it's necessary to correctly locate the object files for post
# processing.
# XXX gyp is quite sensitive about paths with double / they don't normalize
'uv_parent_path': '/',
},

'target_defaults': {
'conditions': [
['OS != "win"', {
Expand Down Expand Up @@ -296,20 +286,6 @@
['uv_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 not in "mac linux"', {
'sources': [ 'src/unix/dtrace.c' ],
}],
[ 'OS=="linux"', {
'sources': [ '<(SHARED_INTERMEDIATE_DIR)/dtrace.o' ]
}],
],
}],
]
},

Expand Down Expand Up @@ -522,60 +498,5 @@
},
},
},

{
'target_name': 'uv_dtrace_header',
'type': 'none',
'conditions': [
[ 'uv_use_dtrace=="true"', {
'actions': [
{
'action_name': 'uv_dtrace_header',
'inputs': [ 'src/unix/uv-dtrace.d' ],
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/uv-dtrace.h' ],
'action': [ 'dtrace', '-h', '-xnolibs', '-s', '<@(_inputs)',
'-o', '<@(_outputs)' ],
},
],
}],
],
},

# FIXME(bnoordhuis or tjfontaine) Unify this, it's extremely ugly.
{
'target_name': 'uv_dtrace_provider',
'type': 'none',
'conditions': [
[ 'uv_use_dtrace=="true" and OS not in "mac linux"', {
'actions': [
{
'action_name': 'uv_dtrace_o',
'inputs': [
'src/unix/uv-dtrace.d',
'<(PRODUCT_DIR)/obj.target/libuv<(uv_parent_path)src/unix/core.o',
],
'outputs': [
'<(PRODUCT_DIR)/obj.target/libuv<(uv_parent_path)src/unix/dtrace.o',
],
'action': [ 'dtrace', '-G', '-xnolibs', '-s', '<@(_inputs)',
'-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)'
],
}
]
}],
]
},

]
}

0 comments on commit cb51400

Please sign in to comment.