blktrace patches from Debian

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I'm the maintainer for the blktrace package in Debian.  

Over the years, a few patches were added to blktrace package in
Debian.  While some of them are specific to Debian (fixing paths to
Debian conventions, for example), a number of others might be more
generically usable.  I'm including those as attachments.

Please consider applying them in the upstream package.

Greetings,
Bas Zoetekouw.
Last-Update: 2015-03-25
Forwarded: no
Author: Dmitry Smirnov <onlyjob@xxxxxxxxxxxxxx>
Description: reduce number of `rsvg-convert` processes to save RAM.
 Default 8 may consume ~3...4 GiB and force extensive swapping...

--- a/iowatcher/main.c
+++ b/iowatcher/main.c
@@ -1044,7 +1044,7 @@
 static void convert_movie_files(char *movie_dir)
 {
 	fprintf(stderr, "Converting svg files in %s\n", movie_dir);
-	snprintf(line, line_len, "find %s -name \\*.svg | xargs -I{} -n 1 -P 8 rsvg-convert -o {}.png {}",
+	snprintf(line, line_len, "find %s -name \\*.svg | xargs -I{} -n 1 -P 4 rsvg-convert -o {}.png {}",
 		 movie_dir);
 	system_check(line);
 }
Last-Update: 2015-03-25
Forwarded: no
Author: Dmitry Smirnov <onlyjob@xxxxxxxxxxxxxx>
Description: "maketitle" insert build date to the document; re-insert original date.

--- a/btreplay/doc/btreplay.tex
+++ b/btreplay/doc/btreplay.tex
@@ -23,9 +23,9 @@
 \begin{document}
 %---------------------
 \title{\texttt{btrecord} and \texttt{btreplay} User Guide}
 \author{Alan D. Brunelle (Alan.Brunelle@xxxxxx)}
-\date{\today}
+\date{25 September 2014}
 \maketitle
 \begin{abstract}
 \input{abstract.tex}
 \end{abstract}
Last-Update: 2015-03-25
Forwarded: no
Author: Dmitry Smirnov <onlyjob@xxxxxxxxxxxxxx>
Description: man page lintianisation: hyphen-used-as-minus-sign

--- a/doc/iowatcher.1
+++ b/doc/iowatcher.1
@@ -15,13 +15,13 @@
 \fB--help\fP
 Print a brief usage summary.
 .TP
-\fB-d, --device\fP \fIdevice\fP
+\fB-d, \--device\fP \fIdevice\fP
 Controls which device you are tracing.  You can only trace one device at a time for now.  It is sent directly to blktrace, and only needed when you are making a new trace.
 .TP
-\fB-D, --blktrace-destination\fP \fIdestination\fP
+\fB-D, \--blktrace-destination\fP \fIdestination\fP
 Destination for blktrace.
 .TP
-\fB-p, --prog\fP
+\fB-p, \--prog\fP
 Run a program while blktrace is run. The program and its arguments must be
 specified after all other options.  Note that this option previously required
 the program to be given as a single argument but it now tells \fBiowatcher\fP
@@ -32,10 +32,10 @@
 the program to be run. This can be useful if the program name could otherwise
 be mistaken for an option.
 .TP
-\fB-K, --keep-movie-svgs\fP
+\fB-K, \--keep-movie-svgs\fP
 Keep the SVG files generated for movie mode.
 .TP
-\fB-t, --trace\fP \fIpath\fP
+\fB-t, \--trace\fP \fIpath\fP
 Specify the name of the file or directory in which blktrace output is located.
 \fBiowatcher\fP uses a dump from blkparse, so this option tries to guess the
 name of the corresponding per-CPU blktrace data files if the dump file doesn't
@@ -44,10 +44,10 @@
 will use the name of the directory as the base name of the dump file and all
 trace files found inside the directory will be processed.
 .TP
-\fB-l, --label\fP \fIlabel\fP
+\fB-l, \--label\fP \fIlabel\fP
 Sets a label in the graph for a trace file.  The labels are added in the same order as the trace files.
 .TP
-\fB-m, --movie\fP \fI[style]\fP
+\fB-m, \--movie\fP \fI[style]\fP
 Create a movie.  The file format depends on the extension used in the \fB-o\fP
 \fIfile\fP option.  If you specify an .ogv or .ogg extension, the result will
 be Ogg Theora video, if png2theora is available.  If you use an .mp4 extension,
@@ -56,43 +56,43 @@
 are \fBspindle\fP for a circular disc-like effect (default) or \fBrect\fP for a
 rectangular graph style.
 .TP
-\fB-T, --title\fP \fItitle\fP
+\fB-T, \--title\fP \fItitle\fP
 Set a \fItitle\fP to be placed at the top of the graph.
 .TP
-\fB-o, --output\fP \fIfile\fP
+\fB-o, \--output\fP \fIfile\fP
 Output filename for the SVG image or video. The video format used will depend
 on the file name extension. See \fB--movie\fP for details.
 .TP
-\fB-r, --rolling\fP \fIseconds\fP
+\fB-r, \--rolling\fP \fIseconds\fP
 Control the duration for the rolling average.  \fBiowatcher\fP tries to smooth out bumpy graphs by averaging the current second with seconds from the past.  Larger numbers here give you flatter graphs.
 .TP
-\fB-h, --height\fP \fIheight\fP
+\fB-h, \--height\fP \fIheight\fP
 Set the height of each graph
 .TP
-\fB-w, --width\fP \fIwidth\fP
+\fB-w, \--width\fP \fIwidth\fP
 Set the width of each graph
 .TP
-\fB-c, --columns\fP \fIcolumns\fP
+\fB-c, \--columns\fP \fIcolumns\fP
 Number of columns in graph output
 .TP
-\fB-x, --xzoom\fP \fImin:max\fP
+\fB-x, \--xzoom\fP \fImin:max\fP
 Limit processed time range to \fImin:max\fP.
 .TP
-\fB-y, --yzoom\fP \fImin:max\fP
+\fB-y, \--yzoom\fP \fImin:max\fP
 Limit processed sectors to \fImin:max\fP.
 .TP
-\fB-a, --io-plot-action\fP \fIaction\fP
+\fB-a, \--io-plot-action\fP \fIaction\fP
 Plot \fIaction\fP (one of Q, D, or C) in the IO graph.
 .TP
-\fB-P, --per-process-io\fP
+\fB-P, \--per-process-io\fP
 Distinguish between processes in the IO graph.
 .TP
-\fB-O, --only-graph\fP \fIgraph\fP
+\fB-O, \--only-graph\fP \fIgraph\fP
 Add a single graph to the output (see section \fBGRAPHS\fP for options).  By
 default all graphs are included. Use \fB-O\fP to generate only the required
 graphs.  \fB-O\fP may be used more than once.
 .TP
-\fB-N, --no-graph\fP \fItype\fP
+\fB-N, \--no-graph\fP \fItype\fP
 Remove a single graph from the output (see section \fBGRAPHS\fP for options).
 This option may be used more than once.
 .SH GRAPHS
@@ -104,37 +104,37 @@
 Generate graph from the existing trace.dump:
 .PP
 .RS
-# iowatcher -t trace
+# iowatcher \-t trace
 .RE
 .PP
 Skip the IO graph:
 .PP
 .RS
-# iowatcher -t trace.dump -o trace.svg -N io
+# iowatcher \-t trace.dump \-o trace.svg \-N io
 .RE
 .PP
 Only graph tput and latency:
 .PP
 .RS
-# iowatcher -t trace.dump -o trace.svg -O tput -O latency
+# iowatcher \-t trace.dump \-o trace.svg \-O tput \-O latency
 .RE
 .PP
 Generate a graph from two runs, and label them:
 .PP
 .RS
-# iowatcher -t ext4.dump -t xfs.dump -l Ext4 -l XFS -o trace.svg
+# iowatcher \-t ext4.dump \-t xfs.dump \-l Ext4 \-l XFS \-o trace.svg
 .RE
 .PP
 Run a fio benchmark and store the trace in trace.dump, add a title to the top, use /dev/sda for blktrace:
 .PP
 .RS
-# iowatcher -d /dev/sda -t trace.dump -T 'Fio Benchmark' -p fio some_job_file
+# iowatcher \-d /dev/sda \-t trace.dump \-T 'Fio Benchmark' \-p fio some_job_file
 .RE
 .PP
 Make a movie from an existing trace:
 .PP
 .RS
-# iowatcher -t trace --movie -o trace.mp4
+# iowatcher \-t trace \--movie \-o trace.mp4
 .RE
 
 .SH AUTHORS
Last-Update: 2012-12-23
Author: Dmitry Smirnov <onlyjob@xxxxxxxxxxxxxx>
Forwarded: no
Description: spelling and hyphen corrections.

--- a/blkiomon.c
+++ b/blkiomon.c
@@ -472,13 +472,13 @@
 			break;
 		}
 
 		if (data_is_native == -1 && check_data_endianness(bit->magic)) {
-			fprintf(stderr, "blkiomon: endianess problem\n");
+			fprintf(stderr, "blkiomon: endianness problem\n");
 			break;
 		}
 
