summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--grapher/GraphWidget.cxx4
-rw-r--r--includes/sys/sdt.h3
-rw-r--r--man/stapprobes.nfs.3stap.in38
-rw-r--r--man/stapprobes.nfsd.3stap.in22
-rw-r--r--man/stapprobes.rpc.3stap.in8
-rw-r--r--man/stapprobes.signal.3stap.in10
-rw-r--r--man/stapprobes.socket.3stap.in2
-rw-r--r--runtime/map.c2
-rw-r--r--stap-server.8.in10
-rw-r--r--stap.1.in2
-rw-r--r--stapprobes.3stap.in12
-rw-r--r--staprun.8.in2
-rw-r--r--systemtap.spec2
-rw-r--r--tapset/aux_syscalls.stp8
-rw-r--r--tapset/context-unwind.stp13
-rw-r--r--tapsets.cxx20
-rwxr-xr-xtestsuite/buildok/tcp_test.stp14
-rwxr-xr-xtestsuite/parseko/cmdline17.stp8
-rwxr-xr-xtestsuite/parseko/cmdline18.stp10
-rwxr-xr-xtestsuite/parseko/cmdline19.stp10
-rwxr-xr-xtestsuite/parseko/cmdline20.stp9
-rwxr-xr-xtestsuite/parseko/cmdline21.stp15
-rw-r--r--testsuite/systemtap.base/alternatives.exp5
-rw-r--r--testsuite/systemtap.base/flightrec3.exp79
-rw-r--r--testsuite/systemtap.base/flightrec3.stp5
-rw-r--r--testsuite/systemtap.base/skipped.exp6
26 files changed, 235 insertions, 84 deletions
diff --git a/grapher/GraphWidget.cxx b/grapher/GraphWidget.cxx
index a82a8bb6..38f8078d 100644
--- a/grapher/GraphWidget.cxx
+++ b/grapher/GraphWidget.cxx
@@ -281,8 +281,8 @@ namespace systemtap
Glib::RefPtr<Gdk::Window> win = get_window();
if(!win)
return true;
- double x;
- double y;
+ double x = 0.0;
+ double y = 0.0;
// XXX Hint
if (event->is_hint)
{
diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h
index f89b736a..5899549c 100644
--- a/includes/sys/sdt.h
+++ b/includes/sys/sdt.h
@@ -19,8 +19,9 @@
#define STAP_PROBE_ADDR "\t.long "
#endif
+/* An allocated section .probes that holds the probe names and addrs. */
#define STAP_PROBE_DATA_(probe) \
- __asm__ volatile (".section .probes\n" \
+ __asm__ volatile (".section .probes, \"a\"\n" \
"\t.align 8\n" \
"1:\n\t.asciz " #probe "\n" \
"\t.align 4\n" \
diff --git a/man/stapprobes.nfs.3stap.in b/man/stapprobes.nfs.3stap.in
index 579af533..14404b96 100644
--- a/man/stapprobes.nfs.3stap.in
+++ b/man/stapprobes.nfs.3stap.in
@@ -551,7 +551,7 @@ Fires when a previous async read operation failed
.TP
.B nfs.aop.readpages
-Fies when in readahead way,read several pages once
+Fires when in readahead way, read several pages once
.B Arguments:
@@ -577,7 +577,7 @@ Fies when in readahead way,read several pages once
.TP
.B nfs.aop.readpages.return
-Fies whenever a nfs read pages operation is done
+Fires whenever a nfs read pages operation is done
.B Arguments:
@@ -588,7 +588,7 @@ Fies whenever a nfs read pages operation is done
.TP
.B nfs.aop.set_page_dirty
-Fies whenever set page dirty on nfs client side
+Fires whenever set page dirty on nfs client side
.B Arguments:
@@ -602,7 +602,7 @@ Fies whenever set page dirty on nfs client side
.TP
.B nfs.aop.writepage
-Fies whenever writing an mapped page to the server from nfs client side
+Fires whenever writing an mapped page to the server from nfs client side
.B Arguments:
@@ -644,7 +644,7 @@ Fies whenever writing an mapped page to the server from nfs client side
.TP
.B nfs.aop.writepages
-Fies whenever writing several dirty pages to the server from nfs client sides
+Fires whenever writing several dirty pages to the server from nfs client sides
.B Arguments:
@@ -674,7 +674,7 @@ Fies whenever writing several dirty pages to the server from nfs client sides
.TP
.B nfs.aop.prepare_write
-Fies whenever prepare a page for writting on nfs client sides
+Fires whenever prepare a page for writing on nfs client sides
.B Arguments:
@@ -703,7 +703,7 @@ Fies whenever prepare a page for writting on nfs client sides
.TP
.B nfs.aop.commit_write
-Fies often after prepare write operation
+Fires often after prepare write operation
.B Arguments:
@@ -771,7 +771,7 @@ Fies often after prepare write operation
nfs version
.I filename
- the name of file which client opens/searchs on server
+ the name of file which client opens/searches on server
.I name_len
the length of file name
@@ -851,7 +851,7 @@ Fires when client synchronously writes file to server
.TP
.B nfs.proc.write.return
-Fires when synchronously writting file from server is done
+Fires when synchronously writing file from server is done
.B Arguments:
@@ -862,7 +862,7 @@ Fires when synchronously writting file from server is done
.TP
.B nfs.proc.commit
-Fires when client writes the buffered data to disk,the buffered
+Fires when client writes the buffered data to disk, the buffered
data is asynchronously written by client before(not exist in NFSV2)
.B Arguments:
@@ -902,7 +902,7 @@ Fires when committing operation is done
.B nfs.proc.read_setup
Fires when client asynchronously reads file from server,
-this function is used to setup a read rpc task,not do
+this function is used to setup a read rpc task, not do
a real read operation.
.B Arguments:
@@ -947,7 +947,7 @@ Fires when a read reply is received or some read error occur
number of bytes read
.I timestamp
- time stamp ,which is used for lease renewal (only
+ time stamp, which is used for lease renewal (only
in nfs.proc4.read_done)
.P
@@ -955,7 +955,7 @@ Fires when a read reply is received or some read error occur
.B nfs.proc.write_setup
Fires when client asynchronously write data to server,
-this function is used to setup a write rpc task,not do
+this function is used to setup a write rpc task, not do
a write read operation.
.B Arguments:
@@ -976,7 +976,7 @@ a write read operation.
the file offset
.I how
- used to set args.stable,The possible value could be:
+ used to set args.stable, The possible value could be:
NFS_UNSTABLE,
NFS_DATA_SYNC,
NFS_FILE_SYNC
@@ -1008,13 +1008,13 @@ Fires when a write reply is received or some write error occur
result of last async write operation
.I valid
- fattr\->valid ,indicates which fields are valid
+ fattr\->valid, indicates which fields are valid
.I count
number of bytes written
.I timestamp
- time stamp ,which is used for lease renewal (only
+ time stamp, which is used for lease renewal (only
in nfs.proc4.read_done)
.P
@@ -1022,7 +1022,7 @@ Fires when a write reply is received or some write error occur
.B nfs.proc.commit_setup
Fires when client asynchronously do a commit operation,
-this function is used to setup a commit rpc task,not do
+this function is used to setup a commit rpc task, not do
a commit read operation.
.B Arguments:
@@ -1068,13 +1068,13 @@ Fires when a commit reply is received or some commit error occur
result of last async write operation
.I valid
- fattr\->valid ,indicates which fields are valid
+ fattr\->valid, indicates which fields are valid
.I count
number of bytes written
.I timestamp
- time stamp ,which is used for lease renewal (only
+ time stamp, which is used for lease renewal (only
in nfs.proc4.read_done)
.P
diff --git a/man/stapprobes.nfsd.3stap.in b/man/stapprobes.nfsd.3stap.in
index 239d3b94..ea2ac2df 100644
--- a/man/stapprobes.nfsd.3stap.in
+++ b/man/stapprobes.nfsd.3stap.in
@@ -29,7 +29,7 @@ It contains the following probe points:
.TP
.B nfsd.proc.lookup
-Fires whenever client opens/searchs file on server
+Fires whenever client opens/searches file on server
.B Arguments:
@@ -78,7 +78,7 @@ Fires whenever client reads file on server
the offset of file
.I vec
- struct kvec ,includes buf address in kernel address
+ struct kvec, includes buf address in kernel address
and the length of each buffer
.I vlen
@@ -111,7 +111,7 @@ Fires whenever client writes data to file on server
the offset of file
.I vec
- struct kvec ,includes buf address in kernel address
+ struct kvec, includes buf address in kernel address
and the length of each buffer
.I vlen
@@ -294,7 +294,7 @@ Fires whenever server reads file
the offset of file
.I vec
- struct kvec ,includes buf address in kernel address
+ struct kvec, includes buf address in kernel address
and the length of each buffer
.I vlen
@@ -321,7 +321,7 @@ Fires whenever server writes file
the offset of file
.I vec
- struct kvec ,includes buf address in kernel address
+ struct kvec, includes buf address in kernel address
and the length of each buffer
.I vlen
@@ -348,7 +348,7 @@ Fires when server commits all pending writes to stable storage
.TP
.B nfsd.lookup
-Fires whenever client opens/searchs file on server
+Fires whenever client opens/searches file on server
.B Arguments:
@@ -394,7 +394,7 @@ Fires whenever client opens/searchs file on server
.B nfsd.createv3
Fires when client creates a regular file or set file attributes
-on server side,only called by nfsd3_proc_create and nfsd4_open
+on server side, only called by nfsd3_proc_create and nfsd4_open
(op_claim_type is NFS4_OPEN_CLAIM_NULL)
.B Arguments:
@@ -415,14 +415,14 @@ on server side,only called by nfsd3_proc_create and nfsd4_open
file access mode
.I createmode
- create mode .The possible values could be:
+ create mode. The possible values could be:
NFS3_CREATE_EXCLUSIVE,NFS3_CREATE_UNCHECKED,NFS3_CREATE_GUARDED
.I truncp
- trunp arguments, indicates if the file shouldbe truncate
+ trunp arguments, indicates if the file should be truncated
.I verfier
- file attributes (atime,mtime,mode).It's used to reset file
+ file attributes (atime,mtime,mode). It's used to reset file
attributes for CREATE_EXCLUSIVE
.P
@@ -485,7 +485,7 @@ Fires whenever server closes file
.TP
.B nfsd.dispatch
-Fires whenever server receives NFS operation from client
+Fires whenever server receives NFS operation from client
.B Arguments:
diff --git a/man/stapprobes.rpc.3stap.in b/man/stapprobes.rpc.3stap.in
index 6061b206..02b37a8b 100644
--- a/man/stapprobes.rpc.3stap.in
+++ b/man/stapprobes.rpc.3stap.in
@@ -375,7 +375,7 @@ Fires when an RPC client is to be processed
The procedure number in the request
.I rq_prot
- The IP protocol of the reqeust
+ The IP protocol of the request
.P
.TP
@@ -403,7 +403,7 @@ Fires when an RPC client is to be authorised
The procedure number in the request
.I rq_prot
- The IP protocol of the reqeust
+ The IP protocol of the request
.P
.TP
@@ -450,7 +450,7 @@ Fires when want to return reply to client
The procedure number in the request
.I rq_prot
- The IP protocol of the reqeust
+ The IP protocol of the request
.P
.TP
@@ -478,7 +478,7 @@ Fires when a request is to be dropped
The procedure number in the request
.I rq_prot
- The IP protocol of the reqeust
+ The IP protocol of the request
.P
.TP
diff --git a/man/stapprobes.signal.3stap.in b/man/stapprobes.signal.3stap.in
index 9b7ccd5f..cdaa51b9 100644
--- a/man/stapprobes.signal.3stap.in
+++ b/man/stapprobes.signal.3stap.in
@@ -74,7 +74,7 @@ Fires when return from sending a signal
.RS
.RS
-- return 0 if the signal is sucessfully sent to a process,
+- return 0 if the signal is successfully sent to a process,
which means the following:
<1> the signal is ignored by receiving process
@@ -90,7 +90,7 @@ by user using something other than kill()
Return values for "send_group_sigqueue"
.RS
-- return 0 if the signal is either sucessfully added into the
+- return 0 if the signal is either successfully added into the
sigqueue of receiving process or a SI_TIMER entry is already
queued so just increment the overrun count
@@ -100,7 +100,7 @@ queued so just increment the overrun count
Return values for "send_sigqueue"
.RS
-- return 0 if the signal is either sucessfully added into the
+- return 0 if the signal is either successfully added into the
sigqueue of receiving process or a SI_TIMER entry is already
queued so just increment the overrun count
@@ -186,8 +186,8 @@ Fires when wake up the process for new active signals
indicate whether to wake up a task in STOPPED or TRACED state
.I state_mask
- a string representation indicate the mask of task states
-that can be woken. Possible values are
+ a string representation indicate the mask of task states
+that can be woken. Possible values are
(TASK_INTERRUPTIBLE|TASK_STOPPED|TASK_TRACED) and
TASK_INTERRUPTIBLE.
diff --git a/man/stapprobes.socket.3stap.in b/man/stapprobes.socket.3stap.in
index 6124e7b7..fa6f1c0a 100644
--- a/man/stapprobes.socket.3stap.in
+++ b/man/stapprobes.socket.3stap.in
@@ -52,7 +52,7 @@ The message sender.
to convert to a string.
Common values include:
- 0 - IP (Internet Procotol, local interprocess communications)
+ 0 - IP (Internet Protocol, local interprocess communications)
6 - TCP (Transmission Control Protocol)
17 - UDP (User Datagram Protocol)
132 - SCTP (Stream Control Transmission Protocol)
diff --git a/runtime/map.c b/runtime/map.c
index 190ba91b..74467f30 100644
--- a/runtime/map.c
+++ b/runtime/map.c
@@ -719,7 +719,7 @@ static MAP _stp_pmap_agg (PMAP pmap)
{
int i, hash;
MAP m, agg;
- struct map_node *ptr, *aptr;
+ struct map_node *ptr, *aptr = NULL;
struct hlist_head *head, *ahead;
struct hlist_node *e, *f;
diff --git a/stap-server.8.in b/stap-server.8.in
index 2ec00c24..0480b6d5 100644
--- a/stap-server.8.in
+++ b/stap-server.8.in
@@ -93,7 +93,7 @@ certificate database, making that server a trusted server for clients using that
.PP
The
.I stap\-client
-program is analagous to the
+program is analogous to the
.I stap
front end except that it attempts to find a compatible systemtap server on the
local network and then attempts to use that server for actions related to
@@ -125,13 +125,13 @@ accepts the following:
.TP
.B \-\-server=\fIHOSTNAME\fR|\fIIP_ADDRESS\fR[\fB:\fIPORT\fR]
-This option intructs
+This option instructs
.I stap\-client
to use the named server instead of looking for one automatically. The server may
be specified using a valid host name or ip address. If no port is specified, then
.I stap\-client
-searches for the server among the servers advertizing their presence on the
-local network and uses the port which is being advertized. This is useful for
+searches for the server among the servers advertising their presence on the
+local network and uses the port which is being advertised. This is useful for
connecting to a specific server on the local network. If a port is specified,
then
.I stap\-client
@@ -181,7 +181,7 @@ server\[aq]s certificate database.
.B DIRNAME
This optional argument is the name of the directory containing the client\-side
certificate database to which the certificate is to be added. If not specified, the
-default, for non\-root users,is
+default, for non\-root users, is
.I $HOME/.systemtap/ssl/server\fP.
For root users (EUID=0), the default is
.I $sysconfdir/systemtap/ssl/server\fP.
diff --git a/stap.1.in b/stap.1.in
index a8609d6f..7736a612 100644
--- a/stap.1.in
+++ b/stap.1.in
@@ -456,7 +456,7 @@ proceed in a sorted order, by ascending or descending index or value.
Using the optional
.BR limit
keyword limits the number of loop iterations to EXP times. EXP is
-evaluted once at the beginning of the loop.
+evaluated once at the beginning of the loop.
.TP
.BR foreach " ([VAR1, VAR2, ...] " in " ARRAY [ "limit " EXP ]) STMT"
Same as above, used when the array is indexed with a tuple of keys.
diff --git a/stapprobes.3stap.in b/stapprobes.3stap.in
index b3066611..795a9a92 100644
--- a/stapprobes.3stap.in
+++ b/stapprobes.3stap.in
@@ -37,7 +37,7 @@ that it is optional, and that no error should result if it fails to
resolve. Optionalness passes down through all levels of
alias/wildcard expansion. Alternately, a probe point may be followed
by a "!" character, to indicate that it is both optional and
-sufficient. (Think vaguely of the prolog cut operator.) If it does
+sufficient. (Think vaguely of the Prolog cut operator.) If it does
resolve, then no further probe points in the same comma-separated list
will be resolved. Therefore, the "!" sufficiency mark only makes
sense in a list of probe point alternatives.
@@ -115,7 +115,7 @@ probe point is similar to the
.IR end
probe, except that each such probe handler run when the session ends
after errors have occurred. In such cases, "end" probes are skipped,
-but each "error" prober is still attempted. This kind of probe can be
+but each "error" probe is still attempted. This kind of probe can be
used to clean up or emit a "final gasp". It may also be numerically
parametrized to set a sequence.
@@ -606,7 +606,7 @@ The marker name string, which may contain the usual wildcard characters,
is matched against the names given to the marker macros when the kernel
and/or module was compiled. Optionally, you can specify
.BR format("format") .
-Specifying the marker format string allows differentation between two
+Specifying the marker format string allows differentiation between two
markers with the same name but different marker format strings.
The handler associated with a marker-based probe may read the
@@ -618,7 +618,7 @@ and string parameters are passed in a type-safe manner.
The marker format string associated with a marker is available in
.BR $format .
-And also the marker name string is avalable in
+And also the marker name string is available in
.BR $name .
.SS TRACEPOINTS
@@ -669,10 +669,10 @@ Performance monitor hardware points begin with a
The next part of the names the event being counted
.BR counter("event") .
The event names are processor implementation specific with the
-execption of the generic
+exception of the generic
.BR cycles " and " instructions
events, which are available on all processors. This sets up a counter
-on the processor to count the number of events occuring on the
+on the processor to count the number of events occurring on the
processor. For more details on the performance monitoring events
available on a specific processor use the command perfmon2 command:
diff --git a/staprun.8.in b/staprun.8.in
index b9993288..5fe2e7fa 100644
--- a/staprun.8.in
+++ b/staprun.8.in
@@ -52,7 +52,7 @@ The '_stp_target' variable will be set to PID.
.TP
.B \-o FILE
Send output to FILE. If the module uses bulk mode, the output will
-be in percpu files FILE_x(FILE_cpux in backgroud and bulk mode)
+be in percpu files FILE_x(FILE_cpux in background and bulk mode)
where 'x' is the cpu number. This supports strftime(3) formats
for FILE.
.TP
diff --git a/systemtap.spec b/systemtap.spec
index 77a170f8..5b9283cf 100644
--- a/systemtap.spec
+++ b/systemtap.spec
@@ -30,7 +30,7 @@ Requires: kernel-devel
Requires: gcc make
# Suggest: kernel-debuginfo
Requires: systemtap-runtime = %{version}-%{release}
-BuildRequires: nss-devel
+BuildRequires: nss-devel nss-tools pkgconfig
%if %{with_bundled_elfutils}
Source1: elfutils-%{elfutils_version}.tar.gz
diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp
index 009b0532..9cb7a3df 100644
--- a/tapset/aux_syscalls.stp
+++ b/tapset/aux_syscalls.stp
@@ -60,10 +60,10 @@ function _struct_timezone_u:string(uaddr:long)
%}
%{
- // Needed for the following four functions
- // _struct_utimbuf_actime, _struct_utimbuf_modtime,
- // _struct_compat_utimbuf_actime, _struct_compat_utimbuf_modtime
- #include <linux/utime.h>
+// Needed for the following four functions
+// _struct_utimbuf_actime, _struct_utimbuf_modtime,
+// _struct_compat_utimbuf_actime, _struct_compat_utimbuf_modtime
+#include <linux/utime.h>
%}
// Returns the value of the actime field of a utimbuf in user space
diff --git a/tapset/context-unwind.stp b/tapset/context-unwind.stp
index f1e99dc8..d6654d25 100644
--- a/tapset/context-unwind.stp
+++ b/tapset/context-unwind.stp
@@ -51,16 +51,13 @@ function backtrace:string () %{ /* pure */
* sfunction caller - Return name and address of calling function
*
* Return the address and name of the calling function.
+ * This is equivalent to calling:
+ * sprintf("%s 0x%x", symname(caller_addr(), caller_addr()))
* <emphasis>Works only for return probes at this time.</emphasis>
*/
-function caller:string() %{ /* pure */
- if (CONTEXT->pi)
- _stp_symbol_snprint( THIS->__retvalue, MAXSTRINGLEN,
- (unsigned long)_stp_ret_addr_r(CONTEXT->pi),
- current, 0);
- else
- strlcpy(THIS->__retvalue,"unknown",MAXSTRINGLEN);
-%}
+function caller:string() {
+ return sprintf("%s 0x%x", symname(caller_addr()), caller_addr());
+}
/**
* sfunction caller_addr - Return caller address
diff --git a/tapsets.cxx b/tapsets.cxx
index eeccb90b..1728ec9e 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -3417,12 +3417,12 @@ dwarf_builder::build(systemtap_session & sess,
Elf_Scn *probe_scn = NULL;
dwfl_assert ("getshstrndx", elf_getshstrndx (elf, &shstrndx));
+ GElf_Shdr shdr_mem;
GElf_Shdr *shdr = NULL;
// Is there a .probes section?
while ((probe_scn = elf_nextscn (elf, probe_scn)))
{
- GElf_Shdr shdr_mem;
shdr = gelf_getshdr (probe_scn, &shdr_mem);
assert (shdr != NULL);
@@ -3433,6 +3433,22 @@ dwarf_builder::build(systemtap_session & sess,
}
}
+ // Older versions put .probes section in the debuginfo dwarf file,
+ // so check if it actually exists, if not take the main elf file
+ if (probe_type == probes_and_dwarf && shdr->sh_type == SHT_NOBITS)
+ {
+ elf = dwfl_module_getelf (dw->module, &bias);
+ dwfl_assert ("getshstrndx", elf_getshstrndx (elf, &shstrndx));
+ probe_scn = NULL;
+ while ((probe_scn = elf_nextscn (elf, probe_scn)))
+ {
+ shdr = gelf_getshdr (probe_scn, &shdr_mem);
+ if (strcmp (elf_strptr (elf, shstrndx, shdr->sh_name),
+ ".probes") == 0)
+ break;
+ }
+ }
+
// We got our .probes section, extract data.
if (probe_type == probes_and_dwarf)
{
@@ -5163,7 +5179,7 @@ tracepoint_var_expanding_visitor::visit_target_symbol_context (target_symbol* e)
expression *texp = require (tsym); // NB: throws nothing ...
assert (!tsym->saved_conversion_error); // ... but this is how we know it happened.
- pf->raw_components += "=%#x";
+ pf->raw_components += args[i].isptr ? "=%p" : "=%#x";
pf->args.push_back(texp);
}
diff --git a/testsuite/buildok/tcp_test.stp b/testsuite/buildok/tcp_test.stp
index a262ab29..a5e3bafb 100755
--- a/testsuite/buildok/tcp_test.stp
+++ b/testsuite/buildok/tcp_test.stp
@@ -8,16 +8,16 @@ function print_report()
}
probe tcp.sendmsg {
- ports = inet_get_local_port(sk)
- src_ips = inet_get_ip_source(sk)
- rtos = tcp_get_info_rto(sk)
+ ports = inet_get_local_port(sock)
+ src_ips = inet_get_ip_source(sock)
+ rtos = tcp_get_info_rto(sock)
}
probe tcp.recvmsg {
- cwnd = tcp_get_info_snd_cwnd(sk)
- mss = tcp_ts_get_info_rcv_mss(sk)
- ssthresh = tcp_ts_get_info_snd_ssthresh(sk)
- state = tcp_ts_get_info_state(sk)
+ cwnd = tcp_get_info_snd_cwnd(sock)
+ mss = tcp_ts_get_info_rcv_mss(sock)
+ ssthresh = tcp_ts_get_info_snd_ssthresh(sock)
+ state = tcp_ts_get_info_state(sock)
}
probe tcp.sendmsg.return {
diff --git a/testsuite/parseko/cmdline17.stp b/testsuite/parseko/cmdline17.stp
new file mode 100755
index 00000000..a9baf2d4
--- /dev/null
+++ b/testsuite/parseko/cmdline17.stp
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# options '-D' and '-L' are mutually exclusive
+#
+#-D Run in background. This requires '-o' option.
+#-L Load module and start probes, then detach.
+
+staprun -L -D fake_module
diff --git a/testsuite/parseko/cmdline18.stp b/testsuite/parseko/cmdline18.stp
new file mode 100755
index 00000000..bbdfbcc5
--- /dev/null
+++ b/testsuite/parseko/cmdline18.stp
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# options '-D' and '-d' are mutually exclusive
+#
+#-D Run in background. This requires '-o' option.
+#-d Delete a module. Only detached or unused modules
+# the user has permission to access will be deleted. Use "*"
+# (quoted) to delete all unused modules.
+
+staprun -d -D fake_module
diff --git a/testsuite/parseko/cmdline19.stp b/testsuite/parseko/cmdline19.stp
new file mode 100755
index 00000000..fbcef351
--- /dev/null
+++ b/testsuite/parseko/cmdline19.stp
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# options '-D' and '-c cmd' are mutually exclusive
+#
+#-D Run in background. This requires '-o' option.
+#-c cmd Command 'cmd' will be run and staprun will
+# exit when it does. The '_stp_target' variable
+# will contain the pid for the command.
+
+staprun -c /bin/ls -D fake_module
diff --git a/testsuite/parseko/cmdline20.stp b/testsuite/parseko/cmdline20.stp
new file mode 100755
index 00000000..625cf20d
--- /dev/null
+++ b/testsuite/parseko/cmdline20.stp
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# You have to specify ouput FILE with '-D' option
+#
+#-D Run in background. This requires '-o' option.
+#-o FILE Send output to FILE. This supports strftime(3)
+# formats for FILE.
+
+staprun -D fake_module
diff --git a/testsuite/parseko/cmdline21.stp b/testsuite/parseko/cmdline21.stp
new file mode 100755
index 00000000..d7496c8c
--- /dev/null
+++ b/testsuite/parseko/cmdline21.stp
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# You have to specify ouput FILE with '-S' option
+#
+#-S size[,N] Switches output file to next file when the size
+# of file reaches the specified size. The value
+# should be an integer greater than 1 which is
+# assumed to be the maximum file size in MB.
+# When the number of output files reaches N, it
+# switches to the first output file. You can omit
+# the second argument.
+#-o FILE Send output to FILE. This supports strftime(3)
+# formats for FILE.
+
+staprun -S 1,1 fake_module
diff --git a/testsuite/systemtap.base/alternatives.exp b/testsuite/systemtap.base/alternatives.exp
index 6cbc1e10..f5dc4513 100644
--- a/testsuite/systemtap.base/alternatives.exp
+++ b/testsuite/systemtap.base/alternatives.exp
@@ -26,10 +26,11 @@ proc stap_run_alternatives {args} {
verbose -log "starting $args"
eval spawn $args
expect {
+ -timeout 60
-re {semantic error: .+ \(alternatives: [a-zA-Z_]} {incr alternatives_found; exp_continue}
-re {[^\r]*\r} { verbose -log $expect_out(0,string); exp_continue }
- eof { }
- timeout { }
+ eof { verbose -log "EOF" }
+ timeout { verbose -log "TIMEOUT" }
}
set results [wait]
verbose -log "wait results: $results"
diff --git a/testsuite/systemtap.base/flightrec3.exp b/testsuite/systemtap.base/flightrec3.exp
new file mode 100644
index 00000000..5b9d8253
--- /dev/null
+++ b/testsuite/systemtap.base/flightrec3.exp
@@ -0,0 +1,79 @@
+set test "flightrec3"
+if {![installtest_p]} { untested $test; return }
+
+# cleanup
+system "rm -f flightlog.out*"
+
+set pid 0
+# check -S option with bulk(percpu file) mode
+spawn stap -F -o flightlog.out -S 1,3 -b $srcdir/$subdir/$test.stp
+expect {
+ -timeout 240
+ -re {([0-9]+)\r\n} {
+ pass "$test (-S option with bulk mode)"
+ set pid $expect_out(1,string)
+ exp_continue}
+ timeout { fail "$test (timeout)"}
+ eof { }
+}
+wait
+if {$pid == 0} {
+ fail "$test (no pid)"
+ return -1
+}
+
+exec sleep 4
+array set cpus {}
+set scnt 0
+# wait for log files
+exec kill -STOP $pid
+exec sleep 1
+eval spawn stat -c \"%n %s\" [glob flightlog.out_cpu*]
+expect {
+ -timeout 100
+ -re {flightlog.out_cpu([0-9]+).[0-9]+ ([0-9]+)\r\n} {
+ set cpuid $expect_out(1,string)
+ set size $expect_out(2,string)
+ if {[array get cpus $cpuid] == ""} {set cpus($cpuid) 0}
+ incr cpus($cpuid);
+ if {$size <= 1048576 } {incr scnt}
+ exp_continue}
+ timeout { fail "$test (logfile timeout)"}
+}
+wait
+exec kill -CONT $pid
+exec sleep 3
+exec kill -STOP $pid
+eval spawn stat -c \"%n %s\" [glob flightlog.out_cpu*]
+expect {
+ -timeout 100
+ -re {flightlog.out_cpu([0-9]+).[0-9]+ ([0-9]+)\r\n} {
+ set cpuid $expect_out(1,string)
+ set size $expect_out(2,string)
+ if {[array get cpus $cpuid] == ""} {set cpus($cpuid) 0}
+ incr cpus($cpuid);
+ if {$size <= 1048576 } {incr scnt}
+ exp_continue}
+ timeout { fail "$test (logfile timeout)"}
+}
+wait
+exec kill -CONT $pid
+# check logfile number
+set cnt 0
+foreach e [array names cpus] {
+ if {$cpus($e) != 6} {
+ fail "$test (log file numbers cpu:$e, cnt:$cpus($e)))"
+ }
+ set cnt [expr $cnt + $cpus($e)]
+}
+# check logfile size
+if {$scnt == $cnt} {
+ pass "$test (log file size limitation with bulk mode)"
+} else {
+ fail "$test (log file size ($scnt != $cnt))"
+}
+exec kill -TERM $pid
+# wait for exiting...
+exec sleep 1
+system "rm -f flightlog.out*"
+
diff --git a/testsuite/systemtap.base/flightrec3.stp b/testsuite/systemtap.base/flightrec3.stp
new file mode 100644
index 00000000..d660793f
--- /dev/null
+++ b/testsuite/systemtap.base/flightrec3.stp
@@ -0,0 +1,5 @@
+probe kernel.function("update_process_times")
+{
+ for (j = 0; j < 100; j++)
+ printf("1234567890\n")
+}
diff --git a/testsuite/systemtap.base/skipped.exp b/testsuite/systemtap.base/skipped.exp
index 8c491037..f3048c8a 100644
--- a/testsuite/systemtap.base/skipped.exp
+++ b/testsuite/systemtap.base/skipped.exp
@@ -2,8 +2,8 @@ set test "skip tracking"
if {! [installtest_p]} { untested $test; return }
-set cpus [exec sh -c "grep ^processor /proc/cpuinfo | wc -l"]
-if {$cpus < 2} { unsupported $test; return }
+set nr_cpus [exec sh -c "grep ^processor /proc/cpuinfo | wc -l"]
+if {$nr_cpus < 2} { unsupported $test; return }
set ok 0
spawn stap -e "probe timer.s(5) {exit()} probe timer.profile,syscall.* {f++} global f" -DMAXTRYLOCK=0 -tu
@@ -18,4 +18,4 @@ expect {
catch {close}
catch {wait}
-if {$ok >= 3} { pass "$test ($cpus $ok)" } else { fail "$test ($cpus $ok)" }
+if {$ok >= 3} { pass "$test ($nr_cpus $ok)" } else { fail "$test ($nr_cpus $ok)" }