File: btrace

package info (click to toggle)
blktrace 1.1.0-2+deb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,216 kB
  • sloc: ansic: 16,550; python: 353; makefile: 218; sh: 147
file content (37 lines) | stat: -rw-r--r-- 867 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
# Copyright (c) 2005 Silicon Graphics, Inc.
# All rights reserved.
# 
#	Nathan Scott <nathans@sgi.com>
#	14 Sep 2005	Initial version
# 

TRACEOPTS=""
PARSEOPTS="-b100000"
USAGE="Usage: btrace [-s] [-t] [-w N] [-n N] [-b N] [-a <trace>...] [-r <dbg mnt>] <dev>..."

while getopts "a:w:n:b:r:sthv" c
do
	case $c in
	a)	TRACEOPTS=$TRACEOPTS" -a "$OPTARG" ";;
	w)	TRACEOPTS=$TRACEOPTS" -w "$OPTARG" ";;
	n)	TRACEOPTS=$TRACEOPTS" -n "$OPTARG" ";;
	b)	TRACEOPTS=$TRACEOPTS" -b "$OPTARG" ";;
	r)	TRACEOPTS=$TRACEOPTS" -r "$OPTARG" ";;
	s)	PARSEOPTS=$PARSEOPTS" -s";;
	t)	PARSEOPTS=$PARSEOPTS" -t";;
	h)	PARSEOPTS=$PARSEOPTS" -h";;
	v)	PARSEOPTS=$PARSEOPTS" -v";;
	\?)	echo $USAGE 1>&2
		exit 2
		;;
	esac
done

shift `expr $OPTIND - 1`
if [ $# -eq 0 ]; then
	echo $USAGE 1>&2
	exit 2
fi

/usr/sbin/blktrace ${TRACEOPTS} -o- $@ | /usr/bin/blkparse ${PARSEOPTS} -i-