~ubuntu-branches/debian/sid/iotop/sid

« back to all changes in this revision

Viewing changes to debian/patches/0002-Document-the-requirement-for-CONFIG_VM_EVENT_COUNTER.patch

  • Committer: Bazaar Package Importer
  • Author(s): Paul Wise
  • Date: 2010-05-31 17:46:30 UTC
  • Revision ID: james.westby@ubuntu.com-20100531174630-ziu6jud3z76rboce
Tags: 0.4-2
* Correct bug number in the changelog for previous version.
* Switch to dpkg-source format v3
* Do not report requirements that are available (Closes: #574246)
* Check for CONFIG_VM_EVENT_COUNTERS, it is needed (Closes: #574346)
* Bump Standards-Version, no changes needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From: Paul Wise <pabs3@bonedaddy.net>
 
2
Date: Mon, 31 May 2010 16:42:06 +0800
 
3
Subject: Document the requirement for CONFIG_VM_EVENT_COUNTERS and check for it on startup.
 
4
Bug-Debian: http://bugs.debian.org/574346
 
5
Forwarded: Guillaume Chazarain <guichaz@gmail.com>
 
6
--- a/README
 
7
+++ b/README
 
8
@@ -1,7 +1,7 @@
 
9
 Iotop is a Python program with a top like UI used to show of behalf of which
 
10
 process is the I/O going on. It requires Python >= 2.5 (or Python >= 2.4 with
 
11
-the ctypes module) and a Linux kernel >= 2.6.20 with the TASK_DELAY_ACCT and
 
12
-TASK_IO_ACCOUNTING options enabled.
 
13
+the ctypes module) and a Linux kernel >= 2.6.20 with the TASK_DELAY_ACCT
 
14
+CONFIG_TASKSTATS, TASK_IO_ACCOUNTING and CONFIG_VM_EVENT_COUNTERS options on.
 
15
 
 
16
 
 
17
 To run a local version of iotop:
 
18
--- a/iotop.1
 
19
+++ b/iotop.1
 
20
@@ -8,9 +8,9 @@
 
21
 .SH DESCRIPTION
 
22
 iotop watches I/O usage information output by the Linux kernel (requires
 
23
 2.6.20 or later) and displays a table of current I/O usage by processes
 
24
-or threads on the system. At least the CONFIG_TASK_DELAY_ACCT and
 
25
-CONFIG_TASK_IO_ACCOUNTING options need to be enabled in your Linux kernel
 
26
-build configuration, these options depend on CONFIG_TASKSTATS.
 
27
+or threads on the system. At least the CONFIG_TASK_DELAY_ACCT,
 
28
+CONFIG_TASK_IO_ACCOUNTING, CONFIG_TASKSTATS and CONFIG_VM_EVENT_COUNTERS
 
29
+options need to be enabled in your Linux kernel build configuration.
 
30
 .PP
 
31
 iotop displays columns for the I/O bandwidth read and written by each
 
32
 process/thread during the sampling period. It also displays the percentage
 
33
--- a/iotop/data.py
 
34
+++ b/iotop/data.py
 
35
@@ -11,7 +11,7 @@
 
36
 
 
37
 #
 
38
 # Check for requirements:
 
39
-#   o Linux >= 2.6.20 with I/O accounting
 
40
+#   o Linux >= 2.6.20 with I/O accounting and VM event counters
 
41
 #   o Python >= 2.5 or Python 2.4 + ctypes
 
42
 #
 
43
 
 
44
@@ -22,13 +22,24 @@
 
45
     has_ctypes = False
 
46
 else:
 
47
     has_ctypes = True
 
48
+try:
 
49
+    from iotop.vmstat import VmStat
 
50
+    vmstat_f = VmStat()
 
51
+except:
 
52
+    vm_event_counters = False
 
53
+else:
 
54
+    vm_event_counters = True
 
55
 
 
56
-if not ioaccounting or not has_ctypes:
 
57
+if not ioaccounting or not has_ctypes or not vm_event_counters:
 
58
     print 'Could not run iotop as some of the requirements are not met:'
 
59
-    if not ioaccounting:
 
60
-        print '- Linux >= 2.6.20 with I/O accounting support ' \
 
61
+    if not ioaccounting or not vm_event_counters:
 
62
+        print '- Linux >= 2.6.20 with'
 
63
+       if not ioaccounting:
 
64
+            print '  - I/O accounting support ' \
 
65
               '(CONFIG_TASKSTATS, CONFIG_TASK_DELAY_ACCT, ' \
 
66
               'CONFIG_TASK_IO_ACCOUNTING)'
 
67
+        if not vm_event_counters:
 
68
+            print '  - VM event counters (CONFIG_VM_EVENT_COUNTERS)'
 
69
     if not has_ctypes:
 
70
         print '- Python >= 2.5 or Python 2.4 with the ctypes module'
 
71