static struct per_process_info *ppi_hash[1 << PPI_HASH_SHIFT];
static struct per_process_info *ppi_list;
-#define S_OPTS "i:o:b:st"
+#define S_OPTS "i:o:b:stq"
static struct option l_opts[] = {
{
.name = "input",
.flag = NULL,
.val = 't'
},
+ {
+ .name = "quiet",
+ .has_arg = 0,
+ .flag = NULL,
+ .val = 'q'
+ },
{
.name = NULL,
.has_arg = 0,
{
char *ofp_buffer;
int c, ret, mode;
+ int per_device_and_cpu_stats = 1;
while ((c = getopt_long(argc, argv, S_OPTS, l_opts, NULL)) != -1) {
switch (c) {
case 't':
track_ios = 1;
break;
+ case 'q':
+ per_device_and_cpu_stats = 0;
+ break;
default:
usage(argv[0]);
return 1;
if (per_process_stats)
show_process_stats();
- show_device_and_cpu_stats();
+ if (per_device_and_cpu_stats)
+ show_device_and_cpu_stats();
flush_output();
return ret;
TRACEOPTS=""
PARSEOPTS=""
-USAGE="Usage: btrace [-s] [-t] [-a <trace>...] <dev>..."
+SUMMARIZE="-q" # quiet (no dev/cpu summary by default)
+USAGE="Usage: btrace [-s] [-t] [-S] [-a <trace>...] <dev>..."
DIRNAME=`dirname $0`
-while getopts "a:st" c
+while getopts "a:stS" c
do
case $c in
a) TRACEOPTS=$TRACEOPTS" -a "$OPTARG" ";;
s) PARSEOPTS=$PARSEOPTS" -s";;
t) PARSEOPTS=$PARSEOPTS" -t";;
+ S) SUMMARIZE="";;
\?) echo $USAGE 1>&2
exit 2
;;
esac
done
+PARSEOPTS=${PARSEOPTS}${SUMMARIZE}
shift `expr $OPTIND - 1`
if [ $# -eq 0 ]; then