From: Alan D. Brunelle Date: Mon, 10 Nov 2008 15:35:44 +0000 (-0500) Subject: Added in -z to provide running waiting-for-issue latencies X-Git-Tag: blktrace-1.0.1~41 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=e47ada103e028a691d296d09d0bc673a3af6a3dc;p=blktrace.git Added in -z to provide running waiting-for-issue latencies --- diff --git a/btt/args.c b/btt/args.c index db4186e..5555e4f 100644 --- a/btt/args.c +++ b/btt/args.c @@ -29,7 +29,7 @@ #define SETBUFFER_SIZE (64 * 1024) -#define S_OPTS "aAB:d:D:e:hi:I:l:L:m:M:o:p:q:Q:s:S:t:T:u:VvX" +#define S_OPTS "aAB:d:D:e:hi:I:l:L:m:M:o:p:q:Q:s:S:t:T:u:VvXz:" static struct option l_opts[] = { { .name = "seek-absolute", @@ -181,6 +181,12 @@ static struct option l_opts[] = { .flag = NULL, .val = 'X' }, + { + .name = "q2d-latencies", + .has_arg = required_argument, + .flag = NULL, + .val = 'z' + }, { .name = NULL, } @@ -212,6 +218,7 @@ static char usage_str[] = \ "[ -V | --version ]\n" \ "[ -v | --verbose ]\n" \ "[ -X | --easy-parse-avgs ]\n" \ + "[ -z | --q2d-latencies= ]\n" \ "\n"; static struct file_info *arg_files = NULL; @@ -336,6 +343,9 @@ void handle_args(int argc, char *argv[]) case 'X': easy_parse_avgs++; break; + case 'z': + q2d_name = strdup(optarg); + break; default: usage(argv[0]); exit(1); diff --git a/btt/bt_timeline.c b/btt/bt_timeline.c index 75e41ca..734ca35 100644 --- a/btt/bt_timeline.c +++ b/btt/bt_timeline.c @@ -25,11 +25,11 @@ #include #include "globals.h" -char bt_timeline_version[] = "2.05"; +char bt_timeline_version[] = "2.06"; 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; +char *sps_name, *aqd_name, *q2d_name; FILE *ranges_ofp, *avgs_ofp, *xavgs_ofp, *per_io_ofp, *msgs_ofp; int verbose, done, time_bounded, output_all_data, seek_absolute; int easy_parse_avgs; diff --git a/btt/devs.c b/btt/devs.c index b7943d3..6c9870f 100644 --- a/btt/devs.c +++ b/btt/devs.c @@ -86,6 +86,7 @@ void dip_exit(void) seeki_exit(dip->seek_handle); seeki_exit(dip->q2q_handle); aqd_exit(dip->aqd_handle); + plat_exit(dip->q2d_plat_handle); plat_exit(dip->q2c_plat_handle); plat_exit(dip->d2c_plat_handle); bno_dump_exit(dip->bno_dump_handle); @@ -124,6 +125,8 @@ struct d_info *dip_add(__u32 device, struct io *iop) dip->seek_handle = seeki_init(mkhandle(str, device, "_d2d")); dip->q2q_handle = seeki_init(mkhandle(str, device, "_q2q")); dip->aqd_handle = aqd_init(mkhandle(str, device, "_aqd")); + dip->q2d_plat_handle = + plat_init(mkhandle(str, device, "_q2d_plat")); dip->q2c_plat_handle = plat_init(mkhandle(str, device, "_q2c_plat")); dip->d2c_plat_handle = diff --git a/btt/doc/btt.tex b/btt/doc/btt.tex index eb4d29a..5f7ef1c 100644 --- a/btt/doc/btt.tex +++ b/btt/doc/btt.tex @@ -22,7 +22,7 @@ \title{\texttt{btt} User Guide} \author{Alan D. Brunelle (Alan.Brunelle@hp.com)} -\date{21 May 2008} +\date{30 October 2008} \begin{document} \maketitle @@ -460,9 +460,9 @@ pdflush 0.000000790 0.000006752 0.247231307 179791 than grepping through a blkparse output file for example). The details on this file is included in section~\ref{sec:per-io}. - \item[iostat] Latency information -- both Q2C and D2C -- + \item[iostat] Latency information -- both Q2d, D2c and Q2C -- on a per-IO basis can be generated. These are described in - sections~\ref{sec:lat-q2c} and~\ref{sec:lat-d2c}. + section~\ref{sec:lat}. \item[seek details] A set of data files containing all IO-to-IO sector differences can be output, with details found in @@ -673,15 +673,16 @@ Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s \item start block + number of blocks \end{enumerate} -\newpage\section{\label{sec:lat}\label{sec:lat-q2c}\label{sec:lat-d2c}Latency Data Files} +\newpage\section{\label{sec:lat}\label{sec:lat-q2d}\label{sec:lat-q2c}\label{sec:lat-d2c}Latency Data Files} The latency data files which can be optionally produced by \texttt{btt} - provide per-IO latency information, one for total IO time (Q2C) and - one for latencies induced by lower layer drivers and devices (D2C). + provide per-IO latency information, one for queue time (Q2D), one + for total IO time (Q2C) and one for latencies induced by lower layer + drivers and devices (D2C). In both cases, the first column (X values) represent runtime (seconds), while the second column (Y values) shows the actual latency for a - command at that time (either Q2C or D2C). + command at that time (either Q2D, D2C or Q2C). \newpage\section{\label{sec:seek}Seek Data Files} @@ -798,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.05 +Usage: btt 2.06 [ -a | --seek-absolute ] [ -A | --all-data ] [ -B | --dump-blocknos= ] @@ -824,6 +825,7 @@ Usage: btt 2.05 [ -V | --version ] [ -v | --verbose ] [ -X | --easy-parse-avgs ] +[ -z | --q2d-latencies= ] \end{verbatim} \subsection{\label{sec:o-a}\texttt{--seek-absolute}/\texttt{-a}} @@ -1094,6 +1096,11 @@ UPG 8,16 1.993361748 1.866492147 ARQ 8,16 12.938165321 \end{verbatim} +\subsection{\label{sec:o-z}\texttt{--q2d-latencies}/\texttt{-l}} + + This option instructs \texttt{btt} to generate the Q2D latency file + discussed in section~\ref{sec:lat-q2d}. + \newpage\section{\label{sec:bno_plot}bno\_plot.py} Included with the distribution is a simple 3D plotting utility based diff --git a/btt/globals.h b/btt/globals.h index 8b804ee..a901b52 100644 --- a/btt/globals.h +++ b/btt/globals.h @@ -146,8 +146,9 @@ struct d_info { struct region_info regions; struct devmap *map; void *q2q_handle, *seek_handle, *bno_dump_handle, *unplug_hist_handle; - void *q2d_priv, *aqd_handle, *q2c_plat_handle, *d2c_plat_handle; - FILE *d2c_ofp, *q2c_ofp; + void *q2d_priv, *aqd_handle; + void *q2d_plat_handle, *q2c_plat_handle, *d2c_plat_handle; + FILE *q2d_ofp, *d2c_ofp, *q2c_ofp; struct avgs_info avgs; struct stats stats, all_stats; __u64 last_q, n_qs, n_ds; @@ -180,7 +181,7 @@ struct io { extern char bt_timeline_version[], *devices, *exes, *input_name, *output_name; extern char *seek_name, *iostat_name, *d2c_name, *q2c_name, *per_io_name; -extern char *bno_dump_name, *unplug_hist_name, *sps_name, *aqd_name; +extern char *bno_dump_name, *unplug_hist_name, *sps_name, *aqd_name, *q2d_name; extern double range_delta, plat_freq; extern FILE *ranges_ofp, *avgs_ofp, *xavgs_ofp, *iostat_ofp, *per_io_ofp; extern FILE *msgs_ofp; @@ -249,6 +250,7 @@ void iostat_dump_stats(__u64 stamp, int all); /* latency.c */ void latency_init(struct d_info *dip); void latency_clean(void); +void latency_q2d(struct d_info *dip, __u64 tstamp, __u64 latency); void latency_d2c(struct d_info *dip, __u64 tstamp, __u64 latency); void latency_q2c(struct d_info *dip, __u64 tstamp, __u64 latency); diff --git a/btt/latency.c b/btt/latency.c index 4fb02d5..0c6e55d 100644 --- a/btt/latency.c +++ b/btt/latency.c @@ -51,6 +51,7 @@ FILE *latency_open(__u32 device, char *name, char *post) void latency_init(struct d_info *dip) { + dip->q2d_ofp = latency_open(dip->device, q2d_name, "q2d"); dip->d2c_ofp = latency_open(dip->device, d2c_name, "d2c"); dip->q2c_ofp = latency_open(dip->device, q2c_name, "q2c"); } @@ -60,6 +61,12 @@ void latency_clean(void) clean_files(&all_files); } +void latency_q2d(struct d_info *dip, __u64 tstamp, __u64 latency) +{ + plat_x2c(dip->q2d_plat_handle, tstamp, latency); + latency_out(dip->q2d_ofp, tstamp, latency); +} + void latency_d2c(struct d_info *dip, __u64 tstamp, __u64 latency) { plat_x2c(dip->d2c_plat_handle, tstamp, latency); diff --git a/btt/trace_issue.c b/btt/trace_issue.c index b7c3e5f..976fe1c 100644 --- a/btt/trace_issue.c +++ b/btt/trace_issue.c @@ -55,6 +55,8 @@ static void handle_issue(struct io *d_iop) if (output_all_data) q2d_histo_add(q_iop->dip->q2d_priv, d_iop->t.time - q_iop->t.time); + latency_q2d(q_iop->dip, d_iop->t.time, + d_iop->t.time - q_iop->t.time); } } diff --git a/doc/btt.1 b/doc/btt.1 index 55bc62a..6f6fbdb 100644 --- a/doc/btt.1 +++ b/doc/btt.1 @@ -52,6 +52,8 @@ btt \- analyse block i/o traces produces by blktrace [ \-v | \-\-verbose ] .br [ \-V | \-\-version ] +.br +[ \-z <\fIoutput name\fR> | \-\-q2d\-latencies=<\fIoutput name\fR> ] .SH DESCRIPTION @@ -306,10 +308,19 @@ Shows the version of btt. Requests a more verbose output. .RE +.B \-z <\fIoutput name\fR> +.br +.B \-\-q2d\-latencies=<\fIoutput name\fR> +.RS 4 +The \-z option allows one to output per\-IO Q2D latencies +respectively. The supplied argument provides the basis for the output +name for each device. +.RE + .SH AUTHORS -\fIblkparse\fR was written by Jens Axboe, Alan D. Brunelle and Nathan Scott. This -man page was created from the \fIblktrace\fR documentation by Bas Zoetekouw. +\fIbtt\fR was written by Alan D. Brunelle. This man page was created +from the \fIblktrace\fR documentation by Bas Zoetekouw. .SH "REPORTING BUGS"