From: hunt Date: Fri, 9 Nov 2007 21:06:11 +0000 (+0000) Subject: 2007-11-09 Martin Hunt X-Git-Tag: release-0.6~29 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=4405ffef373aa53bfc1e93f70d481dcb095397ed;p=systemtap.git 2007-11-09 Martin Hunt * README: New. * *.stp. Fix path. See PR 4718. --- diff --git a/examples/ChangeLog b/examples/ChangeLog index 1999521f2..ded655b45 100644 --- a/examples/ChangeLog +++ b/examples/ChangeLog @@ -1,3 +1,9 @@ +2007-11-09 Martin Hunt + + * 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 000000000..6718a55aa --- /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 old mode 100644 new mode 100755 index 515a8db66..16c629372 --- 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 old mode 100644 new mode 100755 index c1e50c0f5..efe45b793 --- 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 old mode 100644 new mode 100755 index 63b0496c3..ec1aeeb8f --- 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 old mode 100644 new mode 100755 index c9b170413..a5b364499 --- 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 old mode 100644 new mode 100755 index c756f828c..1310f5b43 --- 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 old mode 100644 new mode 100755 index fbac4e50a..96fdb7e72 --- 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 4e0600f18..9c1493f53 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 18b236d3e..ce845aed8 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 42cb1892f..31d7822e5 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 old mode 100644 new mode 100755 index 3234048f9..252e50ccb --- 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 53f53b259..7ba2a0369 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 old mode 100644 new mode 100755 index 5d59ee557..c1298f9c3 --- 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 old mode 100644 new mode 100755 index e574205a6..13ab8e06b --- 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 ceb5821ae..47aa4955a 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 1807a46cf..af7d69321 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 old mode 100644 new mode 100755 index cf74fa55a..bd1628ead --- 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.