diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-07-09 22:44:13 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-07-09 22:44:13 -0400 |
commit | a00cc8c70d20f2f3429590b629d272c8db65b40f (patch) | |
tree | 6a90966d1a715c48db4ac35b891c46ef654f272f | |
parent | df00639dbe262b8919bdf625f30d80e5b9b96346 (diff) | |
parent | 51a3785482396c9f653e3e7647945bfc24f7b160 (diff) | |
download | systemtap-steved-a00cc8c70d20f2f3429590b629d272c8db65b40f.tar.gz systemtap-steved-a00cc8c70d20f2f3429590b629d272c8db65b40f.tar.xz systemtap-steved-a00cc8c70d20f2f3429590b629d272c8db65b40f.zip |
Merge commit 'origin/master' into pr6429-comp-unwindsyms
* commit 'origin/master':
fix shutdown race condition for scripts that might exit during begin probes
Fix PR 6732: Add runtime/autoconf-real-parent.c check for task_struct field.
clarify dejagnu test case name for empty-struct changes
add changelog entries for last two changes
Add test suite for declaration resolution
Fix semantic error: empty struct
Add hack to support git 1.6 in git_version.sh
Sync latest fix for git_version.sh from RadeonHD's tree
Slightly cleanup code of translate.cxx
PR2111: add general blurbage to stapprobes.5 on syscalls tapset
Use `uname -rvm` for checking system compatibility. Generate
Add section to stapex manual page on how installed examples are documented.
Install examples, demos and samples.
Install tutorial and langref manuals.
-rw-r--r-- | ChangeLog | 49 | ||||
-rw-r--r-- | Makefile.am | 71 | ||||
-rw-r--r-- | Makefile.in | 91 | ||||
-rw-r--r-- | aclocal.m4 | 38 | ||||
-rw-r--r-- | buildrun.cxx | 1 | ||||
-rw-r--r-- | doc/ChangeLog | 6 | ||||
-rw-r--r-- | doc/Makefile.am | 15 | ||||
-rw-r--r-- | doc/Makefile.in | 38 | ||||
-rwxr-xr-x | git_version.sh | 25 | ||||
-rw-r--r-- | runtime/ChangeLog | 8 | ||||
-rw-r--r-- | runtime/autoconf-real-parent.c | 15 | ||||
-rw-r--r-- | runtime/task_finder.c | 3 | ||||
-rw-r--r-- | runtime/transport/ChangeLog | 4 | ||||
-rw-r--r-- | runtime/transport/transport.c | 4 | ||||
-rwxr-xr-x | stap-client | 16 | ||||
-rwxr-xr-x | stap-server | 7 | ||||
-rwxr-xr-x | stap-serverd | 5 | ||||
-rw-r--r-- | stapex.5.in | 7 | ||||
-rw-r--r-- | stapprobes.5.in | 41 | ||||
-rw-r--r-- | systemtap.spec.in | 23 | ||||
-rw-r--r-- | tapset/ChangeLog | 7 | ||||
-rw-r--r-- | tapset/context.stp | 8 | ||||
-rw-r--r-- | tapset/task.stp | 4 | ||||
-rw-r--r-- | tapsets.cxx | 93 | ||||
-rw-r--r-- | testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | testsuite/config/unix.exp | 1 | ||||
-rw-r--r-- | testsuite/lib/stap_compile.exp | 39 | ||||
-rw-r--r-- | testsuite/systemtap.base/declaration.exp | 19 | ||||
-rw-r--r-- | testsuite/systemtap.base/marker.exp | 40 | ||||
-rw-r--r-- | translate.cxx | 6 |
30 files changed, 538 insertions, 152 deletions
@@ -1,3 +1,52 @@ +2008-07-09 Mark Wielaard <mwielaard@redhat.com> + + PR 6732 + * buildrun.cxx (compile_pass): Define STAPCONF_REAL_PARENT by + calling autoconf-real-parent.c + +2008-07-09 Frank Ch. Eigler <fche@elastic.org> + + From James Bottomley <James.Bottomley@HansenPartnership.com> + * tapsets.cxx: (dwflpp::global_alias_cache): New member. + (declaration_resolve): Search it, called from translate_components. + (update_alias_cache): Populate it, called from query_cu. + +2008-07-09 <wenji.huang@oracle.com> + + * translate.cxx (visit_comparison): Remove unnecessary comparison. + * translate.cxx (emit_symbol_data): Remove unused local variable. + +2008-07-08 <brolley@redhat.com> + + * stap-client (client_sysinfo): Use `uname -rvm`. + (receive_response): Wait for "done:" from the server. Clear server_ip + when the server is incompatible. + * stap-server (check_request): Quote "`server_sysinfo`". + (server_sysinfo): Use `uname -rvm`. + (send_response): Send "done:". + * stap-serverd (advertise_presence): Use `uname -rvm`. Quote "$txt". + +2008-07-07 Mark Wielaard <mwielaard@redhat.com> + + * stapex.5.in: Add section on installed examples, samples and demos + and how they are documented. + +2008-07-07 Mark Wielaard <mwielaard@redhat.com> + + * Makefile.am (install-data-hook): Install examples, demos and + samples. + (uninstall-local): Remove examples, demos and samples. + * Makefile.in: Regenerated. + * aclocal.m4: Likewise. + * systemtap.spec.in (%install): Move examples. + Don't copy over examples to src. + (testsuite): Don't include src/examples. + +2008-07-07 Mark Wielaard <mwielaard@redhat.com> + + * systemtap.spec.in (%install): Move installed pdf files. + (%files): Mark moved installed pdf as %doc files. + 2008-07-03 Frank Ch. Eigler <fche@elastic.org> * translate.cxx (translate_pass): Don't #include <linux/compile.h>. diff --git a/Makefile.am b/Makefile.am index 8333281e..b603c640 100644 --- a/Makefile.am +++ b/Makefile.am @@ -155,32 +155,33 @@ EXTRA_DIST = auto_free.h buildrun.h elaborate.h loc2c.h session.h \ dwarf_wrappers.h \ git_version.h git_version.sh -EXAMPLE_DEST_DIR = $(distdir)/examples -SAMPLE_DEST_DIR = $(EXAMPLE_DEST_DIR)/samples - -EXAMPLE_SRC = $(srcdir)/testsuite/systemtap.examples - -SAMPLE_SRC = $(srcdir)/testsuite/systemtap.samples/iotask.stp \ - $(srcdir)/testsuite/systemtap.samples/kmalloc-stacks.stp \ - $(srcdir)/testsuite/systemtap.samples/kmalloc-top \ - $(srcdir)/testsuite/systemtap.samples/pfaults.stp \ - $(srcdir)/testsuite/systemtap.samples/profile.stp \ - $(srcdir)/testsuite/systemtap.samples/tcp_connections.stp \ - $(srcdir)/testsuite/systemtap.samples/topsys.stp - -dist-add-examples: $(EXAMPLE_SRC) - rm -rf $(EXAMPLE_DEST_DIR) - mkdir -p $(EXAMPLE_DEST_DIR) - cp -a $(EXAMPLE_SRC)/* $(EXAMPLE_DEST_DIR)/. - -# Copy some of the testsuite sample scripts to the distdir -# 'examples/samples' directory. -dist-add-samples: $(SAMPLE_SRC) dist-add-examples - rm -rf $(SAMPLE_DEST_DIR) - mkdir -p $(SAMPLE_DEST_DIR) - cp $(SAMPLE_SRC) $(SAMPLE_DEST_DIR) - -dist-hook: dist-add-samples dist-gitversion +EXAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples +EXAMPLE_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap/examples +DEMO_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples/small_demos +DEMO_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap/examples/small_demos +SAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.samples +SAMPLE_INSTALL_DIR = $(EXAMPLE_INSTALL_DIR)/samples + +EXAMPLE_SRC = $(EXAMPLE_SOURCE_DIR)/ChangeLog \ + $(EXAMPLE_SOURCE_DIR)/README \ + $(EXAMPLE_SOURCE_DIR)/*.stp \ + $(EXAMPLE_SOURCE_DIR)/*.txt \ + $(EXAMPLE_SOURCE_DIR)/*.meta + +DEMO_SRC = \ + $(EXAMPLE_SOURCE_DIR)/small_demos/*.stp \ + $(EXAMPLE_SOURCE_DIR)/small_demos/*.txt \ + $(EXAMPLE_SOURCE_DIR)/small_demos/*.wav + +SAMPLE_SRC = $(SAMPLE_SOURCE_DIR)/iotask.stp \ + $(SAMPLE_SOURCE_DIR)/kmalloc-stacks.stp \ + $(SAMPLE_SOURCE_DIR)/kmalloc-top \ + $(SAMPLE_SOURCE_DIR)/pfaults.stp \ + $(SAMPLE_SOURCE_DIR)/profile.stp \ + $(SAMPLE_SOURCE_DIR)/tcp_connections.stp \ + $(SAMPLE_SOURCE_DIR)/topsys.stp + +dist-hook: dist-gitversion find $(distdir) -name CVS -o -name '*~' -o -name '.#*' | xargs rm -rf find $(distdir) -name '*.o' -o -name '*.ko' -o -name '*.cmd' -o -name '*.mod.c' -o -name '.??*' | xargs rm -rf find $(distdir) -name 'stap' -o -name '*.log' -o -name '*.sum' -o -name 'site.exp' | xargs rm -rf @@ -195,6 +196,12 @@ install-data-local: do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/uprobes/$$f; done) (cd $(srcdir)/tapset; find . \( -name '*.stp' -o -name README \) -print \ | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/tapset/$$f; done) + $(MKDIR_P) $(EXAMPLE_INSTALL_DIR) + $(INSTALL_DATA) $(EXAMPLE_SRC) $(EXAMPLE_INSTALL_DIR) + $(MKDIR_P) $(DEMO_INSTALL_DIR) + $(INSTALL_DATA) $(DEMO_SRC) $(DEMO_INSTALL_DIR) + $(MKDIR_P) $(SAMPLE_INSTALL_DIR) + $(INSTALL_DATA) $(SAMPLE_SRC) $(SAMPLE_INSTALL_DIR) TEST_COV_DIR = coverage @@ -222,6 +229,18 @@ uninstall-local: rm -rf $(DESTDIR)$(libexecdir)/$(PACKAGE) rm -rf $(DESTDIR)$(libdir)/$(PACKAGE) -rm -rf $(DESTDIR)$(localstatedir)/cache/$(PACKAGE) + @list='$(EXAMPLE_SRC)'; for f in $$list; do p=`basename $$f`; \ + echo " rm -f '$(EXAMPLE_INSTALL_DIR)/$$p'"; \ + rm -f "$(EXAMPLE_INSTALL_DIR)/$$p"; \ + done + @list='$(DEMO_SRC)'; for f in $$list; do p=`basename $$f`; \ + echo " rm -f '$(DEMO_INSTALL_DIR)/$$p'"; \ + rm -f "$(DEMO_INSTALL_DIR)/$$p"; \ + done + @list='$(SAMPLE_SRC)'; for f in $$list; do p=`basename $$f`; \ + echo " rm -f '$(SAMPLE_INSTALL_DIR)/$$p'"; \ + rm -f "$(SAMPLE_INSTALL_DIR)/$$p"; \ + done # XXX: leaves behind man pages SUBDIRS = testsuite doc diff --git a/Makefile.in b/Makefile.in index dc039c3f..0e2cc2fa 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -331,16 +331,30 @@ EXTRA_DIST = auto_free.h buildrun.h elaborate.h loc2c.h session.h \ dwarf_wrappers.h \ git_version.h git_version.sh -EXAMPLE_DEST_DIR = $(distdir)/examples -SAMPLE_DEST_DIR = $(EXAMPLE_DEST_DIR)/samples -EXAMPLE_SRC = $(srcdir)/testsuite/systemtap.examples -SAMPLE_SRC = $(srcdir)/testsuite/systemtap.samples/iotask.stp \ - $(srcdir)/testsuite/systemtap.samples/kmalloc-stacks.stp \ - $(srcdir)/testsuite/systemtap.samples/kmalloc-top \ - $(srcdir)/testsuite/systemtap.samples/pfaults.stp \ - $(srcdir)/testsuite/systemtap.samples/profile.stp \ - $(srcdir)/testsuite/systemtap.samples/tcp_connections.stp \ - $(srcdir)/testsuite/systemtap.samples/topsys.stp +EXAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples +EXAMPLE_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap/examples +DEMO_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples/small_demos +DEMO_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap/examples/small_demos +SAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.samples +SAMPLE_INSTALL_DIR = $(EXAMPLE_INSTALL_DIR)/samples +EXAMPLE_SRC = $(EXAMPLE_SOURCE_DIR)/ChangeLog \ + $(EXAMPLE_SOURCE_DIR)/README \ + $(EXAMPLE_SOURCE_DIR)/*.stp \ + $(EXAMPLE_SOURCE_DIR)/*.txt \ + $(EXAMPLE_SOURCE_DIR)/*.meta + +DEMO_SRC = \ + $(EXAMPLE_SOURCE_DIR)/small_demos/*.stp \ + $(EXAMPLE_SOURCE_DIR)/small_demos/*.txt \ + $(EXAMPLE_SOURCE_DIR)/small_demos/*.wav + +SAMPLE_SRC = $(SAMPLE_SOURCE_DIR)/iotask.stp \ + $(SAMPLE_SOURCE_DIR)/kmalloc-stacks.stp \ + $(SAMPLE_SOURCE_DIR)/kmalloc-top \ + $(SAMPLE_SOURCE_DIR)/pfaults.stp \ + $(SAMPLE_SOURCE_DIR)/profile.stp \ + $(SAMPLE_SOURCE_DIR)/tcp_connections.stp \ + $(SAMPLE_SOURCE_DIR)/topsys.stp TEST_COV_DIR = coverage # XXX: leaves behind man pages @@ -1150,8 +1164,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -1176,8 +1190,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -1187,13 +1201,12 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -1266,6 +1279,10 @@ dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -1293,6 +1310,8 @@ distcheck: dist GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ @@ -1462,7 +1481,7 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 clean-binPROGRAMS clean-generic clean-local \ clean-noinstPROGRAMS clean-pkglibexecPROGRAMS ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \ - dist-shar dist-tarZ dist-zip distcheck distclean \ + dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ @@ -1537,19 +1556,7 @@ install-exec-hook: @BUILD_CRASHMOD_TRUE@ $(MKDIR_P) $(DESTDIR)$(pkglibdir) @BUILD_CRASHMOD_TRUE@ $(INSTALL) $(STAPLOG) $(DESTDIR)$(pkglibdir) -dist-add-examples: $(EXAMPLE_SRC) - rm -rf $(EXAMPLE_DEST_DIR) - mkdir -p $(EXAMPLE_DEST_DIR) - cp -a $(EXAMPLE_SRC)/* $(EXAMPLE_DEST_DIR)/. - -# Copy some of the testsuite sample scripts to the distdir -# 'examples/samples' directory. -dist-add-samples: $(SAMPLE_SRC) dist-add-examples - rm -rf $(SAMPLE_DEST_DIR) - mkdir -p $(SAMPLE_DEST_DIR) - cp $(SAMPLE_SRC) $(SAMPLE_DEST_DIR) - -dist-hook: dist-add-samples dist-gitversion +dist-hook: dist-gitversion find $(distdir) -name CVS -o -name '*~' -o -name '.#*' | xargs rm -rf find $(distdir) -name '*.o' -o -name '*.ko' -o -name '*.cmd' -o -name '*.mod.c' -o -name '.??*' | xargs rm -rf find $(distdir) -name 'stap' -o -name '*.log' -o -name '*.sum' -o -name 'site.exp' | xargs rm -rf @@ -1564,6 +1571,12 @@ install-data-local: do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/uprobes/$$f; done) (cd $(srcdir)/tapset; find . \( -name '*.stp' -o -name README \) -print \ | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/tapset/$$f; done) + $(MKDIR_P) $(EXAMPLE_INSTALL_DIR) + $(INSTALL_DATA) $(EXAMPLE_SRC) $(EXAMPLE_INSTALL_DIR) + $(MKDIR_P) $(DEMO_INSTALL_DIR) + $(INSTALL_DATA) $(DEMO_SRC) $(DEMO_INSTALL_DIR) + $(MKDIR_P) $(SAMPLE_INSTALL_DIR) + $(INSTALL_DATA) $(SAMPLE_SRC) $(SAMPLE_INSTALL_DIR) gcov: @-$(MAKE) clean CXXFLAGS="-g -fprofile-arcs -ftest-coverage" all check @@ -1589,6 +1602,18 @@ uninstall-local: rm -rf $(DESTDIR)$(libexecdir)/$(PACKAGE) rm -rf $(DESTDIR)$(libdir)/$(PACKAGE) -rm -rf $(DESTDIR)$(localstatedir)/cache/$(PACKAGE) + @list='$(EXAMPLE_SRC)'; for f in $$list; do p=`basename $$f`; \ + echo " rm -f '$(EXAMPLE_INSTALL_DIR)/$$p'"; \ + rm -f "$(EXAMPLE_INSTALL_DIR)/$$p"; \ + done + @list='$(DEMO_SRC)'; for f in $$list; do p=`basename $$f`; \ + echo " rm -f '$(DEMO_INSTALL_DIR)/$$p'"; \ + rm -f "$(DEMO_INSTALL_DIR)/$$p"; \ + done + @list='$(SAMPLE_SRC)'; for f in $$list; do p=`basename $$f`; \ + echo " rm -f '$(SAMPLE_INSTALL_DIR)/$$p'"; \ + rm -f "$(SAMPLE_INSTALL_DIR)/$$p"; \ + done check: SRCDIR=`cd $(srcdir); pwd`; \ @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.10 -*- Autoconf -*- +# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,12 +11,15 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -m4_if(m4_PACKAGE_VERSION, [2.61],, -[m4_fatal([this file was generated for autoconf 2.61. -You have another version of autoconf. If you want to use that, -you should regenerate the build system entirely.], [63])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(AC_AUTOCONF_VERSION, [2.61],, +[m4_warning([this file was generated for autoconf 2.61. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -31,7 +34,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10], [], +m4_if([$1], [1.10.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -47,8 +50,10 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10])dnl -_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) +[AM_AUTOMAKE_VERSION([1.10.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -343,7 +348,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue @@ -391,13 +396,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006 Free Software Foundation, Inc. +# 2005, 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 +# serial 13 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -502,16 +507,17 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC], # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $1 | $1:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # @@ -872,7 +878,7 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- -# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) diff --git a/buildrun.cxx b/buildrun.cxx index a39f2b63..3183fe6b 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -96,6 +96,7 @@ compile_pass (systemtap_session& s) o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-nameidata.c, -DSTAPCONF_NAMEIDATA_CLEANUP,)" << endl; o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-unregister-kprobes.c, -DSTAPCONF_UNREGISTER_KPROBES,)" << endl; o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-module-nsections.c, -DSTAPCONF_MODULE_NSECTIONS,)" << endl; + o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-real-parent.c, -DSTAPCONF_REAL_PARENT,)" << endl; #if 0 /* NB: For now, the performance hit of probe_kernel_read/write (vs. our * homegrown safe-access functions) is deemed undesireable, so we'll skip diff --git a/doc/ChangeLog b/doc/ChangeLog index 16a3c111..600edb6d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2008-07-07 Mark Wielaard <mwielaard@redhat.com> + + * Makefile.am (install-data-hook): New, install pdf files. + (uninstall-local): New, uninstall them again. + * Makefile.in: Regenerated. + 2008-04-24 Will Cohen <wcohen@redhat.com> * Makefile.in: Regenerated. diff --git a/doc/Makefile.am b/doc/Makefile.am index 25eb61d7..e4bc3800 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,11 +1,24 @@ # Makefile.am --- automake input file for systemtap docs ## process this file with automake to produce Makefile.in +PDF_FILES = tutorial.pdf langref.pdf +DOC_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap + if BUILD_DOCS -all-local: tutorial.pdf langref.pdf +all-local: $(PDF_FILES) clean-local: rm -f *.pdf *.out *.log *.aux *.toc *.lot *.idx *.glo + +install-data-hook: + $(MKDIR_P) $(DOC_INSTALL_DIR) + $(INSTALL_DATA) $(PDF_FILES) $(DOC_INSTALL_DIR) + +uninstall-local: + @list='$(PDF_FILES)'; for p in $$list; do \ + echo " rm -f '$(DOC_INSTALL_DIR)/$$p'"; \ + rm -f "$(DOC_INSTALL_DIR)/$$p"; \ + done endif SUFFIXES = ps pdf dvi ps tex diff --git a/doc/Makefile.in b/doc/Makefile.in index a31d76f0..e01c5ebf 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -149,6 +149,8 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +PDF_FILES = tutorial.pdf langref.pdf +DOC_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap SUFFIXES = ps pdf dvi ps tex EXTRA_DIST = tutorial.tex langref.tex tutorial nomencl.sty all: all-am @@ -246,7 +248,9 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@BUILD_DOCS_FALSE@uninstall-local: @BUILD_DOCS_FALSE@clean-local: +@BUILD_DOCS_FALSE@install-data-hook: clean: clean-am clean-am: clean-generic clean-local mostlyclean-am @@ -266,6 +270,8 @@ info: info-am info-am: install-data-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am @@ -299,27 +305,37 @@ ps: ps-am ps-am: -uninstall-am: +uninstall-am: uninstall-local -.MAKE: install-am install-strip +.MAKE: install-am install-data-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-local distclean distclean-generic distdir dvi dvi-am \ html html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + install-data-am install-data-hook install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am uninstall uninstall-am + pdf-am ps ps-am uninstall uninstall-am uninstall-local -@BUILD_DOCS_TRUE@all-local: tutorial.pdf langref.pdf +@BUILD_DOCS_TRUE@all-local: $(PDF_FILES) @BUILD_DOCS_TRUE@clean-local: @BUILD_DOCS_TRUE@ rm -f *.pdf *.out *.log *.aux *.toc *.lot *.idx *.glo +@BUILD_DOCS_TRUE@install-data-hook: +@BUILD_DOCS_TRUE@ $(MKDIR_P) $(DOC_INSTALL_DIR) +@BUILD_DOCS_TRUE@ $(INSTALL_DATA) $(PDF_FILES) $(DOC_INSTALL_DIR) + +@BUILD_DOCS_TRUE@uninstall-local: +@BUILD_DOCS_TRUE@ @list='$(PDF_FILES)'; for p in $$list; do \ +@BUILD_DOCS_TRUE@ echo " rm -f '$(DOC_INSTALL_DIR)/$$p'"; \ +@BUILD_DOCS_TRUE@ rm -f "$(DOC_INSTALL_DIR)/$$p"; \ +@BUILD_DOCS_TRUE@ done + .ps.pdf: ps2pdf -r600 $< diff --git a/git_version.sh b/git_version.sh index 69eb0f24..50658970 100755 --- a/git_version.sh +++ b/git_version.sh @@ -155,6 +155,29 @@ cat<<EOF EOF +# Backwards compatibility hack for git 1.6.0 (and people running the +# latest pre-release version of git.) +# +# For now, we'll do this to support git 1.6, with minimal changes to +# the rest of this script, but no guarantees how long this will work. +# The hyphenated git-foo-bar names really are deprecated, and may +# disappear in the future as more of git gets rewritten as built-in C +# programs. Google summer of code students and other git developers +# are hard at work doing this, in order to make git more +# portable/usable for Windows users. As a result, some of the +# git-foo-bar programs, which will be moved to the exec-dir directory +# in git 1.6, may disappear altogether in the future. Hence the only +# truly safe and future-compatible way of running commands such as +# git-diff-files, git-rev-parse, etc., are "git diff-files" and +# "git rev-parse". Here endeth the git portability sermon, which +# I suspect will have as much effect as abstinence-only sex ed +# classes. :-) TYT, 2008-07-08 + +execdir=$(git --exec-path 2> /dev/null) +if test -n "$execdir"; then + PATH=$PATH:$execdir +fi + # Detect git tools (should work with old and new git versions) git_found=yes for git_tool in git-symbolic-ref git-rev-parse git-diff-files git-diff-index git @@ -314,7 +337,7 @@ int main(int argc, char *argv[]) const char *const prog = (idx)?(idx+1):(argv[0]); #ifdef PACKAGE_VERSION printf("%s: version %s, built from %s\n", prog, PACKAGE_VERSION, GIT_MESSAGE); -#elif defined(GIT_USED) +#elif defined(GIT_MESSAGE) printf("%s: built from %s\n", prog, GIT_MESSAGE); #endif return 0; diff --git a/runtime/ChangeLog b/runtime/ChangeLog index f7f1a5a8..25faffe2 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,11 @@ +2008-07-09 Mark Wielaard <mwielaard@redhat.com> + + PR 6732 + * autoconf-real-parent.c: New file. + * task_finder.c (__stp_utrace_task_finder_report_exec): Define + real_parent using STAPCONF_REAL_PARENT. Undefine when no longer + needed. + 2008-07-01 David Smith <dsmith@redhat.com> * task_finder.c (__stp_get_mm_path): Corrected error return code. diff --git a/runtime/autoconf-real-parent.c b/runtime/autoconf-real-parent.c new file mode 100644 index 00000000..010792cb --- /dev/null +++ b/runtime/autoconf-real-parent.c @@ -0,0 +1,15 @@ +/* PR6732 - In RHEL5 and F[678] kernels, the utrace patch removed the + * ptrace-related parent field and renamed real_parent to parent. In + * future Fedora kernels, there may or may not be a ptrace-related + * parent field, but the real useful field will go back to being called + * real_parent. + */ +#include <linux/sched.h> + +struct task_struct t; + +void foo (void) +{ + struct task_struct *p; + p = t.real_parent; +} diff --git a/runtime/task_finder.c b/runtime/task_finder.c index 316a9bc0..fc573eb6 100644 --- a/runtime/task_finder.c +++ b/runtime/task_finder.c @@ -485,7 +485,7 @@ __stp_utrace_task_finder_report_exec(struct utrace_attached_engine *engine, // '/bin/bash' clones and then execs '/bin/ls'. If the user // was probing '/bin/bash', the cloned thread is still // '/bin/bash' up until the exec. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) +#if ! defined(STAPCONF_REAL_PARENT) #define real_parent parent #endif if (tsk != NULL && tsk->real_parent != NULL @@ -494,6 +494,7 @@ __stp_utrace_task_finder_report_exec(struct utrace_attached_engine *engine, // *could* call exec (although they aren't supposed to). __stp_utrace_attach_match_tsk(tsk->real_parent, tsk, 0, 1); } +#undef real_parent // We assume that all exec's are exec'ing a new process. Note // that we don't use bprm->filename, since that path can be diff --git a/runtime/transport/ChangeLog b/runtime/transport/ChangeLog index 98548afa..4bb0868b 100644 --- a/runtime/transport/ChangeLog +++ b/runtime/transport/ChangeLog @@ -1,4 +1,8 @@ +2008-07-09 Frank Ch. Eigler <fche@elastic.org> + PR5963 + * transport.c (_stp_work_queue): Don't signal a premature exit + if a begin probe happened to exit(). 2008-06-23 Wenji Huang <wenji.huang@oracle.com> PR 6646 diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c index 01a24033..ed9718ae 100644 --- a/runtime/transport/transport.c +++ b/runtime/transport/transport.c @@ -159,9 +159,9 @@ static void _stp_work_queue(void *data) wake_up_interruptible(&_stp_ctl_wq); /* if exit flag is set AND we have finished with probe_start() */ - if (unlikely(_stp_exit_flag)) + if (unlikely(_stp_exit_flag && _stp_probes_started)) _stp_cleanup_and_exit(1); - else if (likely(_stp_attached)) + if (likely(_stp_attached)) queue_delayed_work(_stp_wq, &_stp_work, STP_WORK_TIMER); } diff --git a/stap-client b/stap-client index 515cab92..8c3607ae 100755 --- a/stap-client +++ b/stap-client @@ -315,7 +315,7 @@ function create_request { function client_sysinfo { if test "X$sysinfo_client" = "X"; then # Add some info from uname - sysinfo_client="`uname -r`" + sysinfo_client="`uname -rvm`" fi echo $sysinfo_client } @@ -348,7 +348,6 @@ function package_request { # the tar file will expand to. function send_request { echo "request:" >&3 - # Get the server's response. read <&3 local line=$REPLY @@ -368,7 +367,19 @@ function send_request { # function: receive_response # # Wait for a response from the server indicating the results of our request. +# protocol is: +# server -> "done:" +# server -> $tar_server function receive_response { + # Get the server's response. + read <&3 + local line=$REPLY + check_server_error $line + + # Check for the proper response. + test "$line" = "done:" || \ + fatal "ERROR: server response, '$line', is incorrect" + # Make a place to receive the response file. tar_server=`mktemp -t $tmpdir_prefix_client.server.tgz.XXXXXX` || \ fatal "ERROR: cannot create temporary file " $tar_server @@ -522,6 +533,7 @@ function match_server { # It is a stap server, but is it compatible? if test "$sysinfo_server" != "`client_sysinfo`"; then + server_ip= continue fi diff --git a/stap-server b/stap-server index 11d6d81d..16ffe8ee 100755 --- a/stap-server +++ b/stap-server @@ -111,7 +111,7 @@ function check_request { client_sysinfo=`read_data_file sysinfo` test "X$client_sysinfo" != "X" || exit 1 - check_compatibility "$client_sysinfo" `server_sysinfo` + check_compatibility "$client_sysinfo" "`server_sysinfo`" } # function server_sysinfo @@ -120,7 +120,7 @@ function check_request { function server_sysinfo { if test "X$sysinfo_server" = "X"; then # Add some info from uname - sysinfo_server="`uname -r`" + sysinfo_server="`uname -rvm`" fi echo $sysinfo_server } @@ -365,9 +365,10 @@ function package_response { # Notify the client that $tar_server is ready and wait for the client to take # it. # The protocol is: -# server -> "sending: $tmpdir_server $tmpdir_stap" +# server -> "done:" # server -> $tar_server function send_response { + echo "done:" # Now send it nc -l $port < $tar_server > /dev/null } diff --git a/stap-serverd b/stap-serverd index 2c0743c0..eaaeda00 100755 --- a/stap-serverd +++ b/stap-serverd @@ -34,13 +34,12 @@ function initialization { function advertise_presence { # Build up a string representing our server's properties. # TODO: this needs fleshing out. - - local sysinfo=`uname -r` + local sysinfo=`uname -rvm` local txt="$sysinfo" # Call avahi-publish-service to advertise our presence. avahi-publish-service "Systemtap Compile Server on `uname -n`" \ - $avahi_type $port $txt > /dev/null 2>&1 & + $avahi_type $port "$txt" > /dev/null 2>&1 & echo "Systemtap Compile Server on `uname -n` listening on port $port" } diff --git a/stapex.5.in b/stapex.5.in index 2c9ecb60..e6763267 100644 --- a/stapex.5.in +++ b/stapex.5.in @@ -106,6 +106,13 @@ To list the probeable functions in the kernel, use the listings mode. % stap \-l \[aq]kernel.function("*")\[aq] .ESAMPLE +.SH MORE EXAMPLES + +Larger examples, demos and samples can be found in +@prefix@/doc/systemtap*/examples, each example comes with either a .txt +or .meta file explaining what the example, sample or demo does and how +it is ordinarily run. + .SH SEE ALSO .BR @prefix@/doc/systemtap*/examples .IR stap (1) diff --git a/stapprobes.5.in b/stapprobes.5.in index 5d400cb6..700452a7 100644 --- a/stapprobes.5.in +++ b/stapprobes.5.in @@ -121,6 +121,47 @@ handler is never run, though its statements are analyzed for symbol / type correctness as usual. This probe point may be useful in conjunction with optional probes. +.SS SYSCALL + +The +.IR syscall.* +aliases define several hundred probes, too many to +summarize here. They are: + +.SAMPLE +syscall.NAME +.br +syscall.NAME.return +.ESAMPLE + +Generally, two probes are defined for each normal system call as listed in the +.IR syscalls(2) +manual page, one for entry and one for return. Those system calls that never +return do not have a corresponding +.IR .return +probe. +.PP +Each probe alias defines a variety of variables. Looking at the tapset source +code is the most reliable way. Generally, each variable listed in the standard +manual page is made available as a script-level variable, so +.IR syscall.open +exposes +.IR filename ", " flags ", and " mode . +In addition, a standard suite of variables is available at most aliases: +.TP +.IR argstr +A pretty-printed form of the entire argument list, without parentheses. +.TP +.IR name +The name of the system call. +.TP +.IR retstr +For return probes, a pretty-printed form of the system-call result. +.PP +Not all probe aliases obey all of these general guidelines. Please report +any bothersome ones you encounter as a bug. + + .SS TIMERS Intervals defined by the standard kernel "jiffies" timer may be used diff --git a/systemtap.spec.in b/systemtap.spec.in index e663b15a..1fdd65a4 100644 --- a/systemtap.spec.in +++ b/systemtap.spec.in @@ -130,16 +130,19 @@ cd .. %configure %{?elfutils_config} %{sqlite_config} %{crash_config} %{docs_config} make %{?_smp_mflags} +%install +rm -rf ${RPM_BUILD_ROOT} +make DESTDIR=$RPM_BUILD_ROOT install + +# We want the examples in the special doc dir, not the generoc doc install dir. +mv $RPM_BUILD_ROOT%{_datadir}/doc/systemtap/examples examples + # Fix paths in the example & testsuite scripts find examples testsuite -type f -name '*.stp' -print0 | xargs -0 sed -i -r -e '1s@^#!.+stap@#!%{_bindir}/stap@' # To avoid perl dependency, make perl sample script non-executable chmod -x examples/samples/kmalloc-top -%install -rm -rf ${RPM_BUILD_ROOT} -make DESTDIR=$RPM_BUILD_ROOT install - # Because "make install" may install staprun with mode 04111, the # post-processing programs rpmbuild runs won't be able to read it. # So, we change permissions so that they can read it. We'll set the @@ -148,8 +151,12 @@ chmod 755 $RPM_BUILD_ROOT%{_bindir}/staprun # Copy over the testsuite cp -rp testsuite $RPM_BUILD_ROOT%{_datadir}/systemtap -mkdir $RPM_BUILD_ROOT%{_datadir}/%{name}/src -cp -rp examples $RPM_BUILD_ROOT%{_datadir}/%{name}/src + +#%if %{with_docs} +# We want the manuals in the special doc dir, not the generic doc install dir. +mkdir docs.installed +mv $RPM_BUILD_ROOT%{_datadir}/doc/systemtap/*.pdf docs.installed/ +#%endif %clean rm -rf ${RPM_BUILD_ROOT} @@ -164,8 +171,7 @@ exit 0 %doc README AUTHORS NEWS COPYING examples %if %{with_docs} -%doc doc/tutorial.pdf -%doc doc/langref.pdf +%doc docs.installed/*.pdf %endif %{_bindir}/stap @@ -196,7 +202,6 @@ exit 0 %files testsuite %defattr(-,root,root) -%{_datadir}/%{name}/src %{_datadir}/%{name}/testsuite diff --git a/tapset/ChangeLog b/tapset/ChangeLog index b1862324..670f3255 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,10 @@ +2008-07-09 Mark Wielaard <mwielaard@redhat.com> + + PR 6732 + * context.stp (ppid): Use STAPCONF_REAL_PARENT. + (pexecname): Likewise. + * task.stp (task_parent): Likewise. + 2008-07-01 Wenji Huang <wenji.huang@oracle.com> * vfs.stp : Make _vfs.generic_commit_write only for kernel<=2.6.25 diff --git a/tapset/context.stp b/tapset/context.stp index 10c52226..017c934c 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -41,11 +41,19 @@ function tid:long () %{ /* pure */ %} function ppid:long () %{ /* pure */ +#if defined(STAPCONF_REAL_PARENT) + THIS->__retvalue = current->real_parent->tgid; +#else THIS->__retvalue = current->parent->tgid; +#endif %} function pexecname:string () %{ /* pure */ +#if defined(STAPCONF_REAL_PARENT) + strlcpy (THIS->__retvalue, current->real_parent->comm, MAXSTRINGLEN); +#else strlcpy (THIS->__retvalue, current->parent->comm, MAXSTRINGLEN); +#endif %} function gid:long () %{ /* pure */ diff --git a/tapset/task.stp b/tapset/task.stp index d89729e8..9215e83f 100644 --- a/tapset/task.stp +++ b/tapset/task.stp @@ -23,7 +23,11 @@ function task_current:long () %{ /* pure */ // Return the parent task_struct of the given task function task_parent:long (task:long) %{ /* pure */ struct task_struct *t = (struct task_struct *)(long)THIS->task; +#if defined(STAPCONF_REAL_PARENT) + THIS->__retvalue = (long)kread(&(t->real_parent)); +#else THIS->__retvalue = (long)kread(&(t->parent)); +#endif CATCH_DEREF_FAULT(); %} diff --git a/tapsets.cxx b/tapsets.cxx index 56838140..7714715e 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -1,6 +1,7 @@ // tapset resolution // Copyright (C) 2005-2008 Red Hat Inc. // Copyright (C) 2005-2007 Intel Corporation. +// Copyright (C) 2008 James.Bottomley@HansenPartnership.com // // This file is part of systemtap, and is free software. You can // redistribute it and/or modify it under the terms of the GNU General @@ -1157,6 +1158,47 @@ struct dwflpp // ----------------------------------------------------------------- + /* The global alias cache is used to resolve any DIE found in a + * module that is stubbed out with DW_AT_declaration with a defining + * DIE found in a different module. The current assumption is that + * this only applies to structures and unions, which have a global + * namespace (it deliberately only traverses program scope), so this + * cache is indexed by name. If other declaration lookups were + * added to it, it would have to be indexed by name and tag + */ + cu_function_cache_t global_alias_cache; + + static int global_alias_caching_callback(Dwarf_Die *die, void *arg) + { + dwflpp *dw = static_cast<struct dwflpp *>(arg); + const char *name = dwarf_diename(die); + + if (!name) + return DWARF_CB_OK; + + string structure_name = name; + + if (!dwarf_hasattr(die, DW_AT_declaration) && + dw->global_alias_cache.find(structure_name) == + dw->global_alias_cache.end()) + dw->global_alias_cache[structure_name] = *die; + + return DWARF_CB_OK; + } + + Dwarf_Die *declaration_resolve(Dwarf_Die *die) + { + const char *name = dwarf_diename(die); + + if (!name) + return NULL; + + if (global_alias_cache.find(name) == global_alias_cache.end()) + return NULL; + + return &global_alias_cache[name]; + } + mod_cu_function_cache_t cu_function_cache; static int cu_function_caching_callback (Dwarf_Die* func, void *arg) @@ -1169,6 +1211,16 @@ struct dwflpp int iterate_over_functions (int (* callback)(Dwarf_Die * func, void * arg), void * data); + int iterate_over_globals (int (* callback)(Dwarf_Die *, void *), + void * data); + + int update_alias_cache(void) + { + int rc; + + rc = iterate_over_globals(global_alias_caching_callback, this); + return rc; + } bool has_single_line_record (dwarf_query * q, char const * srcfile, int lineno); @@ -1834,6 +1886,14 @@ struct dwflpp case DW_TAG_structure_type: case DW_TAG_union_type: struct_die = *die; + if (dwarf_hasattr(die, DW_AT_declaration)) + { + Dwarf_Die *tmpdie = dwflpp::declaration_resolve(die); + if (tmpdie == NULL) + throw semantic_error ("unresolved struct " + + string (dwarf_diename_integrate (die) ?: "<anonymous>")); + *die_mem = *tmpdie; + } switch (dwarf_child (die, die_mem)) { case 1: /* No children. */ @@ -2517,6 +2577,37 @@ dwflpp::has_single_line_record (dwarf_query * q, char const * srcfile, int linen return false; } +/* This basically only goes one level down from the compile unit so it + * only picks up top level stuff (i.e. nothing in a lower scope) */ +int +dwflpp::iterate_over_globals (int (* callback)(Dwarf_Die *, void *), + void * data) +{ + int rc = DWARF_CB_OK; + Dwarf_Die die; + + assert (module); + assert (cu); + assert (dwarf_tag(cu) == DW_TAG_compile_unit); + + if (dwarf_child(cu, &die) != 0) + return rc; + + do { + /* We're only currently looking for structures and unions, + * although other types of declarations exist */ + if (dwarf_tag(&die) != DW_TAG_structure_type && + dwarf_tag(&die) != DW_TAG_union_type) + continue; + + rc = (*callback)(&die, data); + if (rc != DWARF_CB_OK) + break; + + } while (dwarf_siblingof(&die, &die) == 0); + + return rc; +} int dwflpp::iterate_over_functions (int (* callback)(Dwarf_Die * func, void * arg), @@ -3505,6 +3596,8 @@ query_cu (Dwarf_Die * cudie, void * arg) { q->dw.focus_on_cu (cudie); + q->dw.update_alias_cache(); + if (false && q->sess.verbose>2) clog << "focused on CU '" << q->dw.cu_name << "', in module '" << q->dw.module_name << "'\n"; diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 9353cc32..7296f52c 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-07-09 Frank Ch. Eigler <fche@elastic.org> + + From <James.Bottomley@HansenPartnership.com>: + * systemtap.base/declaration.exp: New test. + * lib/stap_compile.exp: New file, stap_compile moved from ... + * systemtap.base/marker.exp: ... here. 2008-07-01 Wenji Huang <wenji.huang@oracle.com> diff --git a/testsuite/config/unix.exp b/testsuite/config/unix.exp index 625c5604..52560cac 100644 --- a/testsuite/config/unix.exp +++ b/testsuite/config/unix.exp @@ -3,3 +3,4 @@ load_lib "stap_run2.exp" load_lib "stap_run_exact.exp" load_lib "stap_run_binary.exp" load_lib "stap_run.exp" +load_lib "stap_compile.exp" diff --git a/testsuite/lib/stap_compile.exp b/testsuite/lib/stap_compile.exp new file mode 100644 index 00000000..8c6df0ee --- /dev/null +++ b/testsuite/lib/stap_compile.exp @@ -0,0 +1,39 @@ +# stap_compile TEST_NAME flags script args +# - TEST_NAME is the name of the current test +# - compile indicates whether the script is supposed to compile +# - script is the script to compile +# Additional arguments are passed to stap as-is. +proc stap_compile { TEST_NAME compile script args } { + set cmd [concat {stap -v -p4 -e} $script $args] + + verbose -log "running $cmd" + eval spawn $cmd + set compile_errors 0 + expect { + -re {^Pass\ [1234]:[^\r]*\ in\ .*\ ms.\r\n} {exp_continue} + -re {^Pass\ [34]: using cached [^\r\n]+\r\n} {exp_continue} + # pass-4 output + -re {^/[^\r\n]+.ko\r\n} {exp_continue} + -re "parse error" { incr compile_errors 1; exp_continue} + -re "compilation failed" {incr compile_errors 1; exp_continue} + -re "semantic error:" {incr compile_errors 1; exp_continue} + } + catch close + wait + + # If we've got compile errors and the script was supposed to + # compile, fail. + if {$compile_errors > 0} { + if {$compile == 1} { + fail "$TEST_NAME compilation failed" + } else { + pass "$TEST_NAME compilation failed correctly" + } + } else { + if {$compile == 1} { + pass "$TEST_NAME compilation succeeded" + } else { + fail "$TEST_NAME compilation succeeded unexpectedly" + } + } +} diff --git a/testsuite/systemtap.base/declaration.exp b/testsuite/systemtap.base/declaration.exp new file mode 100644 index 00000000..e47898a7 --- /dev/null +++ b/testsuite/systemtap.base/declaration.exp @@ -0,0 +1,19 @@ +# Declaration tests. Specifically looking for resolution of +# DW_AT_declaration from another module + +set TEST_NAME "empty-struct resolve-fail" + +# this test just makes sure $device is still stubbed with DW_AT_declaration +set failscript { + probe\ module(\"libata\").function(\"ata_qc_issue\")\ \{\ print(\$qc->\$scsicmd->\$device->\$host->\$host_no)\ \}; +} + +stap_compile $TEST_NAME 0 $failscript + +set TEST_NAME "empty-struct resolve-pass" + +set passscript { + probe\ module(\"scsi_mod\").function(\"scsi_request_fn\")\ \{print(\$q)\} +} + +stap_compile $TEST_NAME 1 [concat $passscript $failscript ] diff --git a/testsuite/systemtap.base/marker.exp b/testsuite/systemtap.base/marker.exp index 857fa5d2..89c0b8c3 100644 --- a/testsuite/systemtap.base/marker.exp +++ b/testsuite/systemtap.base/marker.exp @@ -3,46 +3,6 @@ # trigger a specific marker). So, we'll try to compile lots of tests # to do as much as we can. -# stap_compile TEST_NAME flags script args -# - TEST_NAME is the name of the current test -# - compile indicates whether the script is supposed to compile -# - script is the script to compile -# Additional arguments are passed to stap as-is. -proc stap_compile { TEST_NAME compile script args } { - set cmd [concat {stap -v -p4 -e} $script $args] - - verbose -log "running $cmd" - eval spawn $cmd - set compile_errors 0 - expect { - -re {^Pass\ [1234]:[^\r]*\ in\ .*\ ms.\r\n} {exp_continue} - -re {^Pass\ [34]: using cached [^\r\n]+\r\n} {exp_continue} - # pass-4 output - -re {^/[^\r\n]+.ko\r\n} {exp_continue} - -re "parse error" { incr compile_errors 1; exp_continue} - -re "compilation failed" {incr compile_errors 1; exp_continue} - -re "semantic error:" {incr compile_errors 1; exp_continue} - } - catch close - wait - - # If we've got compile errors and the script was supposed to - # compile, fail. - if {$compile_errors > 0} { - if {$compile == 1} { - fail "$TEST_NAME compilation failed" - } else { - pass "$TEST_NAME compilation failed correctly" - } - } else { - if {$compile == 1} { - pass "$TEST_NAME compilation succeeded" - } else { - fail "$TEST_NAME compilation succeeded unexpectedly" - } - } -} - # Initialize variables set kernel_markers_found 0 set kernel_marker_names {} diff --git a/translate.cxx b/translate.cxx index 5c25b912..0e10f0fc 100644 --- a/translate.cxx +++ b/translate.cxx @@ -3136,8 +3136,7 @@ c_unparser::visit_comparison (comparison* e) if (e->left->type == pe_string) { - if (e->left->type != pe_string || - e->right->type != pe_string) + if (e->right->type != pe_string) throw semantic_error ("expected string types", e->tok); o->line() << "strncmp ("; @@ -3149,8 +3148,7 @@ c_unparser::visit_comparison (comparison* e) } else if (e->left->type == pe_long) { - if (e->left->type != pe_long || - e->right->type != pe_long) + if (e->right->type != pe_long) throw semantic_error ("expected numeric types", e->tok); o->line() << "(("; |