summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blkparse.c15
-rw-r--r--btrace7
2 files changed, 18 insertions, 4 deletions
diff --git a/blkparse.c b/blkparse.c
index 01a840e..b3172f1 100644
--- a/blkparse.c
+++ b/blkparse.c
@@ -91,7 +91,7 @@ struct per_process_info {
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",
@@ -124,6 +124,12 @@ static struct option l_opts[] = {
.val = 't'
},
{
+ .name = "quiet",
+ .has_arg = 0,
+ .flag = NULL,
+ .val = 'q'
+ },
+ {
.name = NULL,
.has_arg = 0,
.flag = NULL,
@@ -1309,6 +1315,7 @@ int main(int argc, char *argv[])
{
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) {
@@ -1332,6 +1339,9 @@ int main(int argc, char *argv[])
case 't':
track_ios = 1;
break;
+ case 'q':
+ per_device_and_cpu_stats = 0;
+ break;
default:
usage(argv[0]);
return 1;
@@ -1390,7 +1400,8 @@ int main(int argc, char *argv[])
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;
diff --git a/btrace b/btrace
index d74d9c2..f698f9c 100644
--- a/btrace
+++ b/btrace
@@ -8,20 +8,23 @@
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