[bootchart/f15/master] - version 0.14.0 - make use of /run
Harald Hoyer
harald at fedoraproject.org
Thu Mar 31 12:19:57 UTC 2011
commit 8beaf117cef54be10710a52b4612e97b22caa48a
Author: Harald Hoyer <harald at redhat.com>
Date: Thu Mar 31 14:21:02 2011 +0200
- version 0.14.0
- make use of /run
...Expect-dmesg-log-only-if-bootchartd-run-a.patch | 32 ++++++++
0002-Update-NEWS.patch | 21 ++++++
...mport-path-so-we-can-call-them-from-sourc.patch | 39 ++++++++++
...e-parsing-tests-for-ParserState-Trace-cha.patch | 75 ++++++++++++++++++++
...errors-and-failures-of-testParseProcPsLog.patch | 40 +++++++++++
0006-tests-remove-unuseful-testParseLogDir.patch | 29 ++++++++
...ate-for-Trace-and-ProcessTree-api-changes.patch | 51 +++++++++++++
...e-target-for-executing-pybootchartgui-tes.patch | 24 ++++++
...ference-in-bootchartd-SEE-ALSO-section-ma.patch | 22 ++++++
...ybootchartgui-main.py-fix-output-filename.patch | 23 ++++++
...tgui-main.py.in-set-default-format-to-png.patch | 28 +++++++
....py-_parse_proc_stat_log-skip-empty-lines.patch | 23 ++++++
...gui-main.py.in-bail-out-if-output-filenam.patch | 23 ++++++
...ove-to-run-bootchart-instead-of-dev-.boot.patch | 36 +++++++++
14 files changed, 466 insertions(+), 0 deletions(-)
---
diff --git a/0001-bootchartd-Expect-dmesg-log-only-if-bootchartd-run-a.patch b/0001-bootchartd-Expect-dmesg-log-only-if-bootchartd-run-a.patch
new file mode 100644
index 0000000..6f7a69f
--- /dev/null
+++ b/0001-bootchartd-Expect-dmesg-log-only-if-bootchartd-run-a.patch
@@ -0,0 +1,32 @@
+From c8305d566021b18f02d1479b6697406874adb448 Mon Sep 17 00:00:00 2001
+From: Henry Yei <hyei at mvista.com>
+Date: Wed, 16 Mar 2011 22:08:17 +0100
+Subject: [PATCH] bootchartd: Expect dmesg log only if bootchartd run as init
+
+The bootchartd script attempts to archive the dmesg
+log in all cases, however the dmesg log is only dumped
+when bootchartd is being run as the init process. This
+patch adds conditional logic to only expect the dmesg
+log when it is supposed to be generated.
+---
+ bootchartd.in | 7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/bootchartd.in b/bootchartd.in
+index 6bea753..ebe9d8b 100755
+--- a/bootchartd.in
++++ b/bootchartd.in
+@@ -123,7 +123,12 @@ stop()
+ fi
+
+ # Archive it all up into the bootchart output
+- tar -zcf "$BOOTLOG_DEST" header dmesg *.log
++ # expect dmesg log only if bootchartd was started as an init process
++ if [ -n "$INIT_PROCESS" ] ; then
++ tar -zcf "$BOOTLOG_DEST" header dmesg *.log
++ else
++ tar -zcf "$BOOTLOG_DEST" header *.log
++ fi
+
+ rm -Rf $tmpdir
+
diff --git a/0002-Update-NEWS.patch b/0002-Update-NEWS.patch
new file mode 100644
index 0000000..e5cf52f
--- /dev/null
+++ b/0002-Update-NEWS.patch
@@ -0,0 +1,21 @@
+From 659868341ce8c218778308f5a024b74e411ca2a8 Mon Sep 17 00:00:00 2001
+From: Riccardo Magliocchetti <riccardo.magliocchetti at gmail.com>
+Date: Wed, 16 Mar 2011 22:10:25 +0100
+Subject: [PATCH] Update NEWS
+
+---
+ NEWS | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 4c84939..5bfa668 100644
+--- a/NEWS
++++ b/NEWS
+@@ -1,3 +1,7 @@
++bootchart2 UNRELEASED:
++ + bootchartd
++ + Expect dmesg only if started as init (Henry Yei)
++
+ bootchart2 0.14.0:
+ + bootchartd
+ + Add ability to define custom commands
diff --git a/0003-Fix-tests-import-path-so-we-can-call-them-from-sourc.patch b/0003-Fix-tests-import-path-so-we-can-call-them-from-sourc.patch
new file mode 100644
index 0000000..967fde4
--- /dev/null
+++ b/0003-Fix-tests-import-path-so-we-can-call-them-from-sourc.patch
@@ -0,0 +1,39 @@
+From 9539ad4a591a8dac88b7ffe5a60280bced769ec5 Mon Sep 17 00:00:00 2001
+From: Riccardo Magliocchetti <riccardo.magliocchetti at gmail.com>
+Date: Sat, 19 Mar 2011 11:03:43 +0100
+Subject: [PATCH] Fix tests import path so we can call them from source root dir
+
+---
+ pybootchartgui/tests/parser_test.py | 3 ++-
+ pybootchartgui/tests/process_tree_test.py | 4 ++--
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/pybootchartgui/tests/parser_test.py b/pybootchartgui/tests/parser_test.py
+index 7f17779..beeb547 100644
+--- a/pybootchartgui/tests/parser_test.py
++++ b/pybootchartgui/tests/parser_test.py
+@@ -4,7 +4,8 @@ import unittest
+
+ sys.path.insert(0, os.getcwd())
+
+-import parsing, main
++import pybootchartgui.parsing as parsing
++import pybootchartgui.main as main
+
+ debug = False
+
+diff --git a/pybootchartgui/tests/process_tree_test.py b/pybootchartgui/tests/process_tree_test.py
+index 971e125..e1e7553 100644
+--- a/pybootchartgui/tests/process_tree_test.py
++++ b/pybootchartgui/tests/process_tree_test.py
+@@ -4,8 +4,8 @@ import unittest
+
+ sys.path.insert(0, os.getcwd())
+
+-import parsing
+-import process_tree
++import pybootchartgui.parsing as parsing
++import pybootchartgui.process_tree as process_tree
+
+ class TestProcessTree(unittest.TestCase):
+
diff --git a/0004-tests-update-parsing-tests-for-ParserState-Trace-cha.patch b/0004-tests-update-parsing-tests-for-ParserState-Trace-cha.patch
new file mode 100644
index 0000000..af31ba4
--- /dev/null
+++ b/0004-tests-update-parsing-tests-for-ParserState-Trace-cha.patch
@@ -0,0 +1,75 @@
+From ac66b2e49d0d1ad80e6c0246d900653880572c1c Mon Sep 17 00:00:00 2001
+From: Riccardo Magliocchetti <riccardo.magliocchetti at gmail.com>
+Date: Sat, 19 Mar 2011 12:01:47 +0100
+Subject: [PATCH] tests: update parsing tests for ParserState() -> Trace() change
+
+---
+ pybootchartgui/tests/parser_test.py | 22 ++++++++++++++--------
+ 1 files changed, 14 insertions(+), 8 deletions(-)
+
+diff --git a/pybootchartgui/tests/parser_test.py b/pybootchartgui/tests/parser_test.py
+index beeb547..8739485 100644
+--- a/pybootchartgui/tests/parser_test.py
++++ b/pybootchartgui/tests/parser_test.py
+@@ -11,31 +11,35 @@ debug = False
+
+ def floatEq(f1, f2):
+ return math.fabs(f1-f2) < 0.00001
+-
++
++bootchart_dir = os.path.join(os.path.dirname(sys.argv[0]), '../../examples/1/')
+ parser = main._mk_options_parser()
+-options, args = parser.parse_args(['--q', 'testfile'])
++options, args = parser.parse_args(['--q', bootchart_dir])
+ writer = main._mk_writer(options)
+
+ class TestBCParser(unittest.TestCase):
+
+ def setUp(self):
+ self.name = "My first unittest"
+- self.rootdir = '../examples/1'
++ self.rootdir = bootchart_dir
+
+ def mk_fname(self,f):
+ return os.path.join(self.rootdir, f)
+
+ def testParseHeader(self):
+- state = parsing.parse_file(writer, parsing.ParserState(), self.mk_fname('header'))
++ trace = parsing.Trace(writer, args, options)
++ state = parsing.parse_file(writer, trace, self.mk_fname('header'))
+ self.assertEqual(6, len(state.headers))
+ self.assertEqual(2, parsing.get_num_cpus(state.headers))
+
+ def test_parseTimedBlocks(self):
+- state = parsing.parse_file(writer, parsing.ParserState(), self.mk_fname('proc_diskstats.log'))
++ trace = parsing.Trace(writer, args, options)
++ state = parsing.parse_file(writer, trace, self.mk_fname('proc_diskstats.log'))
+ self.assertEqual(141, len(state.disk_stats))
+
+ def testParseProcPsLog(self):
+- state = parsing.parse_file(writer, parsing.ParserState(), self.mk_fname('proc_ps.log'))
++ trace = parsing.Trace(writer, args, options)
++ state = parsing.parse_file(writer, trace, self.mk_fname('proc_ps.log'))
+ samples = state.ps_stats
+ processes = samples.process_list
+ sorted_processes = sorted(processes, key=lambda p: p.pid )
+@@ -55,7 +59,8 @@ class TestBCParser(unittest.TestCase):
+
+
+ def testparseProcDiskStatLog(self):
+- state_with_headers = parsing.parse_file(writer, parsing.ParserState(), self.mk_fname('header'))
++ trace = parsing.Trace(writer, args, options)
++ state_with_headers = parsing.parse_file(writer, trace, self.mk_fname('header'))
+ state_with_headers.headers['system.cpu'] = 'xxx (2)'
+ samples = parsing.parse_file(writer, state_with_headers, self.mk_fname('proc_diskstats.log')).disk_stats
+ self.assertEqual(141, len(samples))
+@@ -74,7 +79,8 @@ class TestBCParser(unittest.TestCase):
+ self.assert_(floatEq(float(tokens[3]), sample.util))
+
+ def testparseProcStatLog(self):
+- samples = parsing.parse_file(writer, parsing.ParserState(), self.mk_fname('proc_stat.log')).cpu_stats
++ trace = parsing.Trace(writer, args, options)
++ samples = parsing.parse_file(writer, trace, self.mk_fname('proc_stat.log')).cpu_stats
+ self.assertEqual(141, len(samples))
+
+ for index, line in enumerate(open(self.mk_fname('extract.proc_stat.log'))):
diff --git a/0005-tests-Fix-errors-and-failures-of-testParseProcPsLog.patch b/0005-tests-Fix-errors-and-failures-of-testParseProcPsLog.patch
new file mode 100644
index 0000000..f26e57a
--- /dev/null
+++ b/0005-tests-Fix-errors-and-failures-of-testParseProcPsLog.patch
@@ -0,0 +1,40 @@
+From 3e76242a0607dc1bd27743f3307a602514036eba Mon Sep 17 00:00:00 2001
+From: Riccardo Magliocchetti <riccardo.magliocchetti at gmail.com>
+Date: Sat, 19 Mar 2011 12:33:27 +0100
+Subject: [PATCH] tests: Fix errors and failures of testParseProcPsLog()
+
+---
+ pybootchartgui/tests/parser_test.py | 12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/pybootchartgui/tests/parser_test.py b/pybootchartgui/tests/parser_test.py
+index 8739485..c9adeea 100644
+--- a/pybootchartgui/tests/parser_test.py
++++ b/pybootchartgui/tests/parser_test.py
+@@ -41,20 +41,20 @@ class TestBCParser(unittest.TestCase):
+ trace = parsing.Trace(writer, args, options)
+ state = parsing.parse_file(writer, trace, self.mk_fname('proc_ps.log'))
+ samples = state.ps_stats
+- processes = samples.process_list
+- sorted_processes = sorted(processes, key=lambda p: p.pid )
++ processes = samples.process_map
++ sorted_processes = [processes[k] for k in sorted(processes.keys())]
+
+ for index, line in enumerate(open(self.mk_fname('extract2.proc_ps.log'))):
+ tokens = line.split();
+ process = sorted_processes[index]
+ if debug:
+ print(tokens[0:4])
+- print(process.pid, process.cmd, process.ppid, len(process.samples))
++ print(process.pid / 1000, process.cmd, process.ppid, len(process.samples))
+ print('-------------------')
+-
+- self.assertEqual(tokens[0], str(process.pid))
++
++ self.assertEqual(tokens[0], str(process.pid / 1000))
+ self.assertEqual(tokens[1], str(process.cmd))
+- self.assertEqual(tokens[2], str(process.ppid))
++ self.assertEqual(tokens[2], str(process.ppid / 1000))
+ self.assertEqual(tokens[3], str(len(process.samples)))
+
+
diff --git a/0006-tests-remove-unuseful-testParseLogDir.patch b/0006-tests-remove-unuseful-testParseLogDir.patch
new file mode 100644
index 0000000..17227d7
--- /dev/null
+++ b/0006-tests-remove-unuseful-testParseLogDir.patch
@@ -0,0 +1,29 @@
+From 12edb72d1004a29d48705892c0b7dcb4712e2322 Mon Sep 17 00:00:00 2001
+From: Riccardo Magliocchetti <riccardo.magliocchetti at gmail.com>
+Date: Sat, 19 Mar 2011 12:39:37 +0100
+Subject: [PATCH] tests: remove unuseful testParseLogDir()
+
+The test was checking the .parse() method which is gone. The
+checks previously done in that method are not done in Trace
+constructor, so the path is already excercised by the other tests.
+---
+ pybootchartgui/tests/parser_test.py | 6 +-----
+ 1 files changed, 1 insertions(+), 5 deletions(-)
+
+diff --git a/pybootchartgui/tests/parser_test.py b/pybootchartgui/tests/parser_test.py
+index c9adeea..9bd31f3 100644
+--- a/pybootchartgui/tests/parser_test.py
++++ b/pybootchartgui/tests/parser_test.py
+@@ -94,11 +94,7 @@ class TestBCParser(unittest.TestCase):
+ self.assert_(floatEq(float(tokens[1]), sample.user))
+ self.assert_(floatEq(float(tokens[2]), sample.sys))
+ self.assert_(floatEq(float(tokens[3]), sample.io))
+-
+- def testParseLogDir(self):
+- res = parsing.parse(writer, [self.rootdir], False, None, None)
+- self.assertEqual(6, len(res))
+-
++
+ if __name__ == '__main__':
+ unittest.main()
+
diff --git a/0007-tests-update-for-Trace-and-ProcessTree-api-changes.patch b/0007-tests-update-for-Trace-and-ProcessTree-api-changes.patch
new file mode 100644
index 0000000..6ac0e83
--- /dev/null
+++ b/0007-tests-update-for-Trace-and-ProcessTree-api-changes.patch
@@ -0,0 +1,51 @@
+From 8e7ed127371e9f5c55d864753f60d04511d47d64 Mon Sep 17 00:00:00 2001
+From: Riccardo Magliocchetti <riccardo.magliocchetti at gmail.com>
+Date: Sat, 19 Mar 2011 13:03:55 +0100
+Subject: [PATCH] tests: update for Trace and ProcessTree api changes.
+
+All errors are fixed, still two failures which i currently do not
+understand what they are about.
+---
+ pybootchartgui/tests/process_tree_test.py | 18 +++++++++++++-----
+ 1 files changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/pybootchartgui/tests/process_tree_test.py b/pybootchartgui/tests/process_tree_test.py
+index e1e7553..7423a04 100644
+--- a/pybootchartgui/tests/process_tree_test.py
++++ b/pybootchartgui/tests/process_tree_test.py
+@@ -6,14 +6,22 @@ sys.path.insert(0, os.getcwd())
+
+ import pybootchartgui.parsing as parsing
+ import pybootchartgui.process_tree as process_tree
++import pybootchartgui.main as main
+
+ class TestProcessTree(unittest.TestCase):
+
+ def setUp(self):
+- self.name = "Process tree unittest"
+- self.rootdir = '../examples/1'
+- self.ps_stats = parsing.parse_file(parsing.ParserState(), self.mk_fname('proc_ps.log')).ps_stats
+- self.processtree = process_tree.ProcessTree(self.ps_stats, None, False, for_testing = True)
++ self.name = "Process tree unittest"
++ self.rootdir = os.path.join(os.path.dirname(sys.argv[0]), '../../examples/1/')
++
++ parser = main._mk_options_parser()
++ options, args = parser.parse_args(['--q', self.rootdir])
++ writer = main._mk_writer(options)
++ trace = parsing.Trace(writer, args, options)
++
++ self.ps_stats = parsing.parse_file(writer, trace, self.mk_fname('proc_ps.log')).ps_stats
++ self.processtree = process_tree.ProcessTree(writer, None, self.ps_stats, \
++ self.ps_stats.sample_period, None, options.prune, None, None, False, for_testing = True)
+
+ def mk_fname(self,f):
+ return os.path.join(self.rootdir, f)
+@@ -28,7 +36,7 @@ class TestProcessTree(unittest.TestCase):
+ def checkAgainstJavaExtract(self, filename, process_tree):
+ for expected, actual in zip(open(filename), self.flatten(process_tree)):
+ tokens = expected.split('\t')
+- self.assertEqual(int(tokens[0]), actual.pid)
++ self.assertEqual(int(tokens[0]), actual.pid / 1000)
+ self.assertEqual(tokens[1], actual.cmd)
+ self.assertEqual(long(tokens[2]), 10 * actual.start_time)
+ self.assert_(long(tokens[3]) - 10 * actual.duration < 5, "duration")
diff --git a/0008-Add-Makefile-target-for-executing-pybootchartgui-tes.patch b/0008-Add-Makefile-target-for-executing-pybootchartgui-tes.patch
new file mode 100644
index 0000000..f47d300
--- /dev/null
+++ b/0008-Add-Makefile-target-for-executing-pybootchartgui-tes.patch
@@ -0,0 +1,24 @@
+From d6e6eeff1bfef234fec3192fb714b05ed2daa476 Mon Sep 17 00:00:00 2001
+From: Riccardo Magliocchetti <riccardo.magliocchetti at gmail.com>
+Date: Sat, 19 Mar 2011 13:34:47 +0100
+Subject: [PATCH] Add Makefile target for executing pybootchartgui tests
+
+---
+ Makefile | 7 +++++++
+ 1 files changed, 7 insertions(+), 0 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 17faada..c293a76 100644
+--- a/Makefile
++++ b/Makefile
+@@ -82,3 +82,10 @@ dist:
+ COMMIT_HASH=`git show-ref -s -h | head -n 1` ; \
+ git archive --prefix=$(PKG_NAME)-$(VER)/ --format=tar $$COMMIT_HASH \
+ | bzip2 -f > $(PKG_TARBALL)
++
++test: pybootchartgui/tests
++ for f in pybootchartgui/tests/*.py;\
++ do \
++ echo "Testing $$f...";\
++ $(PYTHON) "$$f";\
++ done
diff --git a/0009-Fix-self-reference-in-bootchartd-SEE-ALSO-section-ma.patch b/0009-Fix-self-reference-in-bootchartd-SEE-ALSO-section-ma.patch
new file mode 100644
index 0000000..18ba056
--- /dev/null
+++ b/0009-Fix-self-reference-in-bootchartd-SEE-ALSO-section-ma.patch
@@ -0,0 +1,22 @@
+From 5e9b3f482072b8991eeeec58eed4a7d6db662274 Mon Sep 17 00:00:00 2001
+From: David Paleino <dapal at debian.org>
+Date: Mon, 21 Mar 2011 16:53:15 +0100
+Subject: [PATCH] Fix self reference in bootchartd SEE ALSO section man page.
+
+---
+ bootchartd.1 | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/bootchartd.1 b/bootchartd.1
+index 4487ae5..ba7cf65 100644
+--- a/bootchartd.1
++++ b/bootchartd.1
+@@ -22,7 +22,7 @@ Stop the daemon
+ .I /sbin/bootchartd
+ .SH SEE ALSO
+ .BR bootchart2 (1),
+-.BR bootchartd (1)
++.BR pybootchartgui (1)
+ .SH AUTHOR
+ \fBbootchart2\fR was written by:
+ .in +4n
diff --git a/0010-pybootchartgui-main.py-fix-output-filename.patch b/0010-pybootchartgui-main.py-fix-output-filename.patch
new file mode 100644
index 0000000..4494565
--- /dev/null
+++ b/0010-pybootchartgui-main.py-fix-output-filename.patch
@@ -0,0 +1,23 @@
+From 1a74e9cf71e8e74f5387f1d36abc9a9b16eecd11 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Fri, 18 Feb 2011 13:52:37 +0100
+Subject: [PATCH] pybootchartgui/main.py: fix output filename
+
+bootchart -o .
+---
+ pybootchartgui/main.py.in | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/pybootchartgui/main.py.in b/pybootchartgui/main.py.in
+index 9c40943..c5f28d1 100644
+--- a/pybootchartgui/main.py.in
++++ b/pybootchartgui/main.py.in
+@@ -100,6 +100,8 @@ def _get_filename(paths, options):
+ fname = os.path.split(path)[-1]
+ elif os.path.splitext(path)[1] in [".tar", ".tgz", ".tar.gz"]:
+ fname = os.path.splitext(path)[0]
++ # strip directory
++ fname = os.path.split(fname)[-1]
+ return os.path.join (dname, fname + "." + options.format)
+
+ def main(argv=None):
diff --git a/0011-pybootchartgui-main.py.in-set-default-format-to-png.patch b/0011-pybootchartgui-main.py.in-set-default-format-to-png.patch
new file mode 100644
index 0000000..64664b9
--- /dev/null
+++ b/0011-pybootchartgui-main.py.in-set-default-format-to-png.patch
@@ -0,0 +1,28 @@
+From f6c5c9ab94ba076a6ba1623448cafe2f1305be7c Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Fri, 18 Feb 2011 13:54:11 +0100
+Subject: [PATCH] pybootchartgui/main.py.in: set default format to png
+
+fixes traceback:
+
+$ bootchart -o .
+....
+ return os.path.join (dname, fname + "." + options.format)
+ TypeError: cannot concatenate 'str' and 'NoneType' objects
+---
+ pybootchartgui/main.py.in | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/pybootchartgui/main.py.in b/pybootchartgui/main.py.in
+index c5f28d1..cd5f273 100644
+--- a/pybootchartgui/main.py.in
++++ b/pybootchartgui/main.py.in
+@@ -32,7 +32,7 @@ def _mk_options_parser():
+ parser = optparse.OptionParser(usage, version=version)
+ parser.add_option("-i", "--interactive", action="store_true", dest="interactive", default=False,
+ help="start in active mode")
+- parser.add_option("-f", "--format", dest="format", default = None,
++ parser.add_option("-f", "--format", dest="format", default = "png",
+ help="image format (...); default format ...")
+ parser.add_option("-o", "--output", dest="output", metavar="PATH", default="bootchart.png",
+ help="output path (file or directory) where charts are stored")
diff --git a/0012-parsing.py-_parse_proc_stat_log-skip-empty-lines.patch b/0012-parsing.py-_parse_proc_stat_log-skip-empty-lines.patch
new file mode 100644
index 0000000..028431b
--- /dev/null
+++ b/0012-parsing.py-_parse_proc_stat_log-skip-empty-lines.patch
@@ -0,0 +1,23 @@
+From 7dcd5ad5537dcc24136c21728b3c997f884785fd Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Fri, 18 Feb 2011 14:01:00 +0100
+Subject: [PATCH] parsing.py: _parse_proc_stat_log() skip empty lines
+
+---
+ pybootchartgui/parsing.py | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/pybootchartgui/parsing.py b/pybootchartgui/parsing.py
+index 56648d5..f4b76e5 100644
+--- a/pybootchartgui/parsing.py
++++ b/pybootchartgui/parsing.py
+@@ -380,6 +380,9 @@ def _parse_proc_stat_log(file):
+ samples = []
+ ltimes = None
+ for time, lines in _parse_timed_blocks(file):
++ # skip emtpy lines
++ if not lines:
++ continue
+ # CPU times {user, nice, system, idle, io_wait, irq, softirq}
+ tokens = lines[0].split()
+ times = [ int(token) for token in tokens[1:] ]
diff --git a/0013-pybootchartgui-main.py.in-bail-out-if-output-filenam.patch b/0013-pybootchartgui-main.py.in-bail-out-if-output-filenam.patch
new file mode 100644
index 0000000..5e379e7
--- /dev/null
+++ b/0013-pybootchartgui-main.py.in-bail-out-if-output-filenam.patch
@@ -0,0 +1,23 @@
+From 6b25994d0f7df3773fab1e19c9bb74546877ee95 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Fri, 18 Feb 2011 14:05:34 +0100
+Subject: [PATCH] pybootchartgui/main.py.in: bail out if output filename is not writable
+
+---
+ pybootchartgui/main.py.in | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/pybootchartgui/main.py.in b/pybootchartgui/main.py.in
+index cd5f273..661db88 100644
+--- a/pybootchartgui/main.py.in
++++ b/pybootchartgui/main.py.in
+@@ -144,6 +144,9 @@ def main(argv=None):
+ finally:
+ f.close()
+ filename = _get_filename(args, options)
++ if not os.access(filename, os.W_OK):
++ print("Can't write to %s", filename);
++ return 2
+ def render():
+ batch.render(writer, res, options, filename)
+ if options.profile:
diff --git a/0014-collector-move-to-run-bootchart-instead-of-dev-.boot.patch b/0014-collector-move-to-run-bootchart-instead-of-dev-.boot.patch
new file mode 100644
index 0000000..fe5e79a
--- /dev/null
+++ b/0014-collector-move-to-run-bootchart-instead-of-dev-.boot.patch
@@ -0,0 +1,36 @@
+From fa4c293cd7f3413fffec167abc54b1e3c7e0930c Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Thu, 31 Mar 2011 14:01:39 +0200
+Subject: [PATCH] collector: move to /run/bootchart instead of /dev/.bootchart
+
+---
+ collector/collector.c | 2 +-
+ collector/common.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/collector/collector.c b/collector/collector.c
+index 7a746f8..f6d2703 100644
+--- a/collector/collector.c
++++ b/collector/collector.c
+@@ -579,7 +579,7 @@ sanity_check_initrd (void)
+ static int
+ chroot_into_dev (void)
+ {
+- fprintf (stderr, "bootchart-collector - migrating into /dev/\n");
++ fprintf (stderr, "bootchart-collector - migrating into /run/\n");
+
+ if (mkdir (MOVE_DEV_PATH, 0777)) {
+ if (errno != EEXIST) {
+diff --git a/collector/common.h b/collector/common.h
+index 5cc11b7..36939bc 100644
+--- a/collector/common.h
++++ b/collector/common.h
+@@ -38,7 +38,7 @@
+ #define TMPFS_PATH "/lib/bootchart/tmpfs"
+ #define PROC_PATH "/lib/bootchart/tmpfs/proc"
+ /* where we lurk to get move mounted into the live system */
+-#define MOVE_DEV_PATH "/dev/.bootchart"
++#define MOVE_DEV_PATH "/run/bootchart"
+
+ /* helpers */
+ #undef MAX
More information about the scm-commits
mailing list