summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorhunt <hunt>2007-11-09 21:06:11 +0000
committerhunt <hunt>2007-11-09 21:06:11 +0000
commit4405ffef373aa53bfc1e93f70d481dcb095397ed (patch)
tree99f11fada3180f661cfc6dce92f8ce0efd3d194c /examples
parent185457afd0b9b00f835e2bedcd6801aae432b699 (diff)
downloadsystemtap-steved-4405ffef373aa53bfc1e93f70d481dcb095397ed.tar.gz
systemtap-steved-4405ffef373aa53bfc1e93f70d481dcb095397ed.tar.xz
systemtap-steved-4405ffef373aa53bfc1e93f70d481dcb095397ed.zip
2007-11-09 Martin Hunt <hunt@redhat.com>
* README: New. * *.stp. Fix path. See PR 4718.
Diffstat (limited to 'examples')
-rw-r--r--examples/ChangeLog6
-rw-r--r--examples/README9
-rwxr-xr-x[-rw-r--r--]examples/futexes.stp2
-rwxr-xr-x[-rw-r--r--]examples/helloworld.stp4
-rwxr-xr-x[-rw-r--r--]examples/iostat-scsi.stp2
-rwxr-xr-x[-rw-r--r--]examples/iotime.stp2
-rwxr-xr-x[-rw-r--r--]examples/nettop.stp2
-rwxr-xr-x[-rw-r--r--]examples/pf2.stp2
-rwxr-xr-xexamples/sig_by_pid.stp2
-rwxr-xr-xexamples/sig_by_proc.stp2
-rwxr-xr-xexamples/sigmon.stp2
-rwxr-xr-x[-rw-r--r--]examples/sleeptime.stp3
-rwxr-xr-xexamples/small_demos/close.stp5
-rwxr-xr-x[-rw-r--r--]examples/small_demos/fileopen.stp7
-rwxr-xr-x[-rw-r--r--]examples/socket-trace.stp3
-rwxr-xr-xexamples/syscalls_by_pid.stp2
-rwxr-xr-xexamples/syscalls_by_proc.stp2
-rwxr-xr-x[-rw-r--r--]examples/wait4time.stp2
18 files changed, 43 insertions, 16 deletions
diff --git a/examples/ChangeLog b/examples/ChangeLog
index 1999521f..ded655b4 100644
--- a/examples/ChangeLog
+++ b/examples/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-09 Martin Hunt <hunt@redhat.com>
+
+ * README: New.
+
+ * *.stp. Fix path. See PR 4718.
+
2007-10-10 Mike Mason
* syscalltimes, syscalltime.txt: New combination shell/SystemTap script
diff --git a/examples/README b/examples/README
new file mode 100644
index 00000000..6718a55a
--- /dev/null
+++ b/examples/README
@@ -0,0 +1,9 @@
+This directory contains example scripts.
+
+Each script should be checked in as executable.
+
+The first line should be
+#! /usr/bin/env stap
+
+There should be an accompanying ".txt" file describing what the
+script does and how to use it.
diff --git a/examples/futexes.stp b/examples/futexes.stp
index 515a8db6..16c62937 100644..100755
--- a/examples/futexes.stp
+++ b/examples/futexes.stp
@@ -1,4 +1,4 @@
-#! /usr/bin/stap
+#! /usr/bin/env stap
# This script tries to identify contended user-space locks by hooking
# into the futex system call.
diff --git a/examples/helloworld.stp b/examples/helloworld.stp
index c1e50c0f..efe45b79 100644..100755
--- a/examples/helloworld.stp
+++ b/examples/helloworld.stp
@@ -1,2 +1,2 @@
-#! /usr/bin/stap
-probe begin { log("hello world") exit () }
+#! /usr/bin/env stap
+probe begin { println("hello world") exit () }
diff --git a/examples/iostat-scsi.stp b/examples/iostat-scsi.stp
index 63b0496c..ec1aeeb8 100644..100755
--- a/examples/iostat-scsi.stp
+++ b/examples/iostat-scsi.stp
@@ -1,4 +1,4 @@
-#!/bin/env stap
+#! /usr/bin/env stap
global devices, reads, writes
diff --git a/examples/iotime.stp b/examples/iotime.stp
index c9b17041..a5b36449 100644..100755
--- a/examples/iotime.stp
+++ b/examples/iotime.stp
@@ -1,4 +1,4 @@
-#! /usr/bin/stap
+#! /usr/bin/env stap
/*
* Copyright (C) 2006 Daniel Berrange, Red Hat Inc.
diff --git a/examples/nettop.stp b/examples/nettop.stp
index c756f828..1310f5b4 100644..100755
--- a/examples/nettop.stp
+++ b/examples/nettop.stp
@@ -1,4 +1,4 @@
-#! /usr/bin/stap
+#! /usr/bin/env stap
global ifxmit, ifrecv, ifdevs, ifpid, execname, user
diff --git a/examples/pf2.stp b/examples/pf2.stp
index fbac4e50..96fdb7e7 100644..100755
--- a/examples/pf2.stp
+++ b/examples/pf2.stp
@@ -1,4 +1,4 @@
-#! /usr/bin/stap
+#! /usr/bin/env stap
global profile, pcount
probe timer.profile {
diff --git a/examples/sig_by_pid.stp b/examples/sig_by_pid.stp
index 4e0600f1..9c1493f5 100755
--- a/examples/sig_by_pid.stp
+++ b/examples/sig_by_pid.stp
@@ -1,4 +1,4 @@
-#! /usr/bin/stap
+#! /usr/bin/env stap
# Copyright (C) 2006 IBM Corp.
#
diff --git a/examples/sig_by_proc.stp b/examples/sig_by_proc.stp
index 18b236d3..ce845aed 100755
--- a/examples/sig_by_proc.stp
+++ b/examples/sig_by_proc.stp
@@ -1,4 +1,4 @@
-#! /usr/bin/stap
+#! /usr/bin/env stap
# Copyright (C) 2006 IBM Corp.
#
diff --git a/examples/sigmon.stp b/examples/sigmon.stp
index 42cb1892..31d7822e 100755
--- a/examples/sigmon.stp
+++ b/examples/sigmon.stp
@@ -1,4 +1,4 @@
-#! /usr/bin/stap
+#! /usr/bin/env stap
# Copyright (C) 2006 IBM Corp.
#
diff --git a/examples/sleeptime.stp b/examples/sleeptime.stp
index 3234048f..252e50cc 100644..100755
--- a/examples/sleeptime.stp
+++ b/examples/sleeptime.stp
@@ -1,4 +1,5 @@
-#! /usr/bin/stap
+#! /usr/bin/env stap
+
/*
* Copyright (C) 2006 Daniel Berrange, Red Hat Inc.
* Copyright (C) 2007 Will Cohen, Red Hat, Inc.
diff --git a/examples/small_demos/close.stp b/examples/small_demos/close.stp
index 53f53b25..7ba2a036 100755
--- a/examples/small_demos/close.stp
+++ b/examples/small_demos/close.stp
@@ -7,3 +7,8 @@ probe syscall.close {
probe syscall.close.return {
printf("%s\n", returnstr(returnp))
}
+
+probe end {
+ printf("DONE\n")
+}
+
diff --git a/examples/small_demos/fileopen.stp b/examples/small_demos/fileopen.stp
index 5d59ee55..c1298f9c 100644..100755
--- a/examples/small_demos/fileopen.stp
+++ b/examples/small_demos/fileopen.stp
@@ -1,9 +1,14 @@
+#! /usr/bin/env stap
+
+#
# fileopen.stp
#
# This is based on dtrace script from
# http://www.gnome.org/~gman/blog/2006/Jan
#
-#stap fileopen.stp -c "zenity --about"
+# stap fileopen.stp -c "zenity --about"
+# or
+# ./fileopen.stp -c "program or script"
global opens
diff --git a/examples/socket-trace.stp b/examples/socket-trace.stp
index e574205a..13ab8e06 100644..100755
--- a/examples/socket-trace.stp
+++ b/examples/socket-trace.stp
@@ -1,4 +1,5 @@
-#! /usr/bin/stap
+#! /usr/bin/env stap
+
probe kernel.function("*@net/socket.c").call {
printf ("%s -> %s\n", thread_indent(1), probefunc())
}
diff --git a/examples/syscalls_by_pid.stp b/examples/syscalls_by_pid.stp
index ceb5821a..47aa4955 100755
--- a/examples/syscalls_by_pid.stp
+++ b/examples/syscalls_by_pid.stp
@@ -1,4 +1,4 @@
-#! /usr/bin/stap
+#! /usr/bin/env stap
# Copyright (C) 2006 IBM Corp.
#
diff --git a/examples/syscalls_by_proc.stp b/examples/syscalls_by_proc.stp
index 1807a46c..af7d6932 100755
--- a/examples/syscalls_by_proc.stp
+++ b/examples/syscalls_by_proc.stp
@@ -1,4 +1,4 @@
-#! /usr/bin/stap
+#! /usr/bin/env stap
# Copyright (C) 2006 IBM Corp.
#
diff --git a/examples/wait4time.stp b/examples/wait4time.stp
index cf74fa55..bd1628ea 100644..100755
--- a/examples/wait4time.stp
+++ b/examples/wait4time.stp
@@ -1,4 +1,4 @@
-#! /usr/bin/stap
+#! /usr/bin/env stap
/*
* Copyright (C) 2006 Daniel Berrange, Red Hat Inc.