btt: Added no remap option
authorAlan D. Brunelle <alan.brunelle@hp.com>
Fri, 13 Feb 2009 17:38:54 +0000 (12:38 -0500)
committerAlan D. Brunelle <alan.brunelle@hp.com>
Fri, 13 Feb 2009 17:51:52 +0000 (12:51 -0500)
Trying to run btt on pre-2.6.19 kernels has problems handling the
previous remap PDU - it did not include a proper device-from field.
(Probably should have bumped the blktrace version when we did that.)

This option just tosses those out as it just results in lots of crazy
stuff being handled.

Signed-off-by: Alan D. Brunelle <alan.brunelle@hp.com>
btt/args.c
btt/bt_timeline.c
btt/doc/btt.tex
btt/globals.h
btt/trace_remap.c
doc/btt.1

index 183012590762987264ecfc2bcc80bf56115cc077..ed53b8b953fe683d53e6fda79a60fdcb67163786 100644 (file)
@@ -29,7 +29,7 @@
 
 #define SETBUFFER_SIZE (64 * 1024)
 
-#define S_OPTS "aAB:d:D:e:hi:I:l:L:m:M:o:p:P:q:Q:s:S:t:T:u:VvXz:"
+#define S_OPTS "aAB:d:D:e:hi:I:l:L:m:M:o:p:P:q:Q:rs:S:t:T:u:VvXz:"
 static struct option l_opts[] = {
        {
                .name = "seek-absolute",
@@ -139,6 +139,12 @@ static struct option l_opts[] = {
                .flag = NULL,
                .val = 'Q'
        },
+       {
+               .name = "no-remaps",
+               .has_arg = no_argument,
+               .flag = NULL,
+               .val = 'r'
+       },
        {
                .name = "seeks",
                .has_arg = required_argument,
@@ -217,6 +223,7 @@ static char usage_str[] = \
        "[ -P <output name> | --per-io-trees=<output name> ]\n" \
        "[ -q <output name> | --q2c-latencies=<output name> ]\n" \
        "[ -Q <output name> | --active-queue-depth=<output name> ]\n" \
+       "[ -r               | --no-remaps ]\n" \
        "[ -s <output name> | --seeks=<output name> ]\n" \
        "[ -S <interval>    | --iostat-interval=<interval> ]\n" \
        "[ -t <sec>         | --time-start=<sec> ]\n" \
@@ -335,6 +342,9 @@ void handle_args(int argc, char *argv[])
                case 'Q':
                        aqd_name = optarg;
                        break;
+               case 'r':
+                       ignore_remaps = 1;
+                       break;
                case 's':
                        seek_name = optarg;
                        break;
@@ -390,12 +400,12 @@ void handle_args(int argc, char *argv[])
                rngs_ofp = avgs_ofp = msgs_ofp = stdout;
                easy_parse_avgs = 0;
        } else {
-               rngs_ofp = std_open(output_name, ".dat", "range data");
-               avgs_ofp = std_open(output_name, ".avg", "stats data");
-               msgs_ofp = std_open(output_name, ".msg", "K messages");
+               rngs_ofp = std_open(output_name, "dat", "range data");
+               avgs_ofp = std_open(output_name, "avg", "stats data");
+               msgs_ofp = std_open(output_name, "msg", "K messages");
                if (easy_parse_avgs) {
-                       xavgs_ofp = std_open(output_name, ".xvg",
-                                            "X stats data");
+                       xavgs_ofp = std_open(output_name, "xvg",
+                                            "EZ stats data");
                }
        }
 
index d1fefe34ac5c5213186c24d373e130b62ba382b3..24dafc89e98c0f1284a4d4dcb23f05279fdba3f0 100644 (file)
 #include <time.h>
 #include "globals.h"
 
-char bt_timeline_version[] = "2.07";
+char bt_timeline_version[] = "2.08";
 
 char *devices, *exes, *input_name, *output_name, *seek_name, *bno_dump_name;
 char *d2c_name, *q2c_name, *per_io_name, *unplug_hist_name;
 char *sps_name, *aqd_name, *q2d_name, *per_io_trees;
 FILE *rngs_ofp, *avgs_ofp, *xavgs_ofp, *per_io_ofp, *msgs_ofp;
 int verbose, done, time_bounded, output_all_data, seek_absolute;
-int easy_parse_avgs;
+int easy_parse_avgs, ignore_remaps;
 double t_astart, t_aend;
 unsigned long n_traces;
 struct avgs_info all_avgs;
index 4f5997137c74d658534c829312e69ba45cbc2964..29075541969ba4eea2f384400ca48950a6ec4647 100644 (file)
@@ -799,7 +799,7 @@ Device:       rrqm/s   wrqm/s     r/s     w/s    rsec/s    wsec/s
 \newpage\section{\label{sec:cmd-line}Command Line}
 
 \begin{verbatim}
-Usage: btt 2.0
+Usage: btt 2.08
 [ -a               | --seek-absolute ]
 [ -A               | --all-data ]
 [ -B <output name> | --dump-blocknos=<output name> ]
@@ -818,6 +818,7 @@ Usage: btt 2.07
 [ -P <output name> | --per-io-trees=<output name> ]
 [ -q <output name> | --q2c-latencies=<output name> ]
 [ -Q <output name> | --active-queue-depth=<output name> ]
+[ -r               | --no-remaps ]
 [ -s <output name> | --seeks=<output name> ]
 [ -S <interval>    | --iostat-interval=<interval> ]
 [ -t <sec>         | --time-start=<sec> ]
@@ -963,6 +964,10 @@ time values are separated from the Q time values with a vertical bar.
   driver. (The value is incremented when an \emph{issue} is performend,
   and decremented when a \emph{complete} is performed.
 
+\subsection{\label{sec:o-r}\texttt{--no-remaps}/\texttt{-r}}
+
+  Ignore remap traces; older kernels did not implement the full remap PDU.
+
 \subsection{\label{sec:o-s}\texttt{--seeks}/\texttt{-s}}
 
   This option instructs \texttt{btt} to generate the seek data file
index caca6ac86c8c662217d21c404b41f77173408419..43c38f438009c3748c7abd735a951d993d160ef2 100644 (file)
@@ -174,7 +174,7 @@ extern double range_delta, plat_freq;
 extern FILE *rngs_ofp, *avgs_ofp, *xavgs_ofp, *iostat_ofp, *per_io_ofp;
 extern FILE *msgs_ofp;
 extern int verbose, done, time_bounded, output_all_data, seek_absolute;
-extern int easy_parse_avgs;
+extern int easy_parse_avgs, ignore_remaps;
 extern unsigned int n_devs;
 extern unsigned long n_traces;
 extern struct list_head all_devs, all_procs;
index 22d340bb6acfbd7b065543b9db99bf3883e6350d..8739cdad973a18f01914d645d1b80ad0e6408f39 100644 (file)
@@ -35,8 +35,12 @@ void trace_remap(struct io *a_iop)
 {
        struct io *q_iop;
        struct d_info *q_dip;
-       struct blk_io_trace_remap *rp = a_iop->pdu;
+       struct blk_io_trace_remap *rp;
 
+       if (ignore_remaps)
+               goto out;
+
+       rp = a_iop->pdu;
        cvt_pdu_remap(rp);
 
        a_iop->t.device = rp->device_from;
index fa437f9016d19577ee19fcc45165757626b47f46..45d6c0c15d8ec004731db4b8db1d81e855d07b02 100644 (file)
--- a/doc/btt.1
+++ b/doc/btt.1
@@ -41,6 +41,8 @@ btt \- analyse block i/o traces produces by blktrace
 .br
 [ \-Q <\fIoutput name\fR> | \-\-active\-queue\-depth=<\fIoutput name\fR> ]
 .br
+[ \-r               | \-\-no\-remaps ]
+.br
 [ \-s <\fIoutput name\fR> | \-\-seeks=<\fIoutput name\fR> ]
 .br
 [ \-S <\fIinterval\fR>    | \-\-iostat\-interval=<\fIinterval\fR> ]
@@ -245,6 +247,14 @@ The \-Q option allows one to output data files showing the time stamp
 and the depth of active commands (those issued but not completed).
 .RE
 
+.B \-r
+.br
+.B \-\-no\-remaps
+.RS 4
+Ignore remap traces; older kernels did not implement the full remap
+PDU.
+.RE
+
 .B \-s <\fIoutput name\fR>
 .br
 .B \-\-seeks=<\fIoutput name\fR>