summaryrefslogtreecommitdiffstats
path: root/runtime/probes/bench/stp
blob: c350f4e6b0e84cdb26dd0f249b9cf484e9aaf895 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/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

#/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 -mq $modulename