Whamcloud - gitweb
2bfc6d5e0174d1d1a0585bd2b2fcad9d10fb9612
[fs/lustre-release.git] / lustre / scripts / obdtrace_demo.scr
1 # Print OS version
2 shell uname -r
3 # Insert Lustre kernel modules
4 insmod class/obdclass.o
5 procsys trace 0
6 procsys debug 0
7 insmod ext2obd/obdext2.o
8 insmod obdtrace/obdtrace.o
9 insmod obdfs/obdfs.o
10 # Configure direct driver on /dev/obd0
11 device /dev/obd0
12 attach obdext2
13 setup /dev/sda2
14 # Configure obdtrace on /dev/obd1
15 device /dev/obd1
16 attach obdtrace
17 setup /dev/obd0
18 # What's the obd status
19 status
20 shell cat /proc/lustre/obd/1/stats
21 # mount obd file system
22 shell mkdir -p /mnt/obd
23 shell mount -t obdfs -odevice=/dev/obd1 none /mnt/obd
24 shell mount
25 # Prepare a data set (tar file of current directory)
26 shell rm -f /tmp/obdtrace_test.tar
27 shell tar cf /tmp/obdtrace_test.tar .
28 # make a directory on obd device
29 shell mkdir -p /mnt/obd/obdtrace_test_dir
30 # Unpack tarfile to obd device 
31 shell tar -C /mnt/obd/obdtrace_test_dir -xf /tmp/obdtrace_test.tar
32 shell rm -rf /mnt/obd/obdtrace_test_dir
33 # Check obdtrace performance stats
34 status
35 shell cat /proc/lustre/obd/1/stats
36 shell echo 0 >  /proc/lustre/obd/1/stats
37 shell cat /proc/lustre/obd/1/stats
38 # Umount file system
39 shell umount /mnt/obd
40 # Cleanup /tmp
41 shell rm -f /tmp/obdtrace_test.tar
42 # Dismantle /dev/obd1
43 device /dev/obd1
44 cleanup
45 detach
46 close
47 # Dismantle /dev/obd0
48 device /dev/obd0
49 cleanup
50 detach
51 close
52 # Remove all loaded kernel modules
53 rmmod obdfs
54 rmmod obdtrace
55 rmmod obdext2
56 rmmod obdclass