From 849d65468deda9a2beb5402a08ea9190c50c321b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 11 Jun 2009 16:01:08 -0700 Subject: Pick up some NEWS items from the release notes --- NEWS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 6388cc9f..fcf72a9c 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,12 @@ * What's new +- Miscellaneous new tapset functions: + - sid() returns the session ID of the current process + - stringat() indexes a single character from a string. + +- Using %M in print formats for hex dumps can now print entire buffers, + instead of just small numbers. + - Dwarfless syscalls: The nd_syscalls tapset is now available to probe system calls without requiring kernel debugging information. All of the same probepoints in the normal syscalls tapset are available with -- cgit From e1774a7fdc4e44b4b11303b0ee6eda0230c5216c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 11 Jun 2009 16:12:07 -0700 Subject: Version bumps for the 0.9.8 release --- NEWS | 2 +- configure | 20 ++++++++++---------- configure.ac | 2 +- systemtap.spec | 5 ++++- testsuite/configure | 20 ++++++++++---------- testsuite/configure.ac | 2 +- 6 files changed, 27 insertions(+), 24 deletions(-) diff --git a/NEWS b/NEWS index fcf72a9c..464b66c1 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -* What's new +* What's new in version 0.9.8 - Miscellaneous new tapset functions: - sid() returns the session ID of the current process diff --git a/configure b/configure index 8a2c7593..d1b39c34 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for systemtap 0.9.7. +# Generated by GNU Autoconf 2.63 for systemtap 0.9.8. # # Report bugs to . # @@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='systemtap' PACKAGE_TARNAME='systemtap' -PACKAGE_VERSION='0.9.7' -PACKAGE_STRING='systemtap 0.9.7' +PACKAGE_VERSION='0.9.8' +PACKAGE_STRING='systemtap 0.9.8' PACKAGE_BUGREPORT='systemtap@sources.redhat.com' # Factoring default headers for most tests. @@ -1363,7 +1363,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures systemtap 0.9.7 to adapt to many kinds of systems. +\`configure' configures systemtap 0.9.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1429,7 +1429,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of systemtap 0.9.7:";; + short | recursive ) echo "Configuration of systemtap 0.9.8:";; esac cat <<\_ACEOF @@ -1559,7 +1559,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -systemtap configure 0.9.7 +systemtap configure 0.9.8 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1573,7 +1573,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by systemtap $as_me 0.9.7, which was +It was created by systemtap $as_me 0.9.8, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -2291,7 +2291,7 @@ fi # Define the identity of the package. PACKAGE='systemtap' - VERSION='0.9.7' + VERSION='0.9.8' cat >>confdefs.h <<_ACEOF @@ -9383,7 +9383,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by systemtap $as_me 0.9.7, which was +This file was extended by systemtap $as_me 0.9.8, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9446,7 +9446,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -systemtap config.status 0.9.7 +systemtap config.status 0.9.8 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index 403dfab2..747c549b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl configure.ac --- autoconf input file for systemtap dnl Process this file with autoconf to produce a configure script. -AC_INIT([systemtap], 0.9.7, systemtap@sources.redhat.com, systemtap) +AC_INIT([systemtap], 0.9.8, systemtap@sources.redhat.com, systemtap) dnl ^^^^^ see also NEWS, systemtap.spec, testsuite/configure.ac AC_PREREQ(2.59) diff --git a/systemtap.spec b/systemtap.spec index 521eec75..d62bb7ad 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -8,7 +8,7 @@ %{!?with_grapher: %define with_grapher 0} Name: systemtap -Version: 0.9.7 +Version: 0.9.8 Release: 1%{?dist} # for version, see also configure.ac Summary: Instrumentation System @@ -356,6 +356,9 @@ exit 0 %changelog +* Thu Jun 11 2009 Josh Stone - 0.9.8-1 +- Upstream release. + * Thu Apr 23 2009 Josh Stone - 0.9.7-1 - Upstream release. diff --git a/testsuite/configure b/testsuite/configure index ecee48d8..09db931f 100755 --- a/testsuite/configure +++ b/testsuite/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for systemtap 0.9.7. +# Generated by GNU Autoconf 2.63 for systemtap 0.9.8. # # Report bugs to . # @@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='systemtap' PACKAGE_TARNAME='systemtap' -PACKAGE_VERSION='0.9.7' -PACKAGE_STRING='systemtap 0.9.7' +PACKAGE_VERSION='0.9.8' +PACKAGE_STRING='systemtap 0.9.8' PACKAGE_BUGREPORT='systemtap@sources.redhat.com' ac_subst_vars='LTLIBOBJS @@ -1227,7 +1227,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures systemtap 0.9.7 to adapt to many kinds of systems. +\`configure' configures systemtap 0.9.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1293,7 +1293,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of systemtap 0.9.7:";; + short | recursive ) echo "Configuration of systemtap 0.9.8:";; esac cat <<\_ACEOF @@ -1372,7 +1372,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -systemtap configure 0.9.7 +systemtap configure 0.9.8 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1386,7 +1386,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by systemtap $as_me 0.9.7, which was +It was created by systemtap $as_me 0.9.8, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -2104,7 +2104,7 @@ fi # Define the identity of the package. PACKAGE='systemtap' - VERSION='0.9.7' + VERSION='0.9.8' cat >>confdefs.h <<_ACEOF @@ -2749,7 +2749,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by systemtap $as_me 0.9.7, which was +This file was extended by systemtap $as_me 0.9.8, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2799,7 +2799,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -systemtap config.status 0.9.7 +systemtap config.status 0.9.8 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/testsuite/configure.ac b/testsuite/configure.ac index 1a82fe36..62d6e1a8 100644 --- a/testsuite/configure.ac +++ b/testsuite/configure.ac @@ -1,7 +1,7 @@ dnl configure.ac --- autoconf input file for systemtap testsuite dnl Process this file with autoconf to produce a configure script. -AC_INIT([systemtap], 0.9.7, systemtap@sources.redhat.com, systemtap) +AC_INIT([systemtap], 0.9.8, systemtap@sources.redhat.com, systemtap) AC_PREREQ(2.59) AC_CONFIG_AUX_DIR(..) -- cgit From e7872f0713a95867ba64c8770eb4f377069366f2 Mon Sep 17 00:00:00 2001 From: Don Domingo Date: Fri, 12 Jun 2009 13:16:32 +1000 Subject: added quick note to README re latexml --- doc/Language_Reference_Guide/README | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/Language_Reference_Guide/README b/doc/Language_Reference_Guide/README index d3175ae3..c99027db 100644 --- a/doc/Language_Reference_Guide/README +++ b/doc/Language_Reference_Guide/README @@ -14,3 +14,15 @@ The main source of the Language Reference Guide is in: As such, any revisions to this document should be applied to ../langref.tex, not to the source in this directory. + +IMPORTANT: +The publicanize-langref.sh script uses latexml to create the raw XML files +from langref.tex first before cleaning it up for Publican. You will need +LaTeXML along with all its required perl modules to use publicanize-langref.sh. + +For more information on building from source, downloading, and installing LaTeXML, +refer to the following URLs: + +http://dlmf.nist.gov/LaTeXML/download.html +http://dlmf.nist.gov/LaTeXML/install.html + -- cgit From 8fb430a7eeb394d759fe792198d28aeab348f048 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 12 Jun 2009 12:04:34 -0700 Subject: Map przemoc's name to UTF-8 in .mailmap & AUTHORS --- .mailmap | 1 + AUTHORS | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index b55c9ee3..653dd69e 100644 --- a/.mailmap +++ b/.mailmap @@ -54,6 +54,7 @@ K.Prasad K.Prasad Kent Sebastian Prerna Saxena +Przemysław Pawełczyk Srinivasa DS Wenji Huang William Cohen diff --git a/AUTHORS b/AUTHORS index 417d6fc0..4ae6c8ff 100644 --- a/AUTHORS +++ b/AUTHORS @@ -40,7 +40,7 @@ Nobuhiro Tachino Petr Muller Phil Muldoon Prerna Saxena -Przemyslaw Pawelczyk +Przemysław Pawełczyk Rajan Arora Roland McGrath Shaohua Li -- cgit From 6a7dc7d9c3df7d5d722f0702a0a0c8d55591006e Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 12 Jun 2009 22:37:11 +0200 Subject: Add exelib uprobes test framework. Tests uprobes placed in executables and shared libraries on different arches (32-on-64 currently disabled), gcc/g++, optimizations (currently disabled), prelinked libs (currently disabled), seperate libs/exe debuginfo and pie executables. * testsuite/systemtap.base/uprobes_exe.c: Moved to... * testsuite/systemtap.exelib/uprobes_exe.c: From systemtap.base. * testsuite/systemtap.base/uprobes_lib.c: Moved to... * testsuite/systemtap.exelib/uprobes_lib.c: From systemtap.base. * testsuite/systemtap.base/uprobes_lib.exp: Rewritten as... * testsuite/systemtap.exelib/lib.tcl: From uprobes_lib.exp. * testsuite/systemtap.base/uprobes_lib.stp: Rewritten as... * testsuite/systemtap.exelib/lib.stp: From uprobes_lib.stp. * testsuite/systemtap.base/uprobes_uname.exp: Rewritten as... * testsuite/systemtap.exelib/uname.tcl: From uprobes_uname.exp. * testsuite/systemtap.base/uprobes_uname.stp: Rewritten as... * testsuite/systemtap.exelib/uname.stp: From uprobes_uname.stp. * testsuite/systemtap.base/uprobes_ustack.exp: Rewritten as... * testsuite/systemtap.exelib/ustack.tcl: From uprobes_ustack.exp. * testsuite/systemtap.base/uprobes_ustack.stp: Rewritten as... * testsuite/systemtap.exelib/ustack.stp: From uprobes_ustack.stp. * testsuite/systemtap.exelib/exelib.exp: New exelib uprobes framework. * testsuite/systemtap.exelib/cleanup.tcl: New file. --- testsuite/systemtap.base/uprobes_exe.c | 29 ----- testsuite/systemtap.base/uprobes_lib.c | 21 ---- testsuite/systemtap.base/uprobes_lib.exp | 46 -------- testsuite/systemtap.base/uprobes_lib.stp | 15 --- testsuite/systemtap.base/uprobes_uname.exp | 46 -------- testsuite/systemtap.base/uprobes_uname.stp | 7 -- testsuite/systemtap.base/uprobes_ustack.exp | 97 ---------------- testsuite/systemtap.base/uprobes_ustack.stp | 35 ------ testsuite/systemtap.exelib/cleanup.tcl | 3 + testsuite/systemtap.exelib/exelib.exp | 164 ++++++++++++++++++++++++++++ testsuite/systemtap.exelib/lib.stp | 18 +++ testsuite/systemtap.exelib/lib.tcl | 13 +++ testsuite/systemtap.exelib/uname.stp | 10 ++ testsuite/systemtap.exelib/uname.tcl | 13 +++ testsuite/systemtap.exelib/uprobes_exe.c | 29 +++++ testsuite/systemtap.exelib/uprobes_lib.c | 21 ++++ testsuite/systemtap.exelib/ustack.stp | 36 ++++++ testsuite/systemtap.exelib/ustack.tcl | 79 ++++++++++++++ 18 files changed, 386 insertions(+), 296 deletions(-) delete mode 100644 testsuite/systemtap.base/uprobes_exe.c delete mode 100644 testsuite/systemtap.base/uprobes_lib.c delete mode 100644 testsuite/systemtap.base/uprobes_lib.exp delete mode 100644 testsuite/systemtap.base/uprobes_lib.stp delete mode 100644 testsuite/systemtap.base/uprobes_uname.exp delete mode 100644 testsuite/systemtap.base/uprobes_uname.stp delete mode 100644 testsuite/systemtap.base/uprobes_ustack.exp delete mode 100644 testsuite/systemtap.base/uprobes_ustack.stp create mode 100644 testsuite/systemtap.exelib/cleanup.tcl create mode 100644 testsuite/systemtap.exelib/exelib.exp create mode 100644 testsuite/systemtap.exelib/lib.stp create mode 100644 testsuite/systemtap.exelib/lib.tcl create mode 100644 testsuite/systemtap.exelib/uname.stp create mode 100644 testsuite/systemtap.exelib/uname.tcl create mode 100644 testsuite/systemtap.exelib/uprobes_exe.c create mode 100644 testsuite/systemtap.exelib/uprobes_lib.c create mode 100644 testsuite/systemtap.exelib/ustack.stp create mode 100644 testsuite/systemtap.exelib/ustack.tcl diff --git a/testsuite/systemtap.base/uprobes_exe.c b/testsuite/systemtap.base/uprobes_exe.c deleted file mode 100644 index b4811335..00000000 --- a/testsuite/systemtap.base/uprobes_exe.c +++ /dev/null @@ -1,29 +0,0 @@ -/* 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 - -// function from our library -int lib_main (void); - -void -main_func (int foo) -{ - if (foo > 1) - main_func (foo - 1); - else - lib_main(); -} - -int -main (int argc, char *argv[], char *envp[]) -{ - main_func (3); - return 0; -} diff --git a/testsuite/systemtap.base/uprobes_lib.c b/testsuite/systemtap.base/uprobes_lib.c deleted file mode 100644 index 25297b6b..00000000 --- a/testsuite/systemtap.base/uprobes_lib.c +++ /dev/null @@ -1,21 +0,0 @@ -/* 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) -{ - if (bar > 1) - lib_func (bar - 1); -} - -void -lib_main () -{ - lib_func (3); -} diff --git a/testsuite/systemtap.base/uprobes_lib.exp b/testsuite/systemtap.base/uprobes_lib.exp deleted file mode 100644 index 313c01b6..00000000 --- a/testsuite/systemtap.base/uprobes_lib.exp +++ /dev/null @@ -1,46 +0,0 @@ -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" - -# 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 "$test compile $testsrclib" - return -} else { - pass "$test compile $testsrclib" -} - -set res [target_compile $testsrc $testexe executable $maintestflags] -if { $res != "" } { - verbose "target_compile failed: $res" 2 - fail "$test compile $testsrc" - return -} else { - pass "$test compile $testsrc" -} - -set ::result_string {main -main_func -main_func -main_func -lib_main -lib_func -lib_func -lib_func} - -# Only run on make installcheck -if {! [installtest_p]} { untested "$test"; return } -if {! [utrace_p]} { untested $test; return } -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 deleted file mode 100644 index 459351a4..00000000 --- a/testsuite/systemtap.base/uprobes_lib.stp +++ /dev/null @@ -1,15 +0,0 @@ -probe process("uprobes_exe").function("main") { - printf("main\n"); -} - -probe process("uprobes_exe").function("main_func") { - printf("main_func\n"); -} - -probe process("libuprobes_lib.so").function("lib_main") { - printf("lib_main\n"); -} - -probe process("libuprobes_lib.so").function("lib_func") { - printf("lib_func\n"); -} diff --git a/testsuite/systemtap.base/uprobes_uname.exp b/testsuite/systemtap.base/uprobes_uname.exp deleted file mode 100644 index 65e1ff70..00000000 --- a/testsuite/systemtap.base/uprobes_uname.exp +++ /dev/null @@ -1,46 +0,0 @@ -set test "uprobes_uname" -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" - -# 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 "$test compile $testsrclib" - return -} else { - pass "$test compile $testsrclib" -} - -set res [target_compile $testsrc $testexe executable $maintestflags] -if { $res != "" } { - verbose "target_compile failed: $res" 2 - fail "$test compile $testsrc" - return -} else { - pass "$test compile $testsrc" -} - -set ::result_string {exe: main=main -exe: main_func=main_func -exe: main_func=main_func -exe: main_func=main_func -lib: lib_main=lib_main -lib: lib_func=lib_func -lib: lib_func=lib_func -lib: lib_func=lib_func} - -# Only run on make installcheck -if {! [installtest_p]} { untested "$test"; return } -if {! [utrace_p]} { untested $test; return } -stap_run2 $srcdir/$subdir/$test.stp -c $testexe - -#exec rm -f $testexe $testso diff --git a/testsuite/systemtap.base/uprobes_uname.stp b/testsuite/systemtap.base/uprobes_uname.stp deleted file mode 100644 index a44d78d3..00000000 --- a/testsuite/systemtap.base/uprobes_uname.stp +++ /dev/null @@ -1,7 +0,0 @@ -probe process("uprobes_exe").function("*") { - printf("exe: %s=%s\n",probefunc(), usymname(uaddr())); -} - -probe process("libuprobes_lib.so").function("*") { - printf("lib: %s=%s\n",probefunc(), usymname(uaddr())); -} diff --git a/testsuite/systemtap.base/uprobes_ustack.exp b/testsuite/systemtap.base/uprobes_ustack.exp deleted file mode 100644 index bfc435e9..00000000 --- a/testsuite/systemtap.base/uprobes_ustack.exp +++ /dev/null @@ -1,97 +0,0 @@ -set test "uprobes_ustack" -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" - -# 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 "$test compile $testsrclib" - return -} else { - pass "$test compile $testsrclib" -} - -set res [target_compile $testsrc $testexe executable $maintestflags] -if { $res != "" } { - verbose "target_compile failed: $res" 2 - fail "$test compile $testsrc" - return -} else { - pass "$test compile $testsrc" -} - -set ::result_string {exe: main=main -exe: main_func=main_func -exe: main_func=main_func -exe: main_func=main_func -lib: lib_main=lib_main -lib: lib_func=lib_func -lib: lib_func=lib_func -lib: lib_func=lib_func} - -# Only run on make installcheck -if {! [installtest_p]} { untested "$test"; return } -if {! [utrace_p]} { untested $test; return } - -# Output is: -#print_ubacktrace exe 0 -# 0x080484ba : main_func+0xa/0x29 [.../uprobes_exe] -# 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe] -#print_ustack exe 1 -# 0x080484ba : main_func+0xa/0x29 [.../uprobes_exe] -# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe] -# 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe] -#print_ubacktrace lib 2 -# 0x00db2422 : lib_func+0x16/0x2b [.../libuprobes_lib.so] -# 0x00db2455 : lib_main+0x1e/0x29 [.../libuprobes_lib.so] -# 0x080484d0 : main_func+0x20/0x29 [.../uprobes_exe] -# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe] -# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe] -# 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe] -#print_ustack lib 3 -# 0x00db2422 : lib_func+0x16/0x2b [.../libuprobes_lib.so] -# 0x00db2431 : lib_func+0x25/0x2b [.../libuprobes_lib.so] -# 0x00db2455 : lib_main+0x1e/0x29 [.../libuprobes_lib.so] -# 0x080484d0 : main_func+0x20/0x29 [.../uprobes_exe] -# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe] -# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe] -# 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe] - -set print 0 -set main 0 -set main_func 0 -set lib_main 0 -set lib_func 0 -# Needs extra space since on 64bit the last ubacktrace string is -# 7 entries * (16 hex + 2 for 0x + 1 space) = 133 chars. -# Default MAXSTRINGLEN is 128 chars. -spawn stap -DMAXSTRINGLEN=133 $srcdir/$subdir/$test.stp -c $testexe - -wait -expect { - -timeout 60 - -re {^print_[^\r\n]+\r\n} {incr print; exp_continue} - -re {^ 0x[a-f0-9]+ : main\+0x[^\r\n]+\r\n} {incr main; exp_continue} - -re {^ 0x[a-f0-9]+ : main_func\+0x[^\r\n]+\r\n} {incr main_func; exp_continue} - -re {^ 0x[a-f0-9]+ : lib_main\+0x[^\r\n]+\r\n} {incr lib_main; exp_continue} - -re {^ 0x[a-f0-9]+ : lib_func\+0x[^\r\n]+\r\n} {incr lib_func; exp_continue} - timeout { fail "$test (timeout)" } - eof { } -} - -if {$print == 4} {pass "$test print"} {fail "$test print ($print)"} -if {$main == 4} {pass "$test main"} {fail "$test main ($main)"} -if {$main_func == 9} {pass "$test main_func"} {fail "$test main_func ($main_func)"} -if {$lib_main == 2} {pass "$test lib_main"} {fail "$test lib_main ($lib_main)"} -if {$lib_func == 3} {pass "$test lib_func"} {fail "$test lib_func ($lib_func)"} - -#exec rm -f $testexe $testso diff --git a/testsuite/systemtap.base/uprobes_ustack.stp b/testsuite/systemtap.base/uprobes_ustack.stp deleted file mode 100644 index 6de03b42..00000000 --- a/testsuite/systemtap.base/uprobes_ustack.stp +++ /dev/null @@ -1,35 +0,0 @@ -// Prints backtrace from lib through exe twice using diffent ustack functions. - -global hits = 0; - -probe process("uprobes_exe").function("main_func") -{ - if (hits == 0) - { - log("print_ubacktrace exe 0"); - print_ubacktrace(); - hits++; - } - else if (hits == 1) - { - log("print_ustack exe 1"); - print_ustack(ubacktrace()); - hits++; - } -} - -probe process("libuprobes_lib.so").function("lib_func") -{ - if (hits == 2) - { - log("print_ubacktrace lib 2"); - print_ubacktrace(); - hits++; - } - else if (hits == 3) - { - log("print_ustack lib 3"); - print_ustack(ubacktrace()); - hits++; - } -} diff --git a/testsuite/systemtap.exelib/cleanup.tcl b/testsuite/systemtap.exelib/cleanup.tcl new file mode 100644 index 00000000..915587d4 --- /dev/null +++ b/testsuite/systemtap.exelib/cleanup.tcl @@ -0,0 +1,3 @@ +# Remove exes, libs and (possible) separate .debug files +catch {exec rm -f $testexe ${testexe}.debug} +catch {exec rm -f $testlib ${testlib}.debug} diff --git a/testsuite/systemtap.exelib/exelib.exp b/testsuite/systemtap.exelib/exelib.exp new file mode 100644 index 00000000..01ff1241 --- /dev/null +++ b/testsuite/systemtap.exelib/exelib.exp @@ -0,0 +1,164 @@ +# Builds various variants of an executable and a shared library +# (with gcc/g++, -O0/-O3, prelinked/pie, seperate debuginfo) +# Then runs tests with a list of execs. + +set subtestlist {lib uname ustack cleanup} +#set subtestlist {uname} + +proc seperate_debuginfo {elffile} { + set objcopy [list "objcopy" "--only-keep-debug"] + lappend objcopy "$elffile" + lappend objcopy "${elffile}.debug" + send_log "Executing: $objcopy\n" + eval exec $objcopy + + set objcopy [list "objcopy" "--strip-debug"] + lappend objcopy "$elffile" + send_log "Executing: $objcopy\n" + eval exec $objcopy + + set objcopy [list "objcopy"] + lappend objcopy "--add-gnu-debuglink=${elffile}.debug" + lappend objcopy "$elffile" + send_log "Executing: $objcopy\n" + eval exec $objcopy +} + +set testnames {} + +set testpath "$srcdir/$subdir" +set testsrc "$testpath/uprobes_exe.c" +set testsrclib "$testpath/uprobes_lib.c" +set testlibdir "." + +set arches [list "default"] +# BUG! non-default arch breaks ustack tests. +#switch -regexp $::tcl_platform(machine) { +# {^(x86_64|ppc64)$} { lappend arches "-m32" } +# {^s390x$} { lappend arches "-m31" } +#} + +foreach arch $arches { + + foreach compiler {gcc g++} { + + # Just try -O0 and -O3. + # Adding -O, -O2, -Os and mixing lib/exe is a bit overdone + # BUG! -O2, -O3, -Os all break uname tests... + foreach opt {-O0} { + + foreach libprelink {no} { # BUG! "yes" breaks uname tests + + # not done yet, "no" lib debug. + foreach libdebug {yes sep} { + + set libname "uprobeslib${compiler}${opt}${arch}" + + if {$libprelink == "yes"} { + set libname $libname-prelink + } + + if {$libdebug == "sep"} { + set libname $libname-sep-debug + } else { + set libname $libname-debug + } + + # General compiler flags + # For now we always require debuginfo + set testflags "additional_flags=-g" + if {$arch != "default"} { + set testflags "$testflags additional_flags=$arch" + } + if {$compiler == "g++"} { + set testflags "$testflags additional_flags=-x additional_flags=c++" + } + set testflags "$testflags additional_flags=$opt" + + # Extra flags for libraries + set testlibflags "$testflags additional_flags=-fPIC" + set testlibflags "$testlibflags additional_flags=-shared" + + set testso "$testlibdir/lib${libname}.so" + set res [target_compile $testsrclib $testso executable $testlibflags] + if { $res != "" } { + verbose "target_compile for $testso failed: $res" 2 + fail "$libname compile $testsrclib" + return + } else { + pass "$libname compile $testsrclib" + } + + + if {$libdebug == "sep"} { + seperate_debuginfo $testso + } + + if {$libprelink == "yes"} { + set prelink_bin "/usr/sbin/prelink" + set addr "-r 0x6400000" + set prelink_cmd [concat $prelink_bin -vfNR $addr $testso] + send_log "Executing: $prelink_cmd\n" + catch {eval exec $prelink_cmd} result + verbose -log "result is $result" + } + + # should we also prelink exes? + foreach exepie {no yes} { + # not supported, "no" exe debug. + foreach exedebug {yes sep} { + + set exename uprobes$compiler$opt$arch + + # Extra exe compile flags to include lib + set testexeflags "$testflags additional_flags=-L$testlibdir additional_flags=-l$libname additional_flags=-Wl,-rpath,$testlibdir" + + if {$exepie == "yes"} { + set exename $exename-pie + set testexeflags "$testexeflags additional_flags=-fPIE additional_flags=-pie" + } + + if {$exedebug == "sep"} { + set exename $exename-sep-debug + } else { + set exename $exename-debug + } + + set exename $exename-$libname + + set testexe "$testlibdir/${exename}_exe" + set res [target_compile $testsrc $testexe executable $testexeflags] + if { $res != "" } { + verbose "target_compile for $testexe failed: $res" 2 + fail "$exename compile $testsrc" + return + } else { + pass "$exename compile $testsrc" + } + + if {$exedebug == "sep"} { + seperate_debuginfo $testexe + } + + set testname "${exename}_${libname}" + lappend testnames $testname + } + } + } + } + } + } +} + +# Call a test for each exe, set lib to shared library used +foreach subtest $subtestlist { + foreach testname $testnames { + set exelib [split $testname {_}] + set testexe [lindex $exelib 0] + set testexe "${testlibdir}/${testexe}_exe" + set testlib [lindex $exelib 1] + set testlib "${testlibdir}/lib${testlib}.so" + send_log "sourcing: $srcdir/$subdir/$subtest.tcl for $testname\n" + source $srcdir/$subdir/$subtest.tcl + } +} diff --git a/testsuite/systemtap.exelib/lib.stp b/testsuite/systemtap.exelib/lib.stp new file mode 100644 index 00000000..0151282e --- /dev/null +++ b/testsuite/systemtap.exelib/lib.stp @@ -0,0 +1,18 @@ +// Plain function call probes in executable and shared library +// Arguments: @1 uprobes_exe, @2 libuprobes_lib.so + +probe process(@1).function("main") { + printf("main\n"); +} + +probe process(@1).function("main_func") { + printf("main_func\n"); +} + +probe process(@2).function("lib_main") { + printf("lib_main\n"); +} + +probe process(@2).function("lib_func") { + printf("lib_func\n"); +} diff --git a/testsuite/systemtap.exelib/lib.tcl b/testsuite/systemtap.exelib/lib.tcl new file mode 100644 index 00000000..d34ac9ff --- /dev/null +++ b/testsuite/systemtap.exelib/lib.tcl @@ -0,0 +1,13 @@ +set ::result_string {main +main_func +main_func +main_func +lib_main +lib_func +lib_func +lib_func} + +# Only run on make installcheck +if {! [installtest_p]} { untested "lib-$testname"; return } +if {! [utrace_p]} { untested "lib-$testname"; return } +stap_run3 lib-$testname $srcdir/$subdir/lib.stp $testexe $testlib -c $testexe diff --git a/testsuite/systemtap.exelib/uname.stp b/testsuite/systemtap.exelib/uname.stp new file mode 100644 index 00000000..aaf7ef1f --- /dev/null +++ b/testsuite/systemtap.exelib/uname.stp @@ -0,0 +1,10 @@ +// Prints probefunc() and usymname(uaddr()) to check they are similar. +// Arguments: @1 uprobes_exe, @2 libuprobes_lib.so + +probe process(@1).function("*") { + printf("exe: %s=%s\n",probefunc(), usymname(uaddr())); +} + +probe process(@2).function("*") { + printf("lib: %s=%s\n",probefunc(), usymname(uaddr())); +} diff --git a/testsuite/systemtap.exelib/uname.tcl b/testsuite/systemtap.exelib/uname.tcl new file mode 100644 index 00000000..804d8f0b --- /dev/null +++ b/testsuite/systemtap.exelib/uname.tcl @@ -0,0 +1,13 @@ +set ::result_string {exe: main=main +exe: main_func=main_func +exe: main_func=main_func +exe: main_func=main_func +lib: lib_main=lib_main +lib: lib_func=lib_func +lib: lib_func=lib_func +lib: lib_func=lib_func} + +# Only run on make installcheck +if {! [installtest_p]} { untested "uname-$testname"; return } +if {! [utrace_p]} { untested "uname-$testname; return } +stap_run3 uname-$testname $srcdir/$subdir/uname.stp $testexe $testlib -c $testexe diff --git a/testsuite/systemtap.exelib/uprobes_exe.c b/testsuite/systemtap.exelib/uprobes_exe.c new file mode 100644 index 00000000..b4811335 --- /dev/null +++ b/testsuite/systemtap.exelib/uprobes_exe.c @@ -0,0 +1,29 @@ +/* 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 + +// function from our library +int lib_main (void); + +void +main_func (int foo) +{ + if (foo > 1) + main_func (foo - 1); + else + lib_main(); +} + +int +main (int argc, char *argv[], char *envp[]) +{ + main_func (3); + return 0; +} diff --git a/testsuite/systemtap.exelib/uprobes_lib.c b/testsuite/systemtap.exelib/uprobes_lib.c new file mode 100644 index 00000000..25297b6b --- /dev/null +++ b/testsuite/systemtap.exelib/uprobes_lib.c @@ -0,0 +1,21 @@ +/* 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) +{ + if (bar > 1) + lib_func (bar - 1); +} + +void +lib_main () +{ + lib_func (3); +} diff --git a/testsuite/systemtap.exelib/ustack.stp b/testsuite/systemtap.exelib/ustack.stp new file mode 100644 index 00000000..314620d8 --- /dev/null +++ b/testsuite/systemtap.exelib/ustack.stp @@ -0,0 +1,36 @@ +// Prints backtrace from lib through exe twice using diffent ustack functions. +// Arguments: @1 uprobes_exe, @2 libuprobes_lib.so + +global hits = 0; + +probe process(@1).function("main_func") +{ + if (hits == 0) + { + log("print_ubacktrace exe 0"); + print_ubacktrace(); + hits++; + } + else if (hits == 1) + { + log("print_ustack exe 1"); + print_ustack(ubacktrace()); + hits++; + } +} + +probe process(@2).function("lib_func") +{ + if (hits == 2) + { + log("print_ubacktrace lib 2"); + print_ubacktrace(); + hits++; + } + else if (hits == 3) + { + log("print_ustack lib 3"); + print_ustack(ubacktrace()); + hits++; + } +} diff --git a/testsuite/systemtap.exelib/ustack.tcl b/testsuite/systemtap.exelib/ustack.tcl new file mode 100644 index 00000000..b70b8334 --- /dev/null +++ b/testsuite/systemtap.exelib/ustack.tcl @@ -0,0 +1,79 @@ +set ::result_string {exe: main=main +exe: main_func=main_func +exe: main_func=main_func +exe: main_func=main_func +lib: lib_main=lib_main +lib: lib_func=lib_func +lib: lib_func=lib_func + lib: lib_func=lib_func} + +# Only run on make installcheck +if {! [installtest_p]} { untested "ustack-$testname"; return } +if {! [utrace_p]} { untested "ustack-$testname"; return } + +# Output is: +#print_ubacktrace exe 0 +# 0x080484ba : main_func+0xa/0x29 [.../uprobes_exe] +# 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe] +#print_ustack exe 1 +# 0x080484ba : main_func+0xa/0x29 [.../uprobes_exe] +# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe] +# 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe] +#print_ubacktrace lib 2 +# 0x00db2422 : lib_func+0x16/0x2b [.../libuprobes_lib.so] +# 0x00db2455 : lib_main+0x1e/0x29 [.../libuprobes_lib.so] +# 0x080484d0 : main_func+0x20/0x29 [.../uprobes_exe] +# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe] +# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe] +# 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe] +#print_ustack lib 3 +# 0x00db2422 : lib_func+0x16/0x2b [.../libuprobes_lib.so] +# 0x00db2431 : lib_func+0x25/0x2b [.../libuprobes_lib.so] +# 0x00db2455 : lib_main+0x1e/0x29 [.../libuprobes_lib.so] +# 0x080484d0 : main_func+0x20/0x29 [.../uprobes_exe] +# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe] +# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe] +# 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe] + +set print 0 +set main 0 +set main_func 0 +set lib_main 0 +set lib_func 0 +# Needs extra space since on 64bit the last ubacktrace string is +# 7 entries * (16 hex + 2 for 0x + 1 space) = 133 chars. +# Default MAXSTRINGLEN is 128 chars. +send_log "Running: stap -DMAXSTRINGLEN=133 $srcdir/$subdir/ustack.stp $testexe $testlib -c $testexe\n" +spawn stap -DMAXSTRINGLEN=133 $srcdir/$subdir/ustack.stp $testexe $testlib -c $testexe + +wait +expect { + -timeout 60 + -re {^print_[^\r\n]+\r\n} {incr print; exp_continue} + -re {^ 0x[a-f0-9]+ : main\+0x[^\r\n]+\r\n} {incr main; exp_continue} + -re {^ 0x[a-f0-9]+ : main_func\+0x[^\r\n]+\r\n} {incr main_func; exp_continue} + -re {^ 0x[a-f0-9]+ : lib_main\+0x[^\r\n]+\r\n} {incr lib_main; exp_continue} + -re {^ 0x[a-f0-9]+ : lib_func\+0x[^\r\n]+\r\n} {incr lib_func; exp_continue} + timeout { fail "ustack-$testname (timeout)" } + eof { } +} + +if {$print == 4} { pass "ustack-$testname print" } { + fail "ustack-$testname print ($print)" +} + +if {$main == 4} { pass "ustack-$testname main" } { + fail "ustack-$testname main ($main)" +} + +if {$main_func == 9} { pass "ustack-$testname main_func" } { + fail "ustack-$testname main_func ($main_func)" +} + +if {$lib_main == 2} { pass "ustack-$testname lib_main" } { + fail "ustack-$testname lib_main ($lib_main)" +} + +if {$lib_func == 3} { pass "ustack-$testname lib_func" } { + fail "ustack-$testname lib_func ($lib_func)" +} -- cgit From b818f048bb5edca2bde3b33fdbe7e42451eb3c6e Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sat, 13 Jun 2009 15:56:52 -0400 Subject: PR10277: fix \octal escaping of utf-8 characters in path names etc. * util.h (lex_cast_qstring): Use unsigned rather than signed chars. --- util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.h b/util.h index 175f1f40..63e41f9a 100644 --- a/util.h +++ b/util.h @@ -70,7 +70,7 @@ lex_cast_qstring(IN const & in) out2 += '"'; for (unsigned i=0; i Date: Sat, 13 Jun 2009 18:21:06 -0400 Subject: PR10279: add -DKRETACTIVE=nnnn parameter * tapsets.cxx (dwarf/kprobe_derived_...::emit_decl/init): Define and use KRETPROBE instead of hard-coded max(...) values. Raise the default 50%. * testsuite/buildok/thirtytwo.stp: New test. --- NEWS | 5 +++++ tapsets.cxx | 12 ++++++++++-- testsuite/buildok/thirtytwo.stp | 10 ++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100755 testsuite/buildok/thirtytwo.stp diff --git a/NEWS b/NEWS index 464b66c1..8fa10401 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +* What's new + +- Systemwide kernel .function.return (kretprobe) maxactive defaults may + be overridden with the -DKRETACTIVE=nnn parameter. + * What's new in version 0.9.8 - Miscellaneous new tapset functions: diff --git a/tapsets.cxx b/tapsets.cxx index 3ecf2250..0707e052 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -2902,6 +2902,10 @@ dwarf_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline() << "#endif"; s.op->newline(); + s.op->newline() << "#ifndef KRETACTIVE"; + s.op->newline() << "#define KRETACTIVE (max(15,6*NR_CPUS))"; + s.op->newline() << "#endif"; + // Forward declare the master entry functions s.op->newline() << "static int enter_kprobe_probe (struct kprobe *inst,"; s.op->line() << " struct pt_regs *regs);"; @@ -3060,7 +3064,7 @@ dwarf_derived_probe_group::emit_module_init (systemtap_session& s) s.op->newline() << "if (sdp->maxactive_p) {"; s.op->newline(1) << "kp->u.krp.maxactive = sdp->maxactive_val;"; s.op->newline(-1) << "} else {"; - s.op->newline(1) << "kp->u.krp.maxactive = max(10, 4*NR_CPUS);"; + s.op->newline(1) << "kp->u.krp.maxactive = KRETACTIVE;"; s.op->newline(-1) << "}"; s.op->newline() << "kp->u.krp.handler = &enter_kretprobe_probe;"; // to ensure safeness of bspcache, always use aggr_kprobe on ia64 @@ -4550,6 +4554,10 @@ kprobe_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline() << "#endif"; s.op->newline(); + s.op->newline() << "#ifndef KRETACTIVE"; + s.op->newline() << "#define KRETACTIVE (max(15,6*NR_CPUS))"; + s.op->newline() << "#endif"; + // Forward declare the master entry functions s.op->newline() << "static int enter_kprobe2_probe (struct kprobe *inst,"; s.op->line() << " struct pt_regs *regs);"; @@ -4695,7 +4703,7 @@ kprobe_derived_probe_group::emit_module_init (systemtap_session& s) s.op->newline() << "if (sdp->maxactive_p) {"; s.op->newline(1) << "kp->u.krp.maxactive = sdp->maxactive_val;"; s.op->newline(-1) << "} else {"; - s.op->newline(1) << "kp->u.krp.maxactive = max(10, 4*NR_CPUS);"; + s.op->newline(1) << "kp->u.krp.maxactive = KRETACTIVE;"; s.op->newline(-1) << "}"; s.op->newline() << "kp->u.krp.handler = &enter_kretprobe2_probe;"; // to ensure safeness of bspcache, always use aggr_kprobe on ia64 diff --git a/testsuite/buildok/thirtytwo.stp b/testsuite/buildok/thirtytwo.stp new file mode 100755 index 00000000..d97aa50b --- /dev/null +++ b/testsuite/buildok/thirtytwo.stp @@ -0,0 +1,10 @@ +#! /bin/sh + +stap -t -p4 -DKRETACTIVE=8888 -e ' +probe kprobe.function("sys_open").return {} +probe kprobe.function("sys_open").return.maxactive(100) {} +probe kernel.function("sys_open").return {} +probe kernel.function("sys_open").return.maxactive(100) {} +probe syscall.*.return {} +' + -- cgit From 5e3d7f3a3aa8d11b67e74de0c3d9187c323cbff2 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 15 Jun 2009 13:37:39 +0200 Subject: PR10274 Fix exelib -O3 testcase. The testcase now uses noinline, an empty asm statement and a volatile variable to prevent the function getting inlined, being totally unrolled or the recursive call being replaced with an inner-iteration. This does defeat part of the testcase though, which was testing unwinding through an optimized recursive function. But it seems the best we can do. * testsuite/systemtap.exelib/exelib.exp: Add -O3 to the mix. * testsuite/systemtap.exelib/uprobes_exe.c: Use volatile bar and mark main_func noinline. * testsuite/systemtap.exelib/uprobes_lib.c: Use volatile foo and mark lib_func noinline. --- testsuite/systemtap.exelib/exelib.exp | 3 +-- testsuite/systemtap.exelib/uprobes_exe.c | 17 +++++++++++++---- testsuite/systemtap.exelib/uprobes_lib.c | 17 +++++++++++++---- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/testsuite/systemtap.exelib/exelib.exp b/testsuite/systemtap.exelib/exelib.exp index 01ff1241..3d8710a3 100644 --- a/testsuite/systemtap.exelib/exelib.exp +++ b/testsuite/systemtap.exelib/exelib.exp @@ -44,8 +44,7 @@ foreach arch $arches { # Just try -O0 and -O3. # Adding -O, -O2, -Os and mixing lib/exe is a bit overdone - # BUG! -O2, -O3, -Os all break uname tests... - foreach opt {-O0} { + foreach opt {-O0 -O3} { foreach libprelink {no} { # BUG! "yes" breaks uname tests diff --git a/testsuite/systemtap.exelib/uprobes_exe.c b/testsuite/systemtap.exelib/uprobes_exe.c index b4811335..d2905637 100644 --- a/testsuite/systemtap.exelib/uprobes_exe.c +++ b/testsuite/systemtap.exelib/uprobes_exe.c @@ -12,18 +12,27 @@ // function from our library int lib_main (void); -void +// volatile static variable to prevent folding of main_func +static volatile int bar; + +// Marked noinline and has an empty asm statement to prevent inlining +// or optimizing away totally. +int +__attribute__((noinline)) main_func (int foo) { - if (foo > 1) - main_func (foo - 1); + asm (""); + if (foo - bar > 0) + bar = main_func (foo - bar); else lib_main(); + return bar; } int main (int argc, char *argv[], char *envp[]) { - main_func (3); + bar = 1; + bar = main_func (3); return 0; } diff --git a/testsuite/systemtap.exelib/uprobes_lib.c b/testsuite/systemtap.exelib/uprobes_lib.c index 25297b6b..072a1d61 100644 --- a/testsuite/systemtap.exelib/uprobes_lib.c +++ b/testsuite/systemtap.exelib/uprobes_lib.c @@ -7,15 +7,24 @@ * later version. */ -void +// volatile static variable to prevent folding of lib_func +static volatile int foo; + +// Marked noinline and has an empty asm statement to prevent inlining +// or optimizing away totally. +int +__attribute__((noinline)) lib_func (int bar) { - if (bar > 1) - lib_func (bar - 1); + asm (""); + if (bar - foo > 0) + foo = lib_func (bar - foo); + return foo; } void lib_main () { - lib_func (3); + foo = 1; + foo = lib_func (3); } -- cgit From cba30aa93a8836cd9f88b494c17bc991c997d5f2 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 15 Jun 2009 17:16:14 +0200 Subject: Add (disabled) testcase for stap probe marks to exelib. * testsuite/systemtap.exelib/exelib.exp: Compile against sdt.h. * testsuite/systemtap.exelib/uprobes_exe.c: Add main_count probe mark. * testsuite/systemtap.exelib/uprobes_lib.c: Add func_count probe mark. * testsuite/systemtap.exelib/mark.tcl: New test. * testsuite/systemtap.exelib/mark.stp: New test tapset. --- testsuite/systemtap.exelib/exelib.exp | 6 ++++-- testsuite/systemtap.exelib/mark.stp | 10 ++++++++++ testsuite/systemtap.exelib/mark.tcl | 11 +++++++++++ testsuite/systemtap.exelib/uprobes_exe.c | 3 ++- testsuite/systemtap.exelib/uprobes_lib.c | 3 +++ 5 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 testsuite/systemtap.exelib/mark.stp create mode 100644 testsuite/systemtap.exelib/mark.tcl diff --git a/testsuite/systemtap.exelib/exelib.exp b/testsuite/systemtap.exelib/exelib.exp index 3d8710a3..0a4ee8b0 100644 --- a/testsuite/systemtap.exelib/exelib.exp +++ b/testsuite/systemtap.exelib/exelib.exp @@ -3,7 +3,7 @@ # Then runs tests with a list of execs. set subtestlist {lib uname ustack cleanup} -#set subtestlist {uname} +#set subtestlist {mark} # Currently disabled, fails sep-debug case. proc seperate_debuginfo {elffile} { set objcopy [list "objcopy" "--only-keep-debug"] @@ -64,8 +64,10 @@ foreach arch $arches { } # General compiler flags + # We want the sdt.h from the source dir. + set testflags "additional_flags=-I$srcdir/../includes/sys" # For now we always require debuginfo - set testflags "additional_flags=-g" + set testflags "$testflags additional_flags=-g" if {$arch != "default"} { set testflags "$testflags additional_flags=$arch" } diff --git a/testsuite/systemtap.exelib/mark.stp b/testsuite/systemtap.exelib/mark.stp new file mode 100644 index 00000000..6b354dff --- /dev/null +++ b/testsuite/systemtap.exelib/mark.stp @@ -0,0 +1,10 @@ +// Markers probes in executable and shared library plus argument. +// Arguments: @1 uprobes_exe, @2 libuprobes_lib.so + +probe process(@1).mark("main_count") { + printf("main_count: %d\n", $arg1); +} + +probe process(@2).mark("func_count") { + printf("func_count: %d\n", $arg1); +} diff --git a/testsuite/systemtap.exelib/mark.tcl b/testsuite/systemtap.exelib/mark.tcl new file mode 100644 index 00000000..1f21aabc --- /dev/null +++ b/testsuite/systemtap.exelib/mark.tcl @@ -0,0 +1,11 @@ +set ::result_string {main_count: 3 +main_count: 2 +main_count: 1 +func_count: 3 +func_count: 2 +func_count: 1} + +# Only run on make installcheck +if {! [installtest_p]} { untested "lib-$testname"; return } +if {! [utrace_p]} { untested "lib-$testname"; return } +stap_run3 mark-$testname $srcdir/$subdir/mark.stp $testexe $testlib -c $testexe diff --git a/testsuite/systemtap.exelib/uprobes_exe.c b/testsuite/systemtap.exelib/uprobes_exe.c index d2905637..da65efa7 100644 --- a/testsuite/systemtap.exelib/uprobes_exe.c +++ b/testsuite/systemtap.exelib/uprobes_exe.c @@ -7,7 +7,7 @@ * later version. */ -#include +#include "sdt.h" /* Really , but pick current source version. */ // function from our library int lib_main (void); @@ -22,6 +22,7 @@ __attribute__((noinline)) main_func (int foo) { asm (""); + STAP_PROBE1(test, main_count, foo); if (foo - bar > 0) bar = main_func (foo - bar); else diff --git a/testsuite/systemtap.exelib/uprobes_lib.c b/testsuite/systemtap.exelib/uprobes_lib.c index 072a1d61..e3416d17 100644 --- a/testsuite/systemtap.exelib/uprobes_lib.c +++ b/testsuite/systemtap.exelib/uprobes_lib.c @@ -7,6 +7,8 @@ * later version. */ +#include "sdt.h" /* Really , but pick current source version. */ + // volatile static variable to prevent folding of lib_func static volatile int foo; @@ -17,6 +19,7 @@ __attribute__((noinline)) lib_func (int bar) { asm (""); + STAP_PROBE1(test, func_count, bar); if (bar - foo > 0) foo = lib_func (bar - foo); return foo; -- cgit From d438dd9bc070216016e02f4958fe9dea571712c9 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 15 Jun 2009 17:47:36 +0200 Subject: PR10285. User space PROBE marks aren't found with separate debuginfo. The original logic was a little confused. It could end up searching the separate debuginfo twice instead of falling back to the main elf file. Now we explicitly search the main elf file first (where the .probes section really should be) and only then fall back to the separate debuginfo file. * tapsets.cxx (dwarf_builder::probe_table::probe_table): Search main elf file first, then fall back on separate debuginfo file if necessary. * testsuite/systemtap.exelib/exelib.exp: Enable mark.tcl testcase. main elf file or the debuginfo file, but would interpret --- tapsets.cxx | 16 +++++++--------- testsuite/systemtap.exelib/exelib.exp | 3 +-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index 0707e052..79a7aa93 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -692,8 +692,8 @@ dwarf_builder::probe_table::probe_table(string& mark_name, systemtap_session & s Dwarf_Addr bias; size_t shstrndx; - elf = (dwarf_getelf (dwfl_module_getdwarf (dw->module, &bias)) - ?: dwfl_module_getelf (dw->module, &bias)); + // Explicitly look in the main elf file first. + elf = dwfl_module_getelf (dw->module, &bias); Elf_Scn *probe_scn = NULL; dwfl_assert ("getshstrndx", elf_getshstrndx (elf, &shstrndx)); @@ -713,17 +713,15 @@ dwarf_builder::probe_table::probe_table(string& mark_name, systemtap_session & s } } - if (!have_probes) - return; - // Older versions put .probes section in the debuginfo dwarf file, - // so check if it actually exists, if not take the main elf file - if (have_probes && shdr->sh_type == SHT_NOBITS) + // so check if it actually exists, if not take a look in the debuginfo file + if (! have_probes || (have_probes && shdr->sh_type == SHT_NOBITS)) { - elf = dwfl_module_getelf (dw->module, &bias); + elf = dwarf_getelf (dwfl_module_getdwarf (dw->module, &bias)); + if (! elf) + return; dwfl_assert ("getshstrndx", elf_getshstrndx (elf, &shstrndx)); probe_scn = NULL; - have_probes = false; while ((probe_scn = elf_nextscn (elf, probe_scn))) { shdr = gelf_getshdr (probe_scn, &shdr_mem); diff --git a/testsuite/systemtap.exelib/exelib.exp b/testsuite/systemtap.exelib/exelib.exp index 0a4ee8b0..960ebbfa 100644 --- a/testsuite/systemtap.exelib/exelib.exp +++ b/testsuite/systemtap.exelib/exelib.exp @@ -2,8 +2,7 @@ # (with gcc/g++, -O0/-O3, prelinked/pie, seperate debuginfo) # Then runs tests with a list of execs. -set subtestlist {lib uname ustack cleanup} -#set subtestlist {mark} # Currently disabled, fails sep-debug case. +set subtestlist {lib mark uname ustack cleanup} proc seperate_debuginfo {elffile} { set objcopy [list "objcopy" "--only-keep-debug"] -- cgit From 5111fc3e27f24347f61db6465da934a19b553ee6 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Mon, 15 Jun 2009 12:16:17 -0400 Subject: Add experimental utrace/kprobe sdt support * sdt.h (EXPERIMENTAL_UTRACE_SDT, EXPERIMENTAL_KPROBE_SDT): New probe point macros. * dtrace: Add support for creating type debug info, currently invoked with --types. * tapsets.cxx (probe_table::convert_probe): New. (probe_table::convert_location): New. (dwarf_builder::build): Use it to simplify probe point handling. * sdt.exp (pbtype_flags, pbtype_mssgs): New to also test kprobe and utrace. * static_uprobes.exp (pbtype_flags, pbtype_mssgs): New to also test kprobe and utrace. --- dtrace | 79 ++++-- includes/sys/sdt.h | 408 +++++++++++++++++++--------- tapsets.cxx | 230 ++++++++-------- testsuite/systemtap.base/sdt.exp | 37 ++- testsuite/systemtap.base/sdt_types.stp | 4 +- testsuite/systemtap.base/static_uprobes.exp | 99 ++++--- 6 files changed, 557 insertions(+), 300 deletions(-) diff --git a/dtrace b/dtrace index a2b495b2..cdc97c57 100755 --- a/dtrace +++ b/dtrace @@ -12,54 +12,75 @@ # Public License (GPL); either version 2, or (at your option) any # later version. -import os,posix,sys +import os,posix,string,sys from subprocess import call from tempfile import mkstemp class provider: - def open(self, provider, header): + def typedef_append(self, typedefs,this_probe,arg,c): + if (add_typedefs): + split_arg = arg.rsplit(None,1) + type_name = " %s_arg%d" % (this_probe.replace("__","_"),c) + if (len(split_arg) > 1): + typedefs += ("typedef " + arg.replace(" " + split_arg[1].split("[")[0].lstrip("*"),type_name).strip() + "; ") + typedefs += (type_name + type_name + "_v;\n") + else: + typedefs += ("typedef " + arg.strip() + type_name + "; ") + typedefs += (type_name + type_name + "_v;\n") + return typedefs + def generate(self, provider, header, add_typedefs): have_provider = False self.f = open(provider) self.h = open(header,mode='w') self.h.write("/* Generated by the Systemtap dtrace wrapper */\n") self.h.write("\n#include \n\n") in_comment = False + typedefs = "" while (True): line = self.f.readline() if (line == ""): break - if (line.find("/*") >= 0): + if (line.find("/*") != -1): in_comment = True - if (line.find("*/") >= 0): + if (line.find("*/") != -1): in_comment = False continue if (in_comment): continue - if (line.find("provider") >= 0): + if (line.find("provider") != -1): tokens = line.split() have_provider = True self.provider = tokens[1] - elif (have_provider and line.find("probe ") > 0): + elif (not have_provider): + if (add_typedefs): + self.h.write (line) + elif (have_provider and line.find("probe ") != -1): while (line.find(")") < 0): line += self.f.readline() this_probe = line[line.find("probe ")+5:line.find("(")].strip() this_probe_canon = self.provider.upper() + "_" + this_probe.replace("__","_").upper() args = (line[line.find("(")+1:line.find(")")]) - new_args = "" + args_string = "" + arg = "" i = 0 c = 0 while (i < len(args)): if (args[i:i+1] == ","): - new_args = ('%s%s' % (new_args, args[i])) + args_string = ('%s %s,' % (args_string, arg.strip())) c += 1 + typedefs = self.typedef_append (typedefs,this_probe,arg,c) + arg = "" else: - new_args = new_args + args[i] + arg = arg + args[i] i += 1 - if (len(new_args) == 0): + if (i != 0): + args_string = ('%s %s' % (args_string, arg.strip())) + if (len(args_string) == 0): c = 0 stap_str = "STAP_PROBE(provider,%s" % (this_probe) else: c += 1 + typedefs = self.typedef_append (typedefs,this_probe,arg,c) stap_str = "STAP_PROBE%d(provider,%s" % (c,this_probe) define_str = "#define %s(" % (this_probe_canon) i = 1 @@ -69,13 +90,28 @@ class provider: define_str = define_str + "arg%s" % (i); stap_str = stap_str + ",arg%s" % (i); i += 1 - self.h.write ('/* %s (%s) */\n' % (this_probe_canon,new_args)) + self.h.write ('/* %s (%s) */\n' % (this_probe_canon,args_string)) self.h.write ('#define %s_ENABLED() 1\n' % this_probe_canon) self.h.write (define_str + ") \\\n") self.h.write (stap_str + ")\n\n") + elif (line.find("}") != -1 and have_provider): + have_provider = False + if (add_typedefs): + self.h.write (typedefs) + self.h.close() + def usage (): - print "Usage " + sys.argv[0] + " [-h | -G] -s File.d -o File {Files}" + print "Usage " + sys.argv[0] + " [--help] [-h | -G] -s File.d [-o File]" + +def help (): + usage() + print "Where -h builds a systemtap header file from the .d file" + print " -o specifies an explicit output file name," + print " The default for -G is file.o and -h is file.h" + print " -s specifies the name of the .d input file" + print " -G builds a stub file.o from file.d," + print " which is required by some packages that use dtrace." sys.exit(1) def open_file (arg): @@ -95,10 +131,12 @@ def open_file (arg): if (len (sys.argv) < 2): usage() + sys.exit(1) i = 1 build_header = False build_source = False +add_typedefs = False filename = "" while (i < len (sys.argv)): if (sys.argv[i] == "-o"): @@ -110,7 +148,12 @@ while (i < len (sys.argv)): elif (sys.argv[i] == "-h"): build_header = True elif (sys.argv[i] == "-G"): + build_header = True build_source = True + elif (sys.argv[i] == "--types"): + add_typedefs = True + elif (sys.argv[i] == "--help"): + help() i += 1 if (build_header == False and build_source == False): usage() @@ -120,23 +163,19 @@ if (filename == ""): if (s_filename != ""): (filename,ext) = os.path.splitext(s_filename) filename = os.path.basename(filename) - if (build_header): - filename = filename + ".h" - elif (build_source): - filename = filename + ".o" else: usage sys.exit(1) if (build_header): providers = provider() - providers.open(s_filename, filename) -elif (build_source): + providers.generate(s_filename, filename + ".h", add_typedefs) +if (build_source): (basename,ext) = os.path.splitext(s_filename) basename = os.path.basename(basename) (d,fn) = mkstemp(suffix=".c",prefix=basename) f = open(fn,mode='w') - f.write("static __dtrace () {}\n") + f.write("#include \"" + filename + ".h\"\nstatic __dtrace () {}\n") f.close() - call(["gcc", "-fPIC", "-c", fn, "-o", filename], shell=False) + call(["gcc", "-fPIC", "-I.", "-g", "-c", fn, "-o", filename + ".o"], shell=False) os.remove(fn) diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h index fd2c55fb..10639d9c 100644 --- a/includes/sys/sdt.h +++ b/includes/sys/sdt.h @@ -12,6 +12,8 @@ #include #include +#include + #ifdef __LP64__ #define STAP_PROBE_ADDR "\t.quad " @@ -20,20 +22,22 @@ #endif /* An allocated section .probes that holds the probe names and addrs. */ -#define STAP_PROBE_DATA_(probe) \ +#define STAP_PROBE_DATA_(probe,guard,arg) \ __asm__ volatile (".section .probes, \"a\"\n" \ - "\t.align 8\n" \ + "\t.align 8\n" \ "1:\n\t.asciz " #probe "\n" \ - "\t.align 4\n" \ - "\t.int 0x31425250\n" \ - "\t.align 8\n" \ - STAP_PROBE_ADDR "1b\n" \ - "\t.align 8\n" \ - STAP_PROBE_ADDR "2f\n" \ + "\t.align 4\n" \ + "\t.int " #guard "\n" \ + "\t.align 8\n" \ + STAP_PROBE_ADDR "1b\n" \ + "\t.align 8\n" \ + STAP_PROBE_ADDR #arg "\n" \ "\t.previous\n") -#define STAP_PROBE_DATA(probe) \ - STAP_PROBE_DATA_(#probe) +#define STAP_PROBE_DATA(probe, guard, arg) \ + STAP_PROBE_DATA_(#probe,guard,arg) + +#if ! (defined EXPERIMENTAL_UTRACE_SDT || defined EXPERIMENTAL_KPROBE_SDT) /* These baroque macros are used to create a unique label. */ #define STAP_CONCAT(a,b) a ## b @@ -59,174 +63,331 @@ #define STAP_UNINLINE_LABEL(label) \ __extension__ static volatile long labelval __attribute__ ((unused)) = (long) &&label -#if defined(__x86_64__) || defined(__i386__) || defined(__powerpc__) +#if defined __x86_64__ || defined __i386__ || defined __powerpc__ #define STAP_NOP "\tnop " #else #define STAP_NOP "\tnop 0 " #endif +#define STAP_UPROBE_GUARD 0x31425250 + #define STAP_PROBE_(probe) \ do { \ - STAP_PROBE_DATA(probe); \ + STAP_PROBE_DATA(probe,STAP_UPROBE_GUARD,2f); \ __asm__ volatile ("2:\n" \ STAP_NOP); \ } while (0) -#define STAP_PROBE1_(probe,label,parm1) \ -do { \ - STAP_UNINLINE_LABEL(label); \ - volatile __typeof__((parm1)) arg1 = parm1; \ - STAP_UNINLINE; \ - STAP_PROBE_DATA(probe); \ +#define STAP_PROBE1_(probe,label,parm1) \ +do { \ + STAP_UNINLINE_LABEL(label); \ + volatile __typeof__((parm1)) arg1 = parm1; \ + STAP_UNINLINE; \ + STAP_PROBE_DATA(probe,STAP_UPROBE_GUARD,2f); \ label: \ - __asm__ volatile ("2:\n" \ + __asm__ volatile ("2:\n" \ STAP_NOP "/* %0 */" :: "g"(arg1)); \ } while (0) -#define STAP_PROBE2_(probe,label,parm1,parm2) \ -do { \ - STAP_UNINLINE_LABEL(label); \ - volatile __typeof__((parm1)) arg1 = parm1; \ - volatile __typeof__((parm2)) arg2 = parm2; \ - STAP_UNINLINE; \ - STAP_PROBE_DATA(probe); \ - label: \ +#define STAP_PROBE2_(probe,label,parm1,parm2) \ +do { \ + STAP_UNINLINE_LABEL(label); \ + volatile __typeof__((parm1)) arg1 = parm1; \ + volatile __typeof__((parm2)) arg2 = parm2; \ + STAP_UNINLINE; \ + STAP_PROBE_DATA(probe,STAP_UPROBE_GUARD,2f); \ + label: \ __asm__ volatile ("2:\n" \ STAP_NOP "/* %0 %1 */" :: "g"(arg1), "g"(arg2)); \ } while (0) -#define STAP_PROBE3_(probe,label,parm1,parm2,parm3) \ -do { \ - STAP_UNINLINE_LABEL(label); \ - volatile __typeof__((parm1)) arg1 = parm1; \ - volatile __typeof__((parm2)) arg2 = parm2; \ - volatile __typeof__((parm3)) arg3 = parm3; \ - STAP_UNINLINE; \ - STAP_PROBE_DATA(probe); \ - label: \ +#define STAP_PROBE3_(probe,label,parm1,parm2,parm3) \ +do { \ + STAP_UNINLINE_LABEL(label); \ + volatile __typeof__((parm1)) arg1 = parm1; \ + volatile __typeof__((parm2)) arg2 = parm2; \ + volatile __typeof__((parm3)) arg3 = parm3; \ + STAP_UNINLINE; \ + STAP_PROBE_DATA(probe,STAP_UPROBE_GUARD,2f); \ + label: \ __asm__ volatile ("2:\n" \ STAP_NOP "/* %0 %1 %2 */" :: "g"(arg1), "g"(arg2), "g"(arg3)); \ } while (0) -#define STAP_PROBE4_(probe,label,parm1,parm2,parm3,parm4) \ -do { \ - STAP_UNINLINE_LABEL(label); \ - volatile __typeof__((parm1)) arg1 = parm1; \ - volatile __typeof__((parm2)) arg2 = parm2; \ - volatile __typeof__((parm3)) arg3 = parm3; \ - volatile __typeof__((parm4)) arg4 = parm4; \ - STAP_UNINLINE; \ - STAP_PROBE_DATA(probe); \ - label: \ +#define STAP_PROBE4_(probe,label,parm1,parm2,parm3,parm4) \ +do { \ + STAP_UNINLINE_LABEL(label); \ + volatile __typeof__((parm1)) arg1 = parm1; \ + volatile __typeof__((parm2)) arg2 = parm2; \ + volatile __typeof__((parm3)) arg3 = parm3; \ + volatile __typeof__((parm4)) arg4 = parm4; \ + STAP_UNINLINE; \ + STAP_PROBE_DATA(probe,STAP_UPROBE_GUARD,2f); \ + label: \ __asm__ volatile ("2:\n" \ STAP_NOP "/* %0 %1 %2 %3 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4)); \ } while (0) -#define STAP_PROBE5_(probe,label,parm1,parm2,parm3,parm4,parm5) \ -do { \ - STAP_UNINLINE_LABEL(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_UNINLINE; \ - STAP_PROBE_DATA(probe); \ - label: \ +#define STAP_PROBE5_(probe,label,parm1,parm2,parm3,parm4,parm5) \ +do { \ + STAP_UNINLINE_LABEL(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_UNINLINE; \ + STAP_PROBE_DATA(probe,STAP_UPROBE_GUARD,2f); \ + label: \ __asm__ volatile ("2:\n" \ STAP_NOP "/* %0 %1 %2 %3 %4 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5)); \ } while (0) #define STAP_PROBE6_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6) \ -do { \ - STAP_UNINLINE_LABEL(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_UNINLINE; \ - STAP_PROBE_DATA(probe); \ - label: \ +do { \ + STAP_UNINLINE_LABEL(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_UNINLINE; \ + STAP_PROBE_DATA(probe,STAP_UPROBE_GUARD,2f); \ + label: \ __asm__ volatile ("2:\n" \ STAP_NOP "/* %0 %1 %2 %3 %4 %5 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6)); \ } while (0) -#define STAP_PROBE7_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \ -do { \ - STAP_UNINLINE_LABEL(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_UNINLINE; \ - STAP_PROBE_DATA(probe); \ - label: \ +#define STAP_PROBE7_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \ +do { \ + STAP_UNINLINE_LABEL(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_UNINLINE; \ + STAP_PROBE_DATA(probe,STAP_UPROBE_GUARD,2f); \ + label: \ __asm__ volatile ("2:\n" \ STAP_NOP "/* %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,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) \ -do { \ - STAP_UNINLINE_LABEL(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_UNINLINE; \ - STAP_PROBE_DATA(probe); \ - label: \ +do { \ + STAP_UNINLINE_LABEL(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_UNINLINE; \ + STAP_PROBE_DATA(probe,STAP_UPROBE_GUARD,2f); \ + label: \ __asm__ volatile ("2:\n" \ STAP_NOP "/* %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,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \ -do { \ - STAP_UNINLINE_LABEL(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_UNINLINE; \ - STAP_PROBE_DATA(probe); \ - label: \ +do { \ + STAP_UNINLINE_LABEL(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_UNINLINE; \ + STAP_PROBE_DATA(probe,STAP_UPROBE_GUARD,2f); \ + label: \ __asm__ volatile ("2:\n" \ STAP_NOP "/* %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,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10) \ -do { \ - STAP_UNINLINE_LABEL(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_UNINLINE; \ - STAP_PROBE_DATA(probe); \ - label: \ +do { \ + STAP_UNINLINE_LABEL(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_UNINLINE; \ + STAP_PROBE_DATA(probe,STAP_UPROBE_GUARD,2f); \ + label: \ __asm__ volatile ("2:\n" \ STAP_NOP "/* %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) +#else /* ! (defined EXPERIMENTAL_UTRACE_SDT || defined EXPERIMENTAL_KPROBE_SDT) */ +#include +#include +# if defined (__USE_ANSI) +extern long int syscall (long int __sysno, ...) __THROW; +# endif +# if defined EXPERIMENTAL_KPROBE_SDT +# define STAP_SYSCALL __NR_getegid +# define STAP_GUARD 0x32425250 +# define GETTID 0 +# elif defined EXPERIMENTAL_UTRACE_SDT +# define STAP_SYSCALL 0xbead +# define STAP_GUARD 0x33425250 +# define GETTID syscall(SYS_gettid) +# endif + +#include + +#define STAP_PROBE_(probe) \ +do { \ + STAP_PROBE_DATA(probe,STAP_SYSCALL,0); \ + syscall (STAP_SYSCALL, #probe, GETTID); \ + } while (0) + +#define STAP_PROBE1_(probe,label,parm1) \ +do { \ + STAP_PROBE_DATA(probe,STAP_GUARD,1); \ + syscall (STAP_SYSCALL, #probe, GETTID, parm1); \ + } while (0) + +#define STAP_PROBE2_(probe,label,parm1,parm2) \ +do { \ + __extension__ struct {size_t arg1 __attribute__((aligned(8))); \ + size_t arg2 __attribute__((aligned(8)));} \ + stap_probe2_args = {(size_t)parm1, (size_t)parm2}; \ + STAP_PROBE_DATA(probe,STAP_GUARD,2); \ + syscall (STAP_SYSCALL, #probe, GETTID, &stap_probe2_args); \ + } while (0) + +#define STAP_PROBE3_(probe,label,parm1,parm2,parm3) \ +do { \ + __extension__ struct {size_t arg1 __attribute__((aligned(8))); \ + size_t arg2 __attribute__((aligned(8))); \ + size_t arg3 __attribute__((aligned(8)));} \ + stap_probe3_args = {(size_t)parm1, (size_t)parm2, (size_t)parm3}; \ + STAP_PROBE_DATA(probe,STAP_GUARD,3); \ + syscall (STAP_SYSCALL, #probe, GETTID, &stap_probe3_args); \ + } while (0) + +#define STAP_PROBE4_(probe,label,parm1,parm2,parm3,parm4) \ +do { \ + __extension__ struct {size_t arg1 __attribute__((aligned(8))); \ + size_t arg2 __attribute__((aligned(8))); \ + size_t arg3 __attribute__((aligned(8))); \ + size_t arg4 __attribute__((aligned(8)));} \ + stap_probe4_args = {(size_t)parm1, (size_t)parm2, (size_t)parm3, (size_t)parm4}; \ + STAP_PROBE_DATA(probe,STAP_GUARD,4); \ + syscall (STAP_SYSCALL, #probe, GETTID,&stap_probe4_args); \ + } while (0) + +#define STAP_PROBE5_(probe,label,parm1,parm2,parm3,parm4,parm5) \ +do { \ + __extension__ struct {size_t arg1 __attribute__((aligned(8))); \ + size_t arg2 __attribute__((aligned(8))); \ + size_t arg3 __attribute__((aligned(8))); \ + size_t arg4 __attribute__((aligned(8))); \ + size_t arg5 __attribute__((aligned(8)));} \ + stap_probe5_args = {(size_t)parm1, (size_t)parm2, (size_t)parm3, (size_t)parm4, \ + (size_t)parm5}; \ + STAP_PROBE_DATA(probe,STAP_GUARD,5); \ + syscall (STAP_SYSCALL, #probe, GETTID, &stap_probe5_args); \ + } while (0) + +#define STAP_PROBE6_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6) \ +do { \ + __extension__ struct {size_t arg1 __attribute__((aligned(8))); \ + size_t arg2 __attribute__((aligned(8))); \ + size_t arg3 __attribute__((aligned(8))); \ + size_t arg4 __attribute__((aligned(8))); \ + size_t arg5 __attribute__((aligned(8))); \ + size_t arg6 __attribute__((aligned(8)));} \ + stap_probe6_args = {(size_t)parm1, (size_t)parm2, (size_t)parm3, (size_t)parm4, \ + (size_t)parm5, (size_t)parm6}; \ + STAP_PROBE_DATA(probe,STAP_GUARD,6); \ + syscall (STAP_SYSCALL, #probe, GETTID, &stap_probe6_args); \ + } while (0) + +#define STAP_PROBE7_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \ +do { \ + __extension__ struct {size_t arg1 __attribute__((aligned(8))); \ + size_t arg2 __attribute__((aligned(8))); \ + size_t arg3 __attribute__((aligned(8))); \ + size_t arg4 __attribute__((aligned(8))); \ + size_t arg5 __attribute__((aligned(8))); \ + size_t arg6 __attribute__((aligned(8))); \ + size_t arg7 __attribute__((aligned(8)));} \ + stap_probe7_args = {(size_t)parm1, (size_t)parm2, (size_t)parm3, (size_t)parm4, \ + (size_t)parm5, (size_t)parm6, (size_t)parm7}; \ + STAP_PROBE_DATA(probe,STAP_GUARD,7); \ + syscall (STAP_SYSCALL, #probe, GETTID, &stap_probe7_args); \ + } while (0) + +#define STAP_PROBE8_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) \ +do { \ + __extension__ struct {size_t arg1 __attribute__((aligned(8))); \ + size_t arg2 __attribute__((aligned(8))); \ + size_t arg3 __attribute__((aligned(8))); \ + size_t arg4 __attribute__((aligned(8))); \ + size_t arg5 __attribute__((aligned(8))); \ + size_t arg6 __attribute__((aligned(8))); \ + size_t arg7 __attribute__((aligned(8))); \ + size_t arg8 __attribute__((aligned(8)));} \ + stap_probe8_args = {(size_t)parm1, (size_t)parm2, (size_t)parm3, (size_t)parm4, \ + (size_t)parm5, (size_t)parm6, (size_t)parm7, (size_t)parm8}; \ + STAP_PROBE_DATA(probe,STAP_GUARD,8); \ + syscall (STAP_SYSCALL, #probe, GETTID, &stap_probe8_args); \ + } while (0) + +#define STAP_PROBE9_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \ +do { \ + __extension__ struct {size_t arg1 __attribute__((aligned(8))); \ + size_t arg2 __attribute__((aligned(8))); \ + size_t arg3 __attribute__((aligned(8))); \ + size_t arg4 __attribute__((aligned(8))); \ + size_t arg5 __attribute__((aligned(8))); \ + size_t arg6 __attribute__((aligned(8))); \ + size_t arg7 __attribute__((aligned(8))); \ + size_t arg8 __attribute__((aligned(8))); \ + size_t arg9 __attribute__((aligned(8)));} \ + stap_probe9_args = {(size_t)parm1, (size_t)parm2, (size_t)parm3, (size_t)parm4, \ + (size_t)parm5, (size_t)parm6, (size_t)parm7, (size_t)parm8, (size_t)parm9}; \ + STAP_PROBE_DATA(probe,STAP_GUARD,9); \ + syscall (STAP_SYSCALL, #probe, GETTID, &stap_probe9_args); \ + } while (0) + +#define STAP_PROBE10_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10) \ +do { \ + __extension__ struct {size_t arg1 __attribute__((aligned(8))); \ + size_t arg2 __attribute__((aligned(8))); \ + size_t arg3 __attribute__((aligned(8))); \ + size_t arg4 __attribute__((aligned(8))); \ + size_t arg5 __attribute__((aligned(8))); \ + size_t arg6 __attribute__((aligned(8))); \ + size_t arg7 __attribute__((aligned(8))); \ + size_t arg8 __attribute__((aligned(8))); \ + size_t arg9 __attribute__((aligned(8))); \ + size_t arg10 __attribute__((aligned(8)));} \ + stap_probe10_args = {(size_t)parm1, (size_t)parm2, (size_t)parm3, (size_t)parm4, \ + (size_t)parm5, (size_t)parm6, (size_t)parm7, (size_t)parm8, (size_t)parm9, (size_t)parm10}; \ + STAP_PROBE_DATA(probe,STAP_GUARD,10); \ + syscall (STAP_SYSCALL, #probe, GETTID, &stap_probe10_args); \ + } while (0) + +#endif + #define STAP_PROBE(provider,probe) \ STAP_PROBE_(probe) #define STAP_PROBE1(provider,probe,parm1) \ @@ -270,5 +431,6 @@ STAP_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7) STAP_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) #define DTRACE_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \ STAP_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) + #endif /* sys/sdt.h */ diff --git a/tapsets.cxx b/tapsets.cxx index 79a7aa93..0da61d9e 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -672,6 +672,8 @@ struct dwarf_builder: public derived_probe_builder string probe_name; probe_table(string & mark_name, systemtap_session & sess, dwflpp * dw); bool get_next_probe(); + void convert_probe(probe *new_base); + void convert_location(probe *new_base, probe_point *new_location); private: bool have_probes; @@ -800,6 +802,113 @@ dwarf_builder::probe_table::get_next_probe() return false; } + +void +dwarf_builder::probe_table::convert_probe (probe *new_base) +{ + block *b = ((block*)(new_base->body)); + if (probe_type == utrace_type) + { + // Generate: if ($syscall != 0xbead) next; + if_statement *issc = new if_statement; + issc->thenblock = new next_statement; + issc->elseblock = NULL; + issc->tok = new_base->body->tok; + comparison *besc = new comparison; + besc->op = "!="; + besc->tok = new_base->body->tok; + functioncall* n = new functioncall; + n->tok = new_base->body->tok; + n->function = "_utrace_syscall_nr"; + n->referent = 0; + besc->left = n; + literal_number* fake_syscall = new literal_number(0xbead); + fake_syscall->tok = new_base->body->tok; + besc->right = fake_syscall; + issc->condition = besc; + b->statements.insert(b->statements.begin(),(statement*) issc); + + // Generate: if (ulong_arg(2) != task_tid(task_current())) next; + if_statement *istid = new if_statement; + istid->thenblock = new next_statement; + istid->elseblock = NULL; + istid->tok = new_base->body->tok; + comparison *betid = new comparison; + betid->op = "!="; + betid->tok = new_base->body->tok; + functioncall* task_tid = new functioncall; + task_tid->tok = new_base->body->tok; + task_tid->function = "task_tid"; + task_tid->referent = 0; + functioncall* task_current = new functioncall; + task_current->tok = new_base->body->tok; + task_current->function = "task_current"; + task_current->referent = 0; + task_tid->args.push_back(task_current); + betid->left = task_tid; + functioncall *arg2tid = new functioncall; + arg2tid->tok = new_base->body->tok; + arg2tid->function = "ulong_arg"; + arg2tid->tok = new_base->body->tok; + literal_number* littid = new literal_number(2); + littid->tok = new_base->body->tok; + arg2tid->args.push_back(littid); + + betid->right = arg2tid; + istid->condition = betid; + b->statements.insert(b->statements.begin(),(statement*) istid); + } + + // Generate: if (arg1 != mark("label")) next; + functioncall *fc = new functioncall; + fc->function = "ulong_arg"; + fc->tok = new_base->body->tok; + literal_number* num = new literal_number(1); + num->tok = new_base->body->tok; + fc->args.push_back(num); + + functioncall *fcus = new functioncall; + fcus->function = "user_string"; + fcus->type = pe_string; + fcus->tok = new_base->body->tok; + fcus->args.push_back(fc); + + if_statement *is = new if_statement; + is->thenblock = new next_statement; + is->elseblock = NULL; + is->tok = new_base->body->tok; + comparison *be = new comparison; + be->op = "!="; + be->tok = new_base->body->tok; + be->left = fcus; + be->right = new literal_string(mark_name); + is->condition = be; + b->statements.insert(b->statements.begin(),(statement*) is); +} + + +void +dwarf_builder::probe_table::convert_location (probe *new_base, + probe_point *new_location) +{ + if (probe_type == kprobe_type) + { + new_location->components[0]->functor = "kernel"; + new_location->components[0]->arg = NULL; + new_location->components[1]->functor = "function"; + new_location->components[1]->arg = new literal_string("*getegid*"); + new_base->locations.push_back(new_location); + } + else if (probe_type == utrace_type) + { + // process("executable").syscall + new_location->components[1]->functor = "syscall"; + new_location->components[1]->arg = NULL; + new_base->locations.push_back(new_location); + } +} + + dwarf_query::dwarf_query(systemtap_session & sess, probe * base_probe, probe_point * base_loc, @@ -3234,12 +3343,13 @@ sdt_var_expanding_visitor::visit_target_symbol (target_symbol *e) bool lvalue = is_active_lvalue(e); functioncall *fc = new functioncall; - if (arg_count < 6) + // First two args are hidden: 1. pointer to probe name 2. task id + if (arg_count < 2) { fc->function = "ulong_arg"; fc->type = pe_long; fc->tok = e->tok; - literal_number* num = new literal_number(argno + 1); + literal_number* num = new literal_number(argno + 2); num->tok = e->tok; fc->args.push_back(num); } @@ -3252,7 +3362,7 @@ sdt_var_expanding_visitor::visit_target_symbol (target_symbol *e) functioncall *get_arg1 = new functioncall; get_arg1->function = "pointer_arg"; get_arg1->tok = e->tok; - literal_number* num = new literal_number(2); + literal_number* num = new literal_number(3); num->tok = e->tok; get_arg1->args.push_back(num); @@ -3365,62 +3475,8 @@ dwarf_builder::build(systemtap_session & sess, return; } - else if (probe_table.probe_type == probe_table.kprobe_type) - { - do - { - probe *new_base = new probe; - *new_base = *base; - - new_base->body = deep_copy_visitor::deep_copy(base->body); - probe_point *new_location = new probe_point; - *new_location = *location; - new_base->locations.clear(); - - block *b = ((block*)(new_base->body)); - functioncall *fc = new functioncall; - fc->function = "ulong_arg"; - fc->tok = new_base->body->tok; - literal_number* num = new literal_number(1); - num->tok = new_base->body->tok; - fc->args.push_back(num); - - functioncall *fcus = new functioncall; - fcus->function = "user_string"; - fcus->type = pe_string; - fcus->tok = new_base->body->tok; - fcus->args.push_back(fc); - - // Generate: if (arg1 != mark("label")) next; - if_statement *is = new if_statement; - is->thenblock = new next_statement; - is->elseblock = NULL; - is->tok = new_base->body->tok; - comparison *be = new comparison; - be->op = "!="; - be->tok = new_base->body->tok; - be->left = fcus; - be->right = new literal_string(probe_table.mark_name); - is->condition = be; - b->statements.insert(b->statements.begin(),(statement*) is); - - // Now expand the local variables in the probe body - sdt_var_expanding_visitor svv (module_name, probe_table.mark_name, - probe_table.probe_arg, true); - new_base->body = svv.require (new_base->body); - new_location->components[0]->functor = "kernel"; - new_location->components[0]->arg = NULL; - new_location->components[1]->functor = "function"; - new_location->components[1]->arg = new literal_string("*getegid*"); - new_base->locations.push_back(new_location); - - derive_probes(sess, new_base, finished_results); - } - while (probe_table.get_next_probe()); - return; - } - - else if (probe_table.probe_type == probe_table.utrace_type) + else if (probe_table.probe_type == probe_table.kprobe_type + || probe_table.probe_type == probe_table.utrace_type) { do { @@ -3432,63 +3488,13 @@ dwarf_builder::build(systemtap_session & sess, *new_location = *location; new_base->locations.clear(); - block *b = ((block*)(new_base->body)); - - // Generate: if ($syscall != 0xbead) next; - if_statement *issc = new if_statement; - issc->thenblock = new next_statement; - issc->elseblock = NULL; - issc->tok = new_base->body->tok; - comparison *besc = new comparison; - besc->op = "!="; - besc->tok = new_base->body->tok; - functioncall* n = new functioncall; - n->tok = new_base->body->tok; - n->function = "_utrace_syscall_nr"; - n->referent = 0; // NB: must not resolve yet, to ensure inclusion in session - besc->left = n; - literal_number* fake_syscall = new literal_number(0xbead); - fake_syscall->tok = new_base->body->tok; - besc->right = fake_syscall; - issc->condition = besc; - b->statements.insert(b->statements.begin(),(statement*) issc); - - functioncall *fc = new functioncall; - fc->function = "ulong_arg"; - fc->tok = new_base->body->tok; - literal_number* num = new literal_number(1); - num->tok = new_base->body->tok; - fc->args.push_back(num); - - functioncall *fcus = new functioncall; - fcus->function = "user_string"; - fcus->type = pe_string; - fcus->tok = new_base->body->tok; - fcus->args.push_back(fc); - - // Generate: if (arg1 != mark("label")) next; - if_statement *is = new if_statement; - is->thenblock = new next_statement; - is->elseblock = NULL; - is->tok = new_base->body->tok; - comparison *be = new comparison; - be->op = "!="; - be->tok = new_base->body->tok; - be->left = fcus; - be->right = new literal_string(probe_table.mark_name); - is->condition = be; - b->statements.insert(b->statements.begin(),(statement*) is); + probe_table.convert_probe(new_base); - // Now expand the local variables in the probe body + // Expand the local variables in the probe body sdt_var_expanding_visitor svv (module_name, probe_table.mark_name, probe_table.probe_arg, true); new_base->body = svv.require (new_base->body); - - // process("executable").syscall - new_location->components[1]->functor = "syscall"; - new_location->components[1]->arg = NULL; - new_base->locations.push_back(new_location); - + probe_table.convert_location(new_base, new_location); derive_probes(sess, new_base, finished_results); } while (probe_table.get_next_probe()); diff --git a/testsuite/systemtap.base/sdt.exp b/testsuite/systemtap.base/sdt.exp index d24093e0..ea025391 100644 --- a/testsuite/systemtap.base/sdt.exp +++ b/testsuite/systemtap.base/sdt.exp @@ -12,6 +12,14 @@ set ::result_string {1 set extra_flags {{""} {additional_flags=-std=gnu89} {additional_flags=-ansi} {additional_flags=-pedantic} {additional_flags=-ansi additional_flags=-pedantic} {additional_flags=-O2} {additional_flags="-O3"}} +set pbtype_flags {{""} {additional_flags=-DEXPERIMENTAL_UTRACE_SDT} {additional_flags=-DEXPERIMENTAL_KPROBE_SDT}} +set pbtype_mssgs {{uprobe} {utrace} {kprobe}} + +# Iterate pbtype_flags +for {set p 0} {$p < [llength $pbtype_flags]} {incr p} { +set pbtype_flag [lindex $pbtype_flags $p] +set pbtype_mssg [lindex $pbtype_mssgs $p] + # Iterate extra_flags, trying each with C and C++ for {set i 0} {$i < [llength $extra_flags]} {incr i} { set extra_flag [lindex $extra_flags $i] @@ -22,24 +30,24 @@ set test_flags "additional_flags=-g" set test_flags "$test_flags additional_flags=-I$srcdir/../includes/sys" set test_flags "$test_flags additional_flags=-Wall" set test_flags "$test_flags additional_flags=-Wextra" -set test_flags "$test_flags additional_flags=-Werror" +set test_flags "$test_flags additional_flags=-Werror $pbtype_flag" set saveidx 0 set res [target_compile $srcdir/$subdir/$test.c $testprog executable "$test_flags $extra_flag"] if { $res != "" } { verbose "target_compile failed: $res" 2 - fail "compiling $test.c $extra_flag" - untested "$test $extra_flag" + fail "compiling $test.c $extra_flag $pbtype_mssg" + untested "$test $extra_flag $pbtype_mssg" continue } else { - pass "compiling $test.c $extra_flag" + pass "compiling $test.c $extra_flag $pbtype_mssg" } if {[installtest_p] && [utrace_p]} { - stap_run3 "$test $extra_flag" $srcdir/$subdir/$test.stp $testprog -c ./$testprog + stap_run3 "$test $extra_flag $pbtype_mssg" $srcdir/$subdir/$test.stp $testprog -c ./$testprog } else { - untested "$test $extra_flag" + untested "$test $extra_flag $pbtype_mssg" } catch {exec rm -f $testprog} @@ -50,22 +58,27 @@ set test_flags "additional_flags=-g" set test_flags "$test_flags additional_flags=-I$srcdir/../includes/sys" set test_flags "$test_flags additional_flags=-Wall" set test_flags "$test_flags additional_flags=-Werror" -set test_flags "$test_flags additional_flags=-x additional_flags=c++" +set test_flags "$test_flags additional_flags=-x additional_flags=c++ $pbtype_flag" set res [target_compile $srcdir/$subdir/$test.c $testprog executable "$test_flags $extra_flag"] if { $res != "" } { verbose "target_compile failed: $res" 2 - fail "compiling $test.c c++ $extra_flag" - untested "$test $extra_flag" + fail "compiling $test.c c++ $extra_flag $pbtype_mssg" + untested "$test $extra_flag $pbtype_mssg" continue } else { - pass "compiling $test.c c++ $extra_flag" + pass "compiling $test.c c++ $extra_flag $pbtype_mssg" } if {[installtest_p] && [utrace_p]} { - stap_run3 "$test c++ $extra_flag" $srcdir/$subdir/$test.stp $testprog -c ./$testprog + stap_run3 "$test c++ $extra_flag $pbtype_mssg" $srcdir/$subdir/$test.stp $testprog -c ./$testprog } else { - untested "$test c++ $extra_flag" + untested "$test c++ $extra_flag $pbtype_mssg $pbtype_mssg" } catch {exec rm -f $testprog} + +# for {set i 0} {$i < [llength $extra_flags]} +} + +# for {set i 0} {$i < [llength $pbtype_flags]} } diff --git a/testsuite/systemtap.base/sdt_types.stp b/testsuite/systemtap.base/sdt_types.stp index 654b0d18..5f9ebcab 100644 --- a/testsuite/systemtap.base/sdt_types.stp +++ b/testsuite/systemtap.base/sdt_types.stp @@ -68,9 +68,9 @@ probe process(@1).mark("short_int_var") probe process(@1).mark("const_short_int_var") { - if ($arg1 != -32767) + if ($arg1 != -32767) printf("FAIL: const_short_int_var\n") - else + else printf("PASS: const_short_int_var\n") } diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp index 1e53d5d3..41dc3ec0 100644 --- a/testsuite/systemtap.base/static_uprobes.exp +++ b/testsuite/systemtap.base/static_uprobes.exp @@ -1,21 +1,21 @@ -set test "static_uprobes" +set test "static_user_markers" # Test miscellaneous features of .mark probes # Compile a C program to use as the user-space probing target -set sup_srcpath "[pwd]/static_uprobes.c" -set sup_exepath "[pwd]/static_uprobes.x" -set supcplus_exepath "[pwd]/static_uprobes_cplus.x" +set sup_srcpath "[pwd]/static_user_markers.c" +set sup_exepath "[pwd]/static_user_markers.x" +set supcplus_exepath "[pwd]/static_user_markers_cplus.x" set fp [open $sup_srcpath "w"] puts $fp " #include #define USE_STAP_PROBE 1 -#include \"static_uprobes.h\" +#include \"static_user_markers_.h\" void bar (int i) { - STATIC_UPROBES_TEST_PROBE_2(i); + STATIC_USER_MARKERS_TEST_PROBE_2(i); if (i == 0) i = 1000; STAP_PROBE1(static_uprobes,test_probe_2,i); @@ -27,7 +27,7 @@ baz (int i, char* s) STAP_PROBE1(static_uprobes,test_probe_0,i); if (i == 0) i = 1000; - STATIC_UPROBES_TEST_PROBE_3(i,s); + STATIC_USER_MARKERS_TEST_PROBE_3(i,s); } void @@ -35,7 +35,7 @@ buz (int parm) { if (parm == 0) parm = 1000; - DTRACE_PROBE1(static_uprobes,test_probe_4,parm); + DTRACE_PROBE1(static_user_markers,test_probe_4,parm); } int @@ -48,33 +48,33 @@ main () " close $fp -set sup_stppath "[pwd]/static_uprobes.stp" +set sup_stppath "[pwd]/static_user_markers.stp" set fp [open $sup_stppath "w"] puts $fp " -probe process(\"static_uprobes.x\").mark(\"test_probe_0\") +probe process(\"static_user_markers.x\").mark(\"test_probe_0\") { printf(\"In test_probe_0 probe %#x\\n\", \$arg1) } -probe process(\"static_uprobes.x\").mark(\"test_probe_2\") +probe process(\"static_user_markers.x\").mark(\"test_probe_2\") { printf(\"In test_probe_2 probe %#x\\n\", \$arg1) } -probe process(\"static_uprobes.x\").mark(\"test_probe_3\") +probe process(\"static_user_markers.x\").mark(\"test_probe_3\") { printf(\"In test_probe_3 probe %#x %#x\\n\", \$arg1, \$arg2) } -probe process(\"static_uprobes.x\").mark(\"test_probe_4\") +probe process(\"static_user_markers.x\").mark(\"test_probe_4\") { printf(\"In test_probe_4 dtrace probe %#x\\n\", \$arg1) } " close $fp -set sup_dpath "[pwd]/static_uprobes.d" -set sup_hpath "[pwd]/static_uprobes.h" +set sup_dpath "[pwd]/static_user_markers_.d" +set sup_hpath "[pwd]/static_user_markers_.h" set fp [open $sup_dpath "w"] puts $fp " -provider static_uprobes { +provider static_user_markers { probe test_probe_1 (); probe test_probe_2 (int i); probe test_probe_3 (int i, char* x); @@ -97,7 +97,9 @@ if {[file exists $sup_hpath]} then { pass "$test dtrace" } else { fail "$test dtrace" + if { $verbose == 0 } { catch {exec rm -f $sup_srcpath $sup_hpath $sup_stppath} + } return } @@ -107,25 +109,38 @@ if {[installtest_p]} { set sdtdir $srcdir/../includes } +set pbtype_flags {{""} {additional_flags=-DEXPERIMENTAL_UTRACE_SDT} {additional_flags=-DEXPERIMENTAL_KPROBE_SDT}} +set pbtype_mssgs {{uprobe} {utrace} {kprobe}} + +# Iterate pbtype_flags +for {set i 0} {$i < [llength $pbtype_flags]} {incr i} { +set pbtype_flag [lindex $pbtype_flags $i] +set pbtype_mssg [lindex $pbtype_mssgs $i] +set testprog "sdt.c.exe.$i" + set sup_flags "additional_flags=-I$srcdir/../includes/sys" set sup_flags "$sup_flags additional_flags=-I$sdtdir" set sup_flags "$sup_flags additional_flags=-g" set sup_flags "$sup_flags additional_flags=-O" -set sup_flags "$sup_flags additional_flags=-I." +set sup_flags "$sup_flags additional_flags=-I. $pbtype_flag" set res [target_compile $sup_srcpath $sup_exepath executable $sup_flags] if { $res != "" } { verbose "target_compile failed: $res" 2 - fail "$test compiling C -g" + fail "$test compiling -g $pbtype_mssg" + if { $verbose == 0 } { catch {exec rm -f $sup_srcpath $sup_hpath $sup_stppath} + } return } else { - pass "$test compiling C -g" + pass "$test compiling -g $pbtype_mssg" } if {![installtest_p]} {untested $test; return} if {![utrace_p]} { untested "$test" + if { $verbose == 0 } { catch {exec rm -f $sup_srcpath} + } return } @@ -141,24 +156,33 @@ expect { -re {In test_probe_0 probe 0x3} { incr ok; exp_continue } -re {In test_probe_3 probe 0x3 0x[0-9a-f][0-9a-f]} { incr ok; exp_continue } -re {In test_probe_4 dtrace probe 0x4} { incr ok; exp_continue } - timeout { fail "$test C (timeout)" } + timeout { fail "$test (timeout)" } eof { } } wait -if {$ok == 5} { pass "$test C" } { fail "$test C ($ok)" } +if {$ok == 5} { + pass "$test $pbtype_mssg" +} else { + if { $pbtype_mssg == "uprobe" } { + fail "$test ($ok) $pbtype_mssg" + } else { + # probe fires multiple times + xfail "$test ($ok) $pbtype_mssg" + } +} # Test passing various C types to .mark probes -set sup_flags "$sup_flags additional_flags=-O0" +set sup_flags "$sup_flags additional_flags=-O0 $pbtype_flag" set res [target_compile $srcdir/$subdir/sdt_types.c sdt_types.x executable $sup_flags] if { $res != "" } { verbose "target_compile failed: $res" 2 - fail "$test compiling types -g" + fail "$test compiling types -g $pbtype_mssg" return } else { - pass "$test compiling types -g" + pass "$test compiling types -g $pbtype_mssg" } set ok 0 @@ -169,16 +193,22 @@ expect { -timeout 180 -re {FAIL: [a-z_]+var} { regexp " .*$" $expect_out(0,string) s; incr ok; set fail "$fail $s"; exp_continue } - timeout { fail "$test C (timeout)" } + timeout { fail "$test (timeout) } eof { } } wait -if { $ok != 0 } { - fail "$test $fail" +set pbtype_mssgs {{uprobe} {utrace} {kprobe}} +if { $ok != 0} { + if { $pbtype_mssg == "uprobe" } { + fail "$test $fail $pbtype_mssg" + } else { + # (needs cast) + xfail "$test $fail $pbtype_mssg" + } } else { - pass "$test types" + pass "$test types $pbtype_mssg" } # Test .mark probe wildcard matching @@ -188,14 +218,21 @@ spawn stap -l "process(\"./sdt_types.x\").mark(\"*\")" expect { -timeout 180 -re {mark\(\"[a-z_]+\"\)} { incr ok; exp_continue } - timeout { fail "$test C (timeout)" } + timeout { fail "$test (timeout)" } eof { } } if { $ok == 45 } { - pass "$test wildcard" + pass "$test wildcard $pbtype_mssg" } else { - fail "$test wildcard ($ok)" + if { $pbtype_mssg == "uprobe" } { + fail "$test wildcard ($ok) $pbtype_mssg" + } else { + xfail "$test wildcard ($ok) $pbtype_mssg" + } +} + +# for {set i 0} } if { $verbose == 0 } { -- cgit From 74f2951cc3b5d4f3716e23d284a2b3a0767eb5c2 Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Sat, 13 Jun 2009 16:58:30 +0200 Subject: Add pgrp() context tapset function. Describe sid(). * tapset/context.stp: Add pgrp() function. * testsuite/buildok/context_test.stp: Add pgrp() call. * stapfuncs.3stap.in: Describe pgrp() and sid(). Signed-off-by: Josh Stone --- stapfuncs.3stap.in | 6 ++++++ tapset/context.stp | 13 +++++++++++++ testsuite/buildok/context_test.stp | 1 + 3 files changed, 20 insertions(+) diff --git a/stapfuncs.3stap.in b/stapfuncs.3stap.in index b9326fde..518ff2bb 100644 --- a/stapfuncs.3stap.in +++ b/stapfuncs.3stap.in @@ -210,6 +210,12 @@ Return the id of the current process. ppid:long () Return the id of the parent process. .TP +pgrp:long () +Return the pgrp of the current process. +.TP +sid:long () +Return the sid of the current process. +.TP uid:long () Return the uid of the current process. .TP diff --git a/tapset/context.stp b/tapset/context.stp index 468421ae..5be9f21f 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -63,6 +63,19 @@ function ppid:long () %{ /* pure */ #endif %} +/** + * sfunction pgrp - Returns the process group ID of the current process. + */ +function pgrp:long () %{ /* pure */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) + struct signal_struct *ss = kread( &(current->signal) ); + THIS->__retvalue = kread ( &(ss->pgrp) ); + CATCH_DEREF_FAULT(); +#else + THIS->__retvalue = task_pgrp_nr_ns(current, &init_pid_ns); +#endif +%} + /** * sfunction sid - Returns the session ID of the current process. * diff --git a/testsuite/buildok/context_test.stp b/testsuite/buildok/context_test.stp index acc4ea07..e58c8997 100755 --- a/testsuite/buildok/context_test.stp +++ b/testsuite/buildok/context_test.stp @@ -18,5 +18,6 @@ probe begin { printf("gid is %d\n", gid()) printf("egid is %d\n", egid()) printf("pp is %s\n", pp()) + printf("pgrp is %d\n", pgrp()) printf("sid is %d\n", sid()) } -- cgit From 475611069560540caa5453b44691525f26e2fb3b Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 16 Jun 2009 16:13:25 +0200 Subject: Add GCC version to testsuite run output and systemtap.sum file. Prints the gcc being used and full version. Also adds short version number to systemtap.sum file (plus full version string). Will make comparing failures based on compiler version being used easier. * testsuite/lib/systemtap.exp (print_systemtap_version): Also print location and full version of gcc being used. (get_system_info): Get gcc version number and long version string. * testsuite/lib/stap_run.exp (print_system_info): Output GCC version. --- testsuite/lib/stap_run.exp | 3 ++- testsuite/lib/systemtap.exp | 14 +++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/testsuite/lib/stap_run.exp b/testsuite/lib/stap_run.exp index 3043eeed..9d271ca1 100644 --- a/testsuite/lib/stap_run.exp +++ b/testsuite/lib/stap_run.exp @@ -102,12 +102,13 @@ proc no_load {} { } proc print_system_info {} { - global Host Snapshot Distro + global Host Snapshot Distro GCC_Version clone_output "\nHost: $Host" if {[string compare $Snapshot "unknown"]!=0} { clone_output "Snapshot: $Snapshot" } + clone_output "GCC: $GCC_Version" clone_output "Distro: $Distro\n" } diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 379f6c58..3cd7a6ea 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -43,6 +43,12 @@ proc print_systemtap_version {} { print "systemtap location: $location" print "systemtap version: $version" + + set location [exec /usr/bin/which gcc] + set version [exec gcc --version | head -1] + + print "gcc location: $location" + print "gcc version: $version" } @@ -152,7 +158,7 @@ proc shutdown_server {} { } proc get_system_info {} { - global Host Snapshot Distro env + global Host Snapshot Distro GCC_Version env set Host [exec /bin/uname -a] if [file exists ../SNAPSHOT] { @@ -173,6 +179,12 @@ proc get_system_info {} { if [file exists $f] then {set Distro [exec /bin/cat $f]; break } } } + # Easily parsable version first major minor patch level + set n [exec echo "__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__" | cpp -P] + set n [string map {" " "."} $n] + # Plus full version between square brackets. + set full [exec gcc --version | head -1] + set GCC_Version "$n \[$full\]" } if {! [setup_systemtap_environment]} then { -- cgit From 8e02c67338ae99f487d736ad4a5f19b9065b1453 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 16 Jun 2009 16:28:28 +0200 Subject: Strip out newlines in GCC version string. * testsuite/lib/systemtap.exp (get_system_info): Remove possible newlines from GCC_Version string. --- testsuite/lib/systemtap.exp | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 3cd7a6ea..e04fe837 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -182,6 +182,7 @@ proc get_system_info {} { # Easily parsable version first major minor patch level set n [exec echo "__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__" | cpp -P] set n [string map {" " "."} $n] + set n [string map {"\n" ""} $n] # Plus full version between square brackets. set full [exec gcc --version | head -1] set GCC_Version "$n \[$full\]" -- cgit From 611ab8263198e3e8c2640cb4a3e1eb65e2037f96 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Tue, 16 Jun 2009 10:59:25 -0400 Subject: Do not emit duplicate probes for kprobe/utrace cases. * tapsets.cxx (dwarf_builder) Add probes_handled. (dwarf_builder::build): Use probes_handled to not emit duplicates. --- tapsets.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tapsets.cxx b/tapsets.cxx index 0da61d9e..5e9deb9b 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -658,6 +658,7 @@ struct dwarf_builder: public derived_probe_builder literal_map_t const & parameters, vector & finished_results); + set probes_handled; struct probe_table { public: @@ -3480,6 +3481,13 @@ dwarf_builder::build(systemtap_session & sess, { do { + set::iterator pb; + pb = probes_handled.find(probe_table.mark_name); + if (pb == probes_handled.end()) + probes_handled.insert (probe_table.mark_name); + else + return; + probe *new_base = new probe; *new_base = *base; -- cgit From de7c5583f657bb42980f66d3b88572241b676f76 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Tue, 16 Jun 2009 12:58:33 -0400 Subject: Support -L for kprobe and utrace static user markers. tapsets.cxx (dwarf_builder::build): Special case listing mode for kprobe and utrace. --- tapsets.cxx | 11 +++++++++-- testsuite/systemtap.base/static_uprobes.exp | 13 ++----------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index 5e9deb9b..843b6017 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -3482,9 +3482,9 @@ dwarf_builder::build(systemtap_session & sess, do { set::iterator pb; - pb = probes_handled.find(probe_table.mark_name); + pb = probes_handled.find(probe_table.probe_name); if (pb == probes_handled.end()) - probes_handled.insert (probe_table.mark_name); + probes_handled.insert (probe_table.probe_name); else return; @@ -3504,6 +3504,13 @@ dwarf_builder::build(systemtap_session & sess, new_base->body = svv.require (new_base->body); probe_table.convert_location(new_base, new_location); derive_probes(sess, new_base, finished_results); + if (sess.listing_mode) + { + finished_results.back()->locations[0]->components[0]->functor = TOK_FUNCTION; + finished_results.back()->locations[0]->components[0]->arg = new literal_string (module_name); + finished_results.back()->locations[0]->components[1]->functor = TOK_MARK; + finished_results.back()->locations[0]->components[1]->arg = new literal_string (probe_table.probe_name.c_str()); + } } while (probe_table.get_next_probe()); return; diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp index 41dc3ec0..6a597646 100644 --- a/testsuite/systemtap.base/static_uprobes.exp +++ b/testsuite/systemtap.base/static_uprobes.exp @@ -165,12 +165,7 @@ wait if {$ok == 5} { pass "$test $pbtype_mssg" } else { - if { $pbtype_mssg == "uprobe" } { - fail "$test ($ok) $pbtype_mssg" - } else { - # probe fires multiple times - xfail "$test ($ok) $pbtype_mssg" - } + fail "$test ($ok) $pbtype_mssg" } # Test passing various C types to .mark probes @@ -225,11 +220,7 @@ expect { if { $ok == 45 } { pass "$test wildcard $pbtype_mssg" } else { - if { $pbtype_mssg == "uprobe" } { - fail "$test wildcard ($ok) $pbtype_mssg" - } else { - xfail "$test wildcard ($ok) $pbtype_mssg" - } + fail "$test wildcard ($ok) $pbtype_mssg" } # for {set i 0} -- cgit From 657ff134aef7f7fb8e6d7ff687c46d1819f60550 Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 16 Jun 2009 12:17:35 -0500 Subject: Moved time.c inclusion from runtime/transport/transport.c to runtime/runtime.h. * runtime/runtime.h: Includes time.c. * runtime/transport/transport.c: Removed time.c inclusion. --- runtime/runtime.h | 1 + runtime/transport/transport.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/runtime.h b/runtime/runtime.h index c2e927cc..9881acb7 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -88,6 +88,7 @@ static struct #include "copy.c" #include "regs.c" #include "regs-ia64.c" +#include "time.c" #include "task_finder.c" diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c index 762c0a92..0592768c 100644 --- a/runtime/transport/transport.c +++ b/runtime/transport/transport.c @@ -17,7 +17,6 @@ #include #include #include "transport.h" -#include "time.c" #include "../mempool.c" #include "symbols.c" -- cgit