summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-05-05 14:01:51 -0400
committerDave Brolley <brolley@redhat.com>2009-05-05 14:01:51 -0400
commitf80f9e60d170329f4c3210d28914daa732ce0a48 (patch)
treebf7c5142c22a35aa8b56adfcd4812873a0b2efca
parentb03d329d5ad9d22d684b61859971a7b12b5e5104 (diff)
parent7c4e9d57761b10058d36756df3b39039e292812d (diff)
downloadsystemtap-steved-f80f9e60d170329f4c3210d28914daa732ce0a48.tar.gz
systemtap-steved-f80f9e60d170329f4c3210d28914daa732ce0a48.tar.xz
systemtap-steved-f80f9e60d170329f4c3210d28914daa732ce0a48.zip
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Conflicts: modsign.cxx runtime/staprun/modverify.c runtime/staprun/staprun_funcs.c stap-authorize-server-cert stap-authorize-signing-cert stap-serverd systemtap.spec
-rw-r--r--NEWS7
-rw-r--r--buildrun.cxx14
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-ioblktime.xml111
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml2
-rw-r--r--main.cxx8
-rw-r--r--modsign.cxx19
-rw-r--r--runtime/staprun/modverify.c169
-rw-r--r--runtime/staprun/staprun_funcs.c4
-rw-r--r--[-rwxr-xr-x]stap-authorize-cert0
-rwxr-xr-xstap-authorize-server-cert2
-rwxr-xr-xstap-authorize-signing-cert2
-rw-r--r--[-rwxr-xr-x]stap-gen-cert0
-rwxr-xr-xstap-serverd7
-rw-r--r--stapfuncs.3stap.in3
-rw-r--r--systemtap.spec4
-rw-r--r--tapsets.cxx5
-rw-r--r--testsuite/systemtap.base/alternatives.exp6
-rw-r--r--testsuite/systemtap.syscall/access.c24
-rw-r--r--testsuite/systemtap.syscall/acct.c2
-rw-r--r--[-rwxr-xr-x]testsuite/systemtap.syscall/alarm.c20
-rw-r--r--testsuite/systemtap.syscall/chmod.c44
-rw-r--r--testsuite/systemtap.syscall/clock.c38
-rw-r--r--testsuite/systemtap.syscall/dir.c24
-rw-r--r--testsuite/systemtap.syscall/forkwait.c4
-rw-r--r--testsuite/systemtap.syscall/futimes.c14
-rw-r--r--testsuite/systemtap.syscall/itimer.c14
-rw-r--r--testsuite/systemtap.syscall/link.c20
-rw-r--r--testsuite/systemtap.syscall/mmap.c22
-rw-r--r--testsuite/systemtap.syscall/mount.c10
-rw-r--r--testsuite/systemtap.syscall/net1.c12
-rw-r--r--testsuite/systemtap.syscall/openclose.c32
-rw-r--r--testsuite/systemtap.syscall/poll.c10
-rw-r--r--testsuite/systemtap.syscall/readwrite.c34
-rw-r--r--testsuite/systemtap.syscall/rt_signal.c12
-rw-r--r--testsuite/systemtap.syscall/select.c8
-rw-r--r--testsuite/systemtap.syscall/sendfile.c2
-rw-r--r--testsuite/systemtap.syscall/signal.c14
-rw-r--r--testsuite/systemtap.syscall/stat.c18
-rw-r--r--testsuite/systemtap.syscall/statfs.c6
-rw-r--r--[-rwxr-xr-x]testsuite/systemtap.syscall/swap.c12
-rw-r--r--testsuite/systemtap.syscall/sync.c6
-rw-r--r--testsuite/systemtap.syscall/syscall.exp12
-rwxr-xr-xtestsuite/systemtap.syscall/test.tcl15
-rw-r--r--testsuite/systemtap.syscall/timer.c10
-rw-r--r--testsuite/systemtap.syscall/trunc.c4
-rw-r--r--testsuite/systemtap.syscall/uid.c32
-rw-r--r--testsuite/systemtap.syscall/uid16.c32
-rw-r--r--testsuite/systemtap.syscall/umask.c12
-rw-r--r--testsuite/systemtap.syscall/unlink.c12
49 files changed, 613 insertions, 281 deletions
diff --git a/NEWS b/NEWS
index 6cfd7158..664753d3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,12 @@
* What's new
+- Module signing: If the appropriate nss libraries are available on your system,
+ stap will sign each compiled module using a self-generated certificate.
+ This is the first step toward extending authority to load certain modules to
+ unprivileged users. For now, if the system administrator adds a certificate
+ to a database of trusted signers (stap-authorize-signing-cert), modules signed
+ using that certificate will be verified by staprun against tampering.
+ Otherwise, you should notice no difference in the operation of stap or staprun.
* What's new in version 0.9.7
diff --git a/buildrun.cxx b/buildrun.cxx
index 31f7ec00..1b441144 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -66,7 +66,8 @@ run_make_cmd(systemtap_session& s, string& make_cmd)
if (s.verbose > 1) clog << "Running " << make_cmd << endl;
rc = stap_system (make_cmd.c_str());
-
+ if (rc && s.verbose > 1)
+ clog << "Error " << rc << " " << strerror(rc) << endl;
return rc;
}
@@ -243,6 +244,8 @@ kernel_built_uprobes (systemtap_session& s)
string grep_cmd = string ("/bin/grep -q unregister_uprobe ") +
s.kernel_build_tree + string ("/Module.symvers");
int rc = stap_system (grep_cmd.c_str());
+ if (rc && s.verbose > 1)
+ clog << "Error " << rc << " " << strerror(rc) << endl;
return (rc == 0);
}
@@ -294,6 +297,8 @@ copy_uprobes_symbols (systemtap_session& s)
string cp_cmd = string("/bin/cp ") + uprobes_home +
string("/Module.symvers ") + s.tmpdir;
int rc = stap_system (cp_cmd.c_str());
+ if (rc && s.verbose > 1)
+ clog << "Error " << rc << " " << strerror(rc) << endl;
return rc;
}
@@ -359,6 +364,8 @@ run_pass (systemtap_session& s)
if (s.verbose>1) clog << "Running " << staprun_cmd << endl;
rc = stap_system (staprun_cmd.c_str ());
+ if (rc && s.verbose > 1)
+ clog << "Error " << rc << " " << strerror(rc) << endl;
return rc;
}
@@ -519,7 +526,10 @@ make_typequery_umod(systemtap_session& s, const string& header, string& name)
+ name + " -xc /dev/null -include " + header;
if (s.verbose < 4)
cmd += " >/dev/null 2>&1";
- return stap_system (cmd.c_str());
+ int rc = stap_system (cmd.c_str());
+ if (rc && s.verbose > 1)
+ clog << "Error " << rc << " " << strerror(rc) << endl;
+ return rc;
}
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-ioblktime.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-ioblktime.xml
new file mode 100644
index 00000000..e586d81a
--- /dev/null
+++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-ioblktime.xml
@@ -0,0 +1,111 @@
+<?xml version='1.0'?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+
+ <section id="ioblktimesect">
+ <title>Periodically Print I/O Block Time</title>
+<indexterm>
+<primary>script examples</primary>
+<secondary>monitoring I/O block time</secondary>
+</indexterm>
+
+<indexterm>
+<primary>examples of SystemTap scripts</primary>
+<secondary>monitoring I/O block time</secondary>
+</indexterm>
+
+<indexterm>
+<primary>monitoring I/O block time</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+<indexterm>
+<primary>I/O block time, monitoring</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+<indexterm>
+<primary>printing I/O block time (periodically)</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+ <para>
+ This section describes how to track the amount of time each block I/O requests spends
+ waiting for completion. This is useful in determining whether there are too many
+ outstanding block I/O operations at any given time.
+ </para>
+
+<formalpara id="ioblktime">
+ <title>ioblktime.stp</title>
+<para>
+<programlisting>
+<xi:include parse="text" href="extras/testsuite/systemtap.examples/io/ioblktime.stp" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+</para>
+</formalpara>
+
+<!-- <remark>what does $count do, specifically?</remark> -->
+
+<para>
+ <xref linkend="ioblktime"/> computes the average waiting time for block I/O per device,
+ and prints a list every 10 seconds. As always, you can revise this refresh rate by
+ editing the specified value in <command>probe timer.s(10), end {</command>.
+</para>
+<para>
+ In some cases, there can be too many outstanding block
+ I/O operations, at which point the script can exceed the default number of
+ <command>MAXMAPENTRIES</command>. <command>MAXMAPENTRIES</command> is the maximum number of
+ rows in an array if the array size is not specified explicitly when declared. If the script
+ exceeds the default <command>MAXMAPENTRIES</command> value of 2048, run the script again with
+ the <command>stap</command> option <command>-DMAXMAPENTRIES=10000</command>.
+</para>
+
+
+<example id="ioblktimeoutput">
+ <title><xref linkend="ioblktime"/> Sample Output</title>
+<screen>
+ device rw total (us) count avg (us)
+ sda W 9659 6 1609
+ dm-0 W 20278 6 3379
+ dm-0 R 20524 5 4104
+ sda R 19277 5 3855
+</screen>
+</example>
+
+<para>
+ <xref linkend="ioblktimeoutput"/> displays the device name, operations performed
+ (<command>rw</command>), total wait time of all operations (<command>total(us)</command>),
+ number of operations (<command>count</command>), and average
+ wait time for all those operations (<command>avg (us)</command>). The times tallied by the
+ script are in microseconds.
+</para>
+
+<!--
+global reads, writes, total_io
+
+probe kernel.function("vfs_read") {
+reads[execname()] += $count
+}
+
+probe kernel.function("vfs_write") {
+writes[execname()] += $count
+}
+
+# print top 10 IO processes every 5 seconds
+probe timer.s(5) {
+foreach (name in writes)
+total_io[name] += writes[name]
+foreach (name in reads)
+total_io[name] += reads[name]
+printf ("%16s\t%10s\t%10s\n", "Process", "KB Read", "KB Written")
+foreach (name in total_io- limit 10)
+printf("%16s\t%10d\t%10d\n", name,
+reads[name]/1024, writes[name]/1024)
+delete reads
+delete writes
+delete total_io
+print("\n")
+}
+-->
+
+</section> \ No newline at end of file
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml
index 80e68770..4d999b53 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml
@@ -56,6 +56,7 @@
<!-- <xi:include href="Useful_Scripts-Kernel.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> -->
<xi:include href="Useful_Scripts-inodewatch.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Useful_Scripts-inodewatch2.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include condition="fedora" href="Useful_Scripts-ioblktime.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</section>
<section id="mainsect-profiling">
@@ -71,6 +72,7 @@
<!-- removed; handler function no longer working as expected
<xi:include href="Useful_Scripts-kernelprofiling.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> -->
+
<xi:include href="Useful_Scripts-futexes.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<!-- <xi:include href="Useful_Scripts-Network.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
diff --git a/main.cxx b/main.cxx
index 84bbce73..6c28c4a5 100644
--- a/main.cxx
+++ b/main.cxx
@@ -414,6 +414,14 @@ main (int argc, char * const argv [])
else
s.cert_db_path = getenv("HOME") + string ("/.systemtap/ssl/server");
+ // Location of our signing certificate.
+ // If we're root, use the database in SYSCONFDIR, otherwise
+ // use the one in our $HOME directory. */
+ if (geteuid() == 0)
+ s.cert_db_path = SYSCONFDIR "/systemtap/ssl/server";
+ else
+ s.cert_db_path = getenv("HOME") + string ("/.systemtap/ssl/server");
+
const char* s_p = getenv ("SYSTEMTAP_TAPSET");
if (s_p != NULL)
{
diff --git a/modsign.cxx b/modsign.cxx
index 1cb6ddf9..b66497fd 100644
--- a/modsign.cxx
+++ b/modsign.cxx
@@ -62,7 +62,7 @@ check_cert_file_permissions (
rc = stat (cert_file.c_str (), & info);
if (rc)
{
- cerr << "Could not obtain information on certificate database " << cert_file << "." << endl;
+ cerr << "Could not obtain information on certificate file " << cert_file << "." << endl;
perror ("");
return 0;
}
@@ -281,8 +281,21 @@ check_cert_db_permissions (const string &cert_db_path) {
*/
static int
init_cert_db_path (const string &cert_db_path) {
- string cmd = "stap-gen-cert " + cert_db_path;
- return system (cmd.c_str()) == 0;
+ int rc;
+
+ // Generate the certificate and database.
+ string cmd = BINDIR "/stap-gen-cert " + cert_db_path;
+ rc = system (cmd.c_str()) == 0;
+
+ // If we are root, authorize the new certificate as a trusted
+ // signer. It is not an error if this fails.
+ if (geteuid () == 0)
+ {
+ cmd = BINDIR "/stap-authorize-signing-cert " + cert_db_path + "/stap.cert";
+ system (cmd.c_str());
+ }
+
+ return rc;
}
/* Function: int check_cert_db_path (const string &cert_db_path);
diff --git a/runtime/staprun/modverify.c b/runtime/staprun/modverify.c
index d9ccc094..2f3b96d5 100644
--- a/runtime/staprun/modverify.c
+++ b/runtime/staprun/modverify.c
@@ -31,6 +31,163 @@
#include "nsscommon.h"
#include "modverify.h"
+#include <sys/stat.h>
+
+/* Function: int check_cert_db_permissions (const char *cert_db_path);
+ *
+ * Check that the given certificate directory and its contents have
+ * the correct permissions.
+ *
+ * Returns 0 if there is an error, 1 otherwise.
+ */
+static int
+check_db_file_permissions (const char *cert_db_file) {
+ struct stat info;
+ int rc;
+
+ rc = stat (cert_db_file, & info);
+ if (rc)
+ {
+ fprintf (stderr, "Could not obtain information on certificate database file %s.\n",
+ cert_db_file);
+ perror ("");
+ return 0;
+ }
+
+ rc = 1; /* ok */
+
+ /* The owner of the file must be root. */
+ if (info.st_uid != 0)
+ {
+ fprintf (stderr, "Certificate database file %s must be owned by root.\n",
+ cert_db_file);
+ rc = 0;
+ }
+
+ /* Check the access permissions of the file. */
+ if ((info.st_mode & S_IRUSR) == 0)
+ fprintf (stderr, "Certificate database file %s should be readable by the owner.\n", cert_db_file);
+ if ((info.st_mode & S_IWUSR) == 0)
+ fprintf (stderr, "Certificate database file %s should be writeable by the owner.\n", cert_db_file);
+ if ((info.st_mode & S_IXUSR) != 0)
+ {
+ fprintf (stderr, "Certificate database file %s must not be executable by the owner.\n", cert_db_file);
+ rc = 0;
+ }
+ if ((info.st_mode & S_IRGRP) == 0)
+ {
+ fprintf (stderr, "Certificate database file %s should be readable by the group.\n", cert_db_file);
+ rc = 0;
+ }
+ if ((info.st_mode & S_IWGRP) != 0)
+ {
+ fprintf (stderr, "Certificate database file %s must not be writable by the group.\n", cert_db_file);
+ rc = 0;
+ }
+ if ((info.st_mode & S_IXGRP) != 0)
+ {
+ fprintf (stderr, "Certificate database file %s must not be executable by the group.\n", cert_db_file);
+ rc = 0;
+ }
+ if ((info.st_mode & S_IROTH) == 0)
+ {
+ fprintf (stderr, "Certificate database file %s should be readable by others.\n", cert_db_file);
+ rc = 0;
+ }
+ if ((info.st_mode & S_IWOTH) != 0)
+ {
+ fprintf (stderr, "Certificate database file %s must not be writable by others.\n", cert_db_file);
+ rc = 0;
+ }
+ if ((info.st_mode & S_IXOTH) != 0)
+ {
+ fprintf (stderr, "Certificate database file %s must not be executable by others.\n", cert_db_file);
+ rc = 0;
+ }
+
+ return rc;
+}
+
+/* Function: int check_cert_db_permissions (const char *cert_db_path);
+ *
+ * Check that the given certificate directory and its contents have
+ * the correct permissions.
+ *
+ * Returns 0 if there is an error, 1 otherwise.
+ */
+static int
+check_cert_db_permissions (const char *cert_db_path) {
+ struct stat info;
+ char *fileName;
+ int rc;
+
+ rc = stat (cert_db_path, & info);
+ if (rc)
+ {
+ fprintf (stderr, "Could not obtain information on certificate database directory %s.\n",
+ cert_db_path);
+ perror ("");
+ return 0;
+ }
+
+ rc = 1; /* ok */
+
+ /* The owner of the database must be root. */
+ if (info.st_uid != 0)
+ {
+ fprintf (stderr, "Certificate database directory %s must be owned by root.\n", cert_db_path);
+ rc = 0;
+ }
+
+ /* Check the database directory access permissions */
+ if ((info.st_mode & S_IRUSR) == 0)
+ fprintf (stderr, "Certificate database %s should be readable by the owner.\n", cert_db_path);
+ if ((info.st_mode & S_IWUSR) == 0)
+ fprintf (stderr, "Certificate database %s should be writeable by the owner.\n", cert_db_path);
+ if ((info.st_mode & S_IXUSR) == 0)
+ fprintf (stderr, "Certificate database %s should be searchable by the owner.\n", cert_db_path);
+ if ((info.st_mode & S_IRGRP) == 0)
+ fprintf (stderr, "Certificate database %s should be readable by the group.\n", cert_db_path);
+ if ((info.st_mode & S_IWGRP) != 0)
+ {
+ fprintf (stderr, "Certificate database %s must not be writable by the group.\n", cert_db_path);
+ rc = 0;
+ }
+ if ((info.st_mode & S_IXGRP) == 0)
+ fprintf (stderr, "Certificate database %s should be searchable by the group.\n", cert_db_path);
+ if ((info.st_mode & S_IROTH) == 0)
+ fprintf (stderr, "Certificate database %s should be readable by others.\n", cert_db_path);
+ if ((info.st_mode & S_IWOTH) != 0)
+ {
+ fprintf (stderr, "Certificate database %s must not be writable by others.\n", cert_db_path);
+ rc = 0;
+ }
+ if ((info.st_mode & S_IXOTH) == 0)
+ fprintf (stderr, "Certificate database %s should be searchable by others.\n", cert_db_path);
+
+ /* Now check the permissions of the critical files. */
+ fileName = PORT_Alloc (strlen (cert_db_path) + 11);
+ if (! fileName)
+ {
+ fprintf (stderr, "Unable to allocate memory for certificate database file names\n");
+ return 0;
+ }
+
+ sprintf (fileName, "%s/cert8.db", cert_db_path);
+ rc &= check_db_file_permissions (fileName);
+ sprintf (fileName, "%s/key3.db", cert_db_path);
+ rc &= check_db_file_permissions (fileName);
+ sprintf (fileName, "%s/secmod.db", cert_db_path);
+ rc &= check_db_file_permissions (fileName);
+
+ PORT_Free (fileName);
+
+ if (rc == 0)
+ fprintf (stderr, "Unable to use certificate database %s due to errors.\n", cert_db_path);
+
+ return rc;
+}
+
static int
verify_it (const char *inputName, const char *signatureName, SECKEYPublicKey *pubKey)
{
@@ -167,8 +324,20 @@ int verify_module (const char *module_name, const char *signature_name)
CERTCertList *certList;
CERTCertListNode *certListNode;
CERTCertificate *cert;
+ PRStatus prStatus;
+ PRFileInfo info;
int rc = 0;
+ /* Look for the certificate database. If it's not there, it's not an error, it
+ just means that the module can't be verified. */
+ prStatus = PR_GetFileInfo (dbdir, &info);
+ if (prStatus != PR_SUCCESS || info.type != PR_FILE_DIRECTORY)
+ return MODULE_UNTRUSTED;
+
+ /* Verify the permissions of the certificate database and its files. */
+ if (! check_cert_db_permissions (dbdir))
+ return MODULE_UNTRUSTED;
+
/* Call the NSPR initialization routines. */
PR_Init (PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);
diff --git a/runtime/staprun/staprun_funcs.c b/runtime/staprun/staprun_funcs.c
index 6e72fd72..f8fe1308 100644
--- a/runtime/staprun/staprun_funcs.c
+++ b/runtime/staprun/staprun_funcs.c
@@ -225,7 +225,7 @@ check_signature(void)
/* Use realpath() to canonicalize the module path. */
if (realpath(modpath, module_realpath) == NULL) {
- perr("Unable to canonicalize signature path \"%s\"", modpath);
+ perr("Unable to canonicalize module path \"%s\"", modpath);
return MODULE_CHECK_ERROR;
}
@@ -403,7 +403,6 @@ check_groups (void)
perr("Unable to retrieve group list");
return -1;
}
-
for (i = 0; i < ngids; i++) {
/* If the user is a member of 'stapdev', then we're
* done, since he can use staprun without any
@@ -419,7 +418,6 @@ check_groups (void)
if (gidlist[i] == stapusr_gid)
gid = stapusr_gid;
}
-
if (gid != stapusr_gid) {
unprivileged_user = 1;
return 0;
diff --git a/stap-authorize-cert b/stap-authorize-cert
index 21af2ce0..21af2ce0 100755..100644
--- a/stap-authorize-cert
+++ b/stap-authorize-cert
diff --git a/stap-authorize-server-cert b/stap-authorize-server-cert
index d5f9c2e6..13fb9c9f 100755
--- a/stap-authorize-server-cert
+++ b/stap-authorize-server-cert
@@ -27,4 +27,4 @@ if test "X$certdb" = "X"; then
certdb=$stap_ssl_db/client
fi
-stap-authorize-cert $certfile $certdb
+${stap_exec_prefix}stap-authorize-cert $certfile $certdb
diff --git a/stap-authorize-signing-cert b/stap-authorize-signing-cert
index 429d7fa5..22da27c4 100755
--- a/stap-authorize-signing-cert
+++ b/stap-authorize-signing-cert
@@ -27,4 +27,4 @@ if test "X$certdb" = "X"; then
certdb=$stap_signing_db
fi
-stap-authorize-cert $certfile $certdb
+${stap_exec_prefix}stap-authorize-cert $certfile $certdb
diff --git a/stap-gen-cert b/stap-gen-cert
index 574df351..574df351 100755..100644
--- a/stap-gen-cert
+++ b/stap-gen-cert
diff --git a/stap-serverd b/stap-serverd
index b422deaa..4eee8c38 100755
--- a/stap-serverd
+++ b/stap-serverd
@@ -52,12 +52,15 @@ function initialization {
${stap_exec_prefix}stap-gen-cert $ssl_db || exit 1
# Now add the server's certificate to the client's database,
# making it a trusted peer. Do this only if the client has been installed.
- if test -f `which ${stap_exec_prefix}stap-add-server-cert` -a -x `which ${stap_exec_prefix}stap-add-server-cert`; then
+ if test -f `which ${stap_exec_prefix}stap-client` -a \
+ -x `which ${stap_exec_prefix}stap-client`; then
${stap_exec_prefix}stap-authorize-server-cert $ssl_db/$stap_certfile
fi
elif ! test -f $stap_ssl_db/client/cert8.db; then
# If the client's database does not exist, then initialize it with our certificate.
- if test -f `which ${stap_exec_prefix}stap-add-server-cert` -a -x `which ${stap_exec_prefix}stap-add-server-cert`; then
+ # Do this only if the client has been installed.
+ if test -f `which ${stap_exec_prefix}stap-client` -a \
+ -x `which ${stap_exec_prefix}stap-client`; then
${stap_exec_prefix}stap-authorize-server-cert $ssl_db/$stap_certfile
fi
fi
diff --git a/stapfuncs.3stap.in b/stapfuncs.3stap.in
index ccc87b1d..b9326fde 100644
--- a/stapfuncs.3stap.in
+++ b/stapfuncs.3stap.in
@@ -154,6 +154,9 @@ Return the number of characters in str.
substr:string (str:string,start:long, stop:long)
Return the substring of str starting from character start and ending at character stop.
.TP
+stringat:string (str:string,pos:long)
+Return the character in given position of string.
+.TP
isinstr:long (s1:string, s2:string)
Return 1 if string s1 contains string s2, returns 0 otherwise.
.TP
diff --git a/systemtap.spec b/systemtap.spec
index a28940b9..a3a346fc 100644
--- a/systemtap.spec
+++ b/systemtap.spec
@@ -293,6 +293,7 @@ exit 0
%files client
%defattr(-,root,root)
%{_bindir}/stap-client
+%{_bindir}/stap-env
%{_bindir}/stap-find-servers
%{_bindir}/stap-authorize-server-cert
%{_bindir}/stap-client-connect
@@ -302,10 +303,13 @@ exit 0
%defattr(-,root,root)
%{_bindir}/stap-server
%{_bindir}/stap-serverd
+%{_bindir}/stap-env
%{_bindir}/stap-start-server
%{_bindir}/stap-find-servers
%{_bindir}/stap-find-or-start-server
%{_bindir}/stap-stop-server
+%{_bindir}/stap-gen-cert
+%{_bindir}/stap-authorize-cert
%{_bindir}/stap-authorize-server-cert
%{_bindir}/stap-server-connect
%{_mandir}/man8/stap-server.8*
diff --git a/tapsets.cxx b/tapsets.cxx
index eac69322..9051d744 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -3072,7 +3072,10 @@ dwflpp::iterate_over_labels (Dwarf_Die *begin_die,
case DW_TAG_label:
break;
case DW_TAG_subprogram:
- function_name = name;
+ if (!dwarf_hasattr(&die, DW_AT_declaration))
+ function_name = name;
+ else
+ continue;
default:
if (dwarf_haschildren (&die))
iterate_over_labels (&die, q, callback);
diff --git a/testsuite/systemtap.base/alternatives.exp b/testsuite/systemtap.base/alternatives.exp
index fb263d7a..6cbc1e10 100644
--- a/testsuite/systemtap.base/alternatives.exp
+++ b/testsuite/systemtap.base/alternatives.exp
@@ -14,7 +14,7 @@
# listed, but that some alternatives are listed.
set local1_script {
- probe kernel.funtion("vfs_write") { ret = $z; }
+ probe kernel.function("vfs_write") { ret = $z; }
}
set struct1_script {
@@ -37,9 +37,9 @@ proc stap_run_alternatives {args} {
}
set test "LOCAL1"
-set rc [stap_run_alternatives stap -vu -p2 -e $local1_script]
+set rc [stap_run_alternatives stap -u -p2 -e $local1_script]
if {$rc >= 1} { pass $test } else { fail "$test ($rc)" }
set test "STRUCT1"
-set rc [stap_run_alternatives stap -vu -p2 -e $struct1_script]
+set rc [stap_run_alternatives stap -u -p2 -e $struct1_script]
if {$rc >= 1} { pass $test } else { fail "$test ($rc)" }
diff --git a/testsuite/systemtap.syscall/access.c b/testsuite/systemtap.syscall/access.c
index 682424d4..45066015 100644
--- a/testsuite/systemtap.syscall/access.c
+++ b/testsuite/systemtap.syscall/access.c
@@ -13,28 +13,28 @@ int main()
fd1 = creat("foobar1",S_IREAD|S_IWRITE);
access("foobar1", F_OK);
- // access ("foobar1", F_OK)
- // faccessat (AT_FDCWD, "foobar1", F_OK) = 0
+ //staptest// access ("foobar1", F_OK)
+ //staptest// faccessat (AT_FDCWD, "foobar1", F_OK) = 0
access("foobar1", R_OK);
- // access ("foobar1", R_OK)
- // faccessat (AT_FDCWD, "foobar1", R_OK) = 0
+ //staptest// access ("foobar1", R_OK)
+ //staptest// faccessat (AT_FDCWD, "foobar1", R_OK) = 0
access("foobar1", W_OK);
- // access ("foobar1", W_OK)
- // faccessat (AT_FDCWD, "foobar1", W_OK) = 0
+ //staptest// access ("foobar1", W_OK)
+ //staptest// faccessat (AT_FDCWD, "foobar1", W_OK) = 0
access("foobar1", X_OK);
- // access ("foobar1", X_OK)
- // faccessat (AT_FDCWD, "foobar1", X_OK) = -NNNN (EACCES)
+ //staptest// access ("foobar1", X_OK)
+ //staptest// faccessat (AT_FDCWD, "foobar1", X_OK) = -NNNN (EACCES)
access("foobar1", R_OK|W_OK);
- // access ("foobar1", W_OK |R_OK)
- // faccessat (AT_FDCWD, "foobar1", W_OK |R_OK) = 0
+ //staptest// access ("foobar1", W_OK |R_OK)
+ //staptest// faccessat (AT_FDCWD, "foobar1", W_OK |R_OK) = 0
access("foobar1", R_OK|W_OK|X_OK);
- // access ("foobar1", X_OK |W_OK |R_OK)
- // faccessat (AT_FDCWD, "foobar1", X_OK |W_OK |R_OK) = -NNNN (EACCES)
+ //staptest// access ("foobar1", X_OK |W_OK |R_OK)
+ //staptest// faccessat (AT_FDCWD, "foobar1", X_OK |W_OK |R_OK) = -NNNN (EACCES)
return 0;
}
diff --git a/testsuite/systemtap.syscall/acct.c b/testsuite/systemtap.syscall/acct.c
index 927e40c9..47f87961 100644
--- a/testsuite/systemtap.syscall/acct.c
+++ b/testsuite/systemtap.syscall/acct.c
@@ -4,7 +4,7 @@
int main()
{
acct("foobar");
- // acct ("foobar") = -NNNN
+ //staptest// acct ("foobar") = -NNNN
return 0;
}
diff --git a/testsuite/systemtap.syscall/alarm.c b/testsuite/systemtap.syscall/alarm.c
index 7cb17164..6f1bedce 100755..100644
--- a/testsuite/systemtap.syscall/alarm.c
+++ b/testsuite/systemtap.syscall/alarm.c
@@ -20,36 +20,36 @@ int main()
alarm(1);
#ifdef __ia64__
- // setitimer (ITIMER_REAL, \[0.000000,1.000000\], XXXX) = 0
+ //staptest// setitimer (ITIMER_REAL, \[0.000000,1.000000\], XXXX) = 0
#else
- // alarm (1) = 0
+ //staptest// alarm (1) = 0
#endif
pause();
#ifdef __ia64__
- // rt_sigsuspend () =
+ //staptest// rt_sigsuspend () =
#else
- // pause () =
+ //staptest// pause () =
#endif
alarm(0);
#ifdef __ia64__
- // setitimer (ITIMER_REAL, \[0.000000,0.000000\], XXXX) = 0
+ //staptest// setitimer (ITIMER_REAL, \[0.000000,0.000000\], XXXX) = 0
#else
- // alarm (0) = 0
+ //staptest// alarm (0) = 0
#endif
sleep(1);
- // nanosleep (\[1.000000000\], XXXX) = 0
+ //staptest// nanosleep (\[1.000000000\], XXXX) = 0
usleep(1234);
- // nanosleep (\[0.001234000\], 0x[0]+) = 0
+ //staptest// nanosleep (\[0.001234000\], 0x[0]+) = 0
nanosleep(&t, &rem);
- // nanosleep (\[0.000000789\], XXXX) = 0
+ //staptest// nanosleep (\[0.000000789\], XXXX) = 0
nanosleep(&t, NULL);
- // nanosleep (\[0.000000789\], 0x[0]+) = 0
+ //staptest// nanosleep (\[0.000000789\], 0x[0]+) = 0
return 0;
}
diff --git a/testsuite/systemtap.syscall/chmod.c b/testsuite/systemtap.syscall/chmod.c
index 9b0c58e1..724b86c4 100644
--- a/testsuite/systemtap.syscall/chmod.c
+++ b/testsuite/systemtap.syscall/chmod.c
@@ -11,70 +11,70 @@ int main()
int fd;
fd = open("foobar",O_WRONLY|O_CREAT, 0666);
- // open ("foobar", O_WRONLY|O_CREAT, 0666) = NNNN
+ //staptest// open ("foobar", O_WRONLY|O_CREAT, 0666) = NNNN
chmod("foobar", 0644);
- // chmod ("foobar", 0644)
- // fchmodat (AT_FDCWD, "foobar", 0644) = 0
+ //staptest// chmod ("foobar", 0644)
+ //staptest// fchmodat (AT_FDCWD, "foobar", 0644) = 0
fchmod(fd, 0444);
- // fchmod (NNNN, 0444) = 0
+ //staptest// fchmod (NNNN, 0444) = 0
chown("foobar", 5000, -1);
#ifdef __i386__
- // chown ("foobar", 5000, -1) =
+ //staptest// chown ("foobar", 5000, -1) =
#else
- // chown ("foobar", 5000, NNNN) =
+ //staptest// chown ("foobar", 5000, NNNN) =
#endif
chown("foobar", -1, 5001);
#ifdef __i386__
- // chown ("foobar", -1, 5001) =
+ //staptest// chown ("foobar", -1, 5001) =
#else
- // chown ("foobar", NNNN, 5001) =
+ //staptest// chown ("foobar", NNNN, 5001) =
#endif
fchown(fd, 5002, -1);
#ifdef __i386__
- // fchown (NNNN, 5002, -1) =
+ //staptest// fchown (NNNN, 5002, -1) =
#else
- // fchown (NNNN, 5002, NNNN) =
+ //staptest// fchown (NNNN, 5002, NNNN) =
#endif
fchown(fd, -1, 5003);
#ifdef __i386__
- // fchown (NNNN, -1, 5003) =
+ //staptest// fchown (NNNN, -1, 5003) =
#else
- // fchown (NNNN, NNNN, 5003) =
+ //staptest// fchown (NNNN, NNNN, 5003) =
#endif
lchown("foobar", 5004, -1);
#ifdef __i386__
- // lchown ("foobar", 5004, -1) =
+ //staptest// lchown ("foobar", 5004, -1) =
#else
- // lchown ("foobar", 5004, NNNN) =
+ //staptest// lchown ("foobar", 5004, NNNN) =
#endif
lchown("foobar", -1, 5005);
#ifdef __i386__
- // lchown ("foobar", -1, 5005) =
+ //staptest// lchown ("foobar", -1, 5005) =
#else
- // lchown ("foobar", NNNN, 5005) =
+ //staptest// lchown ("foobar", NNNN, 5005) =
#endif
#ifdef __i386__
syscall(SYS_chown, "foobar", 5000, -1);
- // chown16 ("foobar", 5000, -1) =
+ //staptest// chown16 ("foobar", 5000, -1) =
syscall(SYS_chown, "foobar", -1, 5001);
- // chown16 ("foobar", -1, 5001) =
+ //staptest// chown16 ("foobar", -1, 5001) =
syscall(SYS_fchown, fd, 5002, -1);
- // fchown16 (NNNN, 5002, -1) =
+ //staptest// fchown16 (NNNN, 5002, -1) =
syscall(SYS_fchown, fd, -1, 5003);
- // fchown16 (NNNN, -1, 5003) =
+ //staptest// fchown16 (NNNN, -1, 5003) =
syscall(SYS_lchown, "foobar", 5004, -1);
- // lchown16 ("foobar", 5004, -1) =
+ //staptest// lchown16 ("foobar", 5004, -1) =
syscall(SYS_lchown, "foobar", -1, 5005);
- // lchown16 ("foobar", -1, 5005) =
+ //staptest// lchown16 ("foobar", -1, 5005) =
#endif
close(fd);
diff --git a/testsuite/systemtap.syscall/clock.c b/testsuite/systemtap.syscall/clock.c
index bc84871d..995d59df 100644
--- a/testsuite/systemtap.syscall/clock.c
+++ b/testsuite/systemtap.syscall/clock.c
@@ -14,64 +14,64 @@ int main()
#ifdef SYS_time
syscall(SYS_time, &tt);
- // time (XXXX) = NNNN
+ //staptest// time (XXXX) = NNNN
syscall(SYS_time, NULL);
- // time (0x[0]+) = NNNN
+ //staptest// time (0x[0]+) = NNNN
#endif
t = syscall(SYS_gettimeofday, &tv, NULL);
- // gettimeofday (XXXX, 0x[0]+) = 0
+ //staptest// gettimeofday (XXXX, 0x[0]+) = 0
settimeofday(&tv, NULL);
- // settimeofday (\[NNNN.NNNN\], NULL) =
+ //staptest// settimeofday (\[NNNN.NNNN\], NULL) =
syscall(SYS_clock_gettime, CLOCK_REALTIME, &ts);
- // clock_gettime (CLOCK_REALTIME, XXXX) = 0
+ //staptest// clock_gettime (CLOCK_REALTIME, XXXX) = 0
syscall(SYS_clock_settime, CLOCK_REALTIME, &ts);
- // clock_settime (CLOCK_REALTIME, \[NNNN.NNNN\]) =
+ //staptest// clock_settime (CLOCK_REALTIME, \[NNNN.NNNN\]) =
syscall(SYS_clock_getres, CLOCK_REALTIME, &ts);
- // clock_getres (CLOCK_REALTIME, XXXX) = 0
+ //staptest// clock_getres (CLOCK_REALTIME, XXXX) = 0
syscall(SYS_clock_gettime, CLOCK_MONOTONIC, &ts);
- // clock_gettime (CLOCK_MONOTONIC, XXXX) = 0
+ //staptest// clock_gettime (CLOCK_MONOTONIC, XXXX) = 0
syscall(SYS_clock_settime, CLOCK_MONOTONIC, &ts);
- // clock_settime (CLOCK_MONOTONIC, \[NNNN.NNNN\]) =
+ //staptest// clock_settime (CLOCK_MONOTONIC, \[NNNN.NNNN\]) =
syscall(SYS_clock_getres, CLOCK_MONOTONIC, &ts);
- // clock_getres (CLOCK_MONOTONIC, XXXX) = 0
+ //staptest// clock_getres (CLOCK_MONOTONIC, XXXX) = 0
syscall(SYS_clock_gettime, CLOCK_PROCESS_CPUTIME_ID, &ts);
- // clock_gettime (CLOCK_PROCESS_CPUTIME_ID, XXXX) =
+ //staptest// clock_gettime (CLOCK_PROCESS_CPUTIME_ID, XXXX) =
syscall(SYS_clock_settime, CLOCK_PROCESS_CPUTIME_ID, &ts);
- // clock_settime (CLOCK_PROCESS_CPUTIME_ID, \[NNNN.NNNN\]) =
+ //staptest// clock_settime (CLOCK_PROCESS_CPUTIME_ID, \[NNNN.NNNN\]) =
syscall(SYS_clock_getres, CLOCK_PROCESS_CPUTIME_ID, &ts);
- // clock_getres (CLOCK_PROCESS_CPUTIME_ID, XXXX) =
+ //staptest// clock_getres (CLOCK_PROCESS_CPUTIME_ID, XXXX) =
syscall(SYS_clock_gettime, CLOCK_THREAD_CPUTIME_ID, &ts);
- // clock_gettime (CLOCK_THREAD_CPUTIME_ID, XXXX) =
+ //staptest// clock_gettime (CLOCK_THREAD_CPUTIME_ID, XXXX) =
syscall(SYS_clock_settime, CLOCK_THREAD_CPUTIME_ID, &ts);
- // clock_settime (CLOCK_THREAD_CPUTIME_ID, \[NNNN.NNNN\]) =
+ //staptest// clock_settime (CLOCK_THREAD_CPUTIME_ID, \[NNNN.NNNN\]) =
syscall(SYS_clock_getres, CLOCK_THREAD_CPUTIME_ID, &ts);
- // clock_getres (CLOCK_THREAD_CPUTIME_ID, XXXX) =
+ //staptest// clock_getres (CLOCK_THREAD_CPUTIME_ID, XXXX) =
syscall(SYS_clock_gettime, CLOCK_REALTIME, &ts);
- // clock_gettime (CLOCK_REALTIME, XXXX) = 0
+ //staptest// clock_gettime (CLOCK_REALTIME, XXXX) = 0
ts.tv_sec++;
syscall(SYS_clock_nanosleep, CLOCK_REALTIME, TIMER_ABSTIME, &ts);
- // clock_nanosleep (CLOCK_REALTIME, TIMER_ABSTIME, \[NNNN.NNNN\], XXXX) = 0
+ //staptest// clock_nanosleep (CLOCK_REALTIME, TIMER_ABSTIME, \[NNNN.NNNN\], XXXX) = 0
ts.tv_sec = 0; ts.tv_nsec = 10000;
syscall(SYS_clock_nanosleep, CLOCK_REALTIME, 0x0, &ts);
- // clock_nanosleep (CLOCK_REALTIME, 0x0, \[NNNN.NNNN\], XXXX) = 0
+ //staptest// clock_nanosleep (CLOCK_REALTIME, 0x0, \[NNNN.NNNN\], XXXX) = 0
return 0;
}
diff --git a/testsuite/systemtap.syscall/dir.c b/testsuite/systemtap.syscall/dir.c
index 5de4ce35..3eda8175 100644
--- a/testsuite/systemtap.syscall/dir.c
+++ b/testsuite/systemtap.syscall/dir.c
@@ -11,43 +11,43 @@ int main()
int fd;
mkdir("foobar", 0765);
- // mkdir ("foobar", 0765) =
+ //staptest// mkdir ("foobar", 0765) =
chdir("foobar");
- // chdir ("foobar") = 0
+ //staptest// chdir ("foobar") = 0
chdir("..");
- // chdir ("..") = 0
+ //staptest// chdir ("..") = 0
fd = open("foobar", O_RDONLY);
- // open ("foobar", O_RDONLY) = NNNN
+ //staptest// open ("foobar", O_RDONLY) = NNNN
fchdir(fd);
- // fchdir (NNNN) = 0
+ //staptest// fchdir (NNNN) = 0
chdir("..");
- // chdir ("..") = 0
+ //staptest// chdir ("..") = 0
close(fd);
- // close (NNNN) = 0
+ //staptest// close (NNNN) = 0
rmdir("foobar");
- // rmdir ("foobar") = 0
+ //staptest// rmdir ("foobar") = 0
fd = open(".", O_RDONLY);
- // open (".", O_RDONLY) = NNNN
+ //staptest// open (".", O_RDONLY) = NNNN
#ifdef SYS_mkdirat
mkdirat(fd, "xyzzy", 0765);
- // mkdirat (NNNN, "xyzzy", 0765) = 0
+ //staptest// mkdirat (NNNN, "xyzzy", 0765) = 0
#endif
close(fd);
- // close (NNNN) = 0
+ //staptest// close (NNNN) = 0
rmdir("xyzzy");
- // rmdir ("xyzzy") =
+ //staptest// rmdir ("xyzzy") =
return 0;
}
diff --git a/testsuite/systemtap.syscall/forkwait.c b/testsuite/systemtap.syscall/forkwait.c
index bf7516f6..b7df4923 100644
--- a/testsuite/systemtap.syscall/forkwait.c
+++ b/testsuite/systemtap.syscall/forkwait.c
@@ -12,14 +12,14 @@ int main ()
int status;
child = fork();
- // fork () = NNNN
+ //staptest// fork () = NNNN
if (!child) {
int i = 0xfffff;
while (i > 0) i--;
exit(0);
}
wait4(child, &status, WNOHANG, NULL);
- // wait4 (NNNN, XXXX, WNOHANG, XXXX) = NNNN
+ //staptest// wait4 (NNNN, XXXX, WNOHANG, XXXX) = NNNN
return 0;
}
diff --git a/testsuite/systemtap.syscall/futimes.c b/testsuite/systemtap.syscall/futimes.c
index eca1efc7..4b812513 100644
--- a/testsuite/systemtap.syscall/futimes.c
+++ b/testsuite/systemtap.syscall/futimes.c
@@ -31,20 +31,20 @@ int main()
times.actime = 1000000000;
times.modtime = 2000000000;
syscall(__NR_utime, "foobar", &times );
- // utime ("foobar", \[Sun Sep 9 01:46:40 2001, Wed May 18 03:33:20 2033])
+ //staptest// utime ("foobar", \[Sun Sep 9 01:46:40 2001, Wed May 18 03:33:20 2033])
#endif /* __NR_utimes */
#ifdef __NR_utimes
syscall(__NR_utimes, "foobar", tv);
- // utimes ("foobar", \[1000000000.001234\]\[2000000000.005678\])
+ //staptest// utimes ("foobar", \[1000000000.001234\]\[2000000000.005678\])
#endif /* __NR_utimes */
#ifdef __NR_futimesat
syscall(__NR_futimesat, 7, "foobar", tv);
- // futimesat (7, "foobar", \[1000000000.001234\]\[2000000000.005678\])
+ //staptest// futimesat (7, "foobar", \[1000000000.001234\]\[2000000000.005678\])
syscall(__NR_futimesat, AT_FDCWD, "foobar", tv);
- // futimesat (AT_FDCWD, "foobar", \[1000000000.001234\]\[2000000000.005678\])
+ //staptest// futimesat (AT_FDCWD, "foobar", \[1000000000.001234\]\[2000000000.005678\])
#endif /* __NR_futimesat */
#ifdef __NR_utimensat
@@ -53,17 +53,17 @@ int main()
ts[1].tv_sec = 2000000000;
ts[1].tv_nsec = 56780000;
syscall(__NR_utimensat, AT_FDCWD, "foobar", ts, 0);
- // utimensat (AT_FDCWD, "foobar", \[1000000000.123456789\]\[2000000000.056780000\], 0x0)
+ //staptest// utimensat (AT_FDCWD, "foobar", \[1000000000.123456789\]\[2000000000.056780000\], 0x0)
ts[0].tv_sec = 0;
ts[0].tv_nsec = UTIME_NOW;
ts[1].tv_sec = 0;
ts[1].tv_nsec = UTIME_OMIT;
syscall(__NR_utimensat, AT_FDCWD, "foobar", ts, AT_SYMLINK_NOFOLLOW);
- // utimensat (AT_FDCWD, "foobar", \[UTIME_NOW\]\[UTIME_OMIT\], AT_SYMLINK_NOFOLLOW)
+ //staptest// utimensat (AT_FDCWD, "foobar", \[UTIME_NOW\]\[UTIME_OMIT\], AT_SYMLINK_NOFOLLOW)
syscall(__NR_utimensat, 22, "foobar", ts, 0x42);
- // utimensat (22, "foobar", \[UTIME_NOW\]\[UTIME_OMIT\], 0x42)
+ //staptest// utimensat (22, "foobar", \[UTIME_NOW\]\[UTIME_OMIT\], 0x42)
#endif
diff --git a/testsuite/systemtap.syscall/itimer.c b/testsuite/systemtap.syscall/itimer.c
index 5cebc902..ec2c8f5f 100644
--- a/testsuite/systemtap.syscall/itimer.c
+++ b/testsuite/systemtap.syscall/itimer.c
@@ -28,27 +28,27 @@ int main()
itv.it_value.tv_sec = 1;
itv.it_value.tv_usec = 0;
setitimer(ITIMER_REAL, &itv, &old_itv);
- // setitimer (ITIMER_REAL, \[0.500000,1.000000\], XXXX) = 0
+ //staptest// setitimer (ITIMER_REAL, \[0.500000,1.000000\], XXXX) = 0
itv.it_value.tv_sec = 0;
itv.it_value.tv_usec = 0;
setitimer(ITIMER_REAL, &itv, NULL);
- // setitimer (ITIMER_REAL, \[0.500000,0.000000\], 0x[0]+) = 0
+ //staptest// setitimer (ITIMER_REAL, \[0.500000,0.000000\], 0x[0]+) = 0
setitimer(ITIMER_VIRTUAL, &itv, NULL);
- // setitimer (ITIMER_VIRTUAL, \[0.500000,0.000000\], 0x[0]+) = 0
+ //staptest// setitimer (ITIMER_VIRTUAL, \[0.500000,0.000000\], 0x[0]+) = 0
setitimer(ITIMER_PROF, &itv, NULL);
- // setitimer (ITIMER_PROF, \[0.500000,0.000000\], 0x[0]+) = 0
+ //staptest// setitimer (ITIMER_PROF, \[0.500000,0.000000\], 0x[0]+) = 0
getitimer(ITIMER_REAL, &itv);
- // getitimer (ITIMER_REAL, XXXX) = 0
+ //staptest// getitimer (ITIMER_REAL, XXXX) = 0
getitimer(ITIMER_VIRTUAL, &itv);
- // getitimer (ITIMER_VIRTUAL, XXXX) = 0
+ //staptest// getitimer (ITIMER_VIRTUAL, XXXX) = 0
getitimer(ITIMER_PROF, &itv);
- // getitimer (ITIMER_PROF, XXXX) = 0
+ //staptest// getitimer (ITIMER_PROF, XXXX) = 0
return 0;
}
diff --git a/testsuite/systemtap.syscall/link.c b/testsuite/systemtap.syscall/link.c
index 81280bf2..72f422cd 100644
--- a/testsuite/systemtap.syscall/link.c
+++ b/testsuite/systemtap.syscall/link.c
@@ -13,24 +13,24 @@ int main()
close(fd);
link("foobar", "foobar2");
- // link ("foobar", "foobar2")
- // linkat (AT_FDCWD, "foobar", AT_FDCWD, "foobar2", 0x0) = 0
+ //staptest// link ("foobar", "foobar2")
+ //staptest// linkat (AT_FDCWD, "foobar", AT_FDCWD, "foobar2", 0x0) = 0
link("foobar", "foobar");
- // link ("foobar", "foobar")
- // linkat (AT_FDCWD, "foobar", AT_FDCWD, "foobar", 0x0) = -NNNN (EEXIST)
+ //staptest// link ("foobar", "foobar")
+ //staptest// linkat (AT_FDCWD, "foobar", AT_FDCWD, "foobar", 0x0) = -NNNN (EEXIST)
link("nonexist", "foo");
- // link ("nonexist", "foo")
- // linkat (AT_FDCWD, "nonexist", AT_FDCWD, "foo", 0x0) = -NNNN (ENOENT)
+ //staptest// link ("nonexist", "foo")
+ //staptest// linkat (AT_FDCWD, "nonexist", AT_FDCWD, "foo", 0x0) = -NNNN (ENOENT)
symlink("foobar", "Sfoobar");
- // symlink ("foobar", "Sfoobar")
- // symlinkat ("foobar", AT_FDCWD, "Sfoobar") = 0
+ //staptest// symlink ("foobar", "Sfoobar")
+ //staptest// symlinkat ("foobar", AT_FDCWD, "Sfoobar") = 0
readlink("Sfoobar", buf, sizeof(buf));
- // readlink ("Sfoobar", XXXX, 128)
- // readlinkat (AT_FDCWD, "Sfoobar", XXXX, 128)
+ //staptest// readlink ("Sfoobar", XXXX, 128)
+ //staptest// readlinkat (AT_FDCWD, "Sfoobar", XXXX, 128)
return 0;
}
diff --git a/testsuite/systemtap.syscall/mmap.c b/testsuite/systemtap.syscall/mmap.c
index a3a0dc34..13145fb2 100644
--- a/testsuite/systemtap.syscall/mmap.c
+++ b/testsuite/systemtap.syscall/mmap.c
@@ -13,41 +13,41 @@ int main()
/* create a file with something in it */
fd = open("foobar",O_WRONLY|O_CREAT|O_TRUNC, 0600);
- // open ("foobar", O_WRONLY|O_CREAT|O_TRUNC, 0600) = NNNN
+ //staptest// open ("foobar", O_WRONLY|O_CREAT|O_TRUNC, 0600) = NNNN
lseek(fd, 1024, SEEK_SET);
write(fd, "abcdef", 6);
close(fd);
- // close (NNNN) = 0
+ //staptest// close (NNNN) = 0
fd = open("foobar", O_RDONLY);
- // open ("foobar", O_RDONLY) = NNNN
+ //staptest// open ("foobar", O_RDONLY) = NNNN
/* stat for file size */
ret = fstat(fd, &fs);
- // fstat (NNNN, XXXX) = 0
+ //staptest// fstat (NNNN, XXXX) = 0
r = mmap(NULL, fs.st_size, PROT_READ, MAP_SHARED, fd, 0);
- // mmap[2]* (XXXX, 1030, PROT_READ, MAP_SHARED, NNNN, XXXX) = XXXX
+ //staptest// mmap[2]* (XXXX, 1030, PROT_READ, MAP_SHARED, NNNN, XXXX) = XXXX
close(fd);
mlock(r, fs.st_size);
- // mlock (XXXX, 1030) = 0
+ //staptest// mlock (XXXX, 1030) = 0
msync(r, fs.st_size, MS_SYNC);
- // msync (XXXX, 1030, MS_SYNC) = 0
+ //staptest// msync (XXXX, 1030, MS_SYNC) = 0
munlock(r, fs.st_size);
- // munlock (XXXX, 1030) = 0
+ //staptest// munlock (XXXX, 1030) = 0
mlockall(MCL_CURRENT);
- // mlockall (MCL_CURRENT) =
+ //staptest// mlockall (MCL_CURRENT) =
munlockall();
- // munlockall () = 0
+ //staptest// munlockall () = 0
munmap(r, fs.st_size);
- // munmap (XXXX, 1030) = 0
+ //staptest// munmap (XXXX, 1030) = 0
return 0;
}
diff --git a/testsuite/systemtap.syscall/mount.c b/testsuite/systemtap.syscall/mount.c
index 57ae030f..a59582dd 100644
--- a/testsuite/systemtap.syscall/mount.c
+++ b/testsuite/systemtap.syscall/mount.c
@@ -17,19 +17,19 @@
int main()
{
mount ("mount_source", "mount_target", "ext2", MS_BIND|MS_NOATIME|MS_NODIRATIME|MS_NOSUID, "some arguments");
- // mount ("mount_source", "mount_target", "ext2", MS_BIND|MS_NOATIME|MS_NODIRATIME|MS_NOSUID, "some arguments") = -NNNN (ENOENT)
+ //staptest// mount ("mount_source", "mount_target", "ext2", MS_BIND|MS_NOATIME|MS_NODIRATIME|MS_NOSUID, "some arguments") = -NNNN (ENOENT)
umount("umount_target");
- // umount ("umount_target", 0) = -NNNN (ENOENT)
+ //staptest// umount ("umount_target", 0) = -NNNN (ENOENT)
umount2("umount2_target", MNT_FORCE);
- // umount ("umount2_target", MNT_FORCE) = -NNNN (ENOENT)
+ //staptest// umount ("umount2_target", MNT_FORCE) = -NNNN (ENOENT)
umount2("umount2_target", MNT_DETACH);
- // umount ("umount2_target", MNT_DETACH) = -NNNN (ENOENT)
+ //staptest// umount ("umount2_target", MNT_DETACH) = -NNNN (ENOENT)
umount2("umount2_target", MNT_EXPIRE);
- // umount ("umount2_target", MNT_EXPIRE) = -NNNN (ENOENT)
+ //staptest// umount ("umount2_target", MNT_EXPIRE) = -NNNN (ENOENT)
return 0;
}
diff --git a/testsuite/systemtap.syscall/net1.c b/testsuite/systemtap.syscall/net1.c
index 219a3860..f8079ffd 100644
--- a/testsuite/systemtap.syscall/net1.c
+++ b/testsuite/systemtap.syscall/net1.c
@@ -13,12 +13,12 @@ int main()
listenfd = socket(AF_INET, SOCK_STREAM, 0);
- // socket (PF_INET, SOCK_STREAM, 0) = NNNN
+ //staptest// socket (PF_INET, SOCK_STREAM, 0) = NNNN
flags = fcntl(listenfd, F_GETFL, 0);
- // fcntl[64]* (NNNN, F_GETFL, 0x[0]+) = NNNN
+ //staptest// fcntl[64]* (NNNN, F_GETFL, 0x[0]+) = NNNN
fcntl(listenfd, F_SETFL, flags | O_NONBLOCK);
- // fcntl[64]* (NNNN, F_SETFL, XXXX) = 0
+ //staptest// fcntl[64]* (NNNN, F_SETFL, XXXX) = 0
bzero(&sa, sizeof(sa));
sa.sin_family=AF_INET;
@@ -26,13 +26,13 @@ int main()
sa.sin_port = htons(8765);
bind(listenfd, (struct sockaddr *)&sa, sizeof(sa));
- // bind (NNNN, {AF_INET, 0.0.0.0, 8765}, 16) = 0
+ //staptest// bind (NNNN, {AF_INET, 0.0.0.0, 8765}, 16) = 0
listen (listenfd, 7);
- // listen (NNNN, 7) = 0
+ //staptest// listen (NNNN, 7) = 0
cfd = accept(listenfd, (struct sockaddr *)NULL, NULL);
- // accept (NNNN, 0x[0]+, 0x[0]+) = -NNNN (EAGAIN)
+ //staptest// accept (NNNN, 0x[0]+, 0x[0]+) = -NNNN (EAGAIN)
close(cfd);
close(listenfd);
diff --git a/testsuite/systemtap.syscall/openclose.c b/testsuite/systemtap.syscall/openclose.c
index a35f1a59..cb003a9e 100644
--- a/testsuite/systemtap.syscall/openclose.c
+++ b/testsuite/systemtap.syscall/openclose.c
@@ -13,46 +13,46 @@ int main()
int fd1, fd2;
fd2 = creat("foobar1",S_IREAD|S_IWRITE);
- // open ("foobar1", O_WRONLY|O_CREAT|O_TRUNC, 0600) = NNNN
+ //staptest// open ("foobar1", O_WRONLY|O_CREAT|O_TRUNC, 0600) = NNNN
fd1 = open("foobar2",O_WRONLY|O_CREAT, S_IRWXU);
- // open ("foobar2", O_WRONLY|O_CREAT, 0700) = NNNN
+ //staptest// open ("foobar2", O_WRONLY|O_CREAT, 0700) = NNNN
close(fd1);
- // close (NNNN) = 0
+ //staptest// close (NNNN) = 0
fd1 = open("foobar2",O_RDONLY);
- // open ("foobar2", O_RDONLY) = NNNN
+ //staptest// open ("foobar2", O_RDONLY) = NNNN
close(fd1);
- // close (NNNN) = 0
+ //staptest// close (NNNN) = 0
fd1 = open("foobar2",O_RDWR);
- // open ("foobar2", O_RDWR) = NNNN
+ //staptest// open ("foobar2", O_RDWR) = NNNN
close(fd1);
- // close (NNNN) = 0
+ //staptest// close (NNNN) = 0
fd1 = open("foobar2",O_APPEND|O_WRONLY);
- // open ("foobar2", O_WRONLY|O_APPEND) = NNNN
+ //staptest// open ("foobar2", O_WRONLY|O_APPEND) = NNNN
close(fd1);
- // close (NNNN) = 0
+ //staptest// close (NNNN) = 0
fd1 = open("foobar2",O_DIRECT|O_RDWR);
- // open ("foobar2", O_RDWR|O_DIRECT) = NNNN
+ //staptest// open ("foobar2", O_RDWR|O_DIRECT) = NNNN
close(fd1);
- // close (NNNN) = 0
+ //staptest// close (NNNN) = 0
fd1 = open("foobar2",O_NOATIME|O_SYNC|O_RDWR);
- // open ("foobar2", O_RDWR|O_NOATIME|O_SYNC) = NNNN
+ //staptest// open ("foobar2", O_RDWR|O_NOATIME|O_SYNC) = NNNN
close(fd1);
- // close (NNNN) = 0
+ //staptest// close (NNNN) = 0
/* Now test some bad opens */
fd1 = open("/",O_WRONLY);
- // open ("/", O_WRONLY) = -NNNN (EISDIR)
+ //staptest// open ("/", O_WRONLY) = -NNNN (EISDIR)
close (fd1);
- // close (NNNN) = -NNNN (EBADF)
+ //staptest// close (NNNN) = -NNNN (EBADF)
fd1 = open("foobar2",O_WRONLY|O_CREAT|O_EXCL, S_IRWXU);
- // open ("foobar2", O_WRONLY|O_CREAT|O_EXCL, 0700) = -NNNN (EEXIST)
+ //staptest// open ("foobar2", O_WRONLY|O_CREAT|O_EXCL, 0700) = -NNNN (EEXIST)
return 0;
}
diff --git a/testsuite/systemtap.syscall/poll.c b/testsuite/systemtap.syscall/poll.c
index 591c1f74..3caa2b14 100644
--- a/testsuite/systemtap.syscall/poll.c
+++ b/testsuite/systemtap.syscall/poll.c
@@ -17,21 +17,21 @@ int main()
sigaddset(&sigs,SIGUSR2);
fd = epoll_create(32);
- // epoll_create (32)
+ //staptest// epoll_create (32)
epoll_ctl(fd, EPOLL_CTL_ADD, 13, &ev);
- // epoll_ctl (NNNN, EPOLL_CTL_ADD, 13, XXXX)
+ //staptest// epoll_ctl (NNNN, EPOLL_CTL_ADD, 13, XXXX)
epoll_wait(fd, &ev, 17,0);
- // epoll_wait (NNNN, XXXX, 17, 0)
+ //staptest// epoll_wait (NNNN, XXXX, 17, 0)
close(fd);
poll(&pfd, 1, 0);
- // poll (XXXX, 1, 0)
+ //staptest// poll (XXXX, 1, 0)
#ifdef SYS_ppoll
ppoll(&pfd, 1, &tim, &sigs);
- // ppoll (XXXX, 1, \[0.200000000\], XXXX, 8)
+ //staptest// ppoll (XXXX, 1, \[0.200000000\], XXXX, 8)
#endif
return 0;
diff --git a/testsuite/systemtap.syscall/readwrite.c b/testsuite/systemtap.syscall/readwrite.c
index aacd68f2..bd0914cc 100644
--- a/testsuite/systemtap.syscall/readwrite.c
+++ b/testsuite/systemtap.syscall/readwrite.c
@@ -26,56 +26,56 @@ int main()
v[2].iov_len = sizeof(STRING3);
fd = open("foobar1",O_WRONLY|O_CREAT, 0666);
- // open ("foobar1", O_WRONLY|O_CREAT, 0666) = NNNN
+ //staptest// open ("foobar1", O_WRONLY|O_CREAT, 0666) = NNNN
write(fd,"Hello world", 11);
- // write (NNNN, "Hello world", 11) = 11
+ //staptest// write (NNNN, "Hello world", 11) = 11
write(fd,"Hello world abcdefghijklmnopqrstuvwxyz 01234567890123456789", 59);
- // write (NNNN, "Hello world abcdefghijklmnopqrstuvwxyz 012345"..., 59) = 59
+ //staptest// write (NNNN, "Hello world abcdefghijklmnopqrstuvwxyz 012345"..., 59) = 59
pwrite(fd,"Hello Again",11,12);
- // pwrite (NNNN, "Hello Again", 11, 12) = 11
+ //staptest// pwrite (NNNN, "Hello Again", 11, 12) = 11
writev(fd, v, 3);
- // writev (NNNN, XXXX, 3) = 15
+ //staptest// writev (NNNN, XXXX, 3) = 15
lseek(fd, 0, SEEK_SET);
- // lseek (NNNN, 0, SEEK_SET) = 0
+ //staptest// lseek (NNNN, 0, SEEK_SET) = 0
lseek(fd, 1, SEEK_CUR);
- // lseek (NNNN, 1, SEEK_CUR) = 1
+ //staptest// lseek (NNNN, 1, SEEK_CUR) = 1
lseek(fd, -1, SEEK_END);
- // lseek (NNNN, -1, SEEK_END) = 84
+ //staptest// lseek (NNNN, -1, SEEK_END) = 84
#ifdef SYS__llseek
syscall(SYS__llseek, fd, 1, 0, &res, SEEK_SET);
- // llseek (NNNN, 0x1, 0x0, XXXX, SEEK_SET) = 0
+ //staptest// llseek (NNNN, 0x1, 0x0, XXXX, SEEK_SET) = 0
syscall(SYS__llseek, fd, 0, 0, &res, SEEK_SET);
- // llseek (NNNN, 0x0, 0x0, XXXX, SEEK_SET) = 0
+ //staptest// llseek (NNNN, 0x0, 0x0, XXXX, SEEK_SET) = 0
syscall(SYS__llseek, fd, 0, 12, &res, SEEK_CUR);
- // llseek (NNNN, 0x0, 0xc, XXXX, SEEK_CUR) = 0
+ //staptest// llseek (NNNN, 0x0, 0xc, XXXX, SEEK_CUR) = 0
syscall(SYS__llseek, fd, 8, 1, &res, SEEK_END);
- // llseek (NNNN, 0x8, 0x1, XXXX, SEEK_END) = 0
+ //staptest// llseek (NNNN, 0x8, 0x1, XXXX, SEEK_END) = 0
#endif
close (fd);
fd = open("foobar1",O_RDONLY);
- // open ("foobar1", O_RDONLY) = NNNN
+ //staptest// open ("foobar1", O_RDONLY) = NNNN
read(fd, buf, 11);
- // read (NNNN, XXXX, 11) = 11
+ //staptest// read (NNNN, XXXX, 11) = 11
read(fd, buf, 50);
- // read (NNNN, XXXX, 50) = 50
+ //staptest// read (NNNN, XXXX, 50) = 50
pread(fd, buf, 11, 10);
- // pread (NNNN, XXXX, 11, 10) = 11
+ //staptest// pread (NNNN, XXXX, 11, 10) = 11
x[0].iov_base = buf1;
x[0].iov_len = sizeof(STRING1);
@@ -84,7 +84,7 @@ int main()
x[2].iov_base = buf3;
x[2].iov_len = sizeof(STRING3);
readv(fd, x, 3);
- // readv (NNNN, XXXX, 3) = 15
+ //staptest// readv (NNNN, XXXX, 3) = 15
close (fd);
diff --git a/testsuite/systemtap.syscall/rt_signal.c b/testsuite/systemtap.syscall/rt_signal.c
index f25633b7..537b7706 100644
--- a/testsuite/systemtap.syscall/rt_signal.c
+++ b/testsuite/systemtap.syscall/rt_signal.c
@@ -20,30 +20,30 @@ int main()
sigaddset(&mask, SIGUSR1);
sigaddset(&mask, SIGUSR2);
sigprocmask(SIG_BLOCK, &mask, NULL);
- // rt_sigprocmask (SIG_BLOCK, \[SIGUSR1|SIGUSR2\], 0x[0]+, 8) = 0
+ //staptest// rt_sigprocmask (SIG_BLOCK, \[SIGUSR1|SIGUSR2\], 0x[0]+, 8) = 0
sigdelset(&mask, SIGUSR2);
sigprocmask(SIG_UNBLOCK, &mask, NULL);
- // rt_sigprocmask (SIG_UNBLOCK, \[SIGUSR1\], 0x[0]+, 8) = 0
+ //staptest// rt_sigprocmask (SIG_UNBLOCK, \[SIGUSR1\], 0x[0]+, 8) = 0
sa.sa_handler = SIG_IGN;
sigemptyset(&sa.sa_mask);
sigaddset(&sa.sa_mask, SIGALRM);
sa.sa_flags = 0;
sigaction(SIGUSR1, &sa, NULL);
- // rt_sigaction (SIGUSR1, {SIG_IGN}, 0x[0]+, 8) = 0
+ //staptest// rt_sigaction (SIGUSR1, {SIG_IGN}, 0x[0]+, 8) = 0
sa.sa_handler = SIG_DFL;
sigaction(SIGUSR1, &sa, NULL);
- // rt_sigaction (SIGUSR1, {SIG_DFL}, 0x[0]+, 8) = 0
+ //staptest// rt_sigaction (SIGUSR1, {SIG_DFL}, 0x[0]+, 8) = 0
sa.sa_handler = sig_act_handler;
sigaction(SIGUSR1, &sa, NULL);
#ifdef __ia64__
- // rt_sigaction (SIGUSR1, {XXXX, [^,]+, \[SIGALRM\]}, 0x[0]+, 8) = 0
+ //staptest// rt_sigaction (SIGUSR1, {XXXX, [^,]+, \[SIGALRM\]}, 0x[0]+, 8) = 0
#else
- // rt_sigaction (SIGUSR1, {XXXX, [^,]+, XXXX, \[SIGALRM\]}, 0x[0]+, 8) = 0
+ //staptest// rt_sigaction (SIGUSR1, {XXXX, [^,]+, XXXX, \[SIGALRM\]}, 0x[0]+, 8) = 0
#endif
return 0;
diff --git a/testsuite/systemtap.syscall/select.c b/testsuite/systemtap.syscall/select.c
index 6ea13a01..088211e2 100644
--- a/testsuite/systemtap.syscall/select.c
+++ b/testsuite/systemtap.syscall/select.c
@@ -17,20 +17,20 @@ int main()
sigaddset(&sigs,SIGUSR2);
select( 1, &rfds, NULL, NULL, &tv);
- // select (1, XXXX, 0x[0]+, 0x[0]+, \[0.000117\])
+ //staptest// select (1, XXXX, 0x[0]+, 0x[0]+, \[0.000117\])
tv.tv_sec = 0;
tv.tv_usec = 113;
select( 1, NULL, NULL, NULL, &tv);
- // select (1, 0x[0]+, 0x[0]+, 0x[0]+, \[0.000113\])
+ //staptest// select (1, 0x[0]+, 0x[0]+, 0x[0]+, \[0.000113\])
#ifdef SYS_pselect6
pselect( 1, &rfds, NULL, NULL, &tim, &sigs);
- //pselect[67] (1, XXXX, 0x[0]+, 0x[0]+, \[0.200000000\], XXXX)
+ //staptest//pselect[67] (1, XXXX, 0x[0]+, 0x[0]+, \[0.200000000\], XXXX)
pselect( 0, NULL, NULL, NULL, &tim, &sigs);
- // pselect[67] (0, 0x[0]+, 0x[0]+, 0x[0]+, \[0.200000000\], XXXX) =
+ //staptest// pselect[67] (0, 0x[0]+, 0x[0]+, 0x[0]+, \[0.200000000\], XXXX) =
#endif
return 0;
diff --git a/testsuite/systemtap.syscall/sendfile.c b/testsuite/systemtap.syscall/sendfile.c
index 06c6b260..690d078e 100644
--- a/testsuite/systemtap.syscall/sendfile.c
+++ b/testsuite/systemtap.syscall/sendfile.c
@@ -36,7 +36,7 @@ int main ()
* sendfile will fail. So we test for failure here.
*/
ret = sendfile (write_fd, read_fd, &offset, stat_buf.st_size);
- // sendfile (NNNN, NNNN, XXXX, 512) = -22 (EINVAL)
+ //staptest// sendfile (NNNN, NNNN, XXXX, 512) = -22 (EINVAL)
close (read_fd);
close (write_fd);
diff --git a/testsuite/systemtap.syscall/signal.c b/testsuite/systemtap.syscall/signal.c
index 2c0abe38..e450c6d2 100644
--- a/testsuite/systemtap.syscall/signal.c
+++ b/testsuite/systemtap.syscall/signal.c
@@ -18,13 +18,13 @@ int main()
#ifdef SYS_signal
syscall(SYS_signal, SIGUSR1, SIG_IGN);
- // signal (SIGUSR1, SIG_IGN)
+ //staptest// signal (SIGUSR1, SIG_IGN)
syscall (SYS_signal, SIGUSR1, SIG_DFL);
- // signal (SIGUSR1, SIG_DFL) = 1
+ //staptest// signal (SIGUSR1, SIG_DFL) = 1
syscall (SYS_signal, SIGUSR1, sig_act_handler);
- // signal (SIGUSR1, XXXX) = 0
+ //staptest// signal (SIGUSR1, XXXX) = 0
#endif
sigemptyset(&mask);
@@ -32,10 +32,10 @@ int main()
#ifdef SYS_sigprocmask
syscall (SYS_sigprocmask, SIG_BLOCK, &mask, NULL);
- // sigprocmask (SIG_BLOCK, XXXX, 0x0+) = 0
+ //staptest// sigprocmask (SIG_BLOCK, XXXX, 0x0+) = 0
syscall (SYS_sigprocmask, SIG_UNBLOCK, &mask, NULL);
- // sigprocmask (SIG_UNBLOCK, XXXX, 0x0+) = 0
+ //staptest// sigprocmask (SIG_UNBLOCK, XXXX, 0x0+) = 0
#endif
memset(&sa, 0, sizeof(sa));
@@ -44,12 +44,12 @@ int main()
#ifdef SYS_sigaction
syscall (SYS_sigaction, SIGUSR1, &sa, NULL);
- // sigaction (SIGUSR1, {SIG_IGN}, 0x0+) = 0
+ //staptest// sigaction (SIGUSR1, {SIG_IGN}, 0x0+) = 0
#endif
#ifdef SYS_tgkill
syscall(SYS_tgkill, 1234, 5678, 0);
- // tgkill (1234, 5678, SIG_0)
+ //staptest// tgkill (1234, 5678, SIG_0)
#endif
return 0;
diff --git a/testsuite/systemtap.syscall/stat.c b/testsuite/systemtap.syscall/stat.c
index 6be5cc79..d47c1440 100644
--- a/testsuite/systemtap.syscall/stat.c
+++ b/testsuite/systemtap.syscall/stat.c
@@ -17,38 +17,38 @@ int main()
struct utimbuf ubuf;
getcwd(cwd, 128);
- // getcwd (XXXX, 128) = NNNN
+ //staptest// getcwd (XXXX, 128) = NNNN
fd = creat("foobar",S_IREAD|S_IWRITE);
- // open ("foobar", O_WRONLY|O_CREAT|O_TRUNC, 0600) = NNNN
+ //staptest// open ("foobar", O_WRONLY|O_CREAT|O_TRUNC, 0600) = NNNN
fstat(fd, &sbuf);
- // fstat (NNNN, XXXX) = 0
+ //staptest// fstat (NNNN, XXXX) = 0
close(fd);
stat("foobar",&sbuf);
- // stat ("foobar", XXXX) = 0
+ //staptest// stat ("foobar", XXXX) = 0
lstat("foobar",&sbuf);
- // lstat ("foobar", XXXX) = 0
+ //staptest// lstat ("foobar", XXXX) = 0
ubuf.actime = 1;
ubuf.modtime = 1135641600;
utime("foobar", &ubuf);
#ifdef __ia64__
- // utimes ("foobar", \[1.000000\]\[1135641600.000000\]) =
+ //staptest// utimes ("foobar", \[1.000000\]\[1135641600.000000\]) =
#else
- // utime ("foobar", \[Thu Jan 1 00:00:01 1970, Tue Dec 27 00:00:00 2005\]) = 0
+ //staptest// utime ("foobar", \[Thu Jan 1 00:00:01 1970, Tue Dec 27 00:00:00 2005\]) = 0
#endif
ubuf.actime = 1135690000;
ubuf.modtime = 1135700000;
utime("foobar", &ubuf);
#ifdef __ia64__
- // utimes ("foobar", \[1135690000.000000\]\[1135700000.000000\]) =
+ //staptest// utimes ("foobar", \[1135690000.000000\]\[1135700000.000000\]) =
#else
- // utime ("foobar", \[Tue Dec 27 13:26:40 2005, Tue Dec 27 16:13:20 2005\]) = 0
+ //staptest// utime ("foobar", \[Tue Dec 27 13:26:40 2005, Tue Dec 27 16:13:20 2005\]) = 0
#endif
return 0;
}
diff --git a/testsuite/systemtap.syscall/statfs.c b/testsuite/systemtap.syscall/statfs.c
index ea33193b..eafce77e 100644
--- a/testsuite/systemtap.syscall/statfs.c
+++ b/testsuite/systemtap.syscall/statfs.c
@@ -8,13 +8,13 @@ int main()
{
ustat(42, (struct ustat *)0x12345678);
- // ustat (42, 0x0*12345678) =
+ //staptest// ustat (42, 0x0*12345678) =
statfs("abc", (struct statfs *)0x12345678);
- // statfs ("abc", 0x0*12345678) =
+ //staptest// statfs ("abc", 0x0*12345678) =
fstatfs(77, (struct statfs *)0x12345678);
- // fstatfs (77, 0x0*12345678) =
+ //staptest// fstatfs (77, 0x0*12345678) =
return 0;
}
diff --git a/testsuite/systemtap.syscall/swap.c b/testsuite/systemtap.syscall/swap.c
index 3708a477..8fcf9946 100755..100644
--- a/testsuite/systemtap.syscall/swap.c
+++ b/testsuite/systemtap.syscall/swap.c
@@ -6,22 +6,22 @@
int main()
{
swapon("foobar_swap", 0);
- // swapon ("foobar_swap", 0) =
+ //staptest// swapon ("foobar_swap", 0) =
swapon("foobar_swap", ((1 << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK) | SWAP_FLAG_PREFER);
- // swapon ("foobar_swap", 32769) =
+ //staptest// swapon ("foobar_swap", 32769) =
swapon("foobar_swap", ((7 << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK) | SWAP_FLAG_PREFER);
- // swapon ("foobar_swap", 32775) =
+ //staptest// swapon ("foobar_swap", 32775) =
swapon(0, 0);
- // swapon (NULL, 0) =
+ //staptest// swapon (NULL, 0) =
swapoff("foobar_swap");
- // swapoff ("foobar_swap") =
+ //staptest// swapoff ("foobar_swap") =
swapoff(0);
- // swapoff (NULL) =
+ //staptest// swapoff (NULL) =
return 0;
}
diff --git a/testsuite/systemtap.syscall/sync.c b/testsuite/systemtap.syscall/sync.c
index 637bc197..d6e22203 100644
--- a/testsuite/systemtap.syscall/sync.c
+++ b/testsuite/systemtap.syscall/sync.c
@@ -13,13 +13,13 @@ int main()
fd = creat("foobar",S_IREAD|S_IWRITE);
sync();
- // sync () = 0
+ //staptest// sync () = 0
fsync(fd);
- // fsync (NNNN) = 0
+ //staptest// fsync (NNNN) = 0
fdatasync(fd);
- // fdatasync (NNNN) = 0
+ //staptest// fdatasync (NNNN) = 0
close(fd);
diff --git a/testsuite/systemtap.syscall/syscall.exp b/testsuite/systemtap.syscall/syscall.exp
index 2313403f..22e9dc07 100644
--- a/testsuite/systemtap.syscall/syscall.exp
+++ b/testsuite/systemtap.syscall/syscall.exp
@@ -48,15 +48,9 @@ proc test_procedure {} {
set do_32_bit_pass 1
switch -regexp $::tcl_platform(machine) {
- ^(x86_64|ppc64)$ {
- set flags "additional_flags=-m32"
- }
- ^s390x$ {
- set flags "additional_flags=-m31"
- }
- ^ia64$ {
- set do_32_bit_pass 0
- }
+ {^(x86_64|ppc64)$} { set flags "additional_flags=-m32" }
+ {^s390x$} { set flags "additional_flags=-m31" }
+ {^ia64$} { set do_32_bit_pass 0 }
}
if {$do_32_bit_pass} {
diff --git a/testsuite/systemtap.syscall/test.tcl b/testsuite/systemtap.syscall/test.tcl
index db0df138..a458914b 100755
--- a/testsuite/systemtap.syscall/test.tcl
+++ b/testsuite/systemtap.syscall/test.tcl
@@ -40,22 +40,28 @@ proc run_one_test {filename flags} {
target_compile $filename $dir/$testname executable $flags
set sys_prog "[file dirname [file normalize $filename]]/sys.stp"
- set cmd "stap -c $dir/${testname} ${sys_prog}"
+ set cmd "stap --skip-badvars -c $dir/${testname} ${sys_prog}"
# Extract the expected results
# Use the preprocessor so we can ifdef tests in and out
set ccmd "gcc -E -C -P $filename"
+ # XXX: but note, this will expand all system headers too!
catch {eval exec $ccmd} output
set ind 0
foreach line [split $output "\n"] {
- if {[regsub {//} $line {} line]} {
+ if {[regsub {//staptest//} $line {} line]} {
set line "$testname: [string trimleft $line]"
-
+
+ # We need to quote all these metacharacters
regsub -all {\(} $line {\\(} line
- regsub -all {\)} $line {\\)} line
+ regsub -all {\)} $line {\\)} line
regsub -all {\|} $line {\|} line
+ # + and * are metacharacters, but should always be used
+ # as metacharacters in the expressions, don't escape them.
+ #regsub -all {\+} $line {\\+} line
+ #regsub -all {\*} $line {\\*} line
regsub -all NNNN $line {[\-0-9]+} line
regsub -all XXXX $line {[x0-9a-fA-F]+} line
@@ -78,6 +84,7 @@ proc run_one_test {filename flags} {
set i 0
foreach line [split $output "\n"] {
+ # send_log "Comparing $results($i) against $line"
if {[regexp $results($i) $line]} {
incr i
if {$i >= $ind} {break}
diff --git a/testsuite/systemtap.syscall/timer.c b/testsuite/systemtap.syscall/timer.c
index 947f6a77..9a55b2e8 100644
--- a/testsuite/systemtap.syscall/timer.c
+++ b/testsuite/systemtap.syscall/timer.c
@@ -13,19 +13,19 @@ int main()
struct itimerspec val, oval;
syscall(SYS_timer_create, CLOCK_REALTIME, NULL, &tid);
- // timer_create (CLOCK_REALTIME, 0x[0]+, XXXX)
+ //staptest// timer_create (CLOCK_REALTIME, 0x[0]+, XXXX)
syscall(SYS_timer_gettime, tid, &val);
- // timer_gettime (NNNN, XXXX)
+ //staptest// timer_gettime (NNNN, XXXX)
syscall(SYS_timer_settime, 0, tid, &val, &oval);
- // timer_settime (0, NNNN, \[0.000000,0.000000\], XXXX)
+ //staptest// timer_settime (0, NNNN, \[0.000000,0.000000\], XXXX)
syscall(SYS_timer_getoverrun, tid);
- // timer_getoverrun (NNNN)
+ //staptest// timer_getoverrun (NNNN)
syscall(SYS_timer_delete, tid);
- // timer_delete (NNNN)
+ //staptest// timer_delete (NNNN)
return 0;
}
diff --git a/testsuite/systemtap.syscall/trunc.c b/testsuite/systemtap.syscall/trunc.c
index 39a524a7..ef2b0c68 100644
--- a/testsuite/systemtap.syscall/trunc.c
+++ b/testsuite/systemtap.syscall/trunc.c
@@ -13,11 +13,11 @@ int main()
fd = creat("foobar",S_IREAD|S_IWRITE);
ftruncate(fd, 1024);
- // ftruncate (NNNN, 1024) = 0
+ //staptest// ftruncate (NNNN, 1024) = 0
close(fd);
truncate("foobar", 2048);
- // truncate ("foobar", 2048) = 0
+ //staptest// truncate ("foobar", 2048) = 0
return 0;
}
diff --git a/testsuite/systemtap.syscall/uid.c b/testsuite/systemtap.syscall/uid.c
index 3acb4cb8..6ccf8cdd 100644
--- a/testsuite/systemtap.syscall/uid.c
+++ b/testsuite/systemtap.syscall/uid.c
@@ -11,54 +11,54 @@ int main ()
gid_t rgid, egid, sgid;
ruid = getuid();
- // getuid () = NNNN
+ //staptest// getuid () = NNNN
euid = geteuid();
- // geteuid () = NNNN
+ //staptest// geteuid () = NNNN
rgid = getgid();
- // getgid () = NNNN
+ //staptest// getgid () = NNNN
egid = getegid();
- // getegid () = NNNN
+ //staptest// getegid () = NNNN
setuid(4096);
- // setuid (4096) = NNNN
+ //staptest// setuid (4096) = NNNN
seteuid(4097);
- // setresuid (-1, 4097, -1) = NNNN
+ //staptest// setresuid (-1, 4097, -1) = NNNN
getresuid(&ruid, &euid, &suid);
- // getresuid (XXXX, XXXX, XXXX) = 0
+ //staptest// getresuid (XXXX, XXXX, XXXX) = 0
setgid(4098);
- // setgid (4098) = NNNN
+ //staptest// setgid (4098) = NNNN
setegid(4099);
- // setresgid (-1, 4099, -1) = NNNN
+ //staptest// setresgid (-1, 4099, -1) = NNNN
getresgid(&rgid, &egid, &sgid);
- // getresgid (XXXX, XXXX, XXXX) = 0
+ //staptest// getresgid (XXXX, XXXX, XXXX) = 0
setreuid(-1, 5000);
- // setreuid (NNNN, 5000) =
+ //staptest// setreuid (NNNN, 5000) =
setreuid(5001, -1);
- // setreuid (5001, NNNN) =
+ //staptest// setreuid (5001, NNNN) =
setregid(-1, 5002);
- // setregid (NNNN, 5002) =
+ //staptest// setregid (NNNN, 5002) =
setregid(5003, -1);
- // setregid (5003, NNNN) =
+ //staptest// setregid (5003, NNNN) =
setfsuid(5004);
- // setfsuid (5004) =
+ //staptest// setfsuid (5004) =
setfsgid(5005);
- // setfsgid (5005) =
+ //staptest// setfsgid (5005) =
return 0;
}
diff --git a/testsuite/systemtap.syscall/uid16.c b/testsuite/systemtap.syscall/uid16.c
index 2d7d3349..4f2fcff1 100644
--- a/testsuite/systemtap.syscall/uid16.c
+++ b/testsuite/systemtap.syscall/uid16.c
@@ -17,54 +17,54 @@ int main ()
gid_t gid, rgid, egid, sgid;
uid = syscall(__NR_getuid);
- // getuid () = NNNN
+ //staptest// getuid () = NNNN
uid = syscall(__NR_geteuid);
- // geteuid () = NNNN
+ //staptest// geteuid () = NNNN
gid = syscall(__NR_getgid);
- // getgid () = NNNN
+ //staptest// getgid () = NNNN
gid = syscall(__NR_getegid);
- // getegid () = NNNN
+ //staptest// getegid () = NNNN
syscall(__NR_setuid, 4096);
- // setuid (4096) =
+ //staptest// setuid (4096) =
syscall(__NR_setresuid, -1, 4097, -1);
- // setresuid (-1, 4097, -1) =
+ //staptest// setresuid (-1, 4097, -1) =
syscall(__NR_getresuid, &ruid, &euid, &suid);
- // getresuid (XXXX, XXXX, XXXX) =
+ //staptest// getresuid (XXXX, XXXX, XXXX) =
syscall(__NR_setgid, 4098);
- // setgid (4098) =
+ //staptest// setgid (4098) =
syscall(__NR_setresgid, -1, 4099, -1);
- // setresgid (-1, 4099, -1) =
+ //staptest// setresgid (-1, 4099, -1) =
syscall(__NR_getresgid, &rgid, &egid, &sgid);
- // getresgid (XXXX, XXXX, XXXX) =
+ //staptest// getresgid (XXXX, XXXX, XXXX) =
syscall(__NR_setreuid, -1, 5000);
- // setreuid (-1, 5000) =
+ //staptest// setreuid (-1, 5000) =
syscall(__NR_setreuid, 5001, -1);
- // setreuid (5001, -1) =
+ //staptest// setreuid (5001, -1) =
syscall(__NR_setregid, -1, 5002);
- // setregid (-1, 5002) =
+ //staptest// setregid (-1, 5002) =
syscall(__NR_setregid, 5003, -1);
- // setregid (5003, -1) =
+ //staptest// setregid (5003, -1) =
syscall(__NR_setfsuid, 5004);
- // setfsuid (5004) =
+ //staptest// setfsuid (5004) =
syscall(__NR_setfsgid, 5005);
- // setfsgid (5005) =
+ //staptest// setfsgid (5005) =
#endif /* __i386__ */
diff --git a/testsuite/systemtap.syscall/umask.c b/testsuite/systemtap.syscall/umask.c
index 5d13575f..0a3d0534 100644
--- a/testsuite/systemtap.syscall/umask.c
+++ b/testsuite/systemtap.syscall/umask.c
@@ -5,16 +5,16 @@
int main()
{
umask (0);
- // umask (00) = NNNN
+ //staptest// umask (00) = NNNN
umask (7);
- // umask (07) = 00
+ //staptest// umask (07) = 00
umask (077);
- // umask (077) = 07
+ //staptest// umask (077) = 07
umask (0666);
- // umask (0666) = 077
+ //staptest// umask (0666) = 077
umask (0777);
- // umask (0777) = 0666
+ //staptest// umask (0777) = 0666
umask (01777);
- // umask (01777) = 0777
+ //staptest// umask (01777) = 0777
return 0;
}
diff --git a/testsuite/systemtap.syscall/unlink.c b/testsuite/systemtap.syscall/unlink.c
index b0d00be8..33fe6157 100644
--- a/testsuite/systemtap.syscall/unlink.c
+++ b/testsuite/systemtap.syscall/unlink.c
@@ -14,22 +14,22 @@ int main()
close (fd1);
unlink("foobar1");
- // unlink ("foobar1") = 0
+ //staptest// unlink ("foobar1") = 0
unlink("foobar1");
- // unlink ("foobar1") = -NNNN (ENOENT)
+ //staptest// unlink ("foobar1") = -NNNN (ENOENT)
unlink("foobar2");
- // unlink ("foobar2") = -NNNN (ENOENT)
+ //staptest// unlink ("foobar2") = -NNNN (ENOENT)
unlink(0);
- // unlink (NULL) = -NNNN (EFAULT)
+ //staptest// unlink (NULL) = -NNNN (EFAULT)
unlink("..");
- // unlink ("..") = -NNNN (EISDIR)
+ //staptest// unlink ("..") = -NNNN (EISDIR)
unlink("");
- // unlink ("") = -NNNN (ENOENT)
+ //staptest// unlink ("") = -NNNN (ENOENT)
return 0;
}