--- httpd-2.4.6/acinclude.m4 2013-01-30 20:25:31.000000000 +0400 +++ httpd-2.4.6/acinclude.m4 2013-11-18 17:12:38.400158351 +0400 @@ -189,14 +189,42 @@ fi if test -z "$module_standalone"; then + cat >$modpath_current/probes_$1.libtool.hack<>$modpath_current/modules.mk< `echo $libname | sed -e 's/\.la/.objects/;'` EOF if test ! -z "$5"; then APR_ADDTO(AP_LIBS, [$5]) @@ -205,10 +233,27 @@ apache_need_shared=yes libname="mod_$1.la" shobjects=`echo $objects | sed 's/\.lo/.slo/g'` + realobjects=`echo $objects | sed -e 's/\.lo/.o/g;' -e 's/^/.libs\//g;' -e 's/ / .libs\//g;'` modpath_shared="$modpath_shared $libname" + if test -r "$modpath_current/probes_$1.d"; then + echo "Found probes for $1 [$DTRACE]" + BUILD_DTRACE="\$(DTRACE) \$(DTRACEFLAGS) -G -s \$(top_srcdir)/apache_probes.d -s probes_$1.d $realobjects && cp probes_$1.o .libs/probes_$1.o && cp probes_$1.libtool.hack probes_$1.lo" + DTRACE_OBJ=probes_$1.lo + $DTRACE $DTRACEFLAGS -h -o $modpath_current/probes_$1.h -s $modpath_current/probes_$1.d + RELINK="\$(CC) -shared \$(CFLAGS) -o .libs/mod_$1.so $realobjects .libs/probes_$1.o $5" + elif test "$DTRACE" != "true"; then + BUILD_DTRACE="\$(DTRACE) \$(DTRACEFLAGS) -G -o probes_$1.o -s \$(top_srcdir)/apache_probes.d $realobjects && cp probes_$1.o .libs/probes_$1.o && cp probes_$1.libtool.hack probes_$1.lo" + DTRACE_OBJ=probes_$1.lo + RELINK="\$(CC) -shared \$(CFLAGS) -o .libs/mod_$1.so $realobjects .libs/probes_$1.o $5" + else + $DTRACE + fi cat >>$modpath_current/modules.mk< $(LIBLIST) + ld -r -o $(LIBNAME) $(LTLIBRARY_OS) --- httpd-2.4.6/configure.in 2013-06-26 17:01:00.000000000 +0400 +++ httpd-2.4.6/configure.in 2013-11-18 15:27:13.852212919 +0400 @@ -539,29 +539,39 @@ AC_ARG_ENABLE(dtrace,APACHE_HELP_STRING(--enable-dtrace,Enable DTrace probes), [ enable_dtrace=$enableval - if test "$enableval" = "yes"; then - APR_ADDTO(CPPFLAGS, -DAPR_DTRACE_PROVIDER) - AC_MSG_ERROR('DTrace Support in the build system is not complete. Patches Welcome!') - fi ], [ enable_dtrace=no ]) -dnl Disabled dtrace build for now. -enable_dtrace=no - case $host in *-solaris2*) if test $enable_dtrace = "yes" -a "$ac_cv_header_sys_sdt_h" = "yes"; then - AC_DEFINE(AP_ENABLE_DTRACE, 1, - [Enable DTrace probes]) - DTRACE="/usr/sbin/dtrace $DTRACEFLAGS" - test -f include/apache_probes.h || $DTRACE -h -s apache_probes.d -o include/apache_probes.h + if test -x /usr/sbin/dtrace; then + DTRACE="/usr/sbin/dtrace $DTRACEFLAGS" + AC_DEFINE(AP_ENABLE_DTRACE, 1, + [Enable DTrace probes]) + fi fi ;; + *-linux*) + if test $enable_dtrace = "yes" -a "$ac_cv_header_sys_sdt_h" = "yes"; then + if test -x /usr/bin/dtrace; then + DTRACE="/usr/bin/dtrace $DTRACEFLAGS" + AC_DEFINE(AP_ENABLE_SYSTEMTAP, 1, + [Define if SystemTap probe definitions are used]) + fi + fi + ;; + *) + enable_dtrace=no + ;; esac +if test $enable_dtrace = "yes"; then + test -f include/apache_probes.h || $DTRACE -h -s apache_probes.d -o include/apache_probes.h +fi + APACHE_SUBST(DTRACE) AC_ARG_ENABLE(hook-probes,APACHE_HELP_STRING(--enable-hook-probes,Enable APR hook probes), --- httpd-2.4.6/include/ap_config.h 2012-08-15 03:59:24.000000000 +0400 +++ httpd-2.4.6/include/ap_config.h 2013-11-18 15:31:25.704210746 +0400 @@ -22,8 +22,6 @@ #ifndef AP_CONFIG_H #define AP_CONFIG_H -#include "ap_hooks.h" - /* Although this file doesn't declare any hooks, declare the exports group here */ /** * @defgroup exports Apache exports @@ -148,17 +146,88 @@ #define AP_NONBLOCK_WHEN_MULTI_LISTEN 1 #endif -#if defined(AP_ENABLE_DTRACE) && HAVE_SYS_SDT_H + +#include "os.h" +#if (!defined(WIN32) && !defined(NETWARE)) || defined(__MINGW32__) +#include "ap_config_auto.h" +#include "ap_config_layout.h" +#endif +#if defined(NETWARE) +#define AP_NONBLOCK_WHEN_MULTI_LISTEN 1 +#endif + +/* If APR has OTHER_CHILD logic, use reliable piped logs. */ +#if APR_HAS_OTHER_CHILD +#define AP_HAVE_RELIABLE_PIPED_LOGS TRUE +#endif + +/* Presume that the compiler supports C99-style designated + * initializers if using GCC (but not G++), or for any other compiler + * which claims C99 support. */ +#if (defined(__GNUC__) && !defined(__cplusplus)) \ + || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) +#define AP_HAVE_DESIGNATED_INITIALIZER +#endif + +#if AP_ENABLE_DTRACE || AP_ENABLE_SYSTEMTAP + +/* define hook probes before including apr_hooks.h */ + +#if HAVE_SYS_SDT_H #include -#else -#undef _DTRACE_VERSION #endif -#ifdef _DTRACE_VERSION +#define APR_HOOK_PROBES_ENABLED + +#undef APR_HOOK_PROBE_ENTRY +#undef APR_HOOK_PROBE_RETURN +#undef APR_HOOK_PROBE_INVOKE +#undef APR_HOOK_PROBE_COMPLETE + +/* hard-code provider to "ap" instead of using the hook namespace + * so that mod_proxy, mod_dav, and other such hooks with their own + * namespace are part of the "ap" provider + */ + +#if AP_ENABLE_SYSTEMTAP + +#define APR_HOOK_PROBE_ENTRY(ud,ns,name,args) \ + STAP_PROBE(ap, name##__entry); ud=NULL + +#define APR_HOOK_PROBE_RETURN(ud,ns,name,rv,args) \ + STAP_PROBE1(ap, name##__return, rv) + +#define APR_HOOK_PROBE_INVOKE(ud,ns,name,src,args) \ + STAP_PROBE1(ap, name##__dispatch__invoke, src) + +#define APR_HOOK_PROBE_COMPLETE(ud,ns,name,src,rv,args) \ + STAP_PROBE2(ap, name##__dispatch__complete, src, rv) + +#else + +#define APR_HOOK_PROBE_ENTRY(ud,ns,name,args) \ + __dtrace_ap___##name##__entry(); ud=NULL + +#define APR_HOOK_PROBE_RETURN(ud,ns,name,rv,args) \ + __dtrace_ap___##name##__return(rv) + +#define APR_HOOK_PROBE_INVOKE(ud,ns,name,src,args) \ + __dtrace_ap___##name##__dispatch__invoke(src) + +#define APR_HOOK_PROBE_COMPLETE(ud,ns,name,src,rv,args) \ + __dtrace_ap___##name##__dispatch__complete(src, rv) + +#endif + #include "apache_probes.h" + #else + #include "apache_noprobes.h" -#endif + +#endif /* AP_ENABLE_DTRACE */ + +#include "ap_hooks.h" /* If APR has OTHER_CHILD logic, use reliable piped logs. */ #if APR_HAS_OTHER_CHILD --- httpd-2.4.6/include/ap_hooks.h 2011-09-23 22:08:42.000000000 +0400 +++ httpd-2.4.6/include/ap_hooks.h 2013-11-13 17:48:25.799844539 +0400 @@ -32,10 +32,6 @@ #define APR_HOOK_PROBES_ENABLED 1 #endif -#ifdef APR_HOOK_PROBES_ENABLED -#include "ap_hook_probes.h" -#endif - #include "apr.h" #include "apr_hooks.h" #include "apr_optional_hooks.h" --- httpd-2.4.6/Makefile.in 2012-12-17 15:50:41.000000000 +0400 +++ httpd-2.4.6/Makefile.in 2013-11-14 12:16:50.806402472 +0400 @@ -2,10 +2,18 @@ SUBDIRS = srclib os server modules support CLEAN_SUBDIRS = test +MPM_LIB = $(MPM_LIB:.la=.o) +PROGRAM_DEPENDENCIES_O = $(PROGRAM_DEPENDENCIES:.la=.o) +PROGRAM_DEPENDENCIES_OBJECTS = $(PROGRAM_DEPENDENCIES:.la=.objects) + PROGRAM_NAME = $(progname) PROGRAM_SOURCES = modules.c -PROGRAM_LDADD = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(PCRE_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS) -PROGRAM_PRELINK = $(COMPILE) -c $(top_srcdir)/server/buildmark.c +PROGRAM_LDADD = buildmark.o $(HTTPD_LDFLAGS) `cat $(PROGRAM_DEPENDENCIES_OBJECTS)` \ + `test -f probes.o && echo probes.o` $(PCRE_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS) \ + `./libtool-dep-extract $(PROGRAM_DEPENDENCIES)` +PROGRAM_PRELINK = $(COMPILE) -c $(top_srcdir)/server/buildmark.c && \ + $(DTRACE) $(DTRACEFLAGS) -G -s apache_probes.d -o probes.o \ + modules.o buildmark.o `cat $(PROGRAM_DEPENDENCIES_OBJECTS)` PROGRAM_DEPENDENCIES = \ server/libmain.la \ $(BUILTIN_LIBS) \ @@ -97,6 +105,16 @@ fi ; \ fi +install-dtrace: + @echo Installing DTrace library + @$(MKINSTALLDIRS) $(DESTDIR)/usr/lib/dtrace + @chown root:sys $(DESTDIR)/usr + @chown -R root:bin $(DESTDIR)/usr/lib + @chmod -R 0755 $(DESTDIR)/usr + @cp $(top_srcdir)/ap.d $(DESTDIR)/usr/lib/dtrace + @chown root:bin $(DESTDIR)/usr/lib/dtrace/ap.d + @chmod 0644 $(DESTDIR)/usr/lib/dtrace/ap.d + # Create a sanitized config_vars.mk build/config_vars.out: build/config_vars.mk @$(SHELL) build/config_vars.sh < build/config_vars.mk > build/config_vars.out --- httpd-2.4.6/modules/cache/cache_util.h 2013-05-29 01:09:34.000000000 +0400 +++ httpd-2.4.6/modules/cache/cache_util.h 2013-11-13 18:02:32.173851639 +0400 @@ -32,7 +32,7 @@ #include "mod_cache.h" -#include "apr_hooks.h" +#include "ap_config.h" #include "apr.h" #include "apr_lib.h" #include "apr_strings.h" --- httpd-2.4.6/modules/cache/mod_cache.h 2011-12-03 22:02:24.000000000 +0400 +++ httpd-2.4.6/modules/cache/mod_cache.h 2013-11-13 18:02:32.174851639 +0400 @@ -29,7 +29,7 @@ #include "httpd.h" #include "apr_date.h" #include "apr_optional.h" -#include "apr_hooks.h" +#include "ap_config.h" #include "cache_common.h" --- httpd-2.4.6/modules/core/mod_watchdog.h 2011-11-30 14:21:09.000000000 +0400 +++ httpd-2.4.6/modules/core/mod_watchdog.h 2013-11-13 18:02:31.411851633 +0400 @@ -36,7 +36,7 @@ #include "apr_pools.h" #include "apr_shm.h" #include "apr_hash.h" -#include "apr_hooks.h" +#include "ap_config.h" #include "apr_optional.h" #include "apr_file_io.h" #include "apr_time.h" --- httpd-2.4.6/modules/database/mod_dbd.h 2011-09-23 17:38:09.000000000 +0400 +++ httpd-2.4.6/modules/database/mod_dbd.h 2013-11-13 18:02:31.234851631 +0400 @@ -55,7 +55,7 @@ #include #include #include -#include +#include typedef struct { server_rec *server; --- httpd-2.4.6/modules/dav/main/mod_dav.h 2013-05-27 00:07:04.000000000 +0400 +++ httpd-2.4.6/modules/dav/main/mod_dav.h 2013-11-13 18:02:31.591851635 +0400 @@ -26,7 +26,7 @@ #ifndef _MOD_DAV_H_ #define _MOD_DAV_H_ -#include "apr_hooks.h" +#include "ap_config.h" #include "apr_hash.h" #include "apr_dbm.h" #include "apr_tables.h" --- httpd-2.4.6/modules/filters/config.m4 2012-09-26 18:30:31.000000000 +0400 +++ httpd-2.4.6/modules/filters/config.m4 2013-11-14 13:27:29.379438032 +0400 @@ -20,7 +20,8 @@ if test "x$enable_sed" = "xshared"; then # The only symbol which needs to be exported is the module # structure, so ask libtool to hide libsed internals: - APR_ADDTO(MOD_SED_LDADD, [-export-symbols-regex sed_module]) + # APR_ADDTO(MOD_SED_LDADD, [-export-symbols-regex sed_module]) + true fi ]) --- httpd-2.4.6/modules/lua/mod_lua.h 2013-06-10 18:36:56.000000000 +0400 +++ httpd-2.4.6/modules/lua/mod_lua.h 2013-11-13 18:02:31.930851637 +0400 @@ -38,7 +38,7 @@ #include "apr_buckets.h" #include "apr_file_info.h" #include "apr_time.h" -#include "apr_hooks.h" +#include "ap_config.h" #include "apr_reslist.h" /* Allow for Lua 5.2 backwards compatibility */ --- httpd-2.4.6/modules/proxy/ajp.h 2012-01-31 16:04:47.000000000 +0400 +++ httpd-2.4.6/modules/proxy/ajp.h 2013-11-13 18:02:31.777851635 +0400 @@ -29,7 +29,7 @@ #include "apr_version.h" #include "apr.h" -#include "apr_hooks.h" +#include "ap_config.h" #include "apr_lib.h" #include "apr_strings.h" #include "apr_buckets.h" --- httpd-2.4.6/modules/proxy/mod_proxy.h 2013-07-11 16:21:19.000000000 +0400 +++ httpd-2.4.6/modules/proxy/mod_proxy.h 2013-11-13 18:02:31.732851635 +0400 @@ -26,7 +26,7 @@ * @{ */ -#include "apr_hooks.h" +#include "ap_config.h" #include "apr_optional.h" #include "apr.h" #include "apr_lib.h" --- httpd-2.4.6/modules/session/mod_session.h 2011-12-02 21:51:27.000000000 +0400 +++ httpd-2.4.6/modules/session/mod_session.h 2013-11-13 18:02:31.662851635 +0400 @@ -47,7 +47,7 @@ * @{ */ -#include "apr_hooks.h" +#include "ap_config.h" #include "apr_optional.h" #include "apr_tables.h" #include "apr_uuid.h" --- httpd-2.4.6/modules/ssl/config.m4 2012-09-26 18:30:31.000000000 +0400 +++ httpd-2.4.6/modules/ssl/config.m4 2013-11-14 13:08:16.285428358 +0400 @@ -43,7 +43,10 @@ if test "x$enable_ssl" = "xshared"; then # The only symbol which needs to be exported is the module # structure, so ask libtool to hide everything else: - APR_ADDTO(MOD_SSL_LDADD, [-export-symbols-regex ssl_module]) + + # FIXME: -export-symbols-regex not working on Solaris + # APR_ADDTO(MOD_SSL_LDADD, [-export-symbols-regex ssl_module]) + true fi else enable_ssl=no --- httpd-2.4.6/server/Makefile.in 2013-01-28 17:13:18.000000000 +0400 +++ httpd-2.4.6/server/Makefile.in 2013-11-13 11:47:49.994663029 +0400 @@ -60,7 +60,7 @@ for dir in $(EXPORT_DIRS_APR); do \ ls $$dir/ap[ru].h $$dir/ap[ru]_*.h 2>/dev/null; \ done; \ - ) | sed -e s,//,/,g | sort -u > $@ + ) | sed -e s,//,/,g | sort -u | grep -v apache_probes.h > $@ exports.c: export_files $(AWK) -f $(top_srcdir)/build/make_exports.awk `cat $?` > $@ --- httpd-2.4.6/server/mpm/event/Makefile.in 2009-11-03 17:36:48.000000000 +0300 +++ httpd-2.4.6/server/mpm/event/Makefile.in 2013-11-14 12:35:01.419411622 +0400 @@ -1, +1,6 @@ -include $(top_srcdir)/build/special.mk +# include $(top_srcdir)/build/special.mk + +LTLIBRARY_NAME = libevent.la +LTLIBRARY_SOURCES = event.c fdqueue.c pod.c + +include $(top_srcdir)/build/ltlib.mk