diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-09-01 10:24:24 +0200 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-09-01 10:24:24 +0200 |
commit | 677ef89ccb24fb3e38b13b02b9394318afb78f30 (patch) | |
tree | 169fe5a56af117820445c5b28396416d22eb0b4d | |
parent | cf6594424c9f81e1070f2ce8e0969d5c0fe59fe1 (diff) | |
parent | 57c9bbc7f6bd3680910f99ba30d70b54a3076833 (diff) | |
download | blktrace-677ef89ccb24fb3e38b13b02b9394318afb78f30.tar.gz |
Merge branch 'master' of ssh://router.home.kernel.dk/data/git/blktrace
-rw-r--r-- | btt/Makefile | 2 | ||||
-rw-r--r-- | btt/bt_timeline.c | 6 | ||||
-rw-r--r-- | btt/devs.c | 2 | ||||
-rw-r--r-- | btt/doc/Makefile | 2 | ||||
-rw-r--r-- | btt/doc/btt.tex | 49 | ||||
-rw-r--r-- | btt/doc/rstats.eps | 1267 | ||||
-rw-r--r-- | btt/globals.h | 11 | ||||
-rw-r--r-- | btt/rstats.c | 136 | ||||
-rw-r--r-- | btt/trace.c | 2 | ||||
-rw-r--r-- | btt/trace_complete.c | 4 |
10 files changed, 1473 insertions, 8 deletions
diff --git a/btt/Makefile b/btt/Makefile index 1f6dacc..1dc4b5c 100644 --- a/btt/Makefile +++ b/btt/Makefile @@ -17,7 +17,7 @@ OBJS = args.o bt_timeline.o devmap.o devs.o dip_rb.o iostat.o latency.o \ misc.o output.o proc.o seek.o trace.o trace_complete.o trace_im.o \ trace_issue.o trace_queue.o trace_remap.o trace_requeue.o \ ../rbtree.o mmap.o trace_plug.o bno_dump.o unplug_hist.o q2d.o \ - aqd.o plat.o + aqd.o plat.o rstats.o all: depend $(PROGS) diff --git a/btt/bt_timeline.c b/btt/bt_timeline.c index 24dafc8..9b0850b 100644 --- a/btt/bt_timeline.c +++ b/btt/bt_timeline.c @@ -33,7 +33,7 @@ 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, ignore_remaps; -double t_astart, t_aend; +double t_astart, t_aend, last_t_seen; unsigned long n_traces; struct avgs_info all_avgs; unsigned int n_devs; @@ -62,6 +62,9 @@ int main(int argc, char *argv[]) init_dev_heads(); iostat_init(); + if (!rstat_init()) + return 1; + if (process() || output_avgs(avgs_ofp) || output_ranges(rngs_ofp)) return 1; @@ -82,6 +85,7 @@ int main(int argc, char *argv[]) dip_cleanup(); dev_map_exit(); dip_exit(); + rstat_exit(); pip_exit(); io_free_all(); region_exit(&all_regions); @@ -86,6 +86,7 @@ void __dip_exit(struct d_info *dip) plat_free(dip->d2c_plat_handle); bno_dump_free(dip->bno_dump_handle); unplug_hist_free(dip->up_hist_handle); + rstat_free(dip->rstat_handle); if (output_all_data) q2d_free(dip->q2d_priv); if (dip->pit_fp) @@ -152,6 +153,7 @@ struct d_info *dip_alloc(__u32 device, struct io *iop) list_add_tail(&dip->all_head, &all_devs); dip->start_time = BIT_TIME(iop->t.time); dip->pre_culling = 1; + dip->rstat_handle = rstat_alloc(mkhandle(str, device, "")); if (output_all_data) dip->q2d_priv = q2d_alloc(); n_devs++; diff --git a/btt/doc/Makefile b/btt/doc/Makefile index a81b557..87a7e5a 100644 --- a/btt/doc/Makefile +++ b/btt/doc/Makefile @@ -2,7 +2,7 @@ DOCTMP = btt.log btt.aux btt.dvi btt.toc btt.tex.bak all: btt.pdf -btt.tex: activity.eps qhist.eps dhist.eps seek.eps +btt.tex: activity.eps qhist.eps dhist.eps seek.eps rstats.eps @touch btt.tex btt.pdf: btt.tex diff --git a/btt/doc/btt.tex b/btt/doc/btt.tex index 2907554..b295a11 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{30 October 2008} +\date{14 August 2009} \begin{document} \maketitle @@ -425,7 +425,7 @@ pdflush 0.000000790 0.000006752 0.247231307 179791 \newpage\section{\label{sec:data-files}Data Files Output} - Besides the averages output by default, the following 3 files are also + Besides the averages output by default, the following 5(+) files are also created with data points which may be plotted. \begin{description} @@ -440,6 +440,14 @@ pdflush 0.000000790 0.000006752 0.247231307 179791 of IO requests submitted to lower layer drivers, for more information see section~\ref{sec:dhist}. + \item[\emph{file}\_mbps\_fp.dat] Provides a set of data for + mb-per-second values each second + - for more information see section~\ref{sec:rstat}. + + \item[\emph{file}\_iops\_fp.dat] Provides a set of data for + I/Os-per-second values each second + - for more information see section~\ref{sec:rstat}. + \end{description} In addition to the default data files output, there are optional data @@ -595,6 +603,43 @@ pdflush 0.000000790 0.000006752 0.247231307 179791 \caption{\label{fig:dhist}D Histogram} \end{figure} +\newpage\section{\label{sec:rstat}Running Stats Files} + +There are two files produced for each of all devices being traced +(prefixed with \emph{sys\_}) and per-device (prefixed with the device +identifier). + +The two files are for reporting I/O rate (I/Os per second - name ends +with \texttt{iops\_fp.dat}) and throughput (MiB per second - name ends +with \texttt{mbps\_fp.dat}). + +The data in the files has two columns:\smallskip + +\begin{tabular}{lll} +\textbf{File Type} & \textbf{X values} & \textbf{Y values}\\\hline +\textbf{iops} & Runtime (seconds) & I/Os per second\\\hline +\textbf{mbps} & Runtime (seconds) & MiB per second\\\hline +\end{tabular} + +As an example: + +\begin{verbatim} +# ls *fp.dat +008,064_iops_fp.dat +008,064_mbps_fp.dat +sys_iops_fp.dat +sys_mbps_fp.dat +\end{verbatim} + +These can be plotted using various tools (e.g., xmgrace as in +figure~\ref{fig:rstats}). + + \begin{figure}[b!] + \leavevmode\centering + \epsfig{file=rstats.eps,width=4.5in} + \caption{\label{fig:rstats}Running Stats} + \end{figure} + \newpage\section{\label{sec:iostat}iostat Data File} \texttt{btt} attempts to produce the results from running an \texttt{iostat -x} command in parallel with the system as it is being diff --git a/btt/doc/rstats.eps b/btt/doc/rstats.eps new file mode 100644 index 0000000..482db8f --- /dev/null +++ b/btt/doc/rstats.eps @@ -0,0 +1,1267 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%BoundingBox: (atend) +%%LanguageLevel: 2 +%%Creator: Grace-5.1.22 +%%CreationDate: Fri Aug 14 12:01:24 2009 +%%DocumentData: Clean8Bit +%%Orientation: Portrait +%%Title: Untitled +%%For: adb +%%DocumentNeededResources: (atend) +%%EndComments +%%BeginProlog +/m {moveto} def +/l {lineto} def +/s {stroke} def +/n {newpath} def +/c {closepath} def +/RL {rlineto} def +/SLW {setlinewidth} def +/GS {gsave} def +/GR {grestore} def +/SC {setcolor} def +/SGRY {setgray} def +/SRGB {setrgbcolor} def +/SD {setdash} def +/SLC {setlinecap} def +/SLJ {setlinejoin} def +/SCS {setcolorspace} def +/FFSF {findfont setfont} def +/CC {concat} def +/PXL {n m 0 0 RL s} def +/Color0 {1.0000 1.0000 1.0000} def +/Color1 {0.0000 0.0000 0.0000} def +/Color2 {1.0000 0.0000 0.0000} def +/Color3 {0.0000 1.0000 0.0000} def +/Color4 {0.0000 0.0000 1.0000} def +/Color5 {1.0000 1.0000 0.0000} def +/Color6 {0.7373 0.5608 0.5608} def +/Color7 {0.8627 0.8627 0.8627} def +/Color8 {0.5804 0.0000 0.8275} def +/Color9 {0.0000 1.0000 1.0000} def +/Color10 {1.0000 0.0000 1.0000} def +/Color11 {1.0000 0.6471 0.0000} def +/Color12 {0.4471 0.1294 0.7373} def +/Color13 {0.4039 0.0275 0.2824} def +/Color14 {0.2510 0.8784 0.8157} def +/Color15 {0.0000 0.5451 0.0000} def +/PTRN { + /pat_bits exch def + << + /PaintType 2 + /PatternType 1 /TilingType 1 + /BBox[0 0 16 16] + /XStep 16 /YStep 16 + /PaintProc { + pop + 16 16 true [-1 0 0 -1 16 16] pat_bits imagemask + } + >> + [0.0016 0 0 0.0016 0 0] + makepattern +} def +/Pattern0 {<0000000000000000000000000000000000000000000000000000000000000000> PTRN} bind def +/Pattern1 {<ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff> PTRN} bind def +/Pattern2 {<eeeeffffbbbbffffeeeeffffbbbbffffeeeeffffbbbbffffeeeeffffbbbbffff> PTRN} bind def +/Pattern3 {<eeeebbbbeeeebbbbeeeebbbbeeeebbbbeeeebbbbeeeebbbbeeeebbbbeeeebbbb> PTRN} bind def +/Pattern4 {<5555aaaa5555aaaa5555aaaa5555aaaa5555aaaa5555aaaa5555aaaa5555aaaa> PTRN} bind def +/Pattern5 {<1111444411114444111144441111444411114444111144441111444411114444> PTRN} bind def +/Pattern6 {<1111000044440000111100004444000011110000444400001111000044440000> PTRN} bind def +/Pattern7 {<1010000000000000010100000000000010100000000000000101000000000000> PTRN} bind def +/Pattern8 {<0000000000000000000000000000000000000000000000000000000000000000> PTRN} bind def +/Pattern9 {<1e1e0f0f8787c3c3e1e1f0f078783c3c1e1e0f0f8787c3c3e1e1f0f078783c3c> PTRN} bind def +/Pattern10 {<7878f0f0e1e1c3c387870f0f1e1e3c3c7878f0f0e1e1c3c387870f0f1e1e3c3c> PTRN} bind def +/Pattern11 {<3333333333333333333333333333333333333333333333333333333333333333> PTRN} bind def +/Pattern12 {<ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000> PTRN} bind def +/Pattern13 {<8181424224241818181824244242818181814242242418181818242442428181> PTRN} bind def +/Pattern14 {<8080404020201010080804040202010180804040202010100808040402020101> PTRN} bind def +/Pattern15 {<0101020204040808101020204040808001010202040408081010202040408080> PTRN} bind def +/Pattern16 {<2222222222222222222222222222222222222222222222222222222222222222> PTRN} bind def +/Pattern17 {<0000ffff000000000000ffff000000000000ffff000000000000ffff00000000> PTRN} bind def +/Pattern18 {<2222ffff222222222222ffff222222222222ffff222222222222ffff22222222> PTRN} bind def +/Pattern19 {<ffffffff33333333ffffffff33333333ffffffff33333333ffffffff33333333> PTRN} bind def +/Pattern20 {<0f0f0f0f0f0f0f0ff0f0f0f0f0f0f0f00f0f0f0f0f0f0f0ff0f0f0f0f0f0f0f0> PTRN} bind def +/Pattern21 {<ff00ff00ff00ff00ff00ff00ff00ff0000ff00ff00ff00ff00ff00ff00ff00ff> PTRN} bind def +/Pattern22 {<8001800180018001800180018001ffffffff8001800180018001800180018001> PTRN} bind def +/Pattern23 {<c003c003c003c003c003c003ffffffffffffffffc003c003c003c003c003c003> PTRN} bind def +/Pattern24 {<040404040404ffff404040404040ffff040404040404ffff404040404040ffff> PTRN} bind def +/Pattern25 {<180018001800180018001800ffffffff001800180018001800180018ffffffff> PTRN} bind def +/Pattern26 {<1111b8b87c7c3a3a1111a3a3c7c78b8b1111b8b87c7c3a3a1111a3a3c7c78b8b> PTRN} bind def +/Pattern27 {<101010102828c7c70101010182827c7c101010102828c7c70101010182827c7c> PTRN} bind def +/Pattern28 {<1c1c121211112121c1c12121111112121c1c121211112121c1c1212111111212> PTRN} bind def +/Pattern29 {<3e3e414180808080e3e31414080808083e3e414180808080e3e3141408080808> PTRN} bind def +/Pattern30 {<4848888884848383848488884848383848488888848483838484888848483838> PTRN} bind def +/Pattern31 {<03030404080808080c0c12122121c0c003030404080808080c0c12122121c0c0> PTRN} bind def +/ellipsedict 8 dict def +ellipsedict /mtrx matrix put +/EARC { + ellipsedict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arc + savematrix setmatrix + end +} def +/TL { + /kcomp exch def + /linewidth exch def + /offset exch def + GS + 0 offset rmoveto + linewidth SLW + dup stringwidth exch kcomp add exch RL s + GR +} def +/KINIT +{ + /kvector exch def + /kid 0 def +} def +/KPROC +{ + pop pop + kvector kid get + 0 rmoveto + /kid 1 kid add def +} def +/DefEncoding [ + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /space + /exclam + /quotedbl + /numbersign + /dollar + /percent + /ampersand + /quoteright + /parenleft + /parenright + /asterisk + /plus + /comma + /hyphen + /period + /slash + /zero + /one + /two + /three + /four + /five + /six + /seven + /eight + /nine + /colon + /semicolon + /less + /equal + /greater + /question + /at + /A + /B + /C + /D + /E + /F + /G + /H + /I + /J + /K + /L + /M + /N + /O + /P + /Q + /R + /S + /T + /U + /V + /W + /X + /Y + /Z + /bracketleft + /backslash + /bracketright + /asciicircum + /underscore + /grave + /a + /b + /c + /d + /e + /f + /g + /h + /i + /j + /k + /l + /m + /n + /o + /p + /q + /r + /s + /t + /u + /v + /w + /x + /y + /z + /braceleft + /bar + /braceright + /asciitilde + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /.notdef + /space + /exclamdown + /cent + /sterling + /currency + /yen + /brokenbar + /section + /dieresis + /copyright + /ordfeminine + /guillemotleft + /logicalnot + /hyphen + /registered + /macron + /degree + /plusminus + /twosuperior + /threesuperior + /acute + /mu + /paragraph + /periodcentered + /cedilla + /onesuperior + /ordmasculine + /guillemotright + /onequarter + /onehalf + /threequarters + /questiondown + /Agrave + /Aacute + /Acircumflex + /Atilde + /Adieresis + /Aring + /AE + /Ccedilla + /Egrave + /Eacute + /Ecircumflex + /Edieresis + /Igrave + /Iacute + /Icircumflex + /Idieresis + /Eth + /Ntilde + /Ograve + /Oacute + /Ocircumflex + /Otilde + /Odieresis + /multiply + /Oslash + /Ugrave + /Uacute + /Ucircumflex + /Udieresis + /Yacute + /Thorn + /germandbls + /agrave + /aacute + /acircumflex + /atilde + /adieresis + /aring + /ae + /ccedilla + /egrave + /eacute + /ecircumflex + /edieresis + /igrave + /iacute + /icircumflex + /idieresis + /eth + /ntilde + /ograve + /oacute + /ocircumflex + /otilde + /odieresis + /divide + /oslash + /ugrave + /uacute + /ucircumflex + /udieresis + /yacute + /thorn + /ydieresis +] def +%%EndProlog +%%BeginSetup +%%EndSetup +612.00 612.00 scale +n +0.0000 0.0000 m +0.0000 1.0000 l +1.2941 1.0000 l +1.2941 0.0000 l +c +[/DeviceRGB] SCS +Color0 SC +fill +[/DeviceRGB] SCS +Color6 SC +[0.0015 0.0045 ] 0 SD +0.0015 SLW +0 SLC +0 SLJ +n +0.1831 0.5318 m +0.1831 0.8500 l +s +n +0.2162 0.5318 m +0.2162 0.8500 l +s +n +0.2493 0.5318 m +0.2493 0.8500 l +s +n +0.2824 0.5318 m +0.2824 0.8500 l +s +n +0.3487 0.5318 m +0.3487 0.8500 l +s +n +0.3818 0.5318 m +0.3818 0.8500 l +s +n +0.4149 0.5318 m +0.4149 0.8500 l +s +n +0.4480 0.5318 m +0.4480 0.8500 l +s +n +0.5142 0.5318 m +0.5142 0.8500 l +s +n +0.5473 0.5318 m +0.5473 0.8500 l +s +n +0.5805 0.5318 m +0.5805 0.8500 l +s +n +0.6136 0.5318 m +0.6136 0.8500 l +s +n +0.6798 0.5318 m +0.6798 0.8500 l +s +n +0.7129 0.5318 m +0.7129 0.8500 l +s +n +0.7460 0.5318 m +0.7460 0.8500 l +s +n +0.7791 0.5318 m +0.7791 0.8500 l +s +n +0.8453 0.5318 m +0.8453 0.8500 l +s +n +0.8785 0.5318 m +0.8785 0.8500 l +s +n +0.9116 0.5318 m +0.9116 0.8500 l +s +n +0.9447 0.5318 m +0.9447 0.8500 l +s +n +1.0109 0.5318 m +1.0109 0.8500 l +s +n +1.0440 0.5318 m +1.0440 0.8500 l +s +n +1.0771 0.5318 m +1.0771 0.8500 l +s +n +1.1102 0.5318 m +1.1102 0.8500 l +s +[0.0075 0.0045 ] 0 SD +0.0015 SLW +n +0.1500 0.5318 m +0.1500 0.8500 l +s +n +0.3156 0.5318 m +0.3156 0.8500 l +s +n +0.4811 0.5318 m +0.4811 0.8500 l +s +n +0.6467 0.5318 m +0.6467 0.8500 l +s +n +0.8122 0.5318 m +0.8122 0.8500 l +s +n +0.9778 0.5318 m +0.9778 0.8500 l +s +n +1.1433 0.5318 m +1.1433 0.8500 l +s +[0.0015 0.0045 ] 0 SD +0.0015 SLW +n +0.1500 0.5477 m +1.1433 0.5477 l +s +n +0.1500 0.5636 m +1.1433 0.5636 l +s +n +0.1500 0.5795 m +1.1433 0.5795 l +s +n +0.1500 0.5955 m +1.1433 0.5955 l +s +n +0.1500 0.6273 m +1.1433 0.6273 l +s +n +0.1500 0.6432 m +1.1433 0.6432 l +s +n +0.1500 0.6591 m +1.1433 0.6591 l +s +n +0.1500 0.6750 m +1.1433 0.6750 l +s +n +0.1500 0.7068 m +1.1433 0.7068 l +s +n +0.1500 0.7227 m +1.1433 0.7227 l +s +n +0.1500 0.7386 m +1.1433 0.7386 l +s +n +0.1500 0.7545 m +1.1433 0.7545 l +s +n +0.1500 0.7864 m +1.1433 0.7864 l +s +n +0.1500 0.8023 m +1.1433 0.8023 l +s +n +0.1500 0.8182 m +1.1433 0.8182 l +s +n +0.1500 0.8341 m +1.1433 0.8341 l +s +[0.0075 0.0045 ] 0 SD +0.0015 SLW +n +0.1500 0.5318 m +1.1433 0.5318 l +s +n +0.1500 0.6114 m +1.1433 0.6114 l +s +n +0.1500 0.6909 m +1.1433 0.6909 l +s +n +0.1500 0.7705 m +1.1433 0.7705 l +s +n +0.1500 0.8500 m +1.1433 0.8500 l +s +[/DeviceRGB] SCS +Color1 SC +[] 0 SD +0.0023 SLW +n +0.1500 0.8373 m +0.1831 0.7991 l +0.2162 0.7991 l +0.2493 0.8023 l +0.2824 0.7991 l +0.3156 0.8023 l +0.3487 0.7991 l +0.3818 0.7991 l +0.4149 0.8023 l +0.4480 0.7991 l +0.4811 0.8007 l +0.5142 0.8007 l +0.5473 0.7991 l +0.5805 0.8023 l +0.6136 0.7975 l +0.6467 0.8023 l +0.6798 0.8007 l +0.7129 0.7991 l +0.7460 0.8007 l +0.7791 0.7991 l +0.8122 0.8023 l +0.8453 0.8007 l +0.8785 0.7991 l +0.9116 0.8007 l +0.9447 0.8007 l +0.9778 0.8007 l +1.0109 0.8007 l +1.0440 0.7991 l +1.0771 0.7991 l +1.1102 0.8023 l +1.1433 0.5573 l +s +/Times-Roman findfont +dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding DefEncoding def + currentdict +end +/Font32 exch definefont pop +/Font32 FFSF +[/DeviceRGB] SCS +Color6 SC +0.1447 0.5065 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(0) show +GR +/Font32 FFSF +0.3107 0.5065 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(5) show +GR +/Font32 FFSF +0.4701 0.5065 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(10) show +GR +/Font32 FFSF +0.6361 0.5065 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(15) show +GR +/Font32 FFSF +0.8013 0.5065 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(20) show +GR +/Font32 FFSF +0.9672 0.5065 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(25) show +GR +/Font32 FFSF +1.1324 0.5065 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(30) show +GR +/Font32 FFSF +0.1294 0.5244 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(0) show +GR +/Font32 FFSF +1.1533 0.5244 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(0) show +GR +/Font32 FFSF +0.1180 0.6039 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(50) show +GR +/Font32 FFSF +1.1533 0.6039 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(50) show +GR +/Font32 FFSF +0.1071 0.6835 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(100) show +GR +/Font32 FFSF +1.1533 0.6835 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(100) show +GR +/Font32 FFSF +0.1071 0.7630 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(150) show +GR +/Font32 FFSF +1.1533 0.7630 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(150) show +GR +/Font32 FFSF +0.1071 0.8425 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(200) show +GR +/Font32 FFSF +1.1533 0.8425 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(200) show +GR +/Font32 FFSF +0.0967 0.6001 m +GS +[0.0000 0.0280 -0.0280 0.0000 0 0] CC +(I/Os Per Second) show +GR +[] 0 SD +0.0015 SLW +n +0.1500 0.5318 m +0.1500 0.8500 l +1.1433 0.8500 l +1.1433 0.5318 l +0.1500 0.5318 l +c +s +/Font32 FFSF +[/DeviceRGB] SCS +Color1 SC +0.3504 0.9190 m +GS +[0.0420 0.0000 0.0000 0.0420 0 0] CC +(Running Statistics: iSCSI Accesses) show +GR +/Times-Italic findfont +dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding DefEncoding def + currentdict +end +/Font31 exch definefont pop +/Font31 FFSF +[/DeviceRGB] SCS +Color6 SC +0.4153 0.8759 m +GS +[0.0280 0.0000 0.0000 0.0280 0 0] CC +(256KiB Direact Asynchronous I/O Reads) show +GR +[0.0015 0.0045 ] 0 SD +0.0015 SLW +n +0.1831 0.1500 m +0.1831 0.4682 l +s +n +0.2162 0.1500 m +0.2162 0.4682 l +s +n +0.2493 0.1500 m +0.2493 0.4682 l +s +n +0.2824 0.1500 m +0.2824 0.4682 l +s +n +0.3487 0.1500 m +0.3487 0.4682 l +s +n +0.3818 0.1500 m +0.3818 0.4682 l +s +n +0.4149 0.1500 m +0.4149 0.4682 l +s +n +0.4480 0.1500 m +0.4480 0.4682 l +s +n +0.5142 0.1500 m +0.5142 0.4682 l +s +n +0.5473 0.1500 m +0.5473 0.4682 l +s +n +0.5805 0.1500 m +0.5805 0.4682 l +s +n +0.6136 0.1500 m +0.6136 0.4682 l +s +n +0.6798 0.1500 m +0.6798 0.4682 l +s +n +0.7129 0.1500 m +0.7129 0.4682 l +s +n +0.7460 0.1500 m +0.7460 0.4682 l +s +n +0.7791 0.1500 m +0.7791 0.4682 l +s +n +0.8453 0.1500 m +0.8453 0.4682 l +s +n +0.8785 0.1500 m +0.8785 0.4682 l +s +n +0.9116 0.1500 m +0.9116 0.4682 l +s +n +0.9447 0.1500 m +0.9447 0.4682 l +s +n +1.0109 0.1500 m +1.0109 0.4682 l +s +n +1.0440 0.1500 m +1.0440 0.4682 l +s +n +1.0771 0.1500 m +1.0771 0.4682 l +s +n +1.1102 0.1500 m +1.1102 0.4682 l +s +[0.0075 0.0045 ] 0 SD +0.0015 SLW +n +0.1500 0.1500 m +0.1500 0.4682 l +s +n +0.3156 0.1500 m +0.3156 0.4682 l +s +n +0.4811 0.1500 m +0.4811 0.4682 l +s +n +0.6467 0.1500 m +0.6467 0.4682 l +s +n +0.8122 0.1500 m +0.8122 0.4682 l +s +n +0.9778 0.1500 m +0.9778 0.4682 l +s +n +1.1433 0.1500 m +1.1433 0.4682 l +s +[0.0015 0.0045 ] 0 SD +0.0015 SLW +n +0.1500 0.1659 m +1.1433 0.1659 l +s +n +0.1500 0.1977 m +1.1433 0.1977 l +s +n +0.1500 0.2295 m +1.1433 0.2295 l +s +n +0.1500 0.2614 m +1.1433 0.2614 l +s +n +0.1500 0.2932 m +1.1433 0.2932 l +s +n +0.1500 0.3250 m +1.1433 0.3250 l +s +n +0.1500 0.3568 m +1.1433 0.3568 l +s +n +0.1500 0.3886 m +1.1433 0.3886 l +s +n +0.1500 0.4205 m +1.1433 0.4205 l +s +n +0.1500 0.4523 m +1.1433 0.4523 l +s +[0.0075 0.0045 ] 0 SD +0.0015 SLW +n +0.1500 0.1500 m +1.1433 0.1500 l +s +n +0.1500 0.1818 m +1.1433 0.1818 l +s +n +0.1500 0.2136 m +1.1433 0.2136 l +s +n +0.1500 0.2455 m +1.1433 0.2455 l +s +n +0.1500 0.2773 m +1.1433 0.2773 l +s +n +0.1500 0.3091 m +1.1433 0.3091 l +s +n +0.1500 0.3409 m +1.1433 0.3409 l +s +n +0.1500 0.3727 m +1.1433 0.3727 l +s +n +0.1500 0.4045 m +1.1433 0.4045 l +s +n +0.1500 0.4364 m +1.1433 0.4364 l +s +n +0.1500 0.4682 m +1.1433 0.4682 l +s +[/DeviceRGB] SCS +Color1 SC +[] 0 SD +0.0023 SLW +n +0.1500 0.4427 m +0.1831 0.4173 l +0.2162 0.4173 l +0.2493 0.4205 l +0.2824 0.4173 l +0.3156 0.4205 l +0.3487 0.4173 l +0.3818 0.4173 l +0.4149 0.4205 l +0.4480 0.4173 l +0.4811 0.4189 l +0.5142 0.4189 l +0.5473 0.4173 l +0.5805 0.4205 l +0.6136 0.4157 l +0.6467 0.4205 l +0.6798 0.4189 l +0.7129 0.4173 l +0.7460 0.4189 l +0.7791 0.4173 l +0.8122 0.4205 l +0.8453 0.4189 l +0.8785 0.4173 l +0.9116 0.4189 l +0.9447 0.4189 l +0.9778 0.4189 l +1.0109 0.4189 l +1.0440 0.4173 l +1.0771 0.4173 l +1.1102 0.4205 l +1.1433 0.1755 l +s +/Font32 FFSF +[/DeviceRGB] SCS +Color6 SC +0.1447 0.1247 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(0) show +GR +/Font32 FFSF +0.3107 0.1247 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(5) show +GR +/Font32 FFSF +0.4701 0.1247 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(10) show +GR +/Font32 FFSF +0.6361 0.1247 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(15) show +GR +/Font32 FFSF +0.8013 0.1247 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(20) show +GR +/Font32 FFSF +0.9672 0.1247 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(25) show +GR +/Font32 FFSF +1.1324 0.1247 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(30) show +GR +/Font32 FFSF +0.5420 0.0951 m +GS +[0.0280 0.0000 0.0000 0.0280 0 0] CC +(Runtime \(seconds\)) show +GR +/Font32 FFSF +0.1294 0.1425 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(0) show +GR +/Font32 FFSF +1.1533 0.1425 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(0) show +GR +/Font32 FFSF +0.1180 0.1744 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(10) show +GR +/Font32 FFSF +1.1533 0.1744 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(10) show +GR +/Font32 FFSF +0.1180 0.2062 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(20) show +GR +/Font32 FFSF +1.1533 0.2062 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(20) show +GR +/Font32 FFSF +0.1180 0.2380 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(30) show +GR +/Font32 FFSF +1.1533 0.2380 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(30) show +GR +/Font32 FFSF +0.1180 0.2698 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(40) show +GR +/Font32 FFSF +1.1533 0.2698 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(40) show +GR +/Font32 FFSF +0.1180 0.3016 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(50) show +GR +/Font32 FFSF +1.1533 0.3016 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(50) show +GR +/Font32 FFSF +0.1180 0.3335 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(60) show +GR +/Font32 FFSF +1.1533 0.3335 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(60) show +GR +/Font32 FFSF +0.1180 0.3653 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(70) show +GR +/Font32 FFSF +1.1533 0.3653 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(70) show +GR +/Font32 FFSF +0.1180 0.3971 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(80) show +GR +/Font32 FFSF +1.1533 0.3971 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(80) show +GR +/Font32 FFSF +0.1180 0.4289 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(90) show +GR +/Font32 FFSF +1.1533 0.4289 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(90) show +GR +/Font32 FFSF +0.1071 0.4607 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(100) show +GR +/Font32 FFSF +1.1533 0.4607 m +GS +[0.0224 0.0000 0.0000 0.0224 0 0] CC +(100) show +GR +/Font32 FFSF +0.0908 0.1834 m +GS +[0.0000 0.0280 -0.0280 0.0000 0 0] CC +(Throughput \(MiB/sec\)) show +GR +[] 0 SD +0.0015 SLW +n +0.1500 0.1500 m +0.1500 0.4682 l +1.1433 0.4682 l +1.1433 0.1500 l +0.1500 0.1500 l +c +s +%%Trailer +%%BoundingBox: 42 54 728 581 +%%DocumentNeededResources: font Times-Italic +%%+ font Times-Roman +%%EOF diff --git a/btt/globals.h b/btt/globals.h index d05d996..5235ec6 100644 --- a/btt/globals.h +++ b/btt/globals.h @@ -133,7 +133,7 @@ struct d_info { struct region_info regions; char *devmap; void *q2q_handle, *seek_handle, *bno_dump_handle, *up_hist_handle; - void *q2d_priv, *aqd_handle; + void *q2d_priv, *aqd_handle, *rstat_handle; void *q2d_plat_handle, *q2c_plat_handle, *d2c_plat_handle; FILE *q2d_ofp, *d2c_ofp, *q2c_ofp, *pit_fp; struct avgs_info avgs; @@ -170,7 +170,7 @@ 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, *q2d_name; extern char *per_io_trees; -extern double range_delta, plat_freq; +extern double range_delta, plat_freq, last_t_seen; 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; @@ -290,6 +290,13 @@ void q2d_display(FILE *fp, void *priv); int q2d_ok(void *priv); void q2d_acc(void *a1, void *a2); +/* rstats.c */ +void *rstat_alloc(char *bn); +void rstat_free(void *ptr); +void rstat_add(void *ptr, double cur, unsigned long long nblks); +int rstat_init(void); +void rstat_exit(void); + /* seek.c */ void *seeki_alloc(char *str); void seeki_free(void *param); diff --git a/btt/rstats.c b/btt/rstats.c new file mode 100644 index 0000000..c0d2904 --- /dev/null +++ b/btt/rstats.c @@ -0,0 +1,136 @@ +/* + * blktrace output analysis: generate a timeline & gather statistics + * + * (C) Copyright 2009 Hewlett-Packard Development Company, L.P. + * Alan D. Brunelle (alan.brunelle@hp.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +#include "globals.h" + +struct files { + FILE *fp; + char *nm; +}; + +struct rstat { + struct list_head head; + struct files files[2]; + unsigned long long ios, nblks; + long long base_sec; +}; + +static struct rstat *sys_info; +static LIST_HEAD(rstats); + +static int do_open(struct files *fip, char *bn, char *pn) +{ + fip->nm = malloc(sizeof(bn) + 16); + sprintf(fip->nm, "%s_%s.dat", bn, pn); + + fip->fp = my_fopen(fip->nm, "w"); + if (fip->fp) { + add_file(fip->fp, fip->nm); + return 0; + } + + free(fip->nm); + return -1; +} + +static int init_rsip(struct rstat *rsip, char *bn) +{ + rsip->ios = rsip->nblks = 0; + if (do_open(&rsip->files[0], bn, "iops_fp") || + do_open(&rsip->files[1], bn, "mbps_fp")) + return -1; + + list_add_tail(&rsip->head, &rstats); + return 0; +} + +static void rstat_emit(struct rstat *rsip, double cur) +{ + double mbps; + + /* + * I/Os per second is easy: just the ios + */ + fprintf(rsip->files[0].fp, "%lld %llu\n", rsip->base_sec, rsip->ios); + + /* + * MB/s we convert blocks to mb... + */ + mbps = ((double)rsip->nblks * 512.0) / (1024.0 * 1024.0); + fprintf(rsip->files[1].fp, "%lld %lf\n", rsip->base_sec, mbps); + + rsip->base_sec = (unsigned long long)cur; + rsip->ios = rsip->nblks = 0; +} + +static void __add(struct rstat *rsip, double cur, unsigned long long nblks) +{ + if (rsip->base_sec < 0) + rsip->base_sec = (long long)cur; + else if (((long long)cur - rsip->base_sec) >= 1) + rstat_emit(rsip, cur); + + rsip->ios++; + rsip->nblks += nblks; +} + +void *rstat_alloc(char *bn) +{ + struct rstat *rsip = malloc(sizeof(*rsip)); + + if (!init_rsip(rsip, bn)) + return rsip; + + free(rsip); + return NULL; +} + +void rstat_free(void *ptr) +{ + struct rstat *rsip = ptr; + + rstat_emit(rsip, last_t_seen); + list_del(&rsip->head); + free(rsip); +} + +void rstat_add(void *ptr, double cur, unsigned long long nblks) +{ + if (ptr != NULL) + __add((struct rstat *)ptr, cur, nblks); + __add(sys_info, cur, nblks); +} + +int rstat_init(void) +{ + sys_info = rstat_alloc("sys"); + return sys_info != NULL; +} + +void rstat_exit(void) +{ + struct list_head *p, *q; + + list_for_each_safe(p, q, &rstats) { + struct rstat *rsip = list_entry(p, struct rstat, head); + rstat_free(rsip); + } +} diff --git a/btt/trace.c b/btt/trace.c index e18a887..48f4f99 100644 --- a/btt/trace.c +++ b/btt/trace.c @@ -24,6 +24,8 @@ static void __add_trace(struct io *iop) { time_t now = time(NULL); + last_t_seen = BIT_TIME(iop->t.time); + n_traces++; iostat_check_time(iop->t.time); diff --git a/btt/trace_complete.c b/btt/trace_complete.c index 6f616bc..d34fbd0 100644 --- a/btt/trace_complete.c +++ b/btt/trace_complete.c @@ -55,13 +55,15 @@ static void handle_complete(struct io *c_iop) struct list_head *p, *q; __u64 d_time = (__u64)-1; FILE *pit_fp = c_iop->dip->pit_fp; + double cur = BIT_TIME(c_iop->t.time); update_blks(c_iop); update_cregion(&all_regions, c_iop->t.time); update_cregion(&c_iop->dip->regions, c_iop->t.time); if (c_iop->pip) update_cregion(&c_iop->pip->regions, c_iop->t.time); - aqd_complete(c_iop->dip->aqd_handle, BIT_TIME(c_iop->t.time)); + aqd_complete(c_iop->dip->aqd_handle, cur); + rstat_add(c_iop->dip->rstat_handle, cur, c_iop->t.bytes >> 9); dip_foreach_list(c_iop, IOP_Q, &head); list_for_each_safe(p, q, &head) { |