Skip to contentSkip to conversation

btrace: bring back possibility to toggle statistics at end of trace

PATCH In review Steffen Maier 1 participant 1 message Apr 27, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 25/31 btrace: bring back possibility to toggle statistics at end of trace

First, blkparse was internally called in quiet mode by default. v0.99.1 commit eea01dfc2e0e ("[PATCH] btrace: don't be quiet by default, and fix -h parameter") changed the default.
v1.0.1 commit bc93336f08a3 ("fix up btrace options & manpage") removed the no longer functional -S option.
Simply surface -q option of blkparse for use in btrace to suppress stats. Otherwise it keeps printing stats by default.

---
 btrace           | 5 +++--
 doc/blktrace.tex | 2 ++
 doc/btrace.8     | 6 +++++-
 3 files changed, 10 insertions(+), 3 deletions(-)
btrace +3 -2
index 44401823aa61..e260b91ff081 100644
@@ -8,10 +8,10 @@
 
 TRACEOPTS=""
 PARSEOPTS="-b100000"
-USAGE="Usage: btrace [-s] [-t] [-h] [-v] [-w N] [-n N] [-b N] [-a <trace>...] [-r <dbg mnt>] <dev>..."
+USAGE="Usage: btrace [-s] [-t] [-h] [-v] [-q] [-w N] [-n N] [-b N] [-a <trace>...] [-r <dbg mnt>] <dev>..."
 DIRNAME=`dirname $0`
 
-while getopts "a:w:n:b:r:sthv" c
+while getopts "a:w:n:b:r:sthvq" c
 do
 	case $c in
 	a)	TRACEOPTS=$TRACEOPTS" -a "$OPTARG" ";;
@@ -23,6 +23,7 @@ do
 	t)	PARSEOPTS=$PARSEOPTS" -t";;
 	h)	PARSEOPTS=$PARSEOPTS" -h";;
 	v)	PARSEOPTS=$PARSEOPTS" -v";;
+	q)	PARSEOPTS=$PARSEOPTS" -q";;
 	\?)	echo $USAGE 1>&2
 		exit 2
 		;;
doc/blktrace.tex +2 -0
index b5fc769ab891..aad19e2ff38d 100644
@@ -222,6 +222,8 @@ default\footnote{blktrace v0.99.1 eea01dfc2e0e (``[PATCH] btrace:
   don't be quiet by default, and fix -h parameter'')} and the
 \emph{-S} option does not exist any more\footnote{blktrace v1.0.1
   bc93336f08a3 (``fix up btrace options \& manpage'')}.
+An inverse quiet option \emph{-q} allows to toggle off statistics\footnote{
+  blktrace newer than 1.2.0}.
 
 \subsection{blktrace -- SCSI commands}
 \label{sec:pc-blktrace}
doc/btrace.8 +5 -1
index dc08e3608f1d..833cf9bf3596 100644
@@ -6,7 +6,7 @@ btrace \- perform live tracing for block devices
 
 
 .SH SYNOPSIS
-.B btrace [\-s] [\-t] [\-h] [\-v] [\-w \fIN\fN] [\-n \fIN\fR] [\-b \fIN\fR] [\-r \fI<dbg mnt>\fR] [\-a <\fItrace\fR>...] <\fIdev\fR>...
+.B btrace [\-s] [\-t] [\-h] [\-v] [\-q] [\-w \fIN\fN] [\-n \fIN\fR] [\-b \fIN\fR] [\-r \fI<dbg mnt>\fR] [\-a <\fItrace\fR>...] <\fIdev\fR>...
 .br
 
 
@@ -35,6 +35,10 @@ Hash processes by name, not PID (see \fIblkparse\fR (1)).
 .B \-v
 Be more verbose for marginal errors (see \fIblkparse\fR (1)).
 
+.HP 4
+.B \-q
+Do not print any statistics at end of trace (see \fIblkparse\fR (1)).
+
 .HP 4
 .B \-w \fIN\fR
 Sets run time to the number of seconds specified (see \fIblktrace\fR (8)).
Signature · 1 line
2.14.2