summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-04-03 11:56:32 -0400
committerDave Brolley <brolley@redhat.com>2009-04-03 11:56:32 -0400
commit8d3854b9f124aa818552d462bd8cbd2577be298e (patch)
treecef962dbca12c088c6acc3edf621d4502b0012e1
parent2f53f831393d2f0db3d54260c2a7882eff17905c (diff)
parent08dc41a50c508544bc18d384a65a137056a98195 (diff)
downloadsystemtap-steved-8d3854b9f124aa818552d462bd8cbd2577be298e.tar.gz
systemtap-steved-8d3854b9f124aa818552d462bd8cbd2577be298e.tar.xz
systemtap-steved-8d3854b9f124aa818552d462bd8cbd2577be298e.zip
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Conflicts: configure runtime/staprun/staprun_funcs.c
-rw-r--r--Makefile.in1
-rw-r--r--buildrun.cxx6
-rwxr-xr-xconfigure47
-rw-r--r--configure.ac2
-rw-r--r--doc/Makefile.in1
-rw-r--r--doc/SystemTap_Tapset_Reference/Makefile.in1
-rw-r--r--run-stap.in2
-rw-r--r--run-staprun.in29
-rw-r--r--runtime/runtime.h2
-rw-r--r--runtime/staprun/common.c9
-rw-r--r--runtime/staprun/relay.c2
-rw-r--r--runtime/staprun/relay_old.c4
-rw-r--r--runtime/sym.c26
-rw-r--r--runtime/uprobes/.gitignore7
-rw-r--r--tapset/context-symbols.stp60
-rw-r--r--tapset/context-unwind.stp2
-rw-r--r--tapset/errno.stp14
-rwxr-xr-xtestsuite/buildok/modname.stp8
-rwxr-xr-xtestsuite/buildok/symdata.stp8
-rwxr-xr-xtestsuite/buildok/symname.stp8
-rw-r--r--testsuite/systemtap.base/stmt_rel.exp44
-rw-r--r--testsuite/systemtap.base/stmt_rel.stp71
-rw-r--r--testsuite/systemtap.context/usymbols.exp2
-rw-r--r--translate.cxx2
24 files changed, 194 insertions, 164 deletions
diff --git a/Makefile.in b/Makefile.in
index f14918ee..23685917 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -238,7 +238,6 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
PIECFLAGS = @PIECFLAGS@
PIECXXFLAGS = @PIECXXFLAGS@
PIELDFLAGS = @PIELDFLAGS@
diff --git a/buildrun.cxx b/buildrun.cxx
index 949f0859..1eecb3f7 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -51,6 +51,12 @@ run_make_cmd(systemtap_session& s, string& make_cmd)
cerr << "unsetenv failed: " << e << endl;
}
+ // Disable ccache to avoid saving files that will never be reused.
+ // (ccache is useless to us, because our compiler commands always
+ // include the randomized tmpdir path.)
+ // It's not critical if this fails, so the return is ignored.
+ (void) setenv("CCACHE_DISABLE", "1", 0);
+
if (s.verbose > 2)
make_cmd += " V=1";
else if (s.verbose > 1)
diff --git a/configure b/configure
index a169b87f..4e4dee95 100755
--- a/configure
+++ b/configure
@@ -706,7 +706,6 @@ EGREP
U
ANSI2KNR
RANLIB
-PERL
PIELDFLAGS
PIECFLAGS
PIECXXFLAGS
@@ -5825,47 +5824,6 @@ fi
-# Extract the first word of "perl", so it can be a program name with args.
-set dummy perl; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_PERL+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $PERL in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-PERL=$ac_cv_path_PERL
-if test -n "$PERL"; then
- { echo "$as_me:$LINENO: result: $PERL" >&5
-echo "${ECHO_T}$PERL" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-
# Check whether --enable-perfmon was given.
if test "${enable_perfmon+set}" = set; then
enableval=$enable_perfmon;
@@ -8747,11 +8705,11 @@ EGREP!$EGREP$ac_delim
U!$U$ac_delim
ANSI2KNR!$ANSI2KNR$ac_delim
RANLIB!$RANLIB$ac_delim
-PERL!$PERL$ac_delim
PIELDFLAGS!$PIELDFLAGS$ac_delim
PIECFLAGS!$PIECFLAGS$ac_delim
PIECXXFLAGS!$PIECXXFLAGS$ac_delim
sqlite3_LIBS!$sqlite3_LIBS$ac_delim
+staplog_CPPFLAGS!$staplog_CPPFLAGS$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -8793,7 +8751,6 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
-staplog_CPPFLAGS!$staplog_CPPFLAGS$ac_delim
BUILD_CRASHMOD_TRUE!$BUILD_CRASHMOD_TRUE$ac_delim
BUILD_CRASHMOD_FALSE!$BUILD_CRASHMOD_FALSE$ac_delim
have_latex!$have_latex$ac_delim
@@ -8823,7 +8780,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 28; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 27; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/configure.ac b/configure.ac
index 465d2dd7..d814d997 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,8 +25,6 @@ AC_PROG_MAKE_SET
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)
-AC_PATH_PROG(PERL, perl)
-
dnl Handle the perfmon option.
AC_ARG_ENABLE([perfmon],
AS_HELP_STRING([--enable-perfmon@<:@=DIRECTORY@:>@],
diff --git a/doc/Makefile.in b/doc/Makefile.in
index beb5553e..eafd7ca7 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -101,7 +101,6 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
PIECFLAGS = @PIECFLAGS@
PIECXXFLAGS = @PIECXXFLAGS@
PIELDFLAGS = @PIELDFLAGS@
diff --git a/doc/SystemTap_Tapset_Reference/Makefile.in b/doc/SystemTap_Tapset_Reference/Makefile.in
index d4bcf8b0..30ca4b17 100644
--- a/doc/SystemTap_Tapset_Reference/Makefile.in
+++ b/doc/SystemTap_Tapset_Reference/Makefile.in
@@ -104,7 +104,6 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
PIECFLAGS = @PIECFLAGS@
PIECXXFLAGS = @PIECXXFLAGS@
PIELDFLAGS = @PIELDFLAGS@
diff --git a/run-stap.in b/run-stap.in
index 1bfb6a77..8b150ece 100644
--- a/run-stap.in
+++ b/run-stap.in
@@ -19,7 +19,7 @@ esac
# Set all the variables to find the source and build trees.
SYSTEMTAP_TAPSET="${srcdir}/tapset"
SYSTEMTAP_RUNTIME="${srcdir}/runtime"
-SYSTEMTAP_STAPRUN="sudo -P builddir='${builddir}' ${builddir}/run-staprun"
+SYSTEMTAP_STAPRUN="${builddir}/run-staprun"
export SYSTEMTAP_TAPSET SYSTEMTAP_RUNTIME SYSTEMTAP_STAPRUN
# If there were private elfutils libs built, use them.
diff --git a/run-staprun.in b/run-staprun.in
index 0b5f795b..e0615556 100644
--- a/run-staprun.in
+++ b/run-staprun.in
@@ -1,13 +1,24 @@
-#!@PERL@ -w
+#!/bin/sh
-# Reset real IDs to those we had before we were sudo-invoked.
-# This gives staprun the IDs it expects from a setuid exec.
-$< = $ENV{'SUDO_UID'};
-$( = $ENV{'SUDO_GID'};
+srcdir='@abs_top_srcdir@'
+builddir='@abs_top_builddir@'
-$ENV{'SYSTEMTAP_STAPRUN'} = "sudo '$ENV{'builddir'}/staprun'";
-$ENV{'SYSTEMTAP_STAPIO'} = "$ENV{'builddir'}/stapio";
+rundir="${0%/*}"
+[ "$rundir" == "$0" ] || builddir="$rundir"
-exec { "$ENV{'builddir'}/staprun" } ('staprun', @ARGV);
+# Absolutify the paths.
+case "$srcdir" in
+/*) ;;
+*) srcdir=`cd "$srcdir" && pwd` || exit ;;
+esac
+case "$builddir" in
+/*) ;;
+*) builddir=`cd "$builddir" && pwd` || exit ;;
+esac
-exit;
+exec sudo -P "SYSTEMTAP_STAPIO=${builddir}/stapio" \
+ "SYSTEMTAP_STAPRUN=${builddir}/run-staprun" \
+ "SYSTEMTAP_RUNTIME=${srcdir}/runtime" \
+ "SYSTEMTAP_REAL_UID=`id -ru`" \
+ "SYSTEMTAP_REAL_GID=`id -rg`" \
+ ${builddir}/staprun ${1+"$@"}
diff --git a/runtime/runtime.h b/runtime/runtime.h
index 822562a2..0a656b78 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -86,6 +86,8 @@ static struct
#include "io.c"
#include "arith.c"
#include "copy.c"
+#include "regs.c"
+#include "regs-ia64.c"
#include "task_finder.c"
diff --git a/runtime/staprun/common.c b/runtime/staprun/common.c
index 8200ec9d..26b166c2 100644
--- a/runtime/staprun/common.c
+++ b/runtime/staprun/common.c
@@ -82,7 +82,7 @@ int stap_strfloctime(char *buf, size_t max, const char *fmt, time_t t)
num = tm.tm_year % 100;
goto numbering02;
case 'C':
- num = ((tm.tm_year + 1900 - 1) / 100) + 1;
+ num = ((tm.tm_year + 1900) / 100);
goto numbering;
case 'm':
num = tm.tm_mon + 1;
@@ -107,7 +107,7 @@ int stap_strfloctime(char *buf, size_t max, const char *fmt, time_t t)
if (num == 0) num = 12;
goto numbering02;
case 'j':
- ret = snprintf(c, end - c, "%03d", tm.tm_yday);
+ ret = snprintf(c, end - c, "%03d", tm.tm_yday + 1);
if (ret < 0) return ret;
c += ret;
break;
@@ -117,7 +117,10 @@ int stap_strfloctime(char *buf, size_t max, const char *fmt, time_t t)
case 'l':
num = tm.tm_hour % 12;
if (num == 0) num = 12;
- goto numbering;
+ ret = snprintf(c, end - c, "%2d", num);
+ if (ret < 0) return ret;
+ c += ret;
+ break;
case 'M':
num = tm.tm_min;
goto numbering02;
diff --git a/runtime/staprun/relay.c b/runtime/staprun/relay.c
index 50f295b5..694cb27e 100644
--- a/runtime/staprun/relay.c
+++ b/runtime/staprun/relay.c
@@ -200,7 +200,7 @@ static void *reader_thread(void *data)
perr("Couldn't open file for cpu %d, exiting.", cpu);
return(NULL);
}
- wsize = 0;
+ wsize = rc;
}
if (write(out_fd[cpu], buf, rc) != rc) {
perr("Couldn't write to output %d for cpu %d, exiting.", out_fd[cpu], cpu);
diff --git a/runtime/staprun/relay_old.c b/runtime/staprun/relay_old.c
index ef8fd0da..469a5831 100644
--- a/runtime/staprun/relay_old.c
+++ b/runtime/staprun/relay_old.c
@@ -241,7 +241,7 @@ static int process_subbufs(struct _stp_buf_info *info,
perr("Couldn't open file for cpu %d, exiting.", cpu);
exit(1);
}
- scb->wsize = 0;
+ scb->wsize = len;
}
if (len) {
if (fwrite_unlocked (subbuf_ptr, len, 1, percpu_tmpfile[cpu]) != 1) {
@@ -320,7 +320,7 @@ int write_realtime_data(void *data, ssize_t nb)
perr("Couldn't open file, exiting.");
return -1;
}
- global_scb.wsize = 0;
+ global_scb.wsize = nb;
}
bw = write(out_fd[0], data, nb);
if (bw >= 0 && bw != nb) {
diff --git a/runtime/sym.c b/runtime/sym.c
index d0c5d9fd..ecd64fee 100644
--- a/runtime/sym.c
+++ b/runtime/sym.c
@@ -106,8 +106,8 @@ static unsigned long _stp_module_relocate(const char *module, const char *sectio
}
-/* Return module owner and fills in closest section of the address
- if found, return NULL otherwise.
+/* Return module owner and, if sec != NULL, fills in closest section
+ of the address if found, return NULL otherwise.
XXX: needs to be address-space-specific. */
static struct _stp_module *_stp_mod_sec_lookup(unsigned long addr,
struct task_struct *task,
@@ -151,7 +151,8 @@ static struct _stp_module *_stp_mod_sec_lookup(unsigned long addr,
{
closest_section_offset = this_section_offset;
m = _stp_modules[midx];
- *sec = & m->sections[secidx];
+ if (sec)
+ *sec = & m->sections[secidx];
}
}
}
@@ -338,8 +339,15 @@ static int _stp_func_print(unsigned long address, int verbose, int exact)
return 0;
}
+/** Puts symbolic information of an address in a string.
+ * @param src The string to fill in.
+ * @param len The length of the given src string.
+ * @param address The address to lookup.
+ * @param add_mod Whether to include module name information if found.
+ */
+
static void _stp_symbol_snprint(char *str, size_t len, unsigned long address,
- struct task_struct *task)
+ struct task_struct *task, int add_mod)
{
const char *modname;
const char *name;
@@ -347,9 +355,13 @@ static void _stp_symbol_snprint(char *str, size_t len, unsigned long address,
name = _stp_kallsyms_lookup(address, &size, &offset, &modname, NULL,
task);
- if (name)
- strlcpy(str, name, len);
- else
+ if (name) {
+ if (add_mod && modname && *modname)
+ _stp_printf("%s %s+%#lx/%#lx\n",
+ name, modname, offset, size);
+ else
+ strlcpy(str, name, len);
+ } else
_stp_snprintf(str, len, "%p", (int64_t) address);
}
diff --git a/runtime/uprobes/.gitignore b/runtime/uprobes/.gitignore
new file mode 100644
index 00000000..c8172c41
--- /dev/null
+++ b/runtime/uprobes/.gitignore
@@ -0,0 +1,7 @@
+/*.o
+/*.cmd
+/.tmp_versions
+/Module.*
+/modules.order
+/uprobes.ko
+/uprobes.mod.c
diff --git a/tapset/context-symbols.stp b/tapset/context-symbols.stp
index 4c200aa8..66d9fea2 100644
--- a/tapset/context-symbols.stp
+++ b/tapset/context-symbols.stp
@@ -66,7 +66,7 @@ function probefunc:string () %{ /* pure */
#else
((unsigned long)REG_IP(CONTEXT->regs) >= (unsigned long)PAGE_OFFSET)) {
#endif
- _stp_symbol_snprint(THIS->__retvalue, MAXSTRINGLEN, REG_IP(CONTEXT->regs), current);
+ _stp_symbol_snprint(THIS->__retvalue, MAXSTRINGLEN, REG_IP(CONTEXT->regs), current, 0);
if (THIS->__retvalue[0] == '.') /* powerpc symbol has a dot*/
strlcpy(THIS->__retvalue,THIS->__retvalue + 1,MAXSTRINGLEN);
} else {
@@ -89,13 +89,59 @@ function probemod:string () %{ /* pure */
while (*ptr != '"' && --len && *ptr)
*dst++ = *ptr++;
*dst = 0;
- } else {
- /* XXX: need a PC- and symbol-table-based fallback. */
- THIS->__retvalue[0] = '\0';
- }
+ } else if (CONTEXT->regs) {
+ struct _stp_module *m;
+ m = _stp_mod_sec_lookup (REG_IP(CONTEXT->regs), current, NULL);
+ if (m && m->name)
+ strlcpy (THIS->__retvalue, m->name, MAXSTRINGLEN);
+ else
+ strlcpy (THIS->__retvalue, "<unknown>", MAXSTRINGLEN);
+ } else
+ strlcpy (THIS->__retvalue, "<unknown>", MAXSTRINGLEN);
%}
-function symbolname:string (addr:long) %{ /* pure */
+/**
+ * sfunction modname - Return the kernel module name loaded at the address.
+ * @addr: The address.
+ *
+ * Description: Returns the module name associated with the given
+ * address if known. If not known it will return the string "<unknown>".
+ * If the address was not in a kernel module, but in the kernel itself,
+ * then the string "kernel" will be returned.
+ */
+function modname:string (addr: long) %{ /* pure */
+ struct _stp_module *m;
+ m = _stp_mod_sec_lookup (THIS->addr, current, NULL);
+ if (m && m->name)
+ strlcpy (THIS->__retvalue, m->name, MAXSTRINGLEN);
+ else
+ strlcpy (THIS->__retvalue, "<unknown>", MAXSTRINGLEN);
+%}
+
+/**
+ * sfunction symname - Return the symbol associated with the given address.
+ * @addr: The address to translate.
+ *
+ * Description: Returns the (function) symbol name associated with the
+ * given address if known. If not known it will return the hex string
+ * representation of addr.
+ */
+function symname:string (addr: long) %{ /* pure */
+ _stp_symbol_snprint(THIS->__retvalue, MAXSTRINGLEN, THIS->addr,
+ current, 0);
+%}
+
+/**
+ * sfunction symdata - Return the symbol and module offset for the address.
+ * @addr: The address to translate.
+ *
+ * Description: Returns the (function) symbol name associated with the
+ * given address if known, plus the module name (between brackets) and
+ * the offset inside the module, plus the size of the symbol function.
+ * If any element is not known it will be ommitted and if the symbol name
+ * is unknown it will return the hex string for the given address.
+ */
+function symdata:string (addr: long) %{ /* pure */
_stp_symbol_snprint(THIS->__retvalue, MAXSTRINGLEN, THIS->addr,
- current);
+ current, 1);
%}
diff --git a/tapset/context-unwind.stp b/tapset/context-unwind.stp
index a976f8b6..b3d19e29 100644
--- a/tapset/context-unwind.stp
+++ b/tapset/context-unwind.stp
@@ -57,7 +57,7 @@ function caller:string() %{ /* pure */
if (CONTEXT->pi)
_stp_symbol_snprint( THIS->__retvalue, MAXSTRINGLEN,
(unsigned long)_stp_ret_addr_r(CONTEXT->pi),
- current);
+ current, 0);
else
strlcpy(THIS->__retvalue,"unknown",MAXSTRINGLEN);
%}
diff --git a/tapset/errno.stp b/tapset/errno.stp
index eda9bff1..011ff7e2 100644
--- a/tapset/errno.stp
+++ b/tapset/errno.stp
@@ -345,12 +345,20 @@ static const int Maxerrno = sizeof(errlist)/sizeof(char *);
function errno_str:string (err:long) %{ /* pure */
long e = THIS->err;
- if (e < 0 && e > -Maxerrno && errlist[-e])
- strlcpy (THIS->__retvalue, errlist[-e], MAXSTRINGLEN);
- else if (e > 0 && e < Maxerrno && errlist[e])
+ e = (e > 0 ? e : -e);
+ if (e > 0 && e < Maxerrno && errlist[e])
strlcpy (THIS->__retvalue, errlist[e], MAXSTRINGLEN);
%}
+function errno_p:long (err:long) %{ /* pure */
+ long e = THIS->err;
+ e = (e > 0 ? e : -e);
+ if (e > 0 && e < Maxerrno && errlist[e])
+ THIS->__retvalue = e;
+ else
+ THIS->__retvalue = 0;
+%}
+
%{
static long _stp_returnval(struct pt_regs *regs) {
if (regs) {
diff --git a/testsuite/buildok/modname.stp b/testsuite/buildok/modname.stp
new file mode 100755
index 00000000..02229301
--- /dev/null
+++ b/testsuite/buildok/modname.stp
@@ -0,0 +1,8 @@
+#! stap -p4
+#
+# Test the translatability for modname()
+#
+probe begin
+{
+ log(modname(0))
+}
diff --git a/testsuite/buildok/symdata.stp b/testsuite/buildok/symdata.stp
new file mode 100755
index 00000000..d7e803a9
--- /dev/null
+++ b/testsuite/buildok/symdata.stp
@@ -0,0 +1,8 @@
+#! stap -p4
+#
+# Test the translatability for symdata()
+#
+probe begin
+{
+ log(symdata(0))
+}
diff --git a/testsuite/buildok/symname.stp b/testsuite/buildok/symname.stp
new file mode 100755
index 00000000..e082d1a5
--- /dev/null
+++ b/testsuite/buildok/symname.stp
@@ -0,0 +1,8 @@
+#! stap -p4
+#
+# Test the translatability for symname()
+#
+probe begin
+{
+ log(symname(0))
+}
diff --git a/testsuite/systemtap.base/stmt_rel.exp b/testsuite/systemtap.base/stmt_rel.exp
index be51fef9..ec12e484 100644
--- a/testsuite/systemtap.base/stmt_rel.exp
+++ b/testsuite/systemtap.base/stmt_rel.exp
@@ -1,8 +1,40 @@
-# test integer limits. Set and print variables and print constants.
-
set test "stmt_rel"
-set ::result_string {PASS bio_init
-PASS line number
-PASS wildcard}
-stap_run2 $srcdir/$subdir/$test.stp
+set line1 ""
+spawn stap -l "kernel.statement(\"bio_init@fs/bio.c+2\")"
+expect {
+ -timeout 180
+ -re {[0-9][0-9][0-9]} { regexp "\[0-9\]\[0-9\]\[0-9\]" $expect_out(0,string) line1; }
+ timeout { fail "$test C (timeout)" }
+ eof { }
+}
+
+set line2 ""
+spawn stap -l "kernel.statement(\"bio_init@fs/bio.c+3\")"
+expect {
+ -timeout 180
+ -re {[0-9][0-9][0-9]} { regexp "\[0-9\]\[0-9\]\[0-9\]" $expect_out(0,string) line2; }
+ timeout { fail "$test C (timeout)" }
+ eof { }
+}
+
+if { $line1 < $line2 } {
+ pass "$test line numbers"
+} else {
+ fail "$test line numbers"
+}
+
+set ok 0
+spawn stap -l "kernel.statement(\"bio_init@fs/bio.c:*\")"
+expect {
+ -timeout 180
+ -re {[0-9][0-9][0-9]} { incr ok; exp_continue }
+ timeout { fail "$test C (timeout)" }
+ eof { }
+}
+
+if { $ok == 3 } {
+ pass "$test wildcard"
+} else {
+ fail "$test wildcard ($ok)"
+}
diff --git a/testsuite/systemtap.base/stmt_rel.stp b/testsuite/systemtap.base/stmt_rel.stp
deleted file mode 100644
index cfe77317..00000000
--- a/testsuite/systemtap.base/stmt_rel.stp
+++ /dev/null
@@ -1,71 +0,0 @@
-global stack2pp, stack2func, stack3pp, stack3func
-global wildcardpp, wild_count
-
-probe kernel.statement("bio_init@fs/bio.c+2") {
- # stack2 = tokenize(backtrace(), " ")
- stack2func = probefunc()
- stack2pp = pp()
-}
-probe kernel.statement("bio_init@fs/bio.c+3") {
- # stack3 = tokenize(backtrace(), " " )
- stack3func = probefunc()
- stack3pp = pp()
-}
-
-probe kernel.statement("bio_put@fs/bio.c:*") {
- line = tokenize(pp(),":")
- line = tokenize("",":")
- line = substr(line,0,strlen(line)-2)
- wildcardpp[strtol(line,10)]++
-
- if (wild_count++ <= 10) {
- next
- }
-
- stack2pp = tokenize(stack2pp,":")
- stack2pp = tokenize("",":")
- stack3pp = tokenize(stack3pp,":")
- stack3pp = tokenize("",":")
-
- stack2line = strtol (substr(stack2pp,0,strlen(stack2pp)-2), 10)
- stack3line = strtol (substr(stack3pp,0,strlen(stack3pp)-2), 10)
-
- # Did functions for both bio_init probes match?
- if (stack2func == stack3func) {
- printf ("PASS %s\n", stack2func)
- }
- else {
- printf ("FAIL %s %s\n", stack2func, stack3func)
- }
-
- # Was line # for bio_init probe +2 < line # for bio_init probe +3?
- if ((stack2line + 1) == stack3line) {
- printf ("PASS line number\n")
- }
- else {
- printf ("FAIL line number %d %d\n", stack2line, stack3line)
- }
-
- # This test does not take optimized code into account
- # Was address for bio_init probe +2 < address for bio_init probe +3?
- # if (stack2 < stack3) {
- # printf ("PASS address\n")
- # }
- # else {
- # printf ("FAIL address %s %s\n", stack2, stack3)
- # }
-
- # Did wildcard probe hit at least 4 different statements?
- foreach ([i] in wildcardpp) {
- statement_count += 1
- }
- if (statement_count >= 4) {
- printf ("PASS wildcard\n")
- }
- else
- {
- printf ("FAIL wildcard %d\n", statement_count)
- }
-
- exit()
-}
diff --git a/testsuite/systemtap.context/usymbols.exp b/testsuite/systemtap.context/usymbols.exp
index 82f68b67..8af20126 100644
--- a/testsuite/systemtap.context/usymbols.exp
+++ b/testsuite/systemtap.context/usymbols.exp
@@ -35,7 +35,7 @@ set testscript {
probe syscall.rt_sigaction {
if (pid() == target() && execname() == "%s") {
handler = $act->sa_handler;
- printf("handler: %%s\n", symbolname(handler));
+ printf("handler: %%s\n", symname(handler));
}
}
/* track through uprobes, so as to make sure we have the symbols */
diff --git a/translate.cxx b/translate.cxx
index 9085349e..cab37487 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -4967,9 +4967,7 @@ translate_pass (systemtap_session& s)
s.op->newline() << "#define STP_PERFMON";
s.op->newline() << "#include \"runtime.h\"";
- s.op->newline() << "#include \"regs.c\"";
s.op->newline() << "#include \"stack.c\"";
- s.op->newline() << "#include \"regs-ia64.c\"";
s.op->newline() << "#include \"stat.c\"";
s.op->newline() << "#include <linux/string.h>";
s.op->newline() << "#include <linux/timer.h>";