From 6dab699bdea1c6a51c74a644342a720b0f4fdfb6 Mon Sep 17 00:00:00 2001 From: hunt Date: Tue, 12 Jul 2005 00:32:11 +0000 Subject: [PATCH] 2005-07-11 Martin Hunt * 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. --- runtime/probes/ChangeLog | 10 ++++++++ runtime/probes/Makefile.template | 2 +- runtime/probes/agg/stp | 42 +----------------------------- runtime/probes/bench/stp | 8 ++++-- runtime/probes/build_probe | 12 +++++++-- runtime/probes/os_timer/stp | 42 +----------------------------- runtime/probes/scf/stp | 42 +----------------------------- runtime/probes/shellsnoop/stp | 42 +----------------------------- runtime/probes/stp | 44 ++++++++++++++++++++++++++++++++ runtime/probes/tasklet/stp | 42 +----------------------------- runtime/probes/test4/stp | 42 +----------------------------- runtime/probes/where_func/stp | 42 +----------------------------- 12 files changed, 78 insertions(+), 292 deletions(-) create mode 100755 runtime/probes/stp diff --git a/runtime/probes/ChangeLog b/runtime/probes/ChangeLog index 64c5d34ed..db09d0284 100644 --- a/runtime/probes/ChangeLog +++ b/runtime/probes/ChangeLog @@ -1,3 +1,13 @@ +2005-07-11 Martin Hunt + + * 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 * ALL: Use new runtime.h. Change init_module() diff --git a/runtime/probes/Makefile.template b/runtime/probes/Makefile.template index 23122fabd..886bef8e1 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 4baf70ff1..f3feee707 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 8c2301c41..00236805b 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 9eadebd2b..7e3207b13 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 4baf70ff1..f3feee707 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 4baf70ff1..f3feee707 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 4baf70ff1..f3feee707 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 000000000..f045a9e52 --- /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 4baf70ff1..f3feee707 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 4baf70ff1..f3feee707 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 4baf70ff1..f3feee707 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 -- 2.43.5