summaryrefslogtreecommitdiffstats
path: root/runtime/probes
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/probes')
-rw-r--r--runtime/probes/ChangeLog10
-rw-r--r--runtime/probes/Makefile.template2
-rwxr-xr-xruntime/probes/agg/stp42
-rwxr-xr-xruntime/probes/bench/stp8
-rwxr-xr-xruntime/probes/build_probe12
-rwxr-xr-xruntime/probes/os_timer/stp42
-rwxr-xr-xruntime/probes/scf/stp42
-rwxr-xr-xruntime/probes/shellsnoop/stp42
-rwxr-xr-xruntime/probes/stp44
-rwxr-xr-xruntime/probes/tasklet/stp42
-rwxr-xr-xruntime/probes/test4/stp42
-rwxr-xr-xruntime/probes/where_func/stp42
12 files changed, 78 insertions, 292 deletions
diff --git a/runtime/probes/ChangeLog b/runtime/probes/ChangeLog
index 64c5d34e..db09d028 100644
--- a/runtime/probes/ChangeLog
+++ b/runtime/probes/ChangeLog
@@ -1,3 +1,13 @@
+2005-07-11 Martin Hunt <hunt@redhat.com>
+
+ * build_probe: Set RELAYFS correctly.
+
+ * Makefile.template: Fix for RELAYFS.
+
+ * stp: Moved here. All probes now use this copy.
+
+ * ALL/stp: source the master copy of stp.
+
2005-07-08 Martin Hunt <hunt@redhat.com>
* ALL: Use new runtime.h. Change init_module()
diff --git a/runtime/probes/Makefile.template b/runtime/probes/Makefile.template
index 23122fab..886bef8e 100644
--- a/runtime/probes/Makefile.template
+++ b/runtime/probes/Makefile.template
@@ -8,7 +8,7 @@ KALLSYMS_LOOKUP_NAME := 0x$(firstword $(shell grep " kallsyms_lookup_name" /boot
KALLSYMS_LOOKUP := 0x$(firstword $(shell grep " kallsyms_lookup$$" /boot/System.map-$(KVERSION)))
KTA := 0x$(firstword $(shell grep "__kernel_text_address" /boot/System.map-$(KVERSION)))
-FLAGS := -I $(RT) -I $(RT)/relayfs -D KALLSYMS_LOOKUP_NAME=$(KALLSYMS_LOOKUP_NAME) -D KALLSYMS_LOOKUP=$(KALLSYMS_LOOKUP) -DKTA=$(KTA)
+FLAGS := -I $(RT) RELAYFS -D KALLSYMS_LOOKUP_NAME=$(KALLSYMS_LOOKUP_NAME) -D KALLSYMS_LOOKUP=$(KALLSYMS_LOOKUP) -DKTA=$(KTA)
DFLAGS := $(FLAGS) -D DEBUG
diff --git a/runtime/probes/agg/stp b/runtime/probes/agg/stp
index 4baf70ff..f3feee70 100755
--- a/runtime/probes/agg/stp
+++ b/runtime/probes/agg/stp
@@ -1,42 +1,2 @@
#!/bin/bash
-if [ -n "$1" ]
-then
- modulename=$1
-else
- echo "Usage: stp modulename"
- exit
-fi
-
-RELAYFS=`lsmod | grep relayfs |awk '{print $1}'`
-if [ "$RELAYFS" != "relayfs" ]
-then
- /sbin/insmod ../../relayfs/relayfs.ko
-fi
-
-if [ ! -d "/mnt/relay" ]
-then
- mkdir /mnt/relay
-fi
-
-MOUNT=`mount | grep relayfs |awk '{print $1}'`
-if [ "$MOUNT" != "relayfs" ]
-then
- mount -t relayfs relayfs /mnt/relay
-fi
-
-STP_CONTROL=`lsmod | grep stp_control |awk '{print $1}'`
-if [ "$STP_CONTROL" != "stp_control" ]
-then
- /sbin/insmod ../../transport/stp-control.ko
-fi
-
-#/sbin/insmod $modulename
-
-# print to screen only
-#../../stpd/stpd -p $modulename
-
-# print to screen and log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-../../stpd/stpd $modulename
-
-# no screen, log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-#../../stpd/stpd -q $modulename
+source ../stp
diff --git a/runtime/probes/bench/stp b/runtime/probes/bench/stp
index 8c2301c4..00236805 100755
--- a/runtime/probes/bench/stp
+++ b/runtime/probes/bench/stp
@@ -7,10 +7,14 @@ else
exit
fi
-RELAYFS=`lsmod | grep relayfs |awk '{print $1}'`
-if [ "$RELAYFS" != "relayfs" ]
+RELAYFS=`grep " relayfs_poll" /boot/System.map-\`uname -r\``
+if [ -z "$RELAYFS" ]
then
+ RELAYFS=`lsmod | grep relayfs`
+ if [ -z "$RELAYFS" ]
+ then
/sbin/insmod ../../relayfs/relayfs.ko
+ fi
fi
if [ ! -d "/mnt/relay" ]
diff --git a/runtime/probes/build_probe b/runtime/probes/build_probe
index 9eadebd2..7e3207b1 100755
--- a/runtime/probes/build_probe
+++ b/runtime/probes/build_probe
@@ -7,7 +7,7 @@ proc usage {} {
}
# use Makefile.template to generate a Makefile
-proc create_makefile {target} {
+proc create_makefile {target relayfs} {
if {[catch {open ../Makefile.template r} fd]} {
puts "ERROR opening ../Makefile.template"
exit -1
@@ -20,6 +20,9 @@ proc create_makefile {target} {
if {[regsub XXX $line $target newline]} {
set line $newline
}
+ if {[regsub RELAYFS $line $relayfs newline]} {
+ set line $newline
+ }
puts $mfd $line
}
close $fd
@@ -123,10 +126,15 @@ foreach arg $argv {
}
}
+set relayfs ""
+if {![file exists /lib/modules/[exec uname -r]/build/include/linux/relayfs_fs.h]} {
+ set relayfs {-I $(RT)/relayfs}
+}
+
if {![catch {open targets r} tfd]} {
while {[gets $tfd line] >= 0} {
set target [lindex $line 0]
- create_makefile $target
+ create_makefile $target $relayfs
build $target
catch {exec /bin/rm Makefile}
}
diff --git a/runtime/probes/os_timer/stp b/runtime/probes/os_timer/stp
index 4baf70ff..f3feee70 100755
--- a/runtime/probes/os_timer/stp
+++ b/runtime/probes/os_timer/stp
@@ -1,42 +1,2 @@
#!/bin/bash
-if [ -n "$1" ]
-then
- modulename=$1
-else
- echo "Usage: stp modulename"
- exit
-fi
-
-RELAYFS=`lsmod | grep relayfs |awk '{print $1}'`
-if [ "$RELAYFS" != "relayfs" ]
-then
- /sbin/insmod ../../relayfs/relayfs.ko
-fi
-
-if [ ! -d "/mnt/relay" ]
-then
- mkdir /mnt/relay
-fi
-
-MOUNT=`mount | grep relayfs |awk '{print $1}'`
-if [ "$MOUNT" != "relayfs" ]
-then
- mount -t relayfs relayfs /mnt/relay
-fi
-
-STP_CONTROL=`lsmod | grep stp_control |awk '{print $1}'`
-if [ "$STP_CONTROL" != "stp_control" ]
-then
- /sbin/insmod ../../transport/stp-control.ko
-fi
-
-#/sbin/insmod $modulename
-
-# print to screen only
-#../../stpd/stpd -p $modulename
-
-# print to screen and log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-../../stpd/stpd $modulename
-
-# no screen, log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-#../../stpd/stpd -q $modulename
+source ../stp
diff --git a/runtime/probes/scf/stp b/runtime/probes/scf/stp
index 4baf70ff..f3feee70 100755
--- a/runtime/probes/scf/stp
+++ b/runtime/probes/scf/stp
@@ -1,42 +1,2 @@
#!/bin/bash
-if [ -n "$1" ]
-then
- modulename=$1
-else
- echo "Usage: stp modulename"
- exit
-fi
-
-RELAYFS=`lsmod | grep relayfs |awk '{print $1}'`
-if [ "$RELAYFS" != "relayfs" ]
-then
- /sbin/insmod ../../relayfs/relayfs.ko
-fi
-
-if [ ! -d "/mnt/relay" ]
-then
- mkdir /mnt/relay
-fi
-
-MOUNT=`mount | grep relayfs |awk '{print $1}'`
-if [ "$MOUNT" != "relayfs" ]
-then
- mount -t relayfs relayfs /mnt/relay
-fi
-
-STP_CONTROL=`lsmod | grep stp_control |awk '{print $1}'`
-if [ "$STP_CONTROL" != "stp_control" ]
-then
- /sbin/insmod ../../transport/stp-control.ko
-fi
-
-#/sbin/insmod $modulename
-
-# print to screen only
-#../../stpd/stpd -p $modulename
-
-# print to screen and log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-../../stpd/stpd $modulename
-
-# no screen, log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-#../../stpd/stpd -q $modulename
+source ../stp
diff --git a/runtime/probes/shellsnoop/stp b/runtime/probes/shellsnoop/stp
index 4baf70ff..f3feee70 100755
--- a/runtime/probes/shellsnoop/stp
+++ b/runtime/probes/shellsnoop/stp
@@ -1,42 +1,2 @@
#!/bin/bash
-if [ -n "$1" ]
-then
- modulename=$1
-else
- echo "Usage: stp modulename"
- exit
-fi
-
-RELAYFS=`lsmod | grep relayfs |awk '{print $1}'`
-if [ "$RELAYFS" != "relayfs" ]
-then
- /sbin/insmod ../../relayfs/relayfs.ko
-fi
-
-if [ ! -d "/mnt/relay" ]
-then
- mkdir /mnt/relay
-fi
-
-MOUNT=`mount | grep relayfs |awk '{print $1}'`
-if [ "$MOUNT" != "relayfs" ]
-then
- mount -t relayfs relayfs /mnt/relay
-fi
-
-STP_CONTROL=`lsmod | grep stp_control |awk '{print $1}'`
-if [ "$STP_CONTROL" != "stp_control" ]
-then
- /sbin/insmod ../../transport/stp-control.ko
-fi
-
-#/sbin/insmod $modulename
-
-# print to screen only
-#../../stpd/stpd -p $modulename
-
-# print to screen and log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-../../stpd/stpd $modulename
-
-# no screen, log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-#../../stpd/stpd -q $modulename
+source ../stp
diff --git a/runtime/probes/stp b/runtime/probes/stp
new file mode 100755
index 00000000..f045a9e5
--- /dev/null
+++ b/runtime/probes/stp
@@ -0,0 +1,44 @@
+#!/bin/bash
+if [ -n "$1" ]
+then
+ modulename=$1
+else
+ echo "Usage: stp modulename"
+ exit
+fi
+
+RELAYFS=`grep " relayfs_poll" /boot/System.map-\`uname -r\``
+if [ -z "$RELAYFS" ]
+then
+ RELAYFS=`lsmod | grep relayfs`
+ if [ -z "$RELAYFS" ]
+ then
+ /sbin/insmod ../../relayfs/relayfs.ko
+ fi
+fi
+
+if [ ! -d "/mnt/relay" ]
+then
+ mkdir /mnt/relay
+fi
+
+MOUNT=`mount | grep relayfs |awk '{print $1}'`
+if [ "$MOUNT" != "relayfs" ]
+then
+ mount -t relayfs relayfs /mnt/relay
+fi
+
+STP_CONTROL=`lsmod | grep stp_control |awk '{print $1}'`
+if [ "$STP_CONTROL" != "stp_control" ]
+then
+ /sbin/insmod ../../transport/stp-control.ko
+fi
+
+# print to screen only
+#../../stpd/stpd -p $modulename
+
+# print to screen and log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
+../../stpd/stpd $modulename
+
+# no screen, log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
+#../../stpd/stpd -q $modulename
diff --git a/runtime/probes/tasklet/stp b/runtime/probes/tasklet/stp
index 4baf70ff..f3feee70 100755
--- a/runtime/probes/tasklet/stp
+++ b/runtime/probes/tasklet/stp
@@ -1,42 +1,2 @@
#!/bin/bash
-if [ -n "$1" ]
-then
- modulename=$1
-else
- echo "Usage: stp modulename"
- exit
-fi
-
-RELAYFS=`lsmod | grep relayfs |awk '{print $1}'`
-if [ "$RELAYFS" != "relayfs" ]
-then
- /sbin/insmod ../../relayfs/relayfs.ko
-fi
-
-if [ ! -d "/mnt/relay" ]
-then
- mkdir /mnt/relay
-fi
-
-MOUNT=`mount | grep relayfs |awk '{print $1}'`
-if [ "$MOUNT" != "relayfs" ]
-then
- mount -t relayfs relayfs /mnt/relay
-fi
-
-STP_CONTROL=`lsmod | grep stp_control |awk '{print $1}'`
-if [ "$STP_CONTROL" != "stp_control" ]
-then
- /sbin/insmod ../../transport/stp-control.ko
-fi
-
-#/sbin/insmod $modulename
-
-# print to screen only
-#../../stpd/stpd -p $modulename
-
-# print to screen and log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-../../stpd/stpd $modulename
-
-# no screen, log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-#../../stpd/stpd -q $modulename
+source ../stp
diff --git a/runtime/probes/test4/stp b/runtime/probes/test4/stp
index 4baf70ff..f3feee70 100755
--- a/runtime/probes/test4/stp
+++ b/runtime/probes/test4/stp
@@ -1,42 +1,2 @@
#!/bin/bash
-if [ -n "$1" ]
-then
- modulename=$1
-else
- echo "Usage: stp modulename"
- exit
-fi
-
-RELAYFS=`lsmod | grep relayfs |awk '{print $1}'`
-if [ "$RELAYFS" != "relayfs" ]
-then
- /sbin/insmod ../../relayfs/relayfs.ko
-fi
-
-if [ ! -d "/mnt/relay" ]
-then
- mkdir /mnt/relay
-fi
-
-MOUNT=`mount | grep relayfs |awk '{print $1}'`
-if [ "$MOUNT" != "relayfs" ]
-then
- mount -t relayfs relayfs /mnt/relay
-fi
-
-STP_CONTROL=`lsmod | grep stp_control |awk '{print $1}'`
-if [ "$STP_CONTROL" != "stp_control" ]
-then
- /sbin/insmod ../../transport/stp-control.ko
-fi
-
-#/sbin/insmod $modulename
-
-# print to screen only
-#../../stpd/stpd -p $modulename
-
-# print to screen and log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-../../stpd/stpd $modulename
-
-# no screen, log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-#../../stpd/stpd -q $modulename
+source ../stp
diff --git a/runtime/probes/where_func/stp b/runtime/probes/where_func/stp
index 4baf70ff..f3feee70 100755
--- a/runtime/probes/where_func/stp
+++ b/runtime/probes/where_func/stp
@@ -1,42 +1,2 @@
#!/bin/bash
-if [ -n "$1" ]
-then
- modulename=$1
-else
- echo "Usage: stp modulename"
- exit
-fi
-
-RELAYFS=`lsmod | grep relayfs |awk '{print $1}'`
-if [ "$RELAYFS" != "relayfs" ]
-then
- /sbin/insmod ../../relayfs/relayfs.ko
-fi
-
-if [ ! -d "/mnt/relay" ]
-then
- mkdir /mnt/relay
-fi
-
-MOUNT=`mount | grep relayfs |awk '{print $1}'`
-if [ "$MOUNT" != "relayfs" ]
-then
- mount -t relayfs relayfs /mnt/relay
-fi
-
-STP_CONTROL=`lsmod | grep stp_control |awk '{print $1}'`
-if [ "$STP_CONTROL" != "stp_control" ]
-then
- /sbin/insmod ../../transport/stp-control.ko
-fi
-
-#/sbin/insmod $modulename
-
-# print to screen only
-#../../stpd/stpd -p $modulename
-
-# print to screen and log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-../../stpd/stpd $modulename
-
-# no screen, log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-#../../stpd/stpd -q $modulename
+source ../stp