diff options
-rw-r--r-- | Makefile.am | 10 | ||||
-rw-r--r-- | Makefile.in | 137 | ||||
-rw-r--r-- | NEWS | 27 | ||||
-rw-r--r-- | buildrun.cxx | 7 | ||||
-rw-r--r-- | buildrun.h | 2 | ||||
-rwxr-xr-x | configure | 39 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | doc/Makefile.in | 1 | ||||
-rw-r--r-- | doc/SystemTap_Tapset_Reference/Makefile.am | 6 | ||||
-rw-r--r-- | doc/SystemTap_Tapset_Reference/Makefile.in | 7 | ||||
-rwxr-xr-x | dtrace | 1 | ||||
-rw-r--r-- | includes/sys/sdt.h | 217 | ||||
-rw-r--r-- | man/stapprobes.iosched.3stap.in (renamed from man/stapprobes.iosched.5.in) | 4 | ||||
-rw-r--r-- | man/stapprobes.netdev.3stap.in (renamed from man/stapprobes.netdev.5.in) | 4 | ||||
-rw-r--r-- | man/stapprobes.nfs.3stap.in (renamed from man/stapprobes.nfs.5.in) | 4 | ||||
-rw-r--r-- | man/stapprobes.nfsd.3stap.in (renamed from man/stapprobes.nfsd.5.in) | 4 | ||||
-rw-r--r-- | man/stapprobes.pagefault.3stap.in (renamed from man/stapprobes.pagefault.5.in) | 4 | ||||
-rw-r--r-- | man/stapprobes.process.3stap.in (renamed from man/stapprobes.process.5.in) | 4 | ||||
-rw-r--r-- | man/stapprobes.rpc.3stap.in (renamed from man/stapprobes.rpc.5.in) | 4 | ||||
-rw-r--r-- | man/stapprobes.scsi.3stap.in (renamed from man/stapprobes.scsi.5.in) | 4 | ||||
-rw-r--r-- | man/stapprobes.signal.3stap.in (renamed from man/stapprobes.signal.5.in) | 4 | ||||
-rw-r--r-- | man/stapprobes.socket.3stap.in (renamed from man/stapprobes.socket.5.in) | 6 | ||||
-rw-r--r-- | man/stapprobes.tcp.3stap.in (renamed from man/stapprobes.tcp.5.in) | 4 | ||||
-rw-r--r-- | man/stapprobes.udp.3stap.in (renamed from man/stapprobes.udp.5.in) | 4 | ||||
-rw-r--r-- | runtime/itrace.c | 3 | ||||
-rw-r--r-- | runtime/staprun/staprun_funcs.c | 9 | ||||
-rw-r--r-- | runtime/task_finder.c | 45 | ||||
-rwxr-xr-x | scripts/kernel-doc | 2 | ||||
-rw-r--r-- | stap-server.8.in | 8 | ||||
-rw-r--r-- | stap.1.in | 80 | ||||
-rw-r--r-- | stapex.3stap.in (renamed from stapex.5.in) | 6 | ||||
-rw-r--r-- | stapfuncs.3stap.in (renamed from stapfuncs.5.in) | 4 | ||||
-rw-r--r-- | stapprobes.3stap.in (renamed from stapprobes.5.in) | 28 | ||||
-rw-r--r-- | staprun.8.in | 8 | ||||
-rw-r--r-- | stapvars.3stap.in (renamed from stapvars.5.in) | 2 | ||||
-rw-r--r-- | systemtap.spec | 12 | ||||
-rw-r--r-- | tapsets.cxx | 38 | ||||
-rw-r--r-- | testsuite/systemtap.base/tracepoints.exp | 23 | ||||
-rw-r--r-- | testsuite/systemtap.base/uprobes_exe.c | 27 | ||||
-rw-r--r-- | testsuite/systemtap.base/uprobes_lib.c | 20 | ||||
-rw-r--r-- | testsuite/systemtap.base/uprobes_lib.exp | 38 | ||||
-rw-r--r-- | testsuite/systemtap.base/uprobes_lib.stp | 9 | ||||
-rw-r--r-- | translate.cxx | 2 |
43 files changed, 551 insertions, 324 deletions
diff --git a/Makefile.am b/Makefile.am index c58323f0..80b54754 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,15 @@ AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DSYSCONFDIR='"$(sysconfdir)"' -DPKGDATADIR AM_CFLAGS = -D_GNU_SOURCE -fexceptions -Wall -Werror -Wunused -Wformat=2 -W AM_CXXFLAGS = -Wall -Werror -man_MANS = stap.1 stapprobes.5 stapfuncs.5 stapvars.5 stapex.5 staprun.8 man/stapprobes.iosched.5 man/stapprobes.netdev.5 man/stapprobes.nfs.5 man/stapprobes.nfsd.5 man/stapprobes.pagefault.5 man/stapprobes.process.5 man/stapprobes.rpc.5 man/stapprobes.scsi.5 man/stapprobes.signal.5 man/stapprobes.socket.5 man/stapprobes.tcp.5 man/stapprobes.udp.5 +man_MANS = stap.1 \ +stapprobes.3stap stapfuncs.3stap stapvars.3stap stapex.3stap \ +staprun.8 \ +man/stapprobes.iosched.3stap man/stapprobes.netdev.3stap \ +man/stapprobes.nfs.3stap man/stapprobes.nfsd.3stap \ +man/stapprobes.pagefault.3stap man/stapprobes.process.3stap \ +man/stapprobes.rpc.3stap man/stapprobes.scsi.3stap \ +man/stapprobes.signal.3stap man/stapprobes.socket.3stap \ +man/stapprobes.tcp.3stap man/stapprobes.udp.3stap # see also configure.ac bin_PROGRAMS = stap staprun diff --git a/Makefile.in b/Makefile.in index c228d957..495bed87 100644 --- a/Makefile.in +++ b/Makefile.in @@ -62,21 +62,21 @@ subdir = . DIST_COMMON = INSTALL NEWS README AUTHORS $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(srcdir)/config.in $(srcdir)/stap.1.in \ - $(srcdir)/stapprobes.5.in $(srcdir)/stapfuncs.5.in \ - $(srcdir)/stapvars.5.in $(srcdir)/stapex.5.in \ + $(srcdir)/stapprobes.3stap.in $(srcdir)/stapfuncs.3stap.in \ + $(srcdir)/stapvars.3stap.in $(srcdir)/stapex.3stap.in \ $(srcdir)/staprun.8.in $(srcdir)/stap-server.8.in \ - $(top_srcdir)/man/stapprobes.iosched.5.in \ - $(top_srcdir)/man/stapprobes.netdev.5.in \ - $(top_srcdir)/man/stapprobes.nfs.5.in \ - $(top_srcdir)/man/stapprobes.nfsd.5.in \ - $(top_srcdir)/man/stapprobes.pagefault.5.in \ - $(top_srcdir)/man/stapprobes.process.5.in \ - $(top_srcdir)/man/stapprobes.rpc.5.in \ - $(top_srcdir)/man/stapprobes.scsi.5.in \ - $(top_srcdir)/man/stapprobes.signal.5.in \ - $(top_srcdir)/man/stapprobes.socket.5.in \ - $(top_srcdir)/man/stapprobes.tcp.5.in \ - $(top_srcdir)/man/stapprobes.udp.5.in \ + $(top_srcdir)/man/stapprobes.iosched.3stap.in \ + $(top_srcdir)/man/stapprobes.netdev.3stap.in \ + $(top_srcdir)/man/stapprobes.nfs.3stap.in \ + $(top_srcdir)/man/stapprobes.nfsd.3stap.in \ + $(top_srcdir)/man/stapprobes.pagefault.3stap.in \ + $(top_srcdir)/man/stapprobes.process.3stap.in \ + $(top_srcdir)/man/stapprobes.rpc.3stap.in \ + $(top_srcdir)/man/stapprobes.scsi.3stap.in \ + $(top_srcdir)/man/stapprobes.signal.3stap.in \ + $(top_srcdir)/man/stapprobes.socket.3stap.in \ + $(top_srcdir)/man/stapprobes.tcp.3stap.in \ + $(top_srcdir)/man/stapprobes.udp.3stap.in \ $(top_srcdir)/initscript/systemtap.in $(srcdir)/run-stap.in \ depcomp $(oldinclude_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -87,19 +87,20 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = stap.1 stapprobes.5 stapfuncs.5 stapvars.5 \ - stapex.5 staprun.8 stap-server.8 man/stapprobes.iosched.5 \ - man/stapprobes.netdev.5 man/stapprobes.nfs.5 \ - man/stapprobes.nfsd.5 man/stapprobes.pagefault.5 \ - man/stapprobes.process.5 man/stapprobes.rpc.5 \ - man/stapprobes.scsi.5 man/stapprobes.signal.5 \ - man/stapprobes.socket.5 man/stapprobes.tcp.5 \ - man/stapprobes.udp.5 initscript/systemtap run-stap +CONFIG_CLEAN_FILES = stap.1 stapprobes.3stap stapfuncs.3stap \ + stapvars.3stap stapex.3stap staprun.8 stap-server.8 \ + man/stapprobes.iosched.3stap man/stapprobes.netdev.3stap \ + man/stapprobes.nfs.3stap man/stapprobes.nfsd.3stap \ + man/stapprobes.pagefault.3stap man/stapprobes.process.3stap \ + man/stapprobes.rpc.3stap man/stapprobes.scsi.3stap \ + man/stapprobes.signal.3stap man/stapprobes.socket.3stap \ + man/stapprobes.tcp.3stap man/stapprobes.udp.3stap \ + initscript/systemtap run-stap @BUILD_SERVER_TRUE@am__EXEEXT_1 = stap-client-connect$(EXEEXT) \ @BUILD_SERVER_TRUE@ stap-server-connect$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibexecdir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ - "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" \ + "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man8dir)" \ "$(DESTDIR)$(oldincludedir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) pkglibexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) @@ -175,7 +176,7 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive man1dir = $(mandir)/man1 -man5dir = $(mandir)/man5 +man3dir = $(mandir)/man3 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) @@ -299,7 +300,6 @@ staplog_CPPFLAGS = @staplog_CPPFLAGS@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -309,13 +309,14 @@ pkglibexecdir = ${libexecdir}/${PACKAGE} AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DSYSCONFDIR='"$(sysconfdir)"' -DPKGDATADIR='"${pkgdatadir}"' -DPKGLIBDIR='"$(pkglibexecdir)"' AM_CFLAGS = -D_GNU_SOURCE -fexceptions -Wall -Werror -Wunused -Wformat=2 -W AM_CXXFLAGS = -Wall -Werror -man_MANS = stap.1 stapprobes.5 stapfuncs.5 stapvars.5 stapex.5 \ - staprun.8 man/stapprobes.iosched.5 man/stapprobes.netdev.5 \ - man/stapprobes.nfs.5 man/stapprobes.nfsd.5 \ - man/stapprobes.pagefault.5 man/stapprobes.process.5 \ - man/stapprobes.rpc.5 man/stapprobes.scsi.5 \ - man/stapprobes.signal.5 man/stapprobes.socket.5 \ - man/stapprobes.tcp.5 man/stapprobes.udp.5 $(am__append_1) +man_MANS = stap.1 stapprobes.3stap stapfuncs.3stap stapvars.3stap \ + stapex.3stap staprun.8 man/stapprobes.iosched.3stap \ + man/stapprobes.netdev.3stap man/stapprobes.nfs.3stap \ + man/stapprobes.nfsd.3stap man/stapprobes.pagefault.3stap \ + man/stapprobes.process.3stap man/stapprobes.rpc.3stap \ + man/stapprobes.scsi.3stap man/stapprobes.signal.3stap \ + man/stapprobes.socket.3stap man/stapprobes.tcp.3stap \ + man/stapprobes.udp.3stap $(am__append_1) bin_SCRIPTS = stap-report stap-env stap-gen-cert stap-authorize-cert \ stap-authorize-signing-cert $(am__append_3) dtrace oldinclude_HEADERS = includes/sys/sdt.h @@ -445,41 +446,41 @@ distclean-hdr: -rm -f config.h stamp-h1 stap.1: $(top_builddir)/config.status $(srcdir)/stap.1.in cd $(top_builddir) && $(SHELL) ./config.status $@ -stapprobes.5: $(top_builddir)/config.status $(srcdir)/stapprobes.5.in +stapprobes.3stap: $(top_builddir)/config.status $(srcdir)/stapprobes.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -stapfuncs.5: $(top_builddir)/config.status $(srcdir)/stapfuncs.5.in +stapfuncs.3stap: $(top_builddir)/config.status $(srcdir)/stapfuncs.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -stapvars.5: $(top_builddir)/config.status $(srcdir)/stapvars.5.in +stapvars.3stap: $(top_builddir)/config.status $(srcdir)/stapvars.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -stapex.5: $(top_builddir)/config.status $(srcdir)/stapex.5.in +stapex.3stap: $(top_builddir)/config.status $(srcdir)/stapex.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ staprun.8: $(top_builddir)/config.status $(srcdir)/staprun.8.in cd $(top_builddir) && $(SHELL) ./config.status $@ stap-server.8: $(top_builddir)/config.status $(srcdir)/stap-server.8.in cd $(top_builddir) && $(SHELL) ./config.status $@ -man/stapprobes.iosched.5: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.iosched.5.in +man/stapprobes.iosched.3stap: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.iosched.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -man/stapprobes.netdev.5: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.netdev.5.in +man/stapprobes.netdev.3stap: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.netdev.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -man/stapprobes.nfs.5: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.nfs.5.in +man/stapprobes.nfs.3stap: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.nfs.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -man/stapprobes.nfsd.5: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.nfsd.5.in +man/stapprobes.nfsd.3stap: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.nfsd.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -man/stapprobes.pagefault.5: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.pagefault.5.in +man/stapprobes.pagefault.3stap: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.pagefault.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -man/stapprobes.process.5: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.process.5.in +man/stapprobes.process.3stap: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.process.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -man/stapprobes.rpc.5: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.rpc.5.in +man/stapprobes.rpc.3stap: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.rpc.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -man/stapprobes.scsi.5: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.scsi.5.in +man/stapprobes.scsi.3stap: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.scsi.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -man/stapprobes.signal.5: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.signal.5.in +man/stapprobes.signal.3stap: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.signal.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -man/stapprobes.socket.5: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.socket.5.in +man/stapprobes.socket.3stap: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.socket.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -man/stapprobes.tcp.5: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.tcp.5.in +man/stapprobes.tcp.3stap: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.tcp.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ -man/stapprobes.udp.5: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.udp.5.in +man/stapprobes.udp.3stap: $(top_builddir)/config.status $(top_srcdir)/man/stapprobes.udp.3stap.in cd $(top_builddir) && $(SHELL) ./config.status $@ initscript/systemtap: $(top_builddir)/config.status $(top_srcdir)/initscript/systemtap.in cd $(top_builddir) && $(SHELL) ./config.status $@ @@ -1131,14 +1132,14 @@ uninstall-man1: echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done -install-man5: $(man5_MANS) $(man_MANS) +install-man3: $(man3_MANS) $(man_MANS) @$(NORMAL_INSTALL) - test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" - @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ + test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)" + @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ - *.5*) list="$$list $$i" ;; \ + *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ @@ -1146,35 +1147,35 @@ install-man5: $(man5_MANS) $(man_MANS) else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ - 5*) ;; \ - *) ext='5' ;; \ + 3*) ;; \ + *) ext='3' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \ done -uninstall-man5: +uninstall-man3: @$(NORMAL_UNINSTALL) - @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ + @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ - *.5*) list="$$list $$i" ;; \ + *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ - 5*) ;; \ - *) ext='5' ;; \ + 3*) ;; \ + *) ext='3' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man5dir)/$$inst"; \ + echo " rm -f '$(DESTDIR)$(man3dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man3dir)/$$inst"; \ done install-man8: $(man8_MANS) $(man_MANS) @$(NORMAL_INSTALL) @@ -1377,7 +1378,7 @@ all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) $(HEADERS) config.h \ all-local installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(oldincludedir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(oldincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -1442,7 +1443,7 @@ install-html: install-html-recursive install-info: install-info-recursive -install-man: install-man1 install-man5 install-man8 +install-man: install-man1 install-man3 install-man8 install-pdf: install-pdf-recursive @@ -1473,7 +1474,7 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-local uninstall-man uninstall-oldincludeHEADERS \ uninstall-pkglibexecPROGRAMS -uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 +uninstall-man: uninstall-man1 uninstall-man3 uninstall-man8 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-exec-am install-strip @@ -1489,7 +1490,7 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-exec-local \ install-html install-html-am install-info install-info-am \ - install-man install-man1 install-man5 install-man8 \ + install-man install-man1 install-man3 install-man8 \ install-oldincludeHEADERS install-pdf install-pdf-am \ install-pkglibexecPROGRAMS install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ @@ -1497,7 +1498,7 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-local \ - uninstall-man uninstall-man1 uninstall-man5 uninstall-man8 \ + uninstall-man uninstall-man1 uninstall-man3 uninstall-man8 \ uninstall-oldincludeHEADERS uninstall-pkglibexecPROGRAMS git_version.stamp: @@ -1,5 +1,20 @@ * What's new + - New probes process().insn and process().insn.block that allows + inspection of the process after each instruction or block of + instructions executed. So to count the total number of instructions + a process executes during a run do something like: + $ stap -e 'global steps; probe process("/bin/ls").insn {steps++} + probe end {printf("Total instructions: %d\n", steps);}' \ + -c /bin/ls + This feature can slow down execution of a process somewhat. + + - Systemtap probes and function man pages extracted from the tapsets + are now available under 3stap. To show the page for probe vm.pagefault + or the stap function pexecname do: + $ man 3stap vm.pagefault + $ man 3stap pexecname + - Kernel tracepoints are now supported for probing predefined kernel events without any debuginfo. Tracepoints incur less overhead than kprobes, and context parameters are available with full type @@ -39,6 +54,18 @@ This replaces any dwarf $variable expressions that could not be resolved with literal numeric zeros, along with a warning message. +- Both kernel markers and kernel tracepoint support argument listing + through stap -L 'kernel.mark("*")' or stap -L 'kernel.trace("*")' + +- Users can use -DINTERRUPTIBLE=0 to prevent interrupt reentrancy in + their script, at the cost of a bit more overhead to toggle the + interrupt mask. + +- Added reentrancy debugging. If stap is run with the arguments + "-t -DDEBUG_REENTRANCY", additional warnings will be printed for + every reentrancy event, including the probe points of the + resident and interloper probes. + * What's new in version 0.9 - Typecasting is now supported using the @cast operator. A script can diff --git a/buildrun.cxx b/buildrun.cxx index 48d4ea50..505589cf 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -356,7 +356,7 @@ run_pass (systemtap_session& s) // Build a tiny kernel module to query tracepoints int -make_tracequery(systemtap_session& s, string& name) +make_tracequery(systemtap_session& s, string& name, const vector<string>& extra_headers) { // create a subdirectory for the module string dir(s.tmpdir + "/tracequery"); @@ -393,6 +393,11 @@ make_tracequery(systemtap_session& s, string& name) osrc << "#define DEFINE_TRACE(name, proto, args) \\" << endl; osrc << " DECLARE_TRACE(name, TPPROTO(proto), TPARGS(args))" << endl; + // PR9993: Add extra headers to work around undeclared types in individual + // include/trace/foo.h files + for (unsigned z=0; z<extra_headers.size(); z++) + osrc << "#include <" << extra_headers[z] << ">\n"; + // dynamically pull in all tracepoint headers from include/trace/ glob_t trace_glob; string globs[2] = { "/include/trace/*.h", "/source/include/trace/*.h" }; @@ -14,7 +14,7 @@ int compile_pass (systemtap_session& s); int run_pass (systemtap_session& s); -int make_tracequery(systemtap_session& s, std::string& name); +int make_tracequery(systemtap_session& s, std::string& name, const std::vector<std::string>& extra_headers); #endif // BUILDRUN_H @@ -1338,7 +1338,7 @@ Optional Features: location). --enable-prologues make -P prologue-searching default --disable-ssp disable gcc stack-protector - --disable-pie disable position-independent-executable + --enable-pie enable position-independent-executable --enable-sqlite build with sqlite support --enable-crash[=DIRECTORY] enable crash extension (default is disabled). @@ -5992,12 +5992,13 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +# Compiling without fPIE by default (see PR 9922) # Check whether --enable-pie was given. if test "${enable_pie+set}" = set; then enableval=$enable_pie; fi -if test "x$enable_pie" != xno; then +if test "x$enable_pie" == xyes; then save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" @@ -7875,7 +7876,7 @@ _ACEOF ac_config_headers="$ac_config_headers config.h:config.in" -ac_config_files="$ac_config_files Makefile doc/Makefile doc/SystemTap_Tapset_Reference/Makefile stap.1 stapprobes.5 stapfuncs.5 stapvars.5 stapex.5 staprun.8 stap-server.8 man/stapprobes.iosched.5 man/stapprobes.netdev.5 man/stapprobes.nfs.5 man/stapprobes.nfsd.5 man/stapprobes.pagefault.5 man/stapprobes.process.5 man/stapprobes.rpc.5 man/stapprobes.scsi.5 man/stapprobes.signal.5 man/stapprobes.socket.5 man/stapprobes.tcp.5 man/stapprobes.udp.5 initscript/systemtap" +ac_config_files="$ac_config_files Makefile doc/Makefile doc/SystemTap_Tapset_Reference/Makefile stap.1 stapprobes.3stap stapfuncs.3stap stapvars.3stap stapex.3stap staprun.8 stap-server.8 man/stapprobes.iosched.3stap man/stapprobes.netdev.3stap man/stapprobes.nfs.3stap man/stapprobes.nfsd.3stap man/stapprobes.pagefault.3stap man/stapprobes.process.3stap man/stapprobes.rpc.3stap man/stapprobes.scsi.3stap man/stapprobes.signal.3stap man/stapprobes.socket.3stap man/stapprobes.tcp.3stap man/stapprobes.udp.3stap initscript/systemtap" subdirs="$subdirs testsuite" @@ -8527,24 +8528,24 @@ do "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/SystemTap_Tapset_Reference/Makefile") CONFIG_FILES="$CONFIG_FILES doc/SystemTap_Tapset_Reference/Makefile" ;; "stap.1") CONFIG_FILES="$CONFIG_FILES stap.1" ;; - "stapprobes.5") CONFIG_FILES="$CONFIG_FILES stapprobes.5" ;; - "stapfuncs.5") CONFIG_FILES="$CONFIG_FILES stapfuncs.5" ;; - "stapvars.5") CONFIG_FILES="$CONFIG_FILES stapvars.5" ;; - "stapex.5") CONFIG_FILES="$CONFIG_FILES stapex.5" ;; + "stapprobes.3stap") CONFIG_FILES="$CONFIG_FILES stapprobes.3stap" ;; + "stapfuncs.3stap") CONFIG_FILES="$CONFIG_FILES stapfuncs.3stap" ;; + "stapvars.3stap") CONFIG_FILES="$CONFIG_FILES stapvars.3stap" ;; + "stapex.3stap") CONFIG_FILES="$CONFIG_FILES stapex.3stap" ;; "staprun.8") CONFIG_FILES="$CONFIG_FILES staprun.8" ;; "stap-server.8") CONFIG_FILES="$CONFIG_FILES stap-server.8" ;; - "man/stapprobes.iosched.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.iosched.5" ;; - "man/stapprobes.netdev.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.netdev.5" ;; - "man/stapprobes.nfs.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.nfs.5" ;; - "man/stapprobes.nfsd.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.nfsd.5" ;; - "man/stapprobes.pagefault.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.pagefault.5" ;; - "man/stapprobes.process.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.process.5" ;; - "man/stapprobes.rpc.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.rpc.5" ;; - "man/stapprobes.scsi.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.scsi.5" ;; - "man/stapprobes.signal.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.signal.5" ;; - "man/stapprobes.socket.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.socket.5" ;; - "man/stapprobes.tcp.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.tcp.5" ;; - "man/stapprobes.udp.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.udp.5" ;; + "man/stapprobes.iosched.3stap") CONFIG_FILES="$CONFIG_FILES man/stapprobes.iosched.3stap" ;; + "man/stapprobes.netdev.3stap") CONFIG_FILES="$CONFIG_FILES man/stapprobes.netdev.3stap" ;; + "man/stapprobes.nfs.3stap") CONFIG_FILES="$CONFIG_FILES man/stapprobes.nfs.3stap" ;; + "man/stapprobes.nfsd.3stap") CONFIG_FILES="$CONFIG_FILES man/stapprobes.nfsd.3stap" ;; + "man/stapprobes.pagefault.3stap") CONFIG_FILES="$CONFIG_FILES man/stapprobes.pagefault.3stap" ;; + "man/stapprobes.process.3stap") CONFIG_FILES="$CONFIG_FILES man/stapprobes.process.3stap" ;; + "man/stapprobes.rpc.3stap") CONFIG_FILES="$CONFIG_FILES man/stapprobes.rpc.3stap" ;; + "man/stapprobes.scsi.3stap") CONFIG_FILES="$CONFIG_FILES man/stapprobes.scsi.3stap" ;; + "man/stapprobes.signal.3stap") CONFIG_FILES="$CONFIG_FILES man/stapprobes.signal.3stap" ;; + "man/stapprobes.socket.3stap") CONFIG_FILES="$CONFIG_FILES man/stapprobes.socket.3stap" ;; + "man/stapprobes.tcp.3stap") CONFIG_FILES="$CONFIG_FILES man/stapprobes.tcp.3stap" ;; + "man/stapprobes.udp.3stap") CONFIG_FILES="$CONFIG_FILES man/stapprobes.udp.3stap" ;; "initscript/systemtap") CONFIG_FILES="$CONFIG_FILES initscript/systemtap" ;; "run-stap") CONFIG_FILES="$CONFIG_FILES run-stap" ;; diff --git a/configure.ac b/configure.ac index ec5a5085..c439cd54 100644 --- a/configure.ac +++ b/configure.ac @@ -82,9 +82,10 @@ AS_IF([test "x$enable_ssp" != xno],[ CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS"])]) +# Compiling without fPIE by default (see PR 9922) AC_ARG_ENABLE([pie], - [AS_HELP_STRING([--disable-pie], [disable position-independent-executable])]) -AS_IF([test "x$enable_pie" != xno],[ + [AS_HELP_STRING([--enable-pie], [enable position-independent-executable])]) +AS_IF([test "x$enable_pie" == xyes],[ save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" save_LDFLAGS="$LDFLAGS" @@ -358,7 +359,7 @@ dnl Don't use this directly (when not given it is set to NONE). AC_DEFINE_UNQUOTED(STAP_PREFIX, "$prefix", [configure prefix location]) AC_CONFIG_HEADERS([config.h:config.in]) -AC_CONFIG_FILES(Makefile doc/Makefile doc/SystemTap_Tapset_Reference/Makefile stap.1 stapprobes.5 stapfuncs.5 stapvars.5 stapex.5 staprun.8 stap-server.8 man/stapprobes.iosched.5 man/stapprobes.netdev.5 man/stapprobes.nfs.5 man/stapprobes.nfsd.5 man/stapprobes.pagefault.5 man/stapprobes.process.5 man/stapprobes.rpc.5 man/stapprobes.scsi.5 man/stapprobes.signal.5 man/stapprobes.socket.5 man/stapprobes.tcp.5 man/stapprobes.udp.5 initscript/systemtap) +AC_CONFIG_FILES(Makefile doc/Makefile doc/SystemTap_Tapset_Reference/Makefile stap.1 stapprobes.3stap stapfuncs.3stap stapvars.3stap stapex.3stap staprun.8 stap-server.8 man/stapprobes.iosched.3stap man/stapprobes.netdev.3stap man/stapprobes.nfs.3stap man/stapprobes.nfsd.3stap man/stapprobes.pagefault.3stap man/stapprobes.process.3stap man/stapprobes.rpc.3stap man/stapprobes.scsi.3stap man/stapprobes.signal.3stap man/stapprobes.socket.3stap man/stapprobes.tcp.3stap man/stapprobes.udp.3stap initscript/systemtap) AC_CONFIG_SUBDIRS(testsuite) AC_CONFIG_FILES([run-stap], [chmod +x run-stap]) AC_OUTPUT diff --git a/doc/Makefile.in b/doc/Makefile.in index e04852f4..eafd7ca7 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -163,7 +163,6 @@ staplog_CPPFLAGS = @staplog_CPPFLAGS@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ PDF_FILES = tutorial.pdf langref.pdf diff --git a/doc/SystemTap_Tapset_Reference/Makefile.am b/doc/SystemTap_Tapset_Reference/Makefile.am index 68dfd971..b21bfcd6 100644 --- a/doc/SystemTap_Tapset_Reference/Makefile.am +++ b/doc/SystemTap_Tapset_Reference/Makefile.am @@ -2,7 +2,7 @@ ## process this file with automake to produce Makefile.in DOC_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap -MAN_INSTALL_DIR = $(DESTDIR)$(mandir)/man3stap +MAN_INSTALL_DIR = $(DESTDIR)$(mandir)/man3 HTML_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap/tapsets @@ -36,7 +36,7 @@ tapsets.pdf: tapsets.xml xmlto pdf tapsets.xml stamp-mandocs: tapsets.xml - xmlto man -o man3stap tapsets.xml + xmlto man -o man3 tapsets.xml touch stamp-mandocs #FIXME need to figure out where to install things appropriately @@ -45,7 +45,7 @@ install-data-hook: $(MKDIR_P) $(DOC_INSTALL_DIR) $(INSTALL_DATA) tapsets.pdf $(DOC_INSTALL_DIR) $(MKDIR_P) $(MAN_INSTALL_DIR) - $(INSTALL_DATA) man3stap/* $(MAN_INSTALL_DIR) + $(INSTALL_DATA) man3/* $(MAN_INSTALL_DIR) $(MKDIR_P) $(HTML_INSTALL_DIR) $(INSTALL_DATA) tapsets/* $(HTML_INSTALL_DIR) endif diff --git a/doc/SystemTap_Tapset_Reference/Makefile.in b/doc/SystemTap_Tapset_Reference/Makefile.in index 22b27a3e..30ca4b17 100644 --- a/doc/SystemTap_Tapset_Reference/Makefile.in +++ b/doc/SystemTap_Tapset_Reference/Makefile.in @@ -166,11 +166,10 @@ staplog_CPPFLAGS = @staplog_CPPFLAGS@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ DOC_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap -MAN_INSTALL_DIR = $(DESTDIR)$(mandir)/man3stap +MAN_INSTALL_DIR = $(DESTDIR)$(mandir)/man3 HTML_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap/tapsets SRCTREE = $(abs_top_srcdir)/ DOCPROC = $(abs_builddir)/docproc @@ -431,7 +430,7 @@ uninstall-am: @BUILD_REFDOCS_TRUE@ xmlto pdf tapsets.xml @BUILD_REFDOCS_TRUE@stamp-mandocs: tapsets.xml -@BUILD_REFDOCS_TRUE@ xmlto man -o man3stap tapsets.xml +@BUILD_REFDOCS_TRUE@ xmlto man -o man3 tapsets.xml @BUILD_REFDOCS_TRUE@ touch stamp-mandocs #FIXME need to figure out where to install things appropriately @@ -440,7 +439,7 @@ uninstall-am: @BUILD_REFDOCS_TRUE@ $(MKDIR_P) $(DOC_INSTALL_DIR) @BUILD_REFDOCS_TRUE@ $(INSTALL_DATA) tapsets.pdf $(DOC_INSTALL_DIR) @BUILD_REFDOCS_TRUE@ $(MKDIR_P) $(MAN_INSTALL_DIR) -@BUILD_REFDOCS_TRUE@ $(INSTALL_DATA) man3stap/* $(MAN_INSTALL_DIR) +@BUILD_REFDOCS_TRUE@ $(INSTALL_DATA) man3/* $(MAN_INSTALL_DIR) @BUILD_REFDOCS_TRUE@ $(MKDIR_P) $(HTML_INSTALL_DIR) @BUILD_REFDOCS_TRUE@ $(INSTALL_DATA) tapsets/* $(HTML_INSTALL_DIR) # Tell versions [3.59,3.63) of GNU make to not export all variables. @@ -80,7 +80,6 @@ class provider: elif (c == 8): self.h.write ('#define %s(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) STAP_PROBE%d(provider,%s,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)\n' % (this_probe_canon, c+1, this_probe)) elif (c == 9): - self.h.write('// X %d %s\n' % (c+1,this_probe_canon)) self.h.write ('#define %s(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) STAP_PROBE%d(provider,%s,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10)\n' % (this_probe_canon, c+1, this_probe)) self.h.write ('#define %s_ENABLED() 1\n' % this_probe_canon) diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h index 3da4ff66..ba75076b 100644 --- a/includes/sys/sdt.h +++ b/includes/sys/sdt.h @@ -13,180 +13,209 @@ #include <string.h> #include <sys/types.h> -#define STAP_PROBE_DATA_(probe,dataop) \ +#define STAP_PROBE_DATA_(probe) \ __asm__ volatile (".section .probes\n" \ "\t.align 8\n" \ "1:\n\t.asciz " #probe "\n" \ "\t.align 4\n" \ "\t.int 0x31425250\n" \ "\t.align 8\n" \ - "\t" #dataop " 1b\n" \ + "\t.long 1b\n" \ "\t.align 8\n" \ - "\t" #dataop " 2f\n" \ + "\t.long 2f\n" \ "\t.previous\n") -#if _LP64 #define STAP_PROBE_DATA(probe) \ - STAP_PROBE_DATA_(#probe,.quad) + STAP_PROBE_DATA_(#probe) + +/* These baroque macros are used to create a unique label. */ +#define STAP_CONCAT(a,b) a ## b +#define STAP_LABEL_PREFIX(p) _stapprobe1_ ## p +/* __COUNTER__ is not present in gcc 4.1 */ +#if __GNUC__ == 4 && __GNUC_MINOR__ >= 3 +#define STAP_COUNTER STAP_CONCAT(__,COUNTER__) #else -#define STAP_PROBE_DATA(probe) \ - STAP_PROBE_DATA_(#probe,.long) +#define STAP_COUNTER STAP_CONCAT(__,LINE__) #endif +#define STAP_LABEL(a,b) STAP_CONCAT(a,b) -#define STAP_PROBE_(probe) \ +#define STAP_PROBE_(probe) \ do { \ STAP_PROBE_DATA(probe); \ - __asm__ volatile ("2:\n" \ + __asm__ volatile ("2:\n" \ "\tnop"); \ } while (0) -#define STAP_PROBE1_(probe,parm1) \ +/* Taking the address of a local label prevents the containing function + from being inlined, which keeps the parameters visible. */ + +#define STAP_PROBE1_(probe,label,parm1) \ do { \ - volatile __typeof__((parm1)) arg1 __attribute__ ((unused)) = parm1; \ + __extension__ static volatile long labelval __attribute__ ((unused)) = (long) &&label; \ + volatile __typeof__((parm1)) arg1 = parm1; \ STAP_PROBE_DATA(probe); \ + label: \ __asm__ volatile ("2:\n" \ - "\tnop /* %0 */" :: "X"(arg1)); \ + "\tnop /* %0 */" :: "g"(arg1)); \ } while (0) -#define STAP_PROBE2_(probe,parm1,parm2) \ +#define STAP_PROBE2_(probe,label,parm1,parm2) \ do { \ - volatile __typeof__((parm1)) arg1 __attribute__ ((unused)) = parm1; \ - volatile __typeof__((parm2)) arg2 __attribute__ ((unused)) = parm2; \ + __extension__ static volatile long labelval __attribute__ ((unused)) = (long) &&label; \ + volatile __typeof__((parm1)) arg1 = parm1; \ + volatile __typeof__((parm2)) arg2 = parm2; \ STAP_PROBE_DATA(probe); \ + label: \ __asm__ volatile ("2:\n" \ - "\tnop /* %0 %1 */" :: "X"(arg1), "X"(arg2)); \ + "\tnop /* %0 %1 */" :: "g"(arg1), "g"(arg2)); \ } while (0) -#define STAP_PROBE3_(probe,parm1,parm2,parm3) \ +#define STAP_PROBE3_(probe,label,parm1,parm2,parm3) \ do { \ - volatile __typeof__((parm1)) arg1 __attribute__ ((unused)) = parm1; \ - volatile __typeof__((parm2)) arg2 __attribute__ ((unused)) = parm2; \ - volatile __typeof__((parm3)) arg3 __attribute__ ((unused)) = parm3; \ + __extension__ static volatile long labelval __attribute__ ((unused)) = (long) &&label; \ + volatile __typeof__((parm1)) arg1 = parm1; \ + volatile __typeof__((parm2)) arg2 = parm2; \ + volatile __typeof__((parm3)) arg3 = parm3; \ STAP_PROBE_DATA(probe); \ + label: \ __asm__ volatile ("2:\n" \ - "\tnop /* %0 %1 %2 */" :: "X"(arg1), "X"(arg2), "X"(arg3)); \ + "\tnop /* %0 %1 %2 */" :: "g"(arg1), "g"(arg2), "g"(arg3)); \ } while (0) -#define STAP_PROBE4_(probe,parm1,parm2,parm3,parm4) \ +#define STAP_PROBE4_(probe,label,parm1,parm2,parm3,parm4) \ do { \ - volatile __typeof__((parm1)) arg1 __attribute__ ((unused)) = parm1; \ - volatile __typeof__((parm2)) arg2 __attribute__ ((unused)) = parm2; \ - volatile __typeof__((parm3)) arg3 __attribute__ ((unused)) = parm3; \ - volatile __typeof__((parm4)) arg4 __attribute__ ((unused)) = parm4; \ + __extension__ static volatile long labelval __attribute__ ((unused)) = (long) &&label; \ + volatile __typeof__((parm1)) arg1 = parm1; \ + volatile __typeof__((parm2)) arg2 = parm2; \ + volatile __typeof__((parm3)) arg3 = parm3; \ + volatile __typeof__((parm4)) arg4 = parm4; \ STAP_PROBE_DATA(probe); \ + label: \ __asm__ volatile ("2:\n" \ - "\tnop /* %0 %1 %2 %3 */" :: "X"(arg1), "X"(arg2), "X"(arg3), "X"(arg4)); \ + "\tnop /* %0 %1 %2 %3 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4)); \ } while (0) -#define STAP_PROBE5_(probe,parm1,parm2,parm3,parm4,parm5) \ +#define STAP_PROBE5_(probe,label,parm1,parm2,parm3,parm4,parm5) \ do { \ - volatile __typeof__((parm1)) arg1 __attribute__ ((unused)) = parm1; \ - volatile __typeof__((parm2)) arg2 __attribute__ ((unused)) = parm2; \ - volatile __typeof__((parm3)) arg3 __attribute__ ((unused)) = parm3; \ - volatile __typeof__((parm4)) arg4 __attribute__ ((unused)) = parm4; \ - volatile __typeof__((parm5)) arg5 __attribute__ ((unused)) = parm5; \ + __extension__ static volatile long labelval __attribute__ ((unused)) = (long) &&label; \ + volatile __typeof__((parm1)) arg1 = parm1; \ + volatile __typeof__((parm2)) arg2 = parm2; \ + volatile __typeof__((parm3)) arg3 = parm3; \ + volatile __typeof__((parm4)) arg4 = parm4; \ + volatile __typeof__((parm5)) arg5 = parm5; \ STAP_PROBE_DATA(probe); \ + label: \ __asm__ volatile ("2:\n" \ - "\tnop /* %0 %1 %2 %3 %4 */" :: "X"(arg1), "X"(arg2), "X"(arg3), "X"(arg4), "X"(arg5)); \ + "\tnop /* %0 %1 %2 %3 %4 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5)); \ } while (0) -#define STAP_PROBE6_(probe,parm1,parm2,parm3,parm4,parm5,parm6) \ +#define STAP_PROBE6_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6) \ do { \ - volatile __typeof__((parm1)) arg1 __attribute__ ((unused)) = parm1; \ - volatile __typeof__((parm2)) arg2 __attribute__ ((unused)) = parm2; \ - volatile __typeof__((parm3)) arg3 __attribute__ ((unused)) = parm3; \ - volatile __typeof__((parm4)) arg4 __attribute__ ((unused)) = parm4; \ - volatile __typeof__((parm5)) arg5 __attribute__ ((unused)) = parm5; \ - volatile __typeof__((parm6)) arg6 __attribute__ ((unused)) = parm6; \ + __extension__ static volatile long labelval __attribute__ ((unused)) = (long) &&label; \ + volatile __typeof__((parm1)) arg1 = parm1; \ + volatile __typeof__((parm2)) arg2 = parm2; \ + volatile __typeof__((parm3)) arg3 = parm3; \ + volatile __typeof__((parm4)) arg4 = parm4; \ + volatile __typeof__((parm5)) arg5 = parm5; \ + volatile __typeof__((parm6)) arg6 = parm6; \ STAP_PROBE_DATA(probe); \ + label: \ __asm__ volatile ("2:\n" \ - "\tnop /* %0 %1 %2 %3 %4 %5 */" :: "X"(arg1), "X"(arg2), "X"(arg3), "X"(arg4), "X"(arg5), "X"(arg6)); \ + "\tnop /* %0 %1 %2 %3 %4 %5 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6)); \ } while (0) -#define STAP_PROBE7_(probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \ +#define STAP_PROBE7_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \ do { \ - volatile __typeof__((parm1)) arg1 __attribute__ ((unused)) = parm1; \ - volatile __typeof__((parm2)) arg2 __attribute__ ((unused)) = parm2; \ - volatile __typeof__((parm3)) arg3 __attribute__ ((unused)) = parm3; \ - volatile __typeof__((parm4)) arg4 __attribute__ ((unused)) = parm4; \ - volatile __typeof__((parm5)) arg5 __attribute__ ((unused)) = parm5; \ - volatile __typeof__((parm6)) arg6 __attribute__ ((unused)) = parm6; \ - volatile __typeof__((parm7)) arg7 __attribute__ ((unused)) = parm7; \ + __extension__ static volatile long labelval __attribute__ ((unused)) = (long) &&label; \ + volatile __typeof__((parm1)) arg1 = parm1; \ + volatile __typeof__((parm2)) arg2 = parm2; \ + volatile __typeof__((parm3)) arg3 = parm3; \ + volatile __typeof__((parm4)) arg4 = parm4; \ + volatile __typeof__((parm5)) arg5 = parm5; \ + volatile __typeof__((parm6)) arg6 = parm6; \ + volatile __typeof__((parm7)) arg7 = parm7; \ STAP_PROBE_DATA(probe); \ + label: \ __asm__ volatile ("2:\n" \ - "\tnop /* %0 %1 %2 %3 %4 %5 %6 */" :: "X"(arg1), "X"(arg2), "X"(arg3), "X"(arg4), "X"(arg5), "X"(arg6), "X"(arg7)); \ + "\tnop /* %0 %1 %2 %3 %4 %5 %6 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6), "g"(arg7)); \ } while (0) -#define STAP_PROBE8_(probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) \ +#define STAP_PROBE8_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) \ do { \ - volatile __typeof__((parm1)) arg1 __attribute__ ((unused)) = parm1; \ - volatile __typeof__((parm2)) arg2 __attribute__ ((unused)) = parm2; \ - volatile __typeof__((parm3)) arg3 __attribute__ ((unused)) = parm3; \ - volatile __typeof__((parm4)) arg4 __attribute__ ((unused)) = parm4; \ - volatile __typeof__((parm5)) arg5 __attribute__ ((unused)) = parm5; \ - volatile __typeof__((parm6)) arg6 __attribute__ ((unused)) = parm6; \ - volatile __typeof__((parm7)) arg7 __attribute__ ((unused)) = parm7; \ - volatile __typeof__((parm8)) arg8 __attribute__ ((unused)) = parm8; \ + __extension__ static volatile long labelval __attribute__ ((unused)) = (long) &&label; \ + volatile __typeof__((parm1)) arg1 = parm1; \ + volatile __typeof__((parm2)) arg2 = parm2; \ + volatile __typeof__((parm3)) arg3 = parm3; \ + volatile __typeof__((parm4)) arg4 = parm4; \ + volatile __typeof__((parm5)) arg5 = parm5; \ + volatile __typeof__((parm6)) arg6 = parm6; \ + volatile __typeof__((parm7)) arg7 = parm7; \ + volatile __typeof__((parm8)) arg8 = parm8; \ STAP_PROBE_DATA(probe); \ + label: \ __asm__ volatile ("2:\n" \ - "\tnop /* %0 %1 %2 %3 %4 %5 %6 %7 */" :: "X"(arg1), "X"(arg2), "X"(arg3), "X"(arg4), "X"(arg5), "X"(arg6), "X"(arg7), "X"(arg8)); \ + "\tnop /* %0 %1 %2 %3 %4 %5 %6 %7 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6), "g"(arg7), "g"(arg8)); \ } while (0) -#define STAP_PROBE9_(probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \ +#define STAP_PROBE9_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \ do { \ - volatile __typeof__((parm1)) arg1 __attribute__ ((unused)) = parm1; \ - volatile __typeof__((parm2)) arg2 __attribute__ ((unused)) = parm2; \ - volatile __typeof__((parm3)) arg3 __attribute__ ((unused)) = parm3; \ - volatile __typeof__((parm4)) arg4 __attribute__ ((unused)) = parm4; \ - volatile __typeof__((parm5)) arg5 __attribute__ ((unused)) = parm5; \ - volatile __typeof__((parm6)) arg6 __attribute__ ((unused)) = parm6; \ - volatile __typeof__((parm7)) arg7 __attribute__ ((unused)) = parm7; \ - volatile __typeof__((parm8)) arg8 __attribute__ ((unused)) = parm8; \ - volatile __typeof__((parm9)) arg9 __attribute__ ((unused)) = parm9; \ + __extension__ static volatile long labelval __attribute__ ((unused)) = (long) &&label; \ + volatile __typeof__((parm1)) arg1 = parm1; \ + volatile __typeof__((parm2)) arg2 = parm2; \ + volatile __typeof__((parm3)) arg3 = parm3; \ + volatile __typeof__((parm4)) arg4 = parm4; \ + volatile __typeof__((parm5)) arg5 = parm5; \ + volatile __typeof__((parm6)) arg6 = parm6; \ + volatile __typeof__((parm7)) arg7 = parm7; \ + volatile __typeof__((parm8)) arg8 = parm8; \ + volatile __typeof__((parm9)) arg9 = parm9; \ STAP_PROBE_DATA(probe); \ + label: \ __asm__ volatile ("2:\n" \ - "\tnop /* %0 %1 %2 %3 %4 %5 %6 %7 %8 */" :: "X"(arg1), "X"(arg2), "X"(arg3), "X"(arg4), "X"(arg5), "X"(arg6), "X"(arg7), "X"(arg8), "X"(arg9)); \ + "\tnop /* %0 %1 %2 %3 %4 %5 %6 %7 %8 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6), "g"(arg7), "g"(arg8), "g"(arg9)); \ } while (0) -#define STAP_PROBE10_(probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10) \ +#define STAP_PROBE10_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10) \ do { \ - volatile __typeof__((parm1)) arg1 __attribute__ ((unused)) = parm1; \ - volatile __typeof__((parm2)) arg2 __attribute__ ((unused)) = parm2; \ - volatile __typeof__((parm3)) arg3 __attribute__ ((unused)) = parm3; \ - volatile __typeof__((parm4)) arg4 __attribute__ ((unused)) = parm4; \ - volatile __typeof__((parm5)) arg5 __attribute__ ((unused)) = parm5; \ - volatile __typeof__((parm6)) arg6 __attribute__ ((unused)) = parm6; \ - volatile __typeof__((parm7)) arg7 __attribute__ ((unused)) = parm7; \ - volatile __typeof__((parm8)) arg8 __attribute__ ((unused)) = parm8; \ - volatile __typeof__((parm9)) arg9 __attribute__ ((unused)) = parm9; \ - volatile __typeof__((parm10)) arg10 __attribute__ ((unused)) = parm10; \ + __extension__ static volatile long labelval __attribute__ ((unused)) = (long) &&label; \ + volatile __typeof__((parm1)) arg1 = parm1; \ + volatile __typeof__((parm2)) arg2 = parm2; \ + volatile __typeof__((parm3)) arg3 = parm3; \ + volatile __typeof__((parm4)) arg4 = parm4; \ + volatile __typeof__((parm5)) arg5 = parm5; \ + volatile __typeof__((parm6)) arg6 = parm6; \ + volatile __typeof__((parm7)) arg7 = parm7; \ + volatile __typeof__((parm8)) arg8 = parm8; \ + volatile __typeof__((parm9)) arg9 = parm9; \ + volatile __typeof__((parm10)) arg10 = parm10; \ STAP_PROBE_DATA(probe); \ + label: \ __asm__ volatile ("2:\n" \ - "\tnop /* %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 */" :: "X"(arg1), "X"(arg2), "X"(arg3), "X"(arg4), "X"(arg5), "X"(arg6), "X"(arg7), "X"(arg8), "X"(arg9), "X"(arg10)); \ + "\tnop /* %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6), "g"(arg7), "g"(arg8), "g"(arg9), "g"(arg10)); \ } while (0) #define STAP_PROBE(provider,probe) \ STAP_PROBE_(probe) #define STAP_PROBE1(provider,probe,parm1) \ - STAP_PROBE1_(probe,(parm1)) + STAP_PROBE1_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1)) #define STAP_PROBE2(provider,probe,parm1,parm2) \ - STAP_PROBE2_(probe,(parm1),(parm2)) + STAP_PROBE2_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2)) #define STAP_PROBE3(provider,probe,parm1,parm2,parm3) \ - STAP_PROBE3_(probe,(parm1),(parm2),(parm3)) + STAP_PROBE3_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3)) #define STAP_PROBE4(provider,probe,parm1,parm2,parm3,parm4) \ - STAP_PROBE4_(probe,(parm1),(parm2),(parm3),(parm4)) + STAP_PROBE4_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4)) #define STAP_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5) \ - STAP_PROBE5_(probe,(parm1),(parm2),(parm3),(parm4),(parm5)) + STAP_PROBE5_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4),(parm5)) #define STAP_PROBE6(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6) \ - STAP_PROBE6_(probe,(parm1),(parm2),(parm3),(parm4),(parm5),(parm6)) + STAP_PROBE6_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4),(parm5),(parm6)) #define STAP_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \ - STAP_PROBE7_(probe,(parm1),(parm2),(parm3),(parm4),(parm5),(parm6),(parm7)) + STAP_PROBE7_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4),(parm5),(parm6),(parm7)) #define STAP_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) \ - STAP_PROBE8_(probe,(parm1),(parm2),(parm3),(parm4),(parm5),(parm6),(parm7),(parm8)) + STAP_PROBE8_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4),(parm5),(parm6),(parm7),(parm8)) #define STAP_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \ - STAP_PROBE9_(probe,(parm1),(parm2),(parm3),(parm4),(parm5),(parm6),(parm7),(parm8),(parm9)) + STAP_PROBE9_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4),(parm5),(parm6),(parm7),(parm8),(parm9)) #define STAP_PROBE10(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10) \ - STAP_PROBE10_(probe,(parm1),(parm2),(parm3),(parm4),(parm5),(parm6),(parm7),(parm8),(parm9),(parm10)) + STAP_PROBE10_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4),(parm5),(parm6),(parm7),(parm8),(parm9),(parm10)) #define DTRACE_PROBE(provider,probe) \ STAP_PROBE(provider,probe) diff --git a/man/stapprobes.iosched.5.in b/man/stapprobes.iosched.3stap.in index f638b2ff..e08dce8c 100644 --- a/man/stapprobes.iosched.5.in +++ b/man/stapprobes.iosched.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPPROBES.IOSCHED 5 @DATE@ "IBM" +.TH STAPPROBES.IOSCHED 3stap @DATE@ "IBM" .SH NAME stapprobes.iosched \- systemtap IO scheduler probe points @@ -96,5 +96,5 @@ Fires when a request is completed .SH SEE ALSO .IR stap (1), -.IR stapprobes (5), +.IR stapprobes (3stap), diff --git a/man/stapprobes.netdev.5.in b/man/stapprobes.netdev.3stap.in index 0510b07b..c25fbd44 100644 --- a/man/stapprobes.netdev.5.in +++ b/man/stapprobes.netdev.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPPROBES.NETDEV 5 @DATE@ "IBM" +.TH STAPPROBES.NETDEV 3stap @DATE@ "IBM" .SH NAME stapprobes.netdev \- systemtap network device probe points @@ -74,4 +74,4 @@ Fires when the network device wants to transmit a buffer .SH SEE ALSO .IR stap (1), -.IR stapprobes (5), +.IR stapprobes (3stap), diff --git a/man/stapprobes.nfs.5.in b/man/stapprobes.nfs.3stap.in index bf575ae4..b6a81cde 100644 --- a/man/stapprobes.nfs.5.in +++ b/man/stapprobes.nfs.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPPROBES.NFS 5 @DATE@ "IBM" +.TH STAPPROBES.NFS 3stap @DATE@ "IBM" .SH NAME stapprobes.nfs \- systemtap NFS client side probe points @@ -1232,5 +1232,5 @@ Fires whenever nfs client renames a file on server .SH SEE ALSO .IR stap (1), -.IR stapprobes (5), +.IR stapprobes (3stap), diff --git a/man/stapprobes.nfsd.5.in b/man/stapprobes.nfsd.3stap.in index 8d30b38b..d3aea639 100644 --- a/man/stapprobes.nfsd.5.in +++ b/man/stapprobes.nfsd.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPPROBES.NFSD 5 @DATE@ "IBM" +.TH STAPPROBES.NFSD 3stap @DATE@ "IBM" .SH NAME stapprobes.nfsd \- systemtap NFS server side probe points @@ -509,5 +509,5 @@ Fires whenever server receives NFS operation from client .SH SEE ALSO .IR stap (1), -.IR stapprobes (5), +.IR stapprobes (3stap), diff --git a/man/stapprobes.pagefault.5.in b/man/stapprobes.pagefault.3stap.in index ea93f325..b1c53a19 100644 --- a/man/stapprobes.pagefault.5.in +++ b/man/stapprobes.pagefault.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPPROBES.PAGEFAULT 5 @DATE@ "IBM" +.TH STAPPROBES.PAGEFAULT 3stap @DATE@ "IBM" .SH NAME stapprobes.pagefault \- systemtap pagefault probe points @@ -36,5 +36,5 @@ Fires when there is a pagefault .SH SEE ALSO .IR stap (1), -.IR stapprobes (5), +.IR stapprobes (3stap), diff --git a/man/stapprobes.process.5.in b/man/stapprobes.process.3stap.in index b725a907..3b5e751d 100644 --- a/man/stapprobes.process.5.in +++ b/man/stapprobes.process.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPPROBES.PROCESS 5 @DATE@ "Intel, IBM" +.TH STAPPROBES.PROCESS 3stap @DATE@ "Intel, IBM" .SH NAME stapprobes.process \- systemtap process probe points @@ -102,5 +102,5 @@ process waits in a zombie state. .SH SEE ALSO .IR stap (1), -.IR stapprobes (5), +.IR stapprobes (3stap), diff --git a/man/stapprobes.rpc.5.in b/man/stapprobes.rpc.3stap.in index 7f411de6..a2622fe5 100644 --- a/man/stapprobes.rpc.5.in +++ b/man/stapprobes.rpc.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPPROBES.RPC 5 @DATE@ "IBM" +.TH STAPPROBES.RPC 3stap @DATE@ "IBM" .SH NAME stapprobes.rpc \- systemtap SunRPC probe points @@ -579,5 +579,5 @@ Fires when a task is to be delayed .SH SEE ALSO .IR stap (1), -.IR stapprobes (5), +.IR stapprobes (3stap), diff --git a/man/stapprobes.scsi.5.in b/man/stapprobes.scsi.3stap.in index bbebcc81..b595105a 100644 --- a/man/stapprobes.scsi.5.in +++ b/man/stapprobes.scsi.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPPROBES.SCSI 5 @DATE@ "IBM" +.TH STAPPROBES.SCSI 3stap @DATE@ "IBM" .SH NAME stapprobes.scsi \- systemtap scsi probe points @@ -147,5 +147,5 @@ block device I/O requests .SH SEE ALSO .IR stap (1), -.IR stapprobes (5), +.IR stapprobes (3stap), diff --git a/man/stapprobes.signal.5.in b/man/stapprobes.signal.3stap.in index dc669b0c..f42a7781 100644 --- a/man/stapprobes.signal.5.in +++ b/man/stapprobes.signal.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPPROBES.SIGNAL 5 @DATE@ "IBM" +.TH STAPPROBES.SIGNAL 3stap @DATE@ "IBM" .SH NAME stapprobes.signal \- systemtap signal probe points @@ -505,5 +505,5 @@ Fires when flush all pending signals for a task .SH SEE ALSO .IR stap (1), -.IR stapprobes (5), +.IR stapprobes (3stap), diff --git a/man/stapprobes.socket.5.in b/man/stapprobes.socket.3stap.in index 6c939fd2..6124e7b7 100644 --- a/man/stapprobes.socket.5.in +++ b/man/stapprobes.socket.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPPROBES.SOCKET 5 @DATE@ "IBM" +.TH STAPPROBES.SOCKET 3stap @DATE@ "IBM" .SH NAME stapprobes.socket \- systemtap socket probe points @@ -481,5 +481,5 @@ The socket closer. .SH SEE ALSO .IR stap (1), -.IR stapprobes (5), -.IR stapfuncs (5) +.IR stapprobes (3stap), +.IR stapfuncs (3stap) diff --git a/man/stapprobes.tcp.5.in b/man/stapprobes.tcp.3stap.in index c5194261..3e607b69 100644 --- a/man/stapprobes.tcp.5.in +++ b/man/stapprobes.tcp.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPPROBES.TCP 5 @DATE@ "IBM, Intel" +.TH STAPPROBES.TCP 3stap @DATE@ "IBM, Intel" .SH NAME stapprobes.tcp \- systemtap tcp probe points @@ -98,5 +98,5 @@ Fires when returning from tcp.disconnect .SH SEE ALSO .IR stap (1), -.IR stapprobes (5), +.IR stapprobes (3stap), diff --git a/man/stapprobes.udp.5.in b/man/stapprobes.udp.3stap.in index 6e89adf0..3fbfd3e7 100644 --- a/man/stapprobes.udp.5.in +++ b/man/stapprobes.udp.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPPROBES.UDP 5 @DATE@ "Intel" +.TH STAPPROBES.UDP 3stap @DATE@ "Intel" .SH NAME stapprobes.udp \- systemtap udp probe points @@ -98,5 +98,5 @@ Fires when returning from udp.disconnect .SH SEE ALSO .IR stap (1), -.IR stapprobes (5), +.IR stapprobes (3stap), diff --git a/runtime/itrace.c b/runtime/itrace.c index 618cbff0..97ba427e 100644 --- a/runtime/itrace.c +++ b/runtime/itrace.c @@ -340,7 +340,8 @@ static int usr_itrace_init(int single_step, pid_t tid, struct stap_itrace_probe put_task_struct(tsk); rcu_read_unlock(); - printk(KERN_INFO "usr_itrace_init: completed for tid = %d\n", tid); + if (debug) + printk(KERN_INFO "usr_itrace_init: completed for tid = %d\n", tid); return 0; } diff --git a/runtime/staprun/staprun_funcs.c b/runtime/staprun/staprun_funcs.c index 48d82d01..020bb312 100644 --- a/runtime/staprun/staprun_funcs.c +++ b/runtime/staprun/staprun_funcs.c @@ -312,6 +312,15 @@ check_path(void) return -1; } + /* Overwrite the modpath with the canonicalized one, to defeat + a possible race between path checking below and somewhat later + module loading. */ + modpath = strdup (module_realpath); + if (modpath == NULL) { + _perr("allocating memory failed"); + exit (1); + } + /* To make sure the user can't specify something like * /lib/modules/`uname -r`/systemtapmod.ko, put a '/' on the * end of staplib_dir_realpath. */ diff --git a/runtime/task_finder.c b/runtime/task_finder.c index 3f4908cb..7949a81f 100644 --- a/runtime/task_finder.c +++ b/runtime/task_finder.c @@ -39,15 +39,23 @@ static atomic_t __stp_attach_count = ATOMIC_INIT (0); #define debug_task_finder_attach() (atomic_inc(&__stp_attach_count)) #define debug_task_finder_detach() (atomic_dec(&__stp_attach_count)) +#ifdef DEBUG_TASK_FINDER_PRINTK +#define debug_task_finder_report() (printk(KERN_ERR \ + "%s:%d attach count: %d, inuse count: %d\n", \ + __FUNCTION__, __LINE__, \ + atomic_read(&__stp_attach_count), \ + atomic_read(&__stp_inuse_count))) +#else #define debug_task_finder_report() (_stp_dbug(__FUNCTION__, __LINE__, \ "attach count: %d, inuse count: %d\n", \ atomic_read(&__stp_attach_count), \ atomic_read(&__stp_inuse_count))) +#endif /* !DEBUG_TASK_FINDER_PRINTK */ #else #define debug_task_finder_attach() /* empty */ #define debug_task_finder_detach() /* empty */ #define debug_task_finder_report() /* empty */ -#endif +#endif /* !DEBUG_TASK_FINDER */ typedef int (*stap_task_finder_callback)(struct stap_task_finder_target *tgt, struct task_struct *tsk, @@ -280,11 +288,15 @@ stap_utrace_detach(struct task_struct *tsk, break; case -ESRCH: /* REAP callback already begun */ case -EALREADY: /* DEATH callback already begun */ - rc = 0; /* ignore these errors*/ + rc = 0; /* ignore these errors */ + break; + case -EINPROGRESS: + debug_task_finder_detach(); + rc = 0; break; default: rc = -rc; - _stp_error("utrace_detach returned error %d on pid %d", + _stp_error("utrace_control returned error %d on pid %d", rc, tsk->pid); break; } @@ -298,7 +310,6 @@ stap_utrace_detach_ops(struct utrace_engine_ops *ops) { struct task_struct *grp, *tsk; struct utrace_attached_engine *engine; - int rc = 0; pid_t pid = 0; // Notice we're not calling get_task_mm() in this loop. In @@ -324,11 +335,12 @@ stap_utrace_detach_ops(struct utrace_engine_ops *ops) continue; #endif - rc = stap_utrace_detach(tsk, ops); - if (rc != 0) - goto udo_err; + /* Notice we're purposefully ignoring errors from + * stap_utrace_detach(). Even if we got an error on + * this task, we need to keep detaching from other + * tasks. */ + (void) stap_utrace_detach(tsk, ops); } while_each_thread(grp, tsk); -udo_err: rcu_read_unlock(); debug_task_finder_report(); } @@ -475,7 +487,7 @@ __stp_utrace_attach(struct task_struct *tsk, * ref. */ rc = utrace_barrier(tsk, engine); - if (rc != 0) + if (rc != -ESRCH && rc != -EALREADY) _stp_error("utrace_barrier returned error %d on pid %d", rc, (int)tsk->pid); } @@ -494,7 +506,7 @@ __stp_utrace_attach(struct task_struct *tsk, } } - else + else if (rc != -ESRCH && rc != -EALREADY) _stp_error("utrace_set_events2 returned error %d on pid %d", rc, (int)tsk->pid); utrace_engine_put(engine); @@ -869,11 +881,12 @@ __stp_utrace_task_finder_target_quiesce(enum utrace_resume_action action, * a stale task pointer, if we have an engine ref. */ rc = utrace_barrier(tsk, engine); - if (rc != 0) + if (rc == 0) + rc = utrace_set_events(tsk, engine, + __STP_ATTACHED_TASK_BASE_EVENTS(tgt)); + else if (rc != -ESRCH && rc != -EALREADY) _stp_error("utrace_barrier returned error %d on pid %d", rc, (int)tsk->pid); - rc = utrace_set_events(tsk, engine, - __STP_ATTACHED_TASK_BASE_EVENTS(tgt)); } if (rc != 0) _stp_error("utrace_set_events returned error %d on pid %d", @@ -1032,7 +1045,6 @@ __stp_utrace_task_finder_target_syscall_entry(enum utrace_resume_action action, static void __stp_call_vm_callbacks_with_vma(struct stap_task_finder_target *tgt, struct task_struct *tsk, - int map_p, struct vm_area_struct *vma) { char *mmpath_buf; @@ -1059,7 +1071,7 @@ __stp_call_vm_callbacks_with_vma(struct stap_task_finder_target *tgt, rc, (int)tsk->pid); } else { - __stp_call_vm_callbacks(tgt, tsk, map_p, mmpath, + __stp_call_vm_callbacks(tgt, tsk, 1, mmpath, vma->vm_start, vma->vm_end, (vma->vm_pgoff << PAGE_SHIFT)); } @@ -1152,7 +1164,7 @@ __stp_utrace_task_finder_target_syscall_exit(enum utrace_resume_action action, down_read(&mm->mmap_sem); vma = __stp_find_file_based_vma(mm, rv); if (vma != NULL) { - __stp_call_vm_callbacks_with_vma(tgt, tsk, 0, vma); + __stp_call_vm_callbacks_with_vma(tgt, tsk, vma); } up_read(&mm->mmap_sem); mmput(mm); @@ -1225,7 +1237,6 @@ __stp_utrace_task_finder_target_syscall_exit(enum utrace_resume_action action, && vma->vm_end <= entry->vm_end) { __stp_call_vm_callbacks_with_vma(tgt, tsk, - 1, vma); if (vma->vm_end >= entry->vm_end) break; diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 92178910..7f2db03f 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -2083,7 +2083,7 @@ sub process_state3_probe($$) { my $prototype = shift; my $file = shift; - $prototype =~ s@/probe/@@o; # strip off leading 'probe' + $prototype =~ s@probe@@o; # strip off leading 'probe' $prototype =~ s@^\s+@@gos; # strip leading spaces dump_probe($prototype,$file); reset_state(); diff --git a/stap-server.8.in b/stap-server.8.in index 2df70f97..5de87532 100644 --- a/stap-server.8.in +++ b/stap-server.8.in @@ -269,7 +269,7 @@ host. .SH EXAMPLES See the -.IR stapex (5) +.IR stapex (3stap) manual page for a collection of sample scripts. .PP Here is a very basic example of how to use @@ -355,9 +355,9 @@ access permissions before making use of any certificate database. .SH SEE ALSO .IR stap (1), .IR staprun (8), -.IR stapprobes (5), -.IR stapfuncs (5), -.IR stapex (5), +.IR stapprobes (3stap), +.IR stapfuncs (3stap), +.IR stapex (3stap), .IR NSS , .IR certutil , .IR signtool @@ -150,7 +150,7 @@ Add the given directory to the tapset search directory. See the description of pass 2 for details. .TP .BI \-D " NAME=VALUE" -Add the given C preprocessor directive to the module Makefile. These can +Add the given C preprocessor directive to the module Makefile. These can be used to override limit parameters described below. .TP .BI \-R " DIR" @@ -183,7 +183,7 @@ This supports a subset of strftime(3) (%%, %C, %Y, %y, %m, %d, %e, %F, Start the probes, run CMD, and exit when CMD finishes. .TP .BI \-x " PID" -Sets target() to PID. This allows scripts to be written that filter on +Sets target() to PID. This allows scripts to be written that filter on a specific process. .TP .BI \-l " PROBE" @@ -197,7 +197,7 @@ Similar to "-l", but list probe points and script-level local variables. .BI \-F Without -o option, load module and start probes, then detach from the module leaving the probes running. -With -o option, run staprun in background as a daemon and show it's pid. +With -o option, run staprun in background as a daemon and show its pid. .TP .BI \-S " size[,N]" Sets the maximum size of output file and the maximum number of output files. @@ -253,7 +253,7 @@ parser for substitution. See below. .SH SCRIPT LANGUAGE -The systemtap script language resembles +The systemtap script language resembles .IR awk . There are two main outermost constructs: probes and functions. Within these, statements and expressions use C-like operator syntax and @@ -292,7 +292,7 @@ number beyond what was actually given is an error. .SS PREPROCESSING A simple conditional preprocessing stage is run as a part of parsing. -The general form is similar to the +The general form is similar to the .RB cond " ? " exp1 " : " exp2 ternary operator: .SAMPLE @@ -316,7 +316,7 @@ version of the target kernel (as optionally overridden by the option) compares to the given version string. The comparison is performed by the glibc function .BR strverscmp . -As a special case, if the operator is for simple equality +As a special case, if the operator is for simple equality .RB ( == ), or inequality .RB ( != ), @@ -348,14 +348,14 @@ kernel version is newer than 2.6.5: .ESAMPLE The following code might adapt to hypothetical kernel version drift: .SAMPLE -probe kernel.function ( - %( kernel_v <= "2.6.12" %? "__mm_do_fault" %: +probe kernel.function ( + %( kernel_v <= "2.6.12" %? "__mm_do_fault" %: %( kernel_vr == "2.6.13*smp" %? "do_page_fault" %: UNSUPPORTED %) %) ) { /* ... */ } %( arch == "ia64" %? - probe syscall.vliw = kernel.function("vliw_widget") {} + probe syscall.vliw = kernel.function("vliw_widget") {} %) .ESAMPLE @@ -423,7 +423,7 @@ Execute the string- or integer-valued expression and throw away the value. .TP .BR { " STMT1 STMT2 ... " } -Execute each statement in sequence in this block. Note that +Execute each statement in sequence in this block. Note that separators or terminators are generally not necessary between statements. .TP .BR ; @@ -445,12 +445,12 @@ STMT, then the iteration expression EXP3. .BR foreach " (VAR " in " ARRAY [ "limit " EXP ]) STMT" Loop over each element of the named global array, assigning current key to VAR. The array may not be modified within the statement. -By adding a single +By adding a single .BR + " or " \- operator after the VAR or the ARRAY identifier, the iteration will proceed in a sorted order, by ascending or descending index or value. Using the optional -.BR limit +.BR limit keyword limits the number of loop iterations to EXP times. EXP is evaluted once at the beginning of the loop. .TP @@ -503,7 +503,7 @@ string assignment operators .B = .= .TP unary numeric operators -.B + \- ! ~ ++ \-\- +.B + \- ! ~ ++ \-\- .TP binary numeric or string comparison operators .B < > <= >= == != @@ -535,14 +535,14 @@ Events are specified in a special syntax called "probe points". There are several varieties of probe points defined by the translator, and tapset scripts may define further ones using aliases. These are listed in the -.IR stapprobes (5) +.IR stapprobes (3stap) manual pages. .PP The probe handler is interpreted relative to the context of each event. For events associated with kernel code, this context may include .I variables -defined in the +defined in the .I source code at that spot. These "target variables" are presented to the script as variables whose names are prefixed with "$". They may be accessed @@ -553,9 +553,9 @@ with optimized code. Some other events have very little context. New probe points may be defined using "aliases". Probe point aliases look similar to probe definitions, but instead of activating a probe at the given point, it just defines a new probe point name as an alias -to an existing one. There are two types of alias, i.e. the prologue +to an existing one. There are two types of alias, i.e. the prologue style and the epilogue style which are identified by "=" and "+=" -respectively. +respectively. .PP For prologue style alias, the statement block that follows an alias definition is implicitly added as a prologue to any probe that refers @@ -655,9 +655,9 @@ The .IR printf formatting directives similar to those of C, except that they are fully type-checked by the translator: -.RS +.RS .TP -%b +%b Writes a binary blob of the value given, instead of ASCII text. The width specifier determines the number of bytes to write; valid specifiers are %b %1b %2b %4b %8b. Default (%b) is 8 bytes. .TP %c @@ -738,7 +738,7 @@ distinct extraction function operating on a given identifier, the translator arranges to compute a set of statistics that satisfy it. The statistics system is thereby "on-demand". Each execution of an extraction function causes the aggregation to be computed for -that moment across all processors. +that moment across all processors. .PP Here is the set of extractor functions. The first argument of each is the same style of lvalue used on the left hand side of the accumulate @@ -751,7 +751,7 @@ integers. Histograms are also available, but are more complicated because they have a vector rather than scalar value. .I @hist_linear(v,start,stop,interval) -represents a linear histogram from "start" to "stop" by increments +represents a linear histogram from "start" to "stop" by increments of "interval". The interval must be positive. Similarly, .I @hist_log(v) represents a base-2 logarithmic histogram. Printing a histogram @@ -763,7 +763,7 @@ family of functions renders a histogram object as a tabular probe foo { x <<< $value } -probe end { +probe end { printf ("avg %d = sum %d / count %d\\n", @avg(x), @sum(x), @count(x)) print (@hist_log(v)) @@ -823,7 +823,7 @@ sequence, into the generated C code. At the outermost level, this may be useful to add .IR #include instructions, and any auxiliary definitions for use by other embedded -code. +code. .PP The other place where embedded code is permitted is as a function body. In this case, the script language body is replaced entirely by a piece @@ -860,7 +860,7 @@ by the scripts installed under the .IR @prefix@/share/systemtap/tapset .hy directory. These are described in the -.IR stapfuncs "(5) and " stapprobes (5) +.IR stapfuncs "(3stap) and " stapprobes (3stap) manual pages. .SH PROCESSING @@ -884,7 +884,7 @@ the following patterns would be searched, in sequence: .IR 2.6/*.stp , and finally .IR *.stp -Stopping the translator after pass 1 causes it to print the parse trees. +Stopping the translator after pass 1 causes it to print the parse trees. .PP In pass 2, the translator analyzes the input script to resolve symbols @@ -896,7 +896,7 @@ added to the translator's resolution queue. This process iterates until all symbols are resolved and a subset of tapset scripts is selected. .PP -Next, all probe point descriptions are validated +Next, all probe point descriptions are validated against the wide variety supported by the translator. Probe points that refer to code locations ("synchronous probe points") require the appropriate kernel debugging information to be installed. In the @@ -913,7 +913,7 @@ Since this optimization can hide latent code errors such as type mismatches or invalid $target variables, it sometimes may be useful to disable the optimizations with the .BR \-u -option. +option. .PP Finally, all variable, function, parameter, array, and index types are inferred from context (literals and operators). Stopping the @@ -956,8 +956,8 @@ Finally, unloads the module, and cleans up. .SH EXAMPLES -See the -.IR stapex (5) +See the +.IR stapex (3stap) manual page for a collection of samples. .SH CACHING @@ -970,10 +970,10 @@ the .I $SYSTEMTAP_DIR/cache directory. The cache can be limited by having the file .I cache_mb_limit -placed in the cache directory (shown above) containing only an ASCII +placed in the cache directory (shown above) containing only an ASCII integer representing how many MiB the cache should not exceed. Note that this is a 'soft' limit in that the cache will be cleaned after a new entry -is added, so the total cache size may temporarily exceed this limit. In the +is added, so the total cache size may temporarily exceed this limit. In the absence of this file, a default will be created with the limit set to 64MiB. .SH SAFETY AND SECURITY @@ -1005,11 +1005,11 @@ program are run by the .IR staprun program. The latter is a part of the Systemtap package, dedicated to module loading and unloading (but only in the white zone), and -kernel-to-user data transfer. Since +kernel-to-user data transfer. Since .IR staprun does not perform any additional security checks on the kernel objects it is given, it would be unwise for a system administrator to add -untrusted users to the +untrusted users to the .I stapdev or .I stapusr @@ -1026,7 +1026,7 @@ to kernel crash or data corruption. The resource use limits are set by macros in the generated C code. These may be overridden with the .BR \-D -flag. A selection of these is as follows: +flag. A selection of these is as follows: .TP MAXNESTING Maximum number of recursive function call levels, default 10. @@ -1099,7 +1099,7 @@ Note that you must unload guests before unloading a host. If there are some guests connected to the host, unloading the host will be failed. .PP -In case something goes wrong with +In case something goes wrong with .IR stap " or " staprun after a probe has already started running, one may safely kill both user processes, and remove the active probe kernel module with @@ -1173,7 +1173,7 @@ environment variable. Temporary directory for systemtap files, including translated C code and kernel object. .TP -@prefix@/share/systemtap/tapset +@prefix@/share/systemtap/tapset The automatic tapset search directory, unless overridden by the .I SYSTEMTAP_TAPSET @@ -1202,10 +1202,10 @@ The auxiliary program supervising module loading, interaction, and unloading. .SH SEE ALSO -.IR stapprobes (5), -.IR stapfuncs (5), -.IR stapvars (5), -.IR stapex (5), +.IR stapprobes (3stap), +.IR stapfuncs (3stap), +.IR stapvars (3stap), +.IR stapex (3stap), .IR awk (1), .IR gdb (1) diff --git a/stapex.5.in b/stapex.3stap.in index 38f30f62..8d02fc5c 100644 --- a/stapex.5.in +++ b/stapex.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPEX 5 @DATE@ "Red Hat" +.TH STAPEX 3stap @DATE@ "Red Hat" .SH NAME stapex \- systemtap examples @@ -121,6 +121,6 @@ it is ordinarily run. .SH SEE ALSO .BR @prefix@/doc/systemtap*/examples .IR stap (1) -.IR stapprobes (5) -.IR stapfuncs (5) +.IR stapprobes (3stap) +.IR stapfuncs (3stap) diff --git a/stapfuncs.5.in b/stapfuncs.3stap.in index 0322369e..1f2955da 100644 --- a/stapfuncs.5.in +++ b/stapfuncs.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPFUNCS 5 @DATE@ "Red Hat" +.TH STAPFUNCS 3stap @DATE@ "Red Hat" .SH NAME stapfuncs \- systemtap functions @@ -565,7 +565,7 @@ the handle being used for that event. These functions convert arguments in the socket tapset back and forth between their numeric and string representations. See -.IR stapprobes.socket (5) +.IR stapprobes.socket (3stap) for details. .TP diff --git a/stapprobes.5.in b/stapprobes.3stap.in index f4a872cb..f175e6e0 100644 --- a/stapprobes.5.in +++ b/stapprobes.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPPROBES 5 @DATE@ "Red Hat" +.TH STAPPROBES 3stap @DATE@ "Red Hat" .SH NAME stapprobes \- systemtap probe points @@ -661,16 +661,16 @@ refers to the group of probe aliases with any name in the third position .SH SEE ALSO .IR stap (1), -.IR stapprobes.iosched (5), -.IR stapprobes.netdev (5), -.IR stapprobes.nfs (5), -.IR stapprobes.nfsd (5), -.IR stapprobes.pagefault (5), -.IR stapprobes.process (5), -.IR stapprobes.rpc (5), -.IR stapprobes.scsi (5), -.IR stapprobes.signal (5), -.IR stapprobes.socket (5), -.IR stapprobes.tcp (5), -.IR stapprobes.udp (5), -.IR proc (5) +.IR stapprobes.iosched (3stap), +.IR stapprobes.netdev (3stap), +.IR stapprobes.nfs (3stap), +.IR stapprobes.nfsd (3stap), +.IR stapprobes.pagefault (3stap), +.IR stapprobes.process (3stap), +.IR stapprobes.rpc (3stap), +.IR stapprobes.scsi (3stap), +.IR stapprobes.signal (3stap), +.IR stapprobes.socket (3stap), +.IR stapprobes.tcp (3stap), +.IR stapprobes.udp (3stap), +.IR proc (3stap) diff --git a/staprun.8.in b/staprun.8.in index 01ef2320..5d2a72a6 100644 --- a/staprun.8.in +++ b/staprun.8.in @@ -103,7 +103,7 @@ module. .SH EXAMPLES See the -.IR stapex (5) +.IR stapex (3stap) manual page for a collection of sample scripts. .PP Here is a very basic example of how to use @@ -167,9 +167,9 @@ located in this directory. This directory should be owned by the root user and not be world writable. .SH SEE ALSO .IR stap (1), -.IR stapprobes (5), -.IR stapfuncs (5), -.IR stapex (5), +.IR stapprobes (3stap), +.IR stapfuncs (3stap), +.IR stapex (3stap), .SH BUGS Use the Bugzilla link off of the project web page or our mailing list. diff --git a/stapvars.5.in b/stapvars.3stap.in index 94e47667..0ece000f 100644 --- a/stapvars.5.in +++ b/stapvars.3stap.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH STAPVARS 5 @DATE@ "Red Hat" +.TH STAPVARS 3stap @DATE@ "Red Hat" .SH NAME stapvars \- systemtap variables diff --git a/systemtap.spec b/systemtap.spec index 95aba116..9dbfb371 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -3,6 +3,7 @@ %{!?with_crash: %define with_crash 0} %{!?with_bundled_elfutils: %define with_bundled_elfutils 0} %{!?elfutils_version: %define elfutils_version 0.127} +%{!?pie_supported: %define pie_supported 1} Name: systemtap Version: 0.9 @@ -175,9 +176,15 @@ cd .. %define docs_config --disable-docs %endif +# Enable pie as configure defaults to disabling it +%if %{pie_supported} +%define pie_config --enable-pie +%else +%define pie_config --disable-pie +%endif -%configure %{?elfutils_config} %{sqlite_config} %{crash_config} %{docs_config} +%configure %{?elfutils_config} %{sqlite_config} %{crash_config} %{docs_config} %{pie_config} make %{?_smp_mflags} %install @@ -245,7 +252,6 @@ exit 0 %if %{with_docs} %doc docs.installed/*.pdf %doc docs.installed/tapsets -%{_mandir}/man3stap/* %endif %{_bindir}/stap @@ -255,7 +261,7 @@ exit 0 %{_bindir}/stap-authorize-cert %{_bindir}/stap-authorize-signing-cert %{_mandir}/man1/* -%{_mandir}/man5/* +%{_mandir}/man3/* %dir %{_datadir}/%{name} %{_datadir}/%{name}/runtime diff --git a/tapsets.cxx b/tapsets.cxx index e9ade595..c36a1aa0 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -603,7 +603,8 @@ typedef tr1::unordered_map<string,Dwarf_Die> cu_function_cache_t; typedef tr1::unordered_map<string,cu_function_cache_t*> mod_cu_function_cache_t; // module:cu -> function -> die #else struct stringhash { - size_t operator() (const string& s) const { hash<const char*> h; return h(s.c_str()); } + // __gnu_cxx:: is needed because our own hash.h has an ambiguous hash<> decl too. + size_t operator() (const string& s) const { __gnu_cxx::hash<const char*> h; return h(s.c_str()); } }; typedef hash_map<string,Dwarf_Die,stringhash> cu_function_cache_t; @@ -5022,7 +5023,7 @@ void dwarf_cast_expanding_visitor::visit_cast_op (cast_op* e) string code; exp_type type = pe_long; - size_t mod_end = -1; + size_t mod_end = ~0; do { // split the module string by ':' for alternatives @@ -5731,8 +5732,6 @@ dwarf_builder::build(systemtap_session & sess, Elf* elf = dwfl_module_getelf (dw->module, &bias); size_t shstrndx; Elf_Scn *probe_scn = NULL; - bool probe_found = false; - bool dynamic = (dwfl_module_relocations (dw->module) == 1); dwfl_assert ("getshstrndx", elf_getshstrndx (elf, &shstrndx)); GElf_Shdr *shdr = NULL; @@ -5750,8 +5749,6 @@ dwarf_builder::build(systemtap_session & sess, break; } } - if (dynamic || sess.listing_mode) - probe_type = dwarf_no_probes; if (probe_type == probes_and_dwarf) { @@ -5779,9 +5776,7 @@ dwarf_builder::build(systemtap_session & sess, probe_arg = *((__uint64_t*)((char*)pdata->d_buf + probe_scn_offset)); if (probe_scn_offset % (sizeof(__uint64_t)*2)) probe_scn_offset = (probe_scn_offset + sizeof(__uint64_t)*2) - (probe_scn_offset % (sizeof(__uint64_t)*2)); - if (strcmp (location->components[1]->arg->tok->content.c_str(), probe_name.c_str()) == 0) - probe_found = true; - else + if (strcmp (location->components[1]->arg->tok->content.c_str(), probe_name.c_str()) != 0) continue; const token* sv_tok = location->components[1]->arg->tok; location->components[1]->functor = TOK_STATEMENT; @@ -5791,11 +5786,10 @@ dwarf_builder::build(systemtap_session & sess, dwarf_query q(sess, base, location, *dw, parameters, finished_results); dw->query_modules(&q); } - if (probe_found) - return; + return; } - if (probe_type == dwarf_no_probes || ! probe_found) + if (probe_type == dwarf_no_probes) { location->components[1]->functor = TOK_FUNCTION; location->components[1]->arg = new literal_string("*"); @@ -9589,6 +9583,7 @@ tracepoint_derived_probe::tracepoint_derived_probe (systemtap_session& s, // tracepoints from FOO_event_types.h should really be included from FOO.h // XXX can dwarf tell us the include hierarchy? it would be better to // ... walk up to see which one was directly included by tracequery.c + // XXX: see also PR9993. header_pos = header.find("_event_types"); if (header_pos != string::npos) header.erase(header_pos, 12); @@ -9764,6 +9759,16 @@ tracepoint_derived_probe::emit_probe_context_vars (translator_output* o) } +static vector<string> tracepoint_extra_headers () +{ + vector<string> they_live; + // PR 9993 + // XXX: may need this to be configurable + they_live.push_back ("linux/skbuff.h"); + return they_live; +} + + void tracepoint_derived_probe_group::emit_module_decls (systemtap_session& s) { @@ -9773,6 +9778,12 @@ tracepoint_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline() << "/* ---- tracepoint probes ---- */"; s.op->newline(); + // PR9993: Add extra headers to work around undeclared types in individual + // include/trace/foo.h files + const vector<string>& extra_headers = tracepoint_extra_headers (); + for (unsigned z=0; z<extra_headers.size(); z++) + s.op->newline() << "#include <" << extra_headers[z] << ">\n"; + for (unsigned i = 0; i < probes.size(); ++i) { tracepoint_derived_probe *p = probes[i]; @@ -9970,6 +9981,7 @@ private: bool init_dw(systemtap_session& s); public: + tracepoint_builder(): dw(0) {} ~tracepoint_builder() { delete dw; } @@ -10016,7 +10028,7 @@ tracepoint_builder::init_dw(systemtap_session& s) // no cached module, time to make it string tracequery_ko; - int rc = make_tracequery(s, tracequery_ko); + int rc = make_tracequery(s, tracequery_ko, tracepoint_extra_headers()); if (rc != 0) return false; diff --git a/testsuite/systemtap.base/tracepoints.exp b/testsuite/systemtap.base/tracepoints.exp index bea461c4..cd033908 100644 --- a/testsuite/systemtap.base/tracepoints.exp +++ b/testsuite/systemtap.base/tracepoints.exp @@ -1,3 +1,26 @@ + +set tracepoints {} +spawn stap -l {kernel.trace("*")} +expect { + -re {^kernel.trace[^\r\n]*\r\n} { + append tracepoints $expect_out(0,string) + exp_continue + } + timeout {} + eof {} +} +catch {close}; catch { wait } + +foreach tp $tracepoints { + set test "tracepoint $tp -p4" + if {[catch {exec stap -w -p4 -e "probe $tp {}"} res]} { + fail "$test $res" + } else { + pass "$test" + } +} + set test "tracepoints" +if {![installtest_p]} { untested $test; return } set ::result_string {tracepoints OK} stap_run2 $srcdir/$subdir/$test.stp diff --git a/testsuite/systemtap.base/uprobes_exe.c b/testsuite/systemtap.base/uprobes_exe.c new file mode 100644 index 00000000..447434c6 --- /dev/null +++ b/testsuite/systemtap.base/uprobes_exe.c @@ -0,0 +1,27 @@ +/* uprobes_lib test case + * Copyright (C) 2009, Red Hat Inc. + * + * 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 + * Public License (GPL); either version 2, or (at your option) any + * later version. + */ + +#include <unistd.h> + +// function from our library +int lib_main (void); + +void +main_func (int foo) +{ + ; // nothing here... +} + +int +main (int argc, char *argv[], char *envp[]) +{ + main_func(1); + lib_main(); + return 0; +} diff --git a/testsuite/systemtap.base/uprobes_lib.c b/testsuite/systemtap.base/uprobes_lib.c new file mode 100644 index 00000000..c9d70625 --- /dev/null +++ b/testsuite/systemtap.base/uprobes_lib.c @@ -0,0 +1,20 @@ +/* uprobes_lib test case - library helper + * Copyright (C) 2009, Red Hat Inc. + * + * 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 + * Public License (GPL); either version 2, or (at your option) any + * later version. + */ + +void +lib_func (int bar) +{ + ; // nothing here... +} + +void +lib_main () +{ + lib_func (3); +} diff --git a/testsuite/systemtap.base/uprobes_lib.exp b/testsuite/systemtap.base/uprobes_lib.exp new file mode 100644 index 00000000..ae1b72e8 --- /dev/null +++ b/testsuite/systemtap.base/uprobes_lib.exp @@ -0,0 +1,38 @@ +set test "uprobes_lib" +set testpath "$srcdir/$subdir" +set testsrc "$testpath/uprobes_exe.c" +set testsrclib "$testpath/uprobes_lib.c" +set testexe "./uprobes_exe" +set testlibname "uprobes_lib" +set testlibdir "." +set testso "$testlibdir/lib${testlibname}.so" +set testflags "additional_flags=-g additional_flags=-O" +set testlibflags "$testflags additional_flags=-fPIC additional_flags=-shared" +set maintestflags "$testflags additional_flags=-L$testlibdir additional_flags=-l$testlibname additional_flags=-Wl,-rpath,$testlibdir" + +# Only run on make installcheck +if {! [installtest_p]} { untested "$test"; return } + +# Compile our test program and library. +set res [target_compile $testsrclib $testso executable $testlibflags] +if { $res != "" } { + verbose "target_compile for $testso failed: $res" 2 + fail "unable to compile $testsrclib" + return +} +set res [target_compile $testsrc $testexe executable $maintestflags] +if { $res != "" } { + verbose "target_compile failed: $res" 2 + fail "unable to compile $testsrc" + return +} + +# XXX main_func needs another/extra test. Disabled for now. +# Enable (and in uprobes_lib.stp) after PR9940 is fixed. +# set ::result_string {main_func +# lib_func} +set ::result_string {lib_func} + +stap_run2 $srcdir/$subdir/$test.stp -c $testexe + +#exec rm -f $testexe $testso diff --git a/testsuite/systemtap.base/uprobes_lib.stp b/testsuite/systemtap.base/uprobes_lib.stp new file mode 100644 index 00000000..bc6cc249 --- /dev/null +++ b/testsuite/systemtap.base/uprobes_lib.stp @@ -0,0 +1,9 @@ +/* - Not activated probe... Seems always skipped? +probe process("uprobes_exe").function("main_func") { + printf("main_func\n"); +} +*/ + +probe process("libuprobes_lib.so").function("lib_func") { + printf("lib_func\n"); +} diff --git a/translate.cxx b/translate.cxx index 40bb82c2..0b81d9bb 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4824,6 +4824,7 @@ emit_symbol_data (systemtap_session& s) do { if (pending_interrupts) return; + if (ctx.undone_unwindsym_modules.empty()) break; off = dwfl_getmodules (dwfl, &dump_unwindsyms, (void *) &ctx, 0); } while (off > 0); @@ -4862,6 +4863,7 @@ emit_symbol_data (systemtap_session& s) do { if (pending_interrupts) return; + if (ctx.undone_unwindsym_modules.empty()) break; off = dwfl_getmodules (dwfl, &dump_unwindsyms, (void *) &ctx, 0); } while (off > 0); |