-		/* endianess */
+		/* endianness */
 		trace_to_cpu(bit);
 		if (verify_trace(bit)) {
 			fprintf(stderr, "blkiomon: bad trace\n");
 			break;
--- a/doc/blkiomon.8
+++ b/doc/blkiomon.8
@@ -99,9 +99,9 @@
 .SH EXAMPLES
 To get I/O statistics for /dev/sdw every 10 seconds for a period of one hour,
 use the following command:
 
-    % blktrace /dev/sdw -a issue -a complete -w 3600 -o - | blkiomon -I 10 -h -
+    % blktrace /dev/sdw \-a issue \-a complete \-w 3600 \-o \- | blkiomon \-I 10 \-h \-
 
 
 .SH AUTHORS
 blkiomon and this man page were written by Martin Peschke.
--- a/doc/blkparse.1
+++ b/doc/blkparse.1
@@ -242,9 +242,9 @@
 Same as the back merge, except this i/o ends where a previously inserted
 requests starts.
 
 .HP 4
-\fBM --front or back merge\fR
+\fBM -- front or back merge\fR
 One of the above
 
 .HP 4
 \fBM -- front or back merge\fR
--- a/doc/blktrace.8
+++ b/doc/blktrace.8
@@ -149,9 +149,9 @@
 .br
 \-\-output=\fIbasename\fR
 .RS
 Specifies base name for input files. Default is device.blktrace.cpu.
-Specifying -o - runs in live mode with blkparse (writing data to standard out).
+Specifying \-o \- runs in live mode with blkparse (writing data to standard out).
 .RE
 
 \-D \fIdir\fR
 .br
@@ -159,9 +159,9 @@
 .RS
 Prepend \fIfile\fR to output file name(s)
 
 This only works when supplying a single device, or when piping the output
-via "-o -" with multiple devices.
+via "\-o \-" with multiple devices.
 .RE
 
 \-r \fIrel-path\fR
 .br
Description: Make python script python3-compatible
Author: Bas Zoetekouw <bas@xxxxxxxxxx>
Origin: other, automatically generated by 2to3
Forwarded: yes, 2018-05-20
Last-Update: 2018-05-20
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/btt/bno_plot.py
+++ b/btt/bno_plot.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/python3
 #
 # btt blkno plotting interface
 #
@@ -38,6 +38,7 @@
 To exit the plotter, enter 'quit' or ^D at the 'gnuplot> ' prompt.
 """

+from __future__ import print_function
 import getopt, glob, os, sys, tempfile

 verbose	= 0
@@ -60,14 +61,14 @@

 	try:
 		(opts, args) = getopt.getopt(in_args, s_opts, l_opts)
-	except getopt.error, msg:
-		print >>sys.stderr, msg
-		print >>sys.stderr, __doc__
+	except getopt.error as msg:
+		print(msg, file=sys.stderr)
+		print(__doc__, file=sys.stderr)
 		sys.exit(1)

 	for (o, a) in opts:
 		if o in ('-h', '--help'):
-			print __doc__
+			print(__doc__)
 			sys.exit(0)
 		elif o in ('-v', '--verbose'):
 			verbose += 1
@@ -84,10 +85,10 @@
 	(bnos, keys_below) = parse_args(sys.argv[1:])

 	if verbose:
-		print 'Using files:',
-		for bno in bnos: print bno,
-		if keys_below:	print '\nKeys are to be placed below graph'
-		else:		print ''
+		print('Using files:', end=' ')
+		for bno in bnos: print(bno, end=' ')
+		if keys_below:	print('\nKeys are to be placed below graph')
+		else:		print('')

 	tmpdir = tempfile.mktemp()
 	os.mkdir(tmpdir)
@@ -99,7 +100,7 @@
 		fo = open(t, 'w')
 		for line in open(f, 'r'):
 			fld = line.split(None)
-			print >>fo, fld[0], fld[1], int(fld[2])-int(fld[1])
+			print(fld[0], fld[1], int(fld[2])-int(fld[1]), file=fo)
 		fo.close()

 		t = t[t.rfind('/')+1:]
@@ -107,16 +108,16 @@
 		else:                plot_cmd = "%s,'%s'" % (plot_cmd, t)

 	fo = open('%s/plot.cmds' % tmpdir, 'w')
-	print >>fo, cmds
-	if len(bnos) > 10 or keys_below: print >>fo, 'set key below'
-	print >>fo, plot_cmd
+	print(cmds, file=fo)
+	if len(bnos) > 10 or keys_below: print('set key below', file=fo)
+	print(plot_cmd, file=fo)
 	fo.close()

 	pid = os.fork()
 	if pid == 0:
 		cmd = 'gnuplot %s/plot.cmds -' % tmpdir

-		if verbose: print 'Executing %s' % cmd
+		if verbose: print('Executing %s' % cmd)

 		os.chdir(tmpdir)
 		os.system(cmd)
--- a/btt/btt_plot.py
+++ b/btt/btt_plot.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/python3
 #
 # btt_plot.py: Generate matplotlib plots for BTT generate data files
 #
@@ -18,6 +18,7 @@
 #  along with this program; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
+from __future__ import print_function

 """
 btt_plot.py: Generate matplotlib plots for BTT generated data files
@@ -82,7 +83,7 @@
 def fatal(msg):
 	"""Generate fatal error message and exit"""

-	print >>sys.stderr, 'FATAL: %s' % msg
+	print('FATAL: %s' % msg, file=sys.stderr)
 	sys.exit(1)

 #------------------------------------------------------------------------------
@@ -163,7 +164,7 @@
 		if not os.path.exists(file):
 			fatal('%s not found' % file)
 		elif verbose:
-			print 'Processing %s' % file
+			print('Processing %s' % file)

 		xs = []
 		ys = []
@@ -214,8 +215,8 @@

 	try:
 		(opts, args) = getopt.getopt(args[1:], s_opts, l_opts)
-	except getopt.error, msg:
-		print >>sys.stderr, msg
+	except getopt.error as msg:
+		print(msg, file=sys.stderr)
 		fatal(__doc__)

 	for (o, a) in opts:
@@ -293,7 +294,7 @@
 	def color(idx, style):
 		"""Returns a color/symbol type based upon the index passed."""

-                colors = [ 'b', 'g', 'r', 'c', 'm', 'y', 'k' ]
+		colors = [ 'b', 'g', 'r', 'c', 'm', 'y', 'k' ]
 		l_styles = [ '-', ':', '--', '-.' ]
 		m_styles = [ 'o', '+', '.', ',', 's', 'v', 'x', '<', '>' ]

@@ -314,7 +315,7 @@
 		ofile = '%s.png' % type

 	if verbose:
-		print 'Generating plot into %s' % ofile
+		print('Generating plot into %s' % ofile)

 	fig = plt.figure(figsize=plot_size)
 	ax = fig.add_subplot(111)
@@ -329,7 +330,7 @@
 		legends = None

 	keys = []
-	for file in db.iterkeys():
+	for file in db.keys():
 		if not file in ['min_x', 'max_x', 'min_y', 'max_y']:
 			keys.append(file)

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux