diff --git a/bash-4.2/Makefile.in b/bash-4.2/Makefile.in index 6692ac4..77e6f22 100644 --- a/bash-4.2/Makefile.in +++ b/bash-4.2/Makefile.in @@ -431,10 +431,26 @@ HSOURCES = shell.h flags.h trap.h hashcmd.h hashlib.h jobs.h builtins.h \ subst.h externs.h siglist.h bashhist.h bashline.h bashtypes.h \ array.h arrayfunc.h sig.h mailcheck.h bashintl.h bashjmp.h \ execute_cmd.h parser.h pathexp.h pathnames.h pcomplete.h assoc.h \ - $(BASHINCFILES) + $(BASHINCFILES) $(PROBES_H) SOURCES = $(CSOURCES) $(HSOURCES) $(BUILTIN_DEFS) +# The tapset. +TAPSET_SRCDIR=$(srcdir)/tapset + +# Probe point declarations. +PROBES_SRC = @PROBES_SRC@ +PROBES_H = @PROBES_H@ +PROBES_O = @PROBES_O@ +DTRACE = @DTRACE@ + +probes.h: probes.d + $(DTRACE) -C -h -s $< -o $@ + +probes.o: probes.d + $(DTRACE) -C -G -s $< -o $@ + + # header files chosen based on running of configure SIGNAMES_H = @SIGNAMES_H@ @@ -449,8 +465,9 @@ OBJECTS = shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o $(GLOBO) \ expr.o flags.o $(JOBS_O) subst.o hashcmd.o hashlib.o mailcheck.o \ trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o \ alias.o array.o arrayfunc.o assoc.o braces.o bracecomp.o bashhist.o \ - bashline.o $(SIGLIST_O) list.o stringlib.o locale.o findcmd.o redir.o \ - pcomplete.o pcomplib.o syntax.o xmalloc.o $(SIGNAMES_O) + bashline.o $(SIGLIST_O) list.o stringlib.o locale.o findcmd.o \ + redir.o pcomplete.o pcomplib.o syntax.o xmalloc.o $(SIGNAMES_O) \ + $(PROBES_O) # Where the source code of the shell builtins resides. BUILTIN_SRCDIR=$(srcdir)/builtins diff --git a/bash-4.2/config.h.in b/bash-4.2/config.h.in index 4ef846b..fd892a9 100644 --- a/bash-4.2/config.h.in +++ b/bash-4.2/config.h.in @@ -1139,6 +1139,9 @@ /* End additions for lib/readline */ +/* Define to 1 if using probes */ +#undef HAVE_SYSTEMTAP + #include "config-bot.h" #endif /* _CONFIG_H_ */ diff --git a/bash-4.2/configure.in b/bash-4.2/configure.in index ff1e73c..668f38b 100644 --- a/bash-4.2/configure.in +++ b/bash-4.2/configure.in @@ -1109,6 +1109,51 @@ case "$srcdir" in ;; esac +AC_MSG_CHECKING([whether to include systemtap tracing support]) +AC_ARG_ENABLE([systemtap], + [AS_HELP_STRING([--enable-systemtap], + [Enable inclusion of systemtap trace support])], + [ENABLE_SYSTEMTAP="${enableval}"], [ENABLE_SYSTEMTAP='no']) + +AC_MSG_RESULT(${ENABLE_SYSTEMTAP}) + +PROBES_SRC= +PROBES_H= +PROBES_O= + +if test "x${ENABLE_SYSTEMTAP}" = xyes; then + AC_CHECK_PROGS(DTRACE, dtrace) + if test -z "$DTRACE"; then + AC_MSG_ERROR([dtrace not found]) + fi + AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='yes'], + [SDT_H_FOUND='no'; + AC_MSG_ERROR([systemtap support needs sys/sdt.h header])]) + + AC_DEFINE(HAVE_SYSTEMTAP) + PROBES_SRC=probes.d + PROBES_H=probes.h + PROBES_O=probes.o + DTRACE=dtrace + AC_ARG_WITH([tapset-install-dir], + [AS_HELP_STRING([--with-tapset-install-dir], + [The absolute path where the tapset dir will be installed])], + [if test "x${withval}" = x; then + ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset" + else + ABS_TAPSET_DIR="${withval}" + fi], [ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset"]) + AC_SUBST(ABS_TAPSET_DIR) +fi + +AC_SUBST(PROBES_SRC) +AC_SUBST(PROBES_H) +AC_SUBST(PROBES_O) +AC_SUBST(DTRACE) + + + + BUILD_DIR=`pwd` case "$BUILD_DIR" in *\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;; @@ -1161,3 +1206,5 @@ AC_OUTPUT([Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile \ # Makefile uses this timestamp file to record whether config.h is up to date. echo timestamp > stamp-h ]) + + diff --git a/bash-4.2/probes.d b/bash-4.2/probes.d new file mode 100644 index 0000000..0812e62 --- /dev/null +++ b/bash-4.2/probes.d @@ -0,0 +1,3 @@ +provider bash { + probe bash_start(); +}