summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2008-12-09 11:20:11 -0500
committerWilliam Cohen <wcohen@redhat.com>2008-12-09 11:20:11 -0500
commit4ffc629674ac7d1d84b93cb7fdca71953983f762 (patch)
treedca338602903ba87b69592b40faa35ca74b7966e
parent73dc0c77745ee09db15542c14f7e048f91e121e6 (diff)
downloadsystemtap-steved-4ffc629674ac7d1d84b93cb7fdca71953983f762.tar.gz
systemtap-steved-4ffc629674ac7d1d84b93cb7fdca71953983f762.tar.xz
systemtap-steved-4ffc629674ac7d1d84b93cb7fdca71953983f762.zip
Tweak formatting, indent two space.
-rw-r--r--testsuite/systemtap.examples/ChangeLog23
-rwxr-xr-xtestsuite/systemtap.examples/general/ansi_colors.stp30
-rwxr-xr-xtestsuite/systemtap.examples/general/key.stp16
-rwxr-xr-xtestsuite/systemtap.examples/general/keyhack.stp6
-rwxr-xr-xtestsuite/systemtap.examples/general/para-callgraph.stp16
-rwxr-xr-xtestsuite/systemtap.examples/io/disktop.stp80
-rwxr-xr-xtestsuite/systemtap.examples/io/io_submit.stp50
-rwxr-xr-xtestsuite/systemtap.examples/io/iostat-scsi.stp10
-rwxr-xr-xtestsuite/systemtap.examples/io/iotime.stp7
-rwxr-xr-xtestsuite/systemtap.examples/io/traceio.stp26
-rwxr-xr-xtestsuite/systemtap.examples/io/traceio2.stp6
-rwxr-xr-xtestsuite/systemtap.examples/network/nettop.stp44
-rwxr-xr-xtestsuite/systemtap.examples/process/futexes.stp33
-rwxr-xr-xtestsuite/systemtap.examples/process/proc_snoop.stp38
-rwxr-xr-xtestsuite/systemtap.examples/process/sig_by_pid.stp30
-rwxr-xr-xtestsuite/systemtap.examples/process/sigkill.stp6
-rwxr-xr-xtestsuite/systemtap.examples/process/sigmon.stp16
-rwxr-xr-xtestsuite/systemtap.examples/process/syscalls_by_pid.stp10
-rwxr-xr-xtestsuite/systemtap.examples/process/syscalls_by_proc.stp10
-rwxr-xr-xtestsuite/systemtap.examples/process/wait4time.stp2
-rwxr-xr-xtestsuite/systemtap.examples/profiling/thread-times.stp40
21 files changed, 261 insertions, 238 deletions
diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog
index 01675733..7a77d27a 100644
--- a/testsuite/systemtap.examples/ChangeLog
+++ b/testsuite/systemtap.examples/ChangeLog
@@ -1,3 +1,26 @@
+2008-12-09 William Cohen <wcohen@redhat.com>
+
+ * general/ansi_colors.stp:
+ * general/key.stp:
+ * general/keyhack.stp:
+ * general/para-callgraph.stp:
+ * io/disktop.stp:
+ * io/io_submit.stp:
+ * io/iostat-scsi.stp:
+ * io/iotime.stp:
+ * io/traceio.stp:
+ * io/traceio2.stp:
+ * network/nettop.stp:
+ * process/futexes.stp:
+ * process/proc_snoop.stp:
+ * process/sig_by_pid.stp:
+ * process/sigkill.stp:
+ * process/sigmon.stp:
+ * process/syscalls_by_pid.stp:
+ * process/syscalls_by_proc.stp:
+ * process/wait4time.stp:
+ * profiling/thread-times.stp: Tweak formatting, indent two space.
+
2008-11-25 Mark Wielaard <mjw@redhat.com>
* general/para-callgraph.meta: Add accidentially removed -c back
diff --git a/testsuite/systemtap.examples/general/ansi_colors.stp b/testsuite/systemtap.examples/general/ansi_colors.stp
index 0d9d7c47..ae954e69 100755
--- a/testsuite/systemtap.examples/general/ansi_colors.stp
+++ b/testsuite/systemtap.examples/general/ansi_colors.stp
@@ -2,20 +2,20 @@
probe begin {
printf("a \\ b |");
- for (c = 40; c < 48; c++)
- printf(" %d ", c);
- printf("\12");
- for (l = 0; l < 71; l++)
- printf("-");
- printf("\12");
+ for (c = 40; c < 48; c++)
+ printf(" %d ", c);
+ printf("\12");
+ for (l = 0; l < 71; l++)
+ printf("-");
+ printf("\12");
- for (r = 30; r < 38; r++)
- for (t = 0; t < 2; t++) {
- printf("%d |", r);
- for (c = 40; c < 48; c++)
- printf("\033[%d;%d%s %s \033[0;0m",
- r, c, !t ? "m" : ";1m", !t ? "Normal" : "Bold ");
- printf("\12");
- }
- exit();
+ for (r = 30; r < 38; r++)
+ for (t = 0; t < 2; t++) {
+ printf("%d |", r);
+ for (c = 40; c < 48; c++)
+ printf("\033[%d;%d%s %s \033[0;0m",
+ r, c, !t ? "m" : ";1m", !t ? "Normal" : "Bold ");
+ printf("\12");
+ }
+ exit();
}
diff --git a/testsuite/systemtap.examples/general/key.stp b/testsuite/systemtap.examples/general/key.stp
index 6d2d6c3f..8d2c866c 100755
--- a/testsuite/systemtap.examples/general/key.stp
+++ b/testsuite/systemtap.examples/general/key.stp
@@ -5,18 +5,18 @@
// KEY_ENTER = 28
probe kernel.function("kbd_event") {
- if ($event_type == 1 && $value) {
- if ($event_code == 28)
- system("play return.wav &> /dev/null")
- else
- system("play click.wav &> /dev/null")
- }
+ if ($event_type == 1 && $value) {
+ if ($event_code == 28)
+ system("play return.wav &> /dev/null")
+ else
+ system("play click.wav &> /dev/null")
+ }
}
probe begin {
- printf("TYPEWRITER ON\n")
+ printf("TYPEWRITER ON\n")
}
probe end {
- printf("DONE\n")
+ printf("DONE\n")
}
diff --git a/testsuite/systemtap.examples/general/keyhack.stp b/testsuite/systemtap.examples/general/keyhack.stp
index 3137baad..23384a9a 100755
--- a/testsuite/systemtap.examples/general/keyhack.stp
+++ b/testsuite/systemtap.examples/general/keyhack.stp
@@ -6,10 +6,10 @@
# Usage: ./keyhack.stp -g
probe kernel.function("kbd_event") {
- # Changes 'm' to 'b' .
- if ($event_code == 50) $event_code = 48
+ # Changes 'm' to 'b' .
+ if ($event_code == 50) $event_code = 48
}
probe end {
- printf("\nDONE\n")
+ printf("\nDONE\n")
}
diff --git a/testsuite/systemtap.examples/general/para-callgraph.stp b/testsuite/systemtap.examples/general/para-callgraph.stp
index 9abb00c2..a78e26e9 100755
--- a/testsuite/systemtap.examples/general/para-callgraph.stp
+++ b/testsuite/systemtap.examples/general/para-callgraph.stp
@@ -1,22 +1,22 @@
#! /usr/bin/env stap
function trace(entry_p, extra) {
- %( $# > 1 %? if (tid() in trace) %)
- printf("%s%s%s %s\n",
- thread_indent (entry_p),
- (entry_p>0?"->":"<-"),
- probefunc (),
- extra)
+ %( $# > 1 %? if (tid() in trace) %)
+ printf("%s%s%s %s\n",
+ thread_indent (entry_p),
+ (entry_p>0?"->":"<-"),
+ probefunc (),
+ extra)
}
%( $# > 1 %?
global trace
probe $2.call {
- trace[tid()] = 1
+ trace[tid()] = 1
}
probe $2.return {
- delete trace[tid()]
+ delete trace[tid()]
}
%)
diff --git a/testsuite/systemtap.examples/io/disktop.stp b/testsuite/systemtap.examples/io/disktop.stp
index 238195bf..db91f2be 100755
--- a/testsuite/systemtap.examples/io/disktop.stp
+++ b/testsuite/systemtap.examples/io/disktop.stp
@@ -16,56 +16,56 @@ global io_stat,device
global read_bytes,write_bytes
probe vfs.read.return {
- if ($return>0) {
- if (devname!="N/A") {/*skip read from cache*/
- io_stat[pid(),execname(),uid(),ppid(),"R"] += $return
- device[pid(),execname(),uid(),ppid(),"R"] = devname
- read_bytes += $return
- }
- }
+ if ($return>0) {
+ if (devname!="N/A") {/*skip read from cache*/
+ io_stat[pid(),execname(),uid(),ppid(),"R"] += $return
+ device[pid(),execname(),uid(),ppid(),"R"] = devname
+ read_bytes += $return
+ }
+ }
}
probe vfs.write.return {
- if ($return>0) {
- if (devname!="N/A") { /*skip update cache*/
- io_stat[pid(),execname(),uid(),ppid(),"W"] += $return
- device[pid(),execname(),uid(),ppid(),"W"] = devname
- write_bytes += $return
- }
- }
+ if ($return>0) {
+ if (devname!="N/A") { /*skip update cache*/
+ io_stat[pid(),execname(),uid(),ppid(),"W"] += $return
+ device[pid(),execname(),uid(),ppid(),"W"] = devname
+ write_bytes += $return
+ }
+ }
}
probe timer.ms(5000) {
- /* skip non-read/write disk */
- if (read_bytes+write_bytes) {
+ /* skip non-read/write disk */
+ if (read_bytes+write_bytes) {
- printf("\n%-25s, %-8s%4dKb/sec, %-7s%6dKb, %-7s%6dKb\n\n",
- ctime(gettimeofday_s()),
- "Average:", ((read_bytes+write_bytes)/1024)/5,
- "Read:",read_bytes/1024,
- "Write:",write_bytes/1024)
+ printf("\n%-25s, %-8s%4dKb/sec, %-7s%6dKb, %-7s%6dKb\n\n",
+ ctime(gettimeofday_s()),
+ "Average:", ((read_bytes+write_bytes)/1024)/5,
+ "Read:",read_bytes/1024,
+ "Write:",write_bytes/1024)
- /* print header */
- printf("%8s %8s %8s %25s %8s %4s %12s\n",
- "UID","PID","PPID","CMD","DEVICE","T","BYTES")
- }
- /* print top ten I/O */
- foreach ([process,cmd,userid,parent,action] in io_stat- limit 10)
- printf("%8d %8d %8d %25s %8s %4s %12d\n",
- userid,process,parent,cmd,
- device[process,cmd,userid,parent,action],
- action,io_stat[process,cmd,userid,parent,action])
+ /* print header */
+ printf("%8s %8s %8s %25s %8s %4s %12s\n",
+ "UID","PID","PPID","CMD","DEVICE","T","BYTES")
+ }
+ /* print top ten I/O */
+ foreach ([process,cmd,userid,parent,action] in io_stat- limit 10)
+ printf("%8d %8d %8d %25s %8s %4s %12d\n",
+ userid,process,parent,cmd,
+ device[process,cmd,userid,parent,action],
+ action,io_stat[process,cmd,userid,parent,action])
- /* clear data */
- delete io_stat
- delete device
- read_bytes = 0
- write_bytes = 0
+ /* clear data */
+ delete io_stat
+ delete device
+ read_bytes = 0
+ write_bytes = 0
}
probe end{
- delete io_stat
- delete device
- delete read_bytes
- delete write_bytes
+ delete io_stat
+ delete device
+ delete read_bytes
+ delete write_bytes
}
diff --git a/testsuite/systemtap.examples/io/io_submit.stp b/testsuite/systemtap.examples/io/io_submit.stp
index 13dcc5a3..fc2e5ff1 100755
--- a/testsuite/systemtap.examples/io/io_submit.stp
+++ b/testsuite/systemtap.examples/io/io_submit.stp
@@ -21,19 +21,19 @@ global traces
* hash table that this proc is in io_submit
*/
probe syscall.io_submit {
- in_iosubmit[tid()] = 1
+ in_iosubmit[tid()] = 1
}
/*
* when we return from sys_io_submit, record that we're no longer there
*/
probe syscall.io_submit.return {
- /* this assumes a given proc will do lots of io_submit calls, and
- * so doesn't do the more expensive "delete in_iosubmit[p]". If
- * there are lots of procs doing small number of io_submit calls,
- * the hash may grow pretty big, so using delete may be better
- */
- in_iosubmit[tid()] = 0
+ /* this assumes a given proc will do lots of io_submit calls, and
+ * so doesn't do the more expensive "delete in_iosubmit[p]". If
+ * there are lots of procs doing small number of io_submit calls,
+ * the hash may grow pretty big, so using delete may be better
+ */
+ in_iosubmit[tid()] = 0
}
/*
@@ -41,21 +41,21 @@ probe syscall.io_submit.return {
* io_submit. If so, record our backtrace into the traces histogram
*/
probe kernel.function("schedule") {
- if (tid() in in_iosubmit) {
- traces[backtrace()]++
+ if (tid() in in_iosubmit) {
+ traces[backtrace()]++
- /*
- * change this to if (1) if you want a backtrace every time
- * you go into schedule from io_submit. Unfortunately, the traces
- * saved into the traces histogram above are truncated to just a
- * few lines. so the only way to see the full trace is via the
- * more verbose print_backtrace() right here.
- */
- if (0) {
- printf("schedule in io_submit!\n")
- print_backtrace()
- }
- }
+ /*
+ * change this to if (1) if you want a backtrace every time
+ * you go into schedule from io_submit. Unfortunately, the traces
+ * saved into the traces histogram above are truncated to just a
+ * few lines. so the only way to see the full trace is via the
+ * more verbose print_backtrace() right here.
+ */
+ if (0) {
+ printf("schedule in io_submit!\n")
+ print_backtrace()
+ }
+ }
}
/*
@@ -63,9 +63,9 @@ probe kernel.function("schedule") {
* trace paths and print the 30 most common.
*/
probe end {
- foreach (stack in traces- limit 30) {
- printf("%d:", traces[stack])
- print_stack(stack);
- }
+ foreach (stack in traces- limit 30) {
+ printf("%d:", traces[stack])
+ print_stack(stack);
+ }
}
diff --git a/testsuite/systemtap.examples/io/iostat-scsi.stp b/testsuite/systemtap.examples/io/iostat-scsi.stp
index ef778e53..15833af8 100755
--- a/testsuite/systemtap.examples/io/iostat-scsi.stp
+++ b/testsuite/systemtap.examples/io/iostat-scsi.stp
@@ -58,7 +58,7 @@ global hdrcount
probe timer.s($1) {
if ((hdrcount++ % 10) == 0)
printf("%9s %9s %9s %9s %9s %9s\n",
- "Device:","tps","blk_read/s","blk_wrtn/s","blk_read","blk_wrtn")
+ "Device:","tps","blk_read/s","blk_wrtn/s","blk_read","blk_wrtn")
foreach (dev in devices) {
rdcount=@count(reads[dev])
@@ -69,10 +69,10 @@ probe timer.s($1) {
rdblkrate=rdblkcount*100/$1
wrblkrate=wrblkcount*100/$1
printf("%9s %6d.%02d %6d.%02d %6d.%02d %9d %9d\n",
- dev, tps/100,tps%100,
- rdblkrate/100,rdblkrate%100,
- wrblkrate/100,wrblkrate%100,
- rdblkcount, wrblkcount)
+ dev, tps/100,tps%100,
+ rdblkrate/100,rdblkrate%100,
+ wrblkrate/100,wrblkrate%100,
+ rdblkcount, wrblkcount)
}
printf ("\n")
delete devices
diff --git a/testsuite/systemtap.examples/io/iotime.stp b/testsuite/systemtap.examples/io/iotime.stp
index 4fbd6b6e..60fb09af 100755
--- a/testsuite/systemtap.examples/io/iotime.stp
+++ b/testsuite/systemtap.examples/io/iotime.stp
@@ -98,11 +98,12 @@ probe syscall.write.return {
probe syscall.close {
if (filehandles[pid(), $fd] != "") {
- printf("%d %s access %s read: %d write: %d\n", timestamp(), proc(),
- filehandles[pid(), $fd], fileread[pid(), $fd], filewrite[pid(), $fd])
+ printf("%d %s access %s read: %d write: %d\n",
+ timestamp(), proc(), filehandles[pid(), $fd],
+ fileread[pid(), $fd], filewrite[pid(), $fd])
if (@count(time_io[pid(), $fd]))
printf("%d %s iotime %s time: %d\n", timestamp(), proc(),
- filehandles[pid(), $fd], @sum(time_io[pid(), $fd]))
+ filehandles[pid(), $fd], @sum(time_io[pid(), $fd]))
}
delete fileread[pid(), $fd]
delete filewrite[pid(), $fd]
diff --git a/testsuite/systemtap.examples/io/traceio.stp b/testsuite/systemtap.examples/io/traceio.stp
index 4ca4dd4c..9e2deec6 100755
--- a/testsuite/systemtap.examples/io/traceio.stp
+++ b/testsuite/systemtap.examples/io/traceio.stp
@@ -10,23 +10,23 @@
global reads, writes, total_io
probe vfs.read.return {
- reads[execname()] += $return
+ reads[execname()] += $return
}
probe vfs.write.return {
- writes[execname()] += $return
+ writes[execname()] += $return
}
probe timer.s(1) {
- foreach (p in reads)
- total_io[p] += reads[p]
- foreach (p in writes)
- total_io[p] += writes[p]
- foreach(p in total_io- limit 10)
- printf("%15s r: %8d KiB w: %8d KiB\n",
- p, reads[p]/1024,
- writes[p]/1024)
- printf("\n")
- # Note we don't zero out reads, writes and total_io,
- # so the values are cumulative since the script started.
+ foreach (p in reads)
+ total_io[p] += reads[p]
+ foreach (p in writes)
+ total_io[p] += writes[p]
+ foreach(p in total_io- limit 10)
+ printf("%15s r: %8d KiB w: %8d KiB\n",
+ p, reads[p]/1024,
+ writes[p]/1024)
+ printf("\n")
+ # Note we don't zero out reads, writes and total_io,
+ # so the values are cumulative since the script started.
}
diff --git a/testsuite/systemtap.examples/io/traceio2.stp b/testsuite/systemtap.examples/io/traceio2.stp
index a9d3c261..032edcd9 100755
--- a/testsuite/systemtap.examples/io/traceio2.stp
+++ b/testsuite/systemtap.examples/io/traceio2.stp
@@ -11,7 +11,7 @@ probe begin {
probe vfs.write, vfs.read
{
- if (dev == device_of_interest)
- printf ("%s(%d) %s 0x%x\n",
- execname(), pid(), probefunc(), dev)
+ if (dev == device_of_interest)
+ printf ("%s(%d) %s 0x%x\n",
+ execname(), pid(), probefunc(), dev)
}
diff --git a/testsuite/systemtap.examples/network/nettop.stp b/testsuite/systemtap.examples/network/nettop.stp
index 96db413a..15b4d62a 100755
--- a/testsuite/systemtap.examples/network/nettop.stp
+++ b/testsuite/systemtap.examples/network/nettop.stp
@@ -4,39 +4,37 @@ global ifxmit, ifrecv
probe netdev.transmit
{
- ifxmit[pid(), dev_name, execname(), uid()] <<< length
+ ifxmit[pid(), dev_name, execname(), uid()] <<< length
}
probe netdev.receive
{
- ifrecv[pid(), dev_name, execname(), uid()] <<< length
+ ifrecv[pid(), dev_name, execname(), uid()] <<< length
}
-
function print_activity()
{
- printf("%5s %5s %-7s %7s %7s %7s %7s %-15s\n",
- "PID", "UID", "DEV", "XMIT_PK", "RECV_PK",
- "XMIT_KB", "RECV_KB", "COMMAND")
-
- foreach ([pid, dev, exec, uid] in ifrecv-) {
- n_xmit = @count(ifxmit[pid, dev, exec, uid])
- n_recv = @count(ifrecv[pid, dev, exec, uid])
- printf("%5d %5d %-7s %7d %7d %7d %7d %-15s\n",
- pid, uid, dev, n_xmit, n_recv,
- n_xmit ? @sum(ifxmit[pid, dev, exec, uid])/1024 : 0,
- n_recv ? @sum(ifrecv[pid, dev, exec, uid])/1024 : 0,
- exec)
- }
-
- print("\n")
-
- delete ifxmit
- delete ifrecv
+ printf("%5s %5s %-7s %7s %7s %7s %7s %-15s\n",
+ "PID", "UID", "DEV", "XMIT_PK", "RECV_PK",
+ "XMIT_KB", "RECV_KB", "COMMAND")
+
+ foreach ([pid, dev, exec, uid] in ifrecv-) {
+ n_xmit = @count(ifxmit[pid, dev, exec, uid])
+ n_recv = @count(ifrecv[pid, dev, exec, uid])
+ printf("%5d %5d %-7s %7d %7d %7d %7d %-15s\n",
+ pid, uid, dev, n_xmit, n_recv,
+ n_xmit ? @sum(ifxmit[pid, dev, exec, uid])/1024 : 0,
+ n_recv ? @sum(ifrecv[pid, dev, exec, uid])/1024 : 0,
+ exec)
+ }
+
+ print("\n")
+
+ delete ifxmit
+ delete ifrecv
}
probe timer.ms(5000), end, error
{
- print_activity()
+ print_activity()
}
-
diff --git a/testsuite/systemtap.examples/process/futexes.stp b/testsuite/systemtap.examples/process/futexes.stp
index 16c62937..0bd63262 100755
--- a/testsuite/systemtap.examples/process/futexes.stp
+++ b/testsuite/systemtap.examples/process/futexes.stp
@@ -11,26 +11,27 @@ global lock_waits # long-lived stats on (tid,lock) blockage elapsed time
global process_names # long-lived pid-to-execname mapping
probe syscall.futex {
- if (op != FUTEX_WAIT) next # we don't care about originators of WAKE events
- t = tid ()
- process_names[pid()] = execname()
- thread_thislock[t] = $uaddr
- thread_blocktime[t] = gettimeofday_us()
+ if (op != FUTEX_WAIT) next # we don't care about originators of WAKE events
+ t = tid ()
+ process_names[pid()] = execname()
+ thread_thislock[t] = $uaddr
+ thread_blocktime[t] = gettimeofday_us()
}
probe syscall.futex.return {
- t = tid()
- ts = thread_blocktime[t]
- if (ts) {
- elapsed = gettimeofday_us() - ts
- lock_waits[pid(), thread_thislock[t]] <<< elapsed
- delete thread_blocktime[t]
- delete thread_thislock[t]
- }
+ t = tid()
+ ts = thread_blocktime[t]
+ if (ts) {
+ elapsed = gettimeofday_us() - ts
+ lock_waits[pid(), thread_thislock[t]] <<< elapsed
+ delete thread_blocktime[t]
+ delete thread_thislock[t]
+ }
}
probe end {
- foreach ([pid+, lock] in lock_waits)
- printf ("%s[%d] lock %p contended %d times, %d avg us\n",
- process_names[pid], pid, lock, @count(lock_waits[pid,lock]), @avg(lock_waits[pid,lock]))
+ foreach ([pid+, lock] in lock_waits)
+ printf ("%s[%d] lock %p contended %d times, %d avg us\n",
+ process_names[pid], pid, lock, @count(lock_waits[pid,lock]),
+ @avg(lock_waits[pid,lock]))
}
diff --git a/testsuite/systemtap.examples/process/proc_snoop.stp b/testsuite/systemtap.examples/process/proc_snoop.stp
index 5203c93f..06425d45 100755
--- a/testsuite/systemtap.examples/process/proc_snoop.stp
+++ b/testsuite/systemtap.examples/process/proc_snoop.stp
@@ -3,53 +3,53 @@
global start_ts
probe begin {
- start_ts = gettimeofday_us()
- printf("%12s %5s %5s %-16s ACTION\n",
- "TIMESTAMP", "PID", "TID", "EXECNAME")
+ start_ts = gettimeofday_us()
+ printf("%12s %5s %5s %-16s ACTION\n",
+ "TIMESTAMP", "PID", "TID", "EXECNAME")
}
function report(action:string) {
- printf("%12d %5d %5d %-16s %s\n", gettimeofday_us() - start_ts,
- pid(), tid(), execname(), action)
+ printf("%12d %5d %5d %-16s %s\n", gettimeofday_us() - start_ts,
+ pid(), tid(), execname(), action)
}
function id:string(task:long) {
- return sprintf("p:%d t:%d n:%s", task_pid(task), task_tid(task),
- task_execname(task))
+ return sprintf("p:%d t:%d n:%s", task_pid(task), task_tid(task),
+ task_execname(task))
}
probe process.create {
- report(sprintf("create %s", id(task)))
+ report(sprintf("create %s", id(task)))
}
probe process.start {
- report("start")
+ report("start")
}
probe process.exec {
- report(sprintf("exec %s", filename))
+ report(sprintf("exec %s", filename))
}
probe process.exec_complete {
- if (success)
- report("exec success")
- else
- report(sprintf("exec failed %d (%s)", errno, errno_str(errno)))
+ if (success)
+ report("exec success")
+ else
+ report(sprintf("exec failed %d (%s)", errno, errno_str(errno)))
}
probe process.exit {
- report(sprintf("exit %d", code))
+ report(sprintf("exit %d", code))
}
probe process.release {
- report(sprintf("remove %s", id(task)))
+ report(sprintf("remove %s", id(task)))
}
probe signal.send {
- report(sprintf("sigsend %d (%s) to %s%s", sig, sig_name, id(task),
- shared? " [SHARED]" : ""))
+ report(sprintf("sigsend %d (%s) to %s%s", sig, sig_name, id(task),
+ shared? " [SHARED]" : ""))
}
probe signal.handle {
- report(sprintf("sighandle %d (%s)", sig, sig_name))
+ report(sprintf("sighandle %d (%s)", sig, sig_name))
}
diff --git a/testsuite/systemtap.examples/process/sig_by_pid.stp b/testsuite/systemtap.examples/process/sig_by_pid.stp
index 9c1493f5..80bf6294 100755
--- a/testsuite/systemtap.examples/process/sig_by_pid.stp
+++ b/testsuite/systemtap.examples/process/sig_by_pid.stp
@@ -14,29 +14,29 @@
global sigcnt, pid2name, sig2name
probe begin {
- print("Collecting data... Type Ctrl-C to exit and display results\n")
+ print("Collecting data... Type Ctrl-C to exit and display results\n")
}
probe signal.send
{
- snd_pid = pid()
- rcv_pid = sig_pid
+ snd_pid = pid()
+ rcv_pid = sig_pid
- sigcnt[snd_pid, rcv_pid, sig]++
+ sigcnt[snd_pid, rcv_pid, sig]++
- if (!(snd_pid in pid2name)) pid2name[snd_pid] = execname()
- if (!(rcv_pid in pid2name)) pid2name[rcv_pid] = pid_name
- if (!(sig in sig2name)) sig2name[sig] = sig_name
+ if (!(snd_pid in pid2name)) pid2name[snd_pid] = execname()
+ if (!(rcv_pid in pid2name)) pid2name[rcv_pid] = pid_name
+ if (!(sig in sig2name)) sig2name[sig] = sig_name
}
probe end
{
- printf("%-8s %-16s %-5s %-16s %-16s %s\n",
- "SPID", "SENDER", "RPID", "RECEIVER", "SIGNAME", "COUNT")
-
- foreach ([snd_pid, rcv_pid, sig_num] in sigcnt-) {
- printf("%-8d %-16s %-5d %-16s %-16s %d\n",
- snd_pid, pid2name[snd_pid], rcv_pid, pid2name[rcv_pid],
- sig2name[sig_num], sigcnt[snd_pid, rcv_pid, sig_num])
- }
+ printf("%-8s %-16s %-5s %-16s %-16s %s\n",
+ "SPID", "SENDER", "RPID", "RECEIVER", "SIGNAME", "COUNT")
+
+ foreach ([snd_pid, rcv_pid, sig_num] in sigcnt-) {
+ printf("%-8d %-16s %-5d %-16s %-16s %d\n",
+ snd_pid, pid2name[snd_pid], rcv_pid, pid2name[rcv_pid],
+ sig2name[sig_num], sigcnt[snd_pid, rcv_pid, sig_num])
+ }
}
diff --git a/testsuite/systemtap.examples/process/sigkill.stp b/testsuite/systemtap.examples/process/sigkill.stp
index 6cb6ed1e..37960637 100755
--- a/testsuite/systemtap.examples/process/sigkill.stp
+++ b/testsuite/systemtap.examples/process/sigkill.stp
@@ -17,7 +17,7 @@
# [...]
probe signal.send {
- if (sig_name == "SIGKILL")
- printf("%s was sent to %s (pid:%d) by %s uid:%d\n",
- sig_name, pid_name, sig_pid, execname(), uid())
+ if (sig_name == "SIGKILL")
+ printf("%s was sent to %s (pid:%d) by %s uid:%d\n",
+ sig_name, pid_name, sig_pid, execname(), uid())
}
diff --git a/testsuite/systemtap.examples/process/sigmon.stp b/testsuite/systemtap.examples/process/sigmon.stp
index 31d7822e..1242cb5d 100755
--- a/testsuite/systemtap.examples/process/sigmon.stp
+++ b/testsuite/systemtap.examples/process/sigmon.stp
@@ -13,23 +13,23 @@
#
# Example command line:
#
-# stap -x 31994 sigmon.stp SIGKILL
+# stap -x 31994 sigmon.stp SIGKILL
#
# Example output:
#
-# SPID SNAME RPID RNAME SIGNUM SIGNAME
-# 5609 bash 31994 find 9 SIGKILL
+# SPID SNAME RPID RNAME SIGNUM SIGNAME
+# 5609 bash 31994 find 9 SIGKILL
#
probe begin
{
- printf("%-8s %-16s %-5s %-16s %6s %-16s\n",
- "SPID", "SNAME", "RPID", "RNAME", "SIGNUM", "SIGNAME")
+ printf("%-8s %-16s %-5s %-16s %6s %-16s\n",
+ "SPID", "SNAME", "RPID", "RNAME", "SIGNUM", "SIGNAME")
}
probe signal.send
{
- if (sig_name == @1 && sig_pid == target())
- printf("%-8d %-16s %-5d %-16s %-6d %-16s\n",
- pid(), execname(), sig_pid, pid_name, sig, sig_name)
+ if (sig_name == @1 && sig_pid == target())
+ printf("%-8d %-16s %-5d %-16s %-6d %-16s\n",
+ pid(), execname(), sig_pid, pid_name, sig, sig_name)
}
diff --git a/testsuite/systemtap.examples/process/syscalls_by_pid.stp b/testsuite/systemtap.examples/process/syscalls_by_pid.stp
index 47aa4955..8f00e40d 100755
--- a/testsuite/systemtap.examples/process/syscalls_by_pid.stp
+++ b/testsuite/systemtap.examples/process/syscalls_by_pid.stp
@@ -14,15 +14,15 @@
global syscalls
probe begin {
- print ("Collecting data... Type Ctrl-C to exit and display results\n")
+ print ("Collecting data... Type Ctrl-C to exit and display results\n")
}
probe syscall.* {
- syscalls[pid()]++
+ syscalls[pid()]++
}
probe end {
- printf ("%-10s %-s\n", "#SysCalls", "PID")
- foreach (pid in syscalls-)
- printf("%-10d %-d\n", syscalls[pid], pid)
+ printf ("%-10s %-s\n", "#SysCalls", "PID")
+ foreach (pid in syscalls-)
+ printf("%-10d %-d\n", syscalls[pid], pid)
}
diff --git a/testsuite/systemtap.examples/process/syscalls_by_proc.stp b/testsuite/systemtap.examples/process/syscalls_by_proc.stp
index af7d6932..ca5f1c01 100755
--- a/testsuite/systemtap.examples/process/syscalls_by_proc.stp
+++ b/testsuite/systemtap.examples/process/syscalls_by_proc.stp
@@ -14,15 +14,15 @@
global syscalls
probe begin {
- print ("Collecting data... Type Ctrl-C to exit and display results\n")
+ print ("Collecting data... Type Ctrl-C to exit and display results\n")
}
probe syscall.* {
- syscalls[execname()]++
+ syscalls[execname()]++
}
probe end {
- printf ("%-10s %-s\n", "#SysCalls", "Process Name")
- foreach (proc in syscalls-)
- printf("%-10d %-s\n", syscalls[proc], proc)
+ printf ("%-10s %-s\n", "#SysCalls", "Process Name")
+ foreach (proc in syscalls-)
+ printf("%-10d %-s\n", syscalls[proc], proc)
}
diff --git a/testsuite/systemtap.examples/process/wait4time.stp b/testsuite/systemtap.examples/process/wait4time.stp
index ba300ea7..2fd914b9 100755
--- a/testsuite/systemtap.examples/process/wait4time.stp
+++ b/testsuite/systemtap.examples/process/wait4time.stp
@@ -53,7 +53,7 @@ probe syscall.wait4.return {
t = gettimeofday_us(); p = pid()
elapsed_time = t - entry_wait4[p]
printf("%d %s wait4: %d %d\n", timestamp(), proc(), elapsed_time,
- wait4_pid[p])
+ wait4_pid[p])
delete entry_wait4[p]
delete wait4_pid[p]
}
diff --git a/testsuite/systemtap.examples/profiling/thread-times.stp b/testsuite/systemtap.examples/profiling/thread-times.stp
index 1aeb2037..007e23ed 100755
--- a/testsuite/systemtap.examples/profiling/thread-times.stp
+++ b/testsuite/systemtap.examples/profiling/thread-times.stp
@@ -1,13 +1,13 @@
#! /usr/bin/stap
probe timer.profile {
- tid=tid()
- if (!user_mode())
- kticks[tid] <<< 1
- else
- uticks[tid] <<< 1
- ticks <<< 1
- tids[tid] <<< 1
+ tid=tid()
+ if (!user_mode())
+ kticks[tid] <<< 1
+ else
+ uticks[tid] <<< 1
+ ticks <<< 1
+ tids[tid] <<< 1
}
global uticks, kticks, ticks
@@ -15,18 +15,18 @@ global uticks, kticks, ticks
global tids
probe timer.s(5), end {
- allticks = @count(ticks)
- printf ("%5s %7s %7s (of %d ticks)\n", "tid", "%user", "%kernel", allticks)
- foreach (tid in tids- limit 20) {
- uscaled = @count(uticks[tid])*10000/allticks
- kscaled = @count(kticks[tid])*10000/allticks
- printf ("%5d %3d.%02d%% %3d.%02d%%\n",
- tid, uscaled/100, uscaled%100, kscaled/100, kscaled%100)
- }
- printf("\n")
+ allticks = @count(ticks)
+ printf ("%5s %7s %7s (of %d ticks)\n", "tid", "%user", "%kernel", allticks)
+ foreach (tid in tids- limit 20) {
+ uscaled = @count(uticks[tid])*10000/allticks
+ kscaled = @count(kticks[tid])*10000/allticks
+ printf ("%5d %3d.%02d%% %3d.%02d%%\n",
+ tid, uscaled/100, uscaled%100, kscaled/100, kscaled%100)
+ }
+ printf("\n")
- delete uticks
- delete kticks
- delete ticks
- delete tids
+ delete uticks
+ delete kticks
+ delete ticks
+ delete tids
}