* README: New.
* *.stp. Fix path. See PR 4718.
+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
--- /dev/null
+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.
-#! /usr/bin/stap
+#! /usr/bin/env stap
# This script tries to identify contended user-space locks by hooking
# into the futex system call.
-#! /usr/bin/stap
-probe begin { log("hello world") exit () }
+#! /usr/bin/env stap
+probe begin { println("hello world") exit () }
-#!/bin/env stap
+#! /usr/bin/env stap
global devices, reads, writes
-#! /usr/bin/stap
+#! /usr/bin/env stap
/*
* Copyright (C) 2006 Daniel Berrange, Red Hat Inc.
-#! /usr/bin/stap
+#! /usr/bin/env stap
global ifxmit, ifrecv, ifdevs, ifpid, execname, user
-#! /usr/bin/stap
+#! /usr/bin/env stap
global profile, pcount
probe timer.profile {
-#! /usr/bin/stap
+#! /usr/bin/env stap
# Copyright (C) 2006 IBM Corp.
#
-#! /usr/bin/stap
+#! /usr/bin/env stap
# Copyright (C) 2006 IBM Corp.
#
-#! /usr/bin/stap
+#! /usr/bin/env stap
# Copyright (C) 2006 IBM Corp.
#
-#! /usr/bin/stap
+#! /usr/bin/env stap
+
/*
* Copyright (C) 2006 Daniel Berrange, Red Hat Inc.
* Copyright (C) 2007 Will Cohen, Red Hat, Inc.
probe syscall.close.return {
printf("%s\n", returnstr(returnp))
}
+
+probe end {
+ printf("DONE\n")
+}
+
+#! /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
-#! /usr/bin/stap
+#! /usr/bin/env stap
+
probe kernel.function("*@net/socket.c").call {
printf ("%s -> %s\n", thread_indent(1), probefunc())
}
-#! /usr/bin/stap
+#! /usr/bin/env stap
# Copyright (C) 2006 IBM Corp.
#
-#! /usr/bin/stap
+#! /usr/bin/env stap
# Copyright (C) 2006 IBM Corp.
#
-#! /usr/bin/stap
+#! /usr/bin/env stap
/*
* Copyright (C) 2006 Daniel Berrange, Red Hat Inc.