summaryrefslogtreecommitdiff
path: root/btrace
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2005-09-14 19:29:40 +0200
committerJens Axboe <axboe@suse.de>2005-09-14 19:29:40 +0200
commit244ad71db83599dedee8f684f0facef4a13c5630 (patch)
treef2ece70c21ed815c1ab46b78290467f0aee62c1a /btrace
parente7c9f3ffe9833eae21b2601d1cecb2e5d5c7f35f (diff)
downloadblktrace-244ad71db83599dedee8f684f0facef4a13c5630.tar.gz
blktrace-244ad71db83599dedee8f684f0facef4a13c5630.tar.bz2
[PATCH] Add btrace script
Using blktrace and blkparse in the "standard" piped setup is a little cumbersome and not very intuitive, so add a script to do this automatically. This is what users would expect.
Diffstat (limited to 'btrace')
-rw-r--r--btrace32
1 files changed, 32 insertions, 0 deletions
diff --git a/btrace b/btrace
new file mode 100644
index 0000000..d74d9c2
--- /dev/null
+++ b/btrace
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Copyright (c) 2005 Silicon Graphics, Inc.
+# All rights reserved.
+#
+# Nathan Scott <nathans@sgi.com>
+# 14 Sep 2005 Initial version
+#
+
+TRACEOPTS=""
+PARSEOPTS=""
+USAGE="Usage: btrace [-s] [-t] [-a <trace>...] <dev>..."
+DIRNAME=`dirname $0`
+
+while getopts "a:st" c
+do
+ case $c in
+ a) TRACEOPTS=$TRACEOPTS" -a "$OPTARG" ";;
+ s) PARSEOPTS=$PARSEOPTS" -s";;
+ t) PARSEOPTS=$PARSEOPTS" -t";;
+ \?) echo $USAGE 1>&2
+ exit 2
+ ;;
+ esac
+done
+
+shift `expr $OPTIND - 1`
+if [ $# -eq 0 ]; then
+ echo $USAGE 1>&2
+ exit 2
+fi
+
+${DIRNAME}/blktrace ${TRACEOPTS} -o- $@ | ${DIRNAME}/blkparse ${PARSEOPTS} -i-