diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/.gitignore | 3 | ||||
-rwxr-xr-x | testsuite/buildok/seventeen.stp | 9 | ||||
-rwxr-xr-x | testsuite/configure | 20 | ||||
-rw-r--r-- | testsuite/configure.ac | 2 | ||||
-rw-r--r-- | testsuite/lib/systemtap.exp | 15 | ||||
-rw-r--r-- | testsuite/systemtap.base/sdt_types.c | 168 | ||||
-rw-r--r-- | testsuite/systemtap.base/sdt_types.stp | 371 | ||||
-rw-r--r-- | testsuite/systemtap.base/static_uprobes.exp | 47 | ||||
-rw-r--r-- | testsuite/systemtap.examples/network/tcp.stp | 2 |
9 files changed, 596 insertions, 41 deletions
diff --git a/testsuite/.gitignore b/testsuite/.gitignore index 19b30bf1..709de57f 100644 --- a/testsuite/.gitignore +++ b/testsuite/.gitignore @@ -2,3 +2,6 @@ site.exp systemtap.log systemtap.sum +*.so +*_exe +*.exe.[0-9] diff --git a/testsuite/buildok/seventeen.stp b/testsuite/buildok/seventeen.stp index 126db1fb..4e0b07c4 100755 --- a/testsuite/buildok/seventeen.stp +++ b/testsuite/buildok/seventeen.stp @@ -11,3 +11,12 @@ probe kernel.function("pipe_write") printf("0x%x\n", $write_fifo_fops->llseek) %) } + +# PR10000: We're looking for *some* module function that has a nearby global variable in scope +# XXX: See PR4096 +probe module("nfs").function("nfs_create_client") !, module("nfs").function("nfs_init_client") !, + kernel.function("nfs_fsync_dir") { + println(kernel_string($nfs_program->name)) +} + +probe timer.s(5) { exit() } diff --git a/testsuite/configure b/testsuite/configure index 094f99c7..828f8006 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.61 for systemtap 0.9. +# Generated by GNU Autoconf 2.61 for systemtap 0.9.5. # # Report bugs to <systemtap@sources.redhat.com>. # @@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='systemtap' PACKAGE_TARNAME='systemtap' -PACKAGE_VERSION='0.9' -PACKAGE_STRING='systemtap 0.9' +PACKAGE_VERSION='0.9.5' +PACKAGE_STRING='systemtap 0.9.5' PACKAGE_BUGREPORT='systemtap@sources.redhat.com' ac_subst_vars='SHELL @@ -1149,7 +1149,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 to adapt to many kinds of systems. +\`configure' configures systemtap 0.9.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1215,7 +1215,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of systemtap 0.9:";; + short | recursive ) echo "Configuration of systemtap 0.9.5:";; esac cat <<\_ACEOF @@ -1291,7 +1291,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -systemtap configure 0.9 +systemtap configure 0.9.5 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1305,7 +1305,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, which was +It was created by systemtap $as_me 0.9.5, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1997,7 +1997,7 @@ fi # Define the identity of the package. PACKAGE='systemtap' - VERSION='0.9' + VERSION='0.9.5' cat >>confdefs.h <<_ACEOF @@ -2617,7 +2617,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, which was +This file was extended by systemtap $as_me 0.9.5, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2660,7 +2660,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -systemtap config.status 0.9 +systemtap config.status 0.9.5 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/testsuite/configure.ac b/testsuite/configure.ac index c40fdf72..03ce3f61 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, systemtap@sources.redhat.com, systemtap) +AC_INIT([systemtap], 0.9.5, systemtap@sources.redhat.com, systemtap) AC_PREREQ(2.59) AC_CONFIG_AUX_DIR(..) diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index c80ad171..554e88ed 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -148,13 +148,18 @@ proc get_system_info {} { set Snapshot [exec /bin/cat $env(SRCDIR)/../SNAPSHOT] } else { regexp {version [^)]*} [exec stap -V 2>@ stdout] version - set Snapshot $version + set Snapshot $version } set Distro "Linux" - if [file exists /etc/fedora-release] {set Distro [exec /bin/cat /etc/fedora-release]} - if [file exists /etc/redhat-release] {set Distro [exec /bin/cat /etc/redhat-release]} - if [file exists /etc/suse-release] {set Distro [exec /bin/cat /etc/suse-release]} - if [file exists /etc/debian_version] {set Distro [exec /bin/cat /etc/debian_version]} + if [file exists /usr/bin/lsb_release] { + # this produces one line of this format: + # Distribution:\tSTRING + set Distro [lrange [exec /usr/bin/lsb_release -d] 1 end] + } else { + foreach f {/etc/fedora-release /etc/enterprise-release /etc/redhat-release /etc/suse-release /etc/debian_version} { + if [file exists $f] then {set Distro [exec /bin/cat $f]; break } + } + } } if {! [setup_systemtap_environment]} then { diff --git a/testsuite/systemtap.base/sdt_types.c b/testsuite/systemtap.base/sdt_types.c new file mode 100644 index 00000000..2e04ec7e --- /dev/null +++ b/testsuite/systemtap.base/sdt_types.c @@ -0,0 +1,168 @@ +#include "sdt.h" /* Really <sys/sdt.h>, but pick current source version. */ +#include <stdint.h> +#include <values.h> + +int +main (int argc, char **argv) +{ + char char_var = '~'; + STAP_PROBE1(provider,char_var,char_var); + const char const_char_var = '!'; + STAP_PROBE1(provider,const_char_var,const_char_var); + volatile char volatile_char_var = '!'; + STAP_PROBE1(provider,volatile_char_var,volatile_char_var); + char *ptr_char_var = &char_var; + STAP_PROBE2(provider,ptr_char_var,ptr_char_var,&char_var); + const char *ptr_const_char_var = &char_var; + STAP_PROBE2(provider,ptr_const_char_var,ptr_const_char_var,&char_var); + char * const char_ptr_const_var = &char_var; + STAP_PROBE2(provider,char_ptr_const_var,char_ptr_const_var,&char_var); + volatile char *ptr_volatile_char_var = &char_var; + STAP_PROBE2(provider,ptr_volatile_char_var,ptr_volatile_char_var,&char_var); + char * volatile char_ptr_volatile_var = &char_var; + STAP_PROBE2(provider,char_ptr_volatile_var,char_ptr_volatile_var,&char_var); + short int short_int_var = 32767; + STAP_PROBE1(provider,short_int_var,short_int_var); + const short int const_short_int_var = -32767; + STAP_PROBE1(provider,const_short_int_var,const_short_int_var); + volatile short int volatile_short_int_var = -32767; + STAP_PROBE1(provider,volatile_short_int_var,volatile_short_int_var); + short int *ptr_short_int_var = &short_int_var; + STAP_PROBE2(provider,ptr_short_int_var,ptr_short_int_var,&short_int_var); + const short int *ptr_const_short_int_var = &short_int_var; + STAP_PROBE2(provider,ptr_const_short_int_var,ptr_const_short_int_var,&short_int_var); + short int * const short_int_ptr_const_var = &short_int_var; + STAP_PROBE2(provider,short_int_ptr_const_var,short_int_ptr_const_var,&short_int_var); + volatile short int *ptr_volatile_short_int_var = &short_int_var; + STAP_PROBE2(provider,ptr_volatile_short_int_var,ptr_volatile_short_int_var,&short_int_var); + short int * volatile short_int_ptr_volatile_var = &short_int_var; + STAP_PROBE2(provider,short_int_ptr_volatile_var,short_int_ptr_volatile_var,&short_int_var); + int int_var = 65536; + STAP_PROBE1(provider,int_var,int_var); + const int const_int_var = -65536; + STAP_PROBE1(provider,const_int_var,const_int_var); + volatile int volatile_int_var = -65536; + STAP_PROBE1(provider,volatile_int_var,volatile_int_var); + int *ptr_int_var = &int_var; + STAP_PROBE2(provider,ptr_int_var,ptr_int_var,&int_var); + const int *ptr_const_int_var = &int_var; + STAP_PROBE2(provider,ptr_const_int_var,ptr_const_int_var,&int_var); + int * const int_ptr_const_var = &int_var; + STAP_PROBE2(provider,int_ptr_const_var,int_ptr_const_var,&int_var); + volatile int *ptr_volatile_int_var = &int_var; + STAP_PROBE2(provider,ptr_volatile_int_var,ptr_volatile_int_var,&int_var); + int * volatile int_ptr_volatile_var = &int_var; + STAP_PROBE2(provider,int_ptr_volatile_var,int_ptr_volatile_var,&int_var); + long int long_int_var = 65536; + STAP_PROBE1(provider,long_int_var,long_int_var); + const long int const_long_int_var = -65536; + STAP_PROBE1(provider,const_long_int_var,const_long_int_var); + volatile long int volatile_long_int_var = -65536; + STAP_PROBE1(provider,volatile_long_int_var,volatile_long_int_var); + long int *ptr_long_int_var = &long_int_var; + STAP_PROBE2(provider,ptr_long_int_var,ptr_long_int_var,&long_int_var); + const long int *ptr_const_long_int_var = &long_int_var; + STAP_PROBE2(provider,ptr_const_long_int_var,ptr_const_long_int_var,&long_int_var); + long int * const long_int_ptr_const_var = &long_int_var; + STAP_PROBE2(provider,long_int_ptr_const_var,long_int_ptr_const_var,&long_int_var); + volatile long int *ptr_volatile_long_int_var = &long_int_var; + STAP_PROBE2(provider,ptr_volatile_long_int_var,ptr_volatile_long_int_var,&long_int_var); + long int * volatile long_int_ptr_volatile_var = &long_int_var; + STAP_PROBE2(provider,long_int_ptr_volatile_var,long_int_ptr_volatile_var,&long_int_var); + long long int long_long_int_var = 65536; + STAP_PROBE1(provider,long_long_int_var,long_long_int_var); + const long long int const_long_long_int_var = -65536; + STAP_PROBE1(provider,const_long_long_int_var,const_long_long_int_var); + volatile long long int volatile_long_long_int_var = -65536; + STAP_PROBE1(provider,volatile_long_long_int_var,volatile_long_long_int_var); + long long int *ptr_long_long_int_var = &long_long_int_var; + STAP_PROBE2(provider,ptr_long_long_int_var,ptr_long_long_int_var,&long_long_int_var); + const long long int *ptr_const_long_long_int_var = &long_long_int_var; + STAP_PROBE2(provider,ptr_const_long_long_int_var,ptr_const_long_long_int_var,&long_long_int_var); + long long int * const long_long_int_ptr_const_var = &long_long_int_var; + STAP_PROBE2(provider,long_long_int_ptr_const_var,long_long_int_ptr_const_var,&long_long_int_var); + volatile long long int *ptr_volatile_long_long_int_var = &long_long_int_var; + STAP_PROBE2(provider,ptr_volatile_long_long_int_var,ptr_volatile_long_long_int_var,&long_long_int_var); + long long int * volatile long_long_int_ptr_volatile_var = &long_long_int_var; + STAP_PROBE2(provider,long_long_int_ptr_volatile_var,long_long_int_ptr_volatile_var,&long_long_int_var); + + char arr_char [2] = "!~"; + STAP_PROBE1(provider,arr_char,&arr_char); + struct { + int int_var; + } arr_struct [2] = {{ + .int_var=1, + },{ + .int_var=2, + }}; + STAP_PROBE1(provider,arr_struct,&arr_struct); + struct { + unsigned int bit1_0:1; + unsigned int bit1_1:1; + char char_2; + unsigned int bit1_6:1; + unsigned int bit1_7:1; + char char_8; + unsigned int bit1_9:1; + unsigned int bit1_10:1; + } bitfields_small_var = { + .bit1_0=1, + .bit1_1=0, + .char_2='a', + .bit1_6=1, + .bit1_7=0, + .char_8='z', + .bit1_9=1, + .bit1_10=0, + }; + STAP_PROBE8(provider,bitfields_small_var, + (int)bitfields_small_var.bit1_0, + (int)bitfields_small_var.bit1_1, + bitfields_small_var.char_2, + (int)bitfields_small_var.bit1_6, + (int)bitfields_small_var.bit1_7, + bitfields_small_var.char_8, + (int)bitfields_small_var.bit1_9, + (int)bitfields_small_var.bit1_10); + struct { + unsigned char char_0; + int bit1_4:1; + unsigned int bit1_5:1; + int bit2_6:2; + unsigned int bit2_8:2; + int bit3_10:3; + unsigned int bit3_13:3; + int bit9_16:9; + unsigned int bit9_25:9; + char char_34; + } bitfields_bit_var = { + .char_0='A', + .bit1_4=-1, + .bit1_5=1, + .bit2_6=1, + .bit2_8=3, + .bit3_10=3, + .bit3_13=7, + .bit9_16=255, + .bit9_25=511, + .char_34='Z', + }; + STAP_PROBE10(provider,bitfields_bit_var,bitfields_bit_var.char_0, + (int)bitfields_bit_var.bit1_4, + (int)bitfields_bit_var.bit1_5, + (int)bitfields_bit_var.bit2_6, + (int)bitfields_bit_var.bit2_8, + (int)bitfields_bit_var.bit3_10, + (int)bitfields_bit_var.bit3_13, + (int)bitfields_bit_var.bit9_16, + (int)bitfields_bit_var.bit9_25, + bitfields_bit_var.char_34); + enum { + red = 0, + green = 1, + blue = 2 + } primary_colors_var = green; + STAP_PROBE1(provider,primary_colors_var,primary_colors_var); + return 0; +} + diff --git a/testsuite/systemtap.base/sdt_types.stp b/testsuite/systemtap.base/sdt_types.stp new file mode 100644 index 00000000..654b0d18 --- /dev/null +++ b/testsuite/systemtap.base/sdt_types.stp @@ -0,0 +1,371 @@ +probe process(@1).mark("char_var") { + if ($arg1 != 126) + printf("FAIL: char_var\n") + else + printf("PASS: char_var\n") +} + +probe process(@1).mark("const_char_var") { + if ($arg1 != 33) + printf("FAIL: const_char_var\n") + else + printf("PASS: const_char_var\n") +} + +probe process(@1).mark("volatile_char_var") { + if ($arg1 != 33) + printf("FAIL: volatile_char_var\n") + else + printf("PASS: volatile_char_var\n") +} + +probe process(@1).mark("ptr_char_var") { + if ($arg1 != $arg2) + printf("FAIL: ptr_char_var\n") + else + printf("PASS: ptr_char_var\n") +} + +probe process(@1).mark("ptr_const_char_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_const_char_var\n") + else + printf("PASS: ptr_const_char_var\n") +} + +probe process(@1).mark("char_ptr_const_var") +{ + if ($arg1 != $arg2) + printf("FAIL: char_ptr_const_var\n") + else + printf("PASS: char_ptr_const_var\n") +} + +probe process(@1).mark("ptr_volatile_char_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_volatile_char_var\n") + else + printf("PASS: ptr_volatile_char_var\n") +} + +probe process(@1).mark("char_ptr_volatile_var") +{ + if ($arg1 != $arg2) + printf("FAIL: char_ptr_volatile_var\n") + else + printf("PASS: char_ptr_volatile_var\n") +} + +probe process(@1).mark("short_int_var") +{ + if ($arg1 != 32767) + printf("FAIL: short_int_var\n") + else + printf("PASS: short_int_var\n") +} + +probe process(@1).mark("const_short_int_var") +{ + if ($arg1 != -32767) + printf("FAIL: const_short_int_var\n") + else + printf("PASS: const_short_int_var\n") +} + +probe process(@1).mark("volatile_short_int_var") +{ + if ($arg1 != -32767) + printf("FAIL: volatile_short_int_var\n") + else + printf("PASS: volatile_short_int_var\n") +} + +probe process(@1).mark("ptr_short_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_short_int_var\n") + else + printf("PASS: ptr_short_int_var\n") +} + +probe process(@1).mark("ptr_const_short_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_const_short_int_var\n") + else + printf("PASS: ptr_const_short_int_var\n") +} + +probe process(@1).mark("short_int_ptr_const_var") +{ + if ($arg1 != $arg2) + printf("FAIL: short_int_ptr_const_var\n") + else + printf("PASS: short_int_ptr_const_var\n") +} + +probe process(@1).mark("ptr_volatile_short_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_volatile_short_int_var\n") + else + printf("PASS: ptr_volatile_short_int_var\n") +} + +probe process(@1).mark("short_int_ptr_volatile_var") +{ + if ($arg1 != $arg2) + printf("FAIL: short_int_ptr_volatile_var\n") + else + printf("PASS: short_int_ptr_volatile_var\n") +} + +probe process(@1).mark("int_var") +{ + if ($arg1 != 65536) + printf("FAIL: int_var") + else + printf("PASS: int_var") +} + +probe process(@1).mark("const_int_var") +{ + if ($arg1 != -65536) + printf("FAIL: const_int_var\n") + else + printf("PASS: const_int_var\n") +} + +probe process(@1).mark("volatile_int_var") +{ + if ($arg1 != -65536) + printf("FAIL: volatile_int_var\n") + else + printf("PASS: volatile_int_var\n") +} + +probe process(@1).mark("ptr_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_const_int_var\n") + else + printf("PASS: ptr_const_int_var\n") +} + +probe process(@1).mark("ptr_const_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_const_int_var\n") + else + printf("PASS: ptr_const_int_var\n") +} + +probe process(@1).mark("int_ptr_const_var") +{ + if ($arg1 != $arg2) + printf("FAIL: int_ptr_const_var\n") + else + printf("PASS: int_ptr_const_var\n") +} + +probe process(@1).mark("ptr_volatile_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_volatile_int_var\n") + else + printf("PASS: ptr_volatile_int_var\n") +} + +probe process(@1).mark("int_ptr_volatile_var") +{ + if ($arg1 != $arg2) + printf("FAIL: int_ptr_volatile_var\n") + else + printf("PASS: int_ptr_volatile_var\n") +} + +probe process(@1).mark("long_int_var") +{ + if ($arg1 != 65536) + printf("FAIL: long_int_var\n") + else + printf("PASS: long_int_var\n") +} + +probe process(@1).mark("const_long_int_var") +{ + if ($arg1 != -65536) + printf("FAIL: const_long_int_var\n") + else + printf("PASS: const_long_int_var\n") +} + +probe process(@1).mark("volatile_long_int_var") +{ + if ($arg1 != -65536) + printf("FAIL: volatile_long_int_var\n") + else + printf("PASS: volatile_long_int_var\n") +} + +probe process(@1).mark("ptr_long_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_long_int_var\n") + else + printf("PASS: ptr_long_int_var\n") +} + +probe process(@1).mark("ptr_const_long_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_const_long_int_var\n") + else + printf("PASS: ptr_const_long_int_var\n") +} + +probe process(@1).mark("long_int_ptr_const_var") +{ + if ($arg1 != $arg2) + printf("FAIL: long_int_ptr_const_var\n") + else + printf("PASS: long_int_ptr_const_var\n") +} + +probe process(@1).mark("ptr_volatile_long_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_volatile_long_int_var\n") + else + printf("PASS: ptr_volatile_long_int_var\n") +} + +probe process(@1).mark("long_int_ptr_volatile_var") +{ + if ($arg1 != $arg2) + printf("FAIL: long_int_ptr_volatile_var\n") + else + printf("PASS: long_int_ptr_volatile_var\n") +} + +probe process(@1).mark("long_long_int_var") +{ + if ($arg1 != 65536) + printf("FAIL: long_long_int_var\n") + else + printf("PASS: long_long_int_var\n") +} + +probe process(@1).mark("const_long_long_int_var") +{ + if ($arg1 != -65536) + printf("FAIL: const_long_long_int_var\n") + else + printf("PASS: const_long_long_int_var\n") +} + +probe process(@1).mark("volatile_long_long_int_var") +{ + if ($arg1 != -65536) + printf("FAIL: volatile_long_long_int_var\n") + else + printf("PASS: volatile_long_long_int_var\n") +} + +probe process(@1).mark("ptr_long_long_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_long_long_int_var\n") + else + printf("PASS: ptr_long_long_int_var\n") +} + +probe process(@1).mark("ptr_const_long_long_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_const_long_long_int_var\n") + else + printf("PASS: ptr_const_long_long_int_var\n") +} + +probe process(@1).mark("long_long_int_ptr_const_var") +{ + if ($arg1 != $arg2) + printf("FAIL: long_long_int_ptr_const_var\n") + else + printf("PASS: long_long_int_ptr_const_var\n") +} + +probe process(@1).mark("ptr_volatile_long_long_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_volatile_long_long_int_var\n") + else + printf("PASS: ptr_volatile_long_long_int_var\n") +} + +probe process(@1).mark("long_long_int_ptr_volatile_var") +{ + if ($arg1 != $arg2) + printf("FAIL: long_long_int_ptr_volatile_var\n") + else + printf("PASS: long_long_int_ptr_volatile_var\n") +} + +probe process(@1).mark("arr_char") +{ + arr_char = user_string ($arg1); + if (arr_char != "!~") + printf("FAIL: arr_char_var\n") + else + printf("PASS: arr_char_var\n") +} + +probe process(@1).mark("arr_struct") +{ + arr_struct_int_var = user_int ($arg1) + if (arr_struct_int_var != 1) + printf("FAIL: arr_struct_var\n") + else + printf("PASS: arr_struct_var\n") +} + +probe process(@1).mark("bitfields_small_var") +{ + if ($arg1 != 1 || $arg2 != 0 || $arg3 != 97 || $arg4 != 1 + || $arg5 != 0 || $arg6 != 122 || $arg7 != 1 || $arg8 != 0) + printf("FAIL: bitfields_small_var\n") + +} + +probe process(@1).mark("bitfields_bit_var") +{ + if ($arg1 != 65 || $arg2 != -1 || $arg3 != 1 || $arg4 != 1 + || $arg5 != 3 || $arg6 != 3 || $arg7 != 7 || $arg8 != 255 + || $arg9 != 511 || $arg10 != 90) + printf("FAIL: bitfields_bit_var\n") + else + printf("PASS: bitfields_bit_var\n") +} + + +probe process(@1).mark("primary_colors_var") +{ + if ($arg1 != 1) + printf("FAIL: primary_colors_var\n") + else + printf("PASS: primary_colors_var\n") +} + + + + + + + + + + + diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp index e407440e..620d5576 100644 --- a/testsuite/systemtap.base/static_uprobes.exp +++ b/testsuite/systemtap.base/static_uprobes.exp @@ -118,17 +118,6 @@ if { $res != "" } { pass "$test compiling C -g" } -set sup_flags "$sup_flags additional_flags=-x additional_flags=c++" -set res [target_compile $sup_srcpath $supcplus_exepath executable $sup_flags] -if { $res != "" } { - verbose "target_compile failed: $res" 2 - fail "$test compiling C++ -g" - catch {exec rm -f $sup_srcpath $sup_exepath $sup_hpath $sup_stppath} - return -} else { - pass "$test compiling C++ -g" -} - if {![installtest_p]} {untested $test; return} # Try to find utrace_attach symbol in /proc/kallsyms @@ -162,29 +151,37 @@ wait if {$ok == 5} { pass "$test C" } { fail "$test C ($ok)" } -set ok 0 +set sup_flags "$sup_flags additional_flags=-O0" +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 -g" + return +} else { + pass "$test compiling -g" +} -# Test setting a probe without .probes using only dwarf label info -verbose -log "objcopy -R .probes $supcplus_exepath $sup_exepath" -spawn objcopy -R .probes $supcplus_exepath $sup_exepath -verbose -log "spawn stap -c $sup_exepath $sup_stppath" -spawn stap -c $sup_exepath $sup_stppath +set ok 0 +set fail "types" +verbose -log "spawn stap -c ./sdt_types.x $srcdir/$subdir/sdt_types.stp ./sdt_types.x" +spawn stap -c ./sdt_types.x $srcdir/$subdir/sdt_types.stp ./sdt_types.x expect { -timeout 180 - -re {In test_probe_2 probe 0x2} { incr ok; exp_continue } - -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)" } + -re {FAIL: [a-z_]+var} { regexp " .*$" $expect_out(0,string) s; + incr ok; set fail "$fail $s"; exp_continue } + timeout { fail "$test C (timeout)" } eof { } } wait -# we now generate the probes via asm so there is no label debug info -if {$ok == 5} { pass "$test C++" } { xfail "$test C++ ($ok)" } +if { $ok != 0 } { + fail $fail +} else { + pass types +} if { $verbose == 0 } { -catch {exec rm -f $sup_srcpath $sup_exepath $supcplus_exepath $sup_dpath $sup_hpath $sup_stppath} +catch {exec rm -f $sup_srcpath $sup_exepath $supcplus_exepath $sup_dpath $sup_hpath $sup_stppath sdt_types.x} } diff --git a/testsuite/systemtap.examples/network/tcp.stp b/testsuite/systemtap.examples/network/tcp.stp index ebe72a1c..01db9d2d 100644 --- a/testsuite/systemtap.examples/network/tcp.stp +++ b/testsuite/systemtap.examples/network/tcp.stp @@ -1,3 +1,5 @@ +#! /usr/bin/env stap + //A simple TCP tapset example probe begin { |