Hello community, here is the log from the commit of package blktrace for openSUSE:Factory checked in at 2012-03-22 12:31:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/blktrace (Old) and /work/SRC/openSUSE:Factory/.blktrace.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "blktrace", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/blktrace/blktrace.changes 2011-09-23 01:52:35.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.blktrace.new/blktrace.changes 2012-03-22 12:31:29.000000000 +0100 @@ -1,0 +2,9 @@ +Thu Oct 27 02:43:26 CEST 2011 - [email protected] + +- Update to v1.0.3 (bnc#720300 and others). + - Updated documentation + - Fixed multiple output errors + - Added FLUSH/FUA support + - Misc bug fixes + +------------------------------------------------------------------- Old: ---- 0001-Update-q_iop-c_time-in-handle_queue.patch 0001-btrecord-Fix-memory-leak-in-find_input_files.patch blktrace-1.0.1-fix-memory-leak-in-find_input_devs.patch blktrace-1.0.1.tar.bz2 blktrace-pthread.patch New: ---- blkparse-track-smallest-sequence-read-per-device.patch blktrace-1.0.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ blktrace.spec ++++++ --- /var/tmp/diff_new_pack.aAOACB/_old 2012-03-22 12:31:31.000000000 +0100 +++ /var/tmp/diff_new_pack.aAOACB/_new 2012-03-22 12:31:31.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package blktrace # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,22 +22,20 @@ Summary: Block IO tracer License: GPL-2.0 Group: Development/Tools/Other -Version: 1.0.1 -Release: 14 +Version: 1.0.3 +Release: 0 Url: http://git.kernel.dk/?p=blktrace.git;a=summary Source0: %name-%version.tar.bz2 -Patch0: 0001-Update-q_iop-c_time-in-handle_queue.patch -Patch1: 0001-btrecord-Fix-memory-leak-in-find_input_files.patch -# PATCH-FIX-OPENSUSE blktrace-1.0.1-fix-memory-leak-in-find_input_devs.patch bnc#546035 -Patch2: blktrace-1.0.1-fix-memory-leak-in-find_input_devs.patch -Patch3: blktrace-pthread.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: gcc libaio-devel +Patch0: blkparse-track-smallest-sequence-read-per-device.patch +BuildRequires: gcc +BuildRequires: libaio-devel %if 0%{?with_docs} %if 0%{?suse_version} >= 1030 -BuildRequires: texlive texlive-latex +BuildRequires: texlive +BuildRequires: texlive-latex %else -BuildRequires: te_latex tetex +BuildRequires: te_latex +BuildRequires: tetex %endif %endif @@ -50,9 +48,6 @@ %prep %setup -q %patch0 -p1 -%patch1 -p1 -%patch2 -%patch3 %build make CFLAGS="$RPM_OPT_FLAGS" all %{?with_docs: docs} -j1 ++++++ blkparse-track-smallest-sequence-read-per-device.patch ++++++ From: Jan Blunck <[email protected]> Subject: blkparse: Track smallest sequence read per device When running blktrace -d /dev/sda -o - | ./blkparse -i - only a few traces are actually printed out on stdout. Most of the traces are queued up and only after hitting ^C and therefore forcing show_entries_rb() they are printed out. I noticed that once pci->smallest_seq_read is zero, check_sequence always returns 1: static int check_sequence(struct per_dev_info *pdi, struct trace *t, int force) { ... if (expected_sequence < pci->smallest_seq_read) { __t = trace_rb_find_last(pdi, pci, expected_sequence); if (!__t) goto skip; __put_trace_last(pdi, __t); return 0; } else if (!force) { return 1; ... } This patch fixes the problem by using a variable per device to keep track of the smallest sequence read on each cpu. -- diff --git a/blkparse.c b/blkparse.c index d869da6..a558a6d 100644 --- a/blkparse.c +++ b/blkparse.c @@ -58,6 +58,8 @@ struct per_dev_info { unsigned int max_depth[2]; unsigned int cur_depth[2]; + unsigned long smallest_seq_read; + struct rb_root rb_track; int nfiles; @@ -395,6 +397,7 @@ static struct per_dev_info *get_dev_info(dev_t dev) pdi->dev = dev; pdi->first_reported_time = 0; pdi->last_read_time = 0; + pdi->smallest_seq_read = -1UL; return pdi; } @@ -1899,10 +1902,14 @@ static int sort_entries(unsigned long long *youngest) struct per_dev_info *pdi = NULL; struct per_cpu_info *pci = NULL; struct trace *t; + int i; if (!genesis_time) find_genesis(); + for (i = 0; i < ndevices; i++) + devices[i].smallest_seq_read = -1UL; + *youngest = 0; while ((t = trace_list) != NULL) { struct blk_io_trace *bit = t->bit; @@ -1922,8 +1929,8 @@ static int sort_entries(unsigned long long *youngest) if (!pci || pci->cpu != bit->cpu) pci = get_cpu_info(pdi, bit->cpu); - if (bit->sequence < pci->smallest_seq_read) - pci->smallest_seq_read = bit->sequence; + if (bit->sequence < pdi->smallest_seq_read) + pdi->smallest_seq_read = bit->sequence; if (check_stopwatch(bit)) { bit_free(bit); @@ -1994,7 +2001,7 @@ static int check_sequence(struct per_dev_info *pdi, struct trace *t, int force) */ if (bit->sequence == 1) return 0; - if (bit->sequence == pci->smallest_seq_read) + if (bit->sequence == pdi->smallest_seq_read) return 0; return check_cpu_map(pdi); @@ -2007,7 +2014,7 @@ static int check_sequence(struct per_dev_info *pdi, struct trace *t, int force) * we may not have seen that sequence yet. if we are not doing * the final run, break and wait for more entries. */ - if (expected_sequence < pci->smallest_seq_read) { + if (expected_sequence < pdi->smallest_seq_read) { __t = trace_rb_find_last(pdi, pci, expected_sequence); if (!__t) goto skip; @@ -2535,10 +2542,6 @@ static void do_pipe(int fd) fdblock = -1; while ((events = read_events(fd, 0, &fdblock)) > 0) { read_sequence++; - -#if 0 - smallest_seq_read = -1U; -#endif if (sort_entries(&youngest)) break; ++++++ blktrace-1.0.1.tar.bz2 -> blktrace-1.0.3.tar.bz2 ++++++ ++++ 74051 lines of diff (skipped) -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
