diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/ABI/testing/debugfs-pktcdvd | 20 | ||||
-rw-r--r-- | Documentation/ABI/testing/sysfs-class-pktcdvd | 72 | ||||
-rw-r--r-- | Documentation/cdrom/packet-writing.txt | 35 | ||||
-rw-r--r-- | Documentation/fault-injection/failcmd.sh | 4 | ||||
-rw-r--r-- | Documentation/fault-injection/failmodule.sh | 31 | ||||
-rw-r--r-- | Documentation/fault-injection/fault-injection.txt | 225 | ||||
-rw-r--r-- | Documentation/ioctl-number.txt | 2 | ||||
-rw-r--r-- | Documentation/kernel-parameters.txt | 7 |
8 files changed, 396 insertions, 0 deletions
diff --git a/Documentation/ABI/testing/debugfs-pktcdvd b/Documentation/ABI/testing/debugfs-pktcdvd new file mode 100644 index 000000000000..03dbd883cc41 --- /dev/null +++ b/Documentation/ABI/testing/debugfs-pktcdvd | |||
@@ -0,0 +1,20 @@ | |||
1 | What: /debug/pktcdvd/pktcdvd[0-7] | ||
2 | Date: Oct. 2006 | ||
3 | KernelVersion: 2.6.19 | ||
4 | Contact: Thomas Maier <balagi@justmail.de> | ||
5 | Description: | ||
6 | |||
7 | debugfs interface | ||
8 | ----------------- | ||
9 | |||
10 | The pktcdvd module (packet writing driver) creates | ||
11 | these files in debugfs: | ||
12 | |||
13 | /debug/pktcdvd/pktcdvd[0-7]/ | ||
14 | info (0444) Lots of human readable driver | ||
15 | statistics and infos. Multiple lines! | ||
16 | |||
17 | Example: | ||
18 | ------- | ||
19 | |||
20 | cat /debug/pktcdvd/pktcdvd0/info | ||
diff --git a/Documentation/ABI/testing/sysfs-class-pktcdvd b/Documentation/ABI/testing/sysfs-class-pktcdvd new file mode 100644 index 000000000000..c4c55edc9a5c --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-pktcdvd | |||
@@ -0,0 +1,72 @@ | |||
1 | What: /sys/class/pktcdvd/ | ||
2 | Date: Oct. 2006 | ||
3 | KernelVersion: 2.6.19 | ||
4 | Contact: Thomas Maier <balagi@justmail.de> | ||
5 | Description: | ||
6 | |||
7 | sysfs interface | ||
8 | --------------- | ||
9 | |||
10 | The pktcdvd module (packet writing driver) creates | ||
11 | these files in the sysfs: | ||
12 | (<devid> is in format major:minor ) | ||
13 | |||
14 | /sys/class/pktcdvd/ | ||
15 | add (0200) Write a block device id (major:minor) | ||
16 | to create a new pktcdvd device and map | ||
17 | it to the block device. | ||
18 | |||
19 | remove (0200) Write the pktcdvd device id (major:minor) | ||
20 | to it to remove the pktcdvd device. | ||
21 | |||
22 | device_map (0444) Shows the device mapping in format: | ||
23 | pktcdvd[0-7] <pktdevid> <blkdevid> | ||
24 | |||
25 | /sys/class/pktcdvd/pktcdvd[0-7]/ | ||
26 | dev (0444) Device id | ||
27 | uevent (0200) To send an uevent. | ||
28 | |||
29 | /sys/class/pktcdvd/pktcdvd[0-7]/stat/ | ||
30 | packets_started (0444) Number of started packets. | ||
31 | packets_finished (0444) Number of finished packets. | ||
32 | |||
33 | kb_written (0444) kBytes written. | ||
34 | kb_read (0444) kBytes read. | ||
35 | kb_read_gather (0444) kBytes read to fill write packets. | ||
36 | |||
37 | reset (0200) Write any value to it to reset | ||
38 | pktcdvd device statistic values, like | ||
39 | bytes read/written. | ||
40 | |||
41 | /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/ | ||
42 | size (0444) Contains the size of the bio write | ||
43 | queue. | ||
44 | |||
45 | congestion_off (0644) If bio write queue size is below | ||
46 | this mark, accept new bio requests | ||
47 | from the block layer. | ||
48 | |||
49 | congestion_on (0644) If bio write queue size is higher | ||
50 | as this mark, do no longer accept | ||
51 | bio write requests from the block | ||
52 | layer and wait till the pktcdvd | ||
53 | device has processed enough bio's | ||
54 | so that bio write queue size is | ||
55 | below congestion off mark. | ||
56 | A value of <= 0 disables congestion | ||
57 | control. | ||
58 | |||
59 | |||
60 | Example: | ||
61 | -------- | ||
62 | To use the pktcdvd sysfs interface directly, you can do: | ||
63 | |||
64 | # create a new pktcdvd device mapped to /dev/hdc | ||
65 | echo "22:0" >/sys/class/pktcdvd/add | ||
66 | cat /sys/class/pktcdvd/device_map | ||
67 | # assuming device pktcdvd0 was created, look at stat's | ||
68 | cat /sys/class/pktcdvd/pktcdvd0/stat/kb_written | ||
69 | # print the device id of the mapped block device | ||
70 | fgrep pktcdvd0 /sys/class/pktcdvd/device_map | ||
71 | # remove device, using pktcdvd0 device id 253:0 | ||
72 | echo "253:0" >/sys/class/pktcdvd/remove | ||
diff --git a/Documentation/cdrom/packet-writing.txt b/Documentation/cdrom/packet-writing.txt index 3d44c561fe6d..7715d2247c4d 100644 --- a/Documentation/cdrom/packet-writing.txt +++ b/Documentation/cdrom/packet-writing.txt | |||
@@ -90,6 +90,41 @@ Notes | |||
90 | to create an ext2 filesystem on the disc. | 90 | to create an ext2 filesystem on the disc. |
91 | 91 | ||
92 | 92 | ||
93 | Using the pktcdvd sysfs interface | ||
94 | --------------------------------- | ||
95 | |||
96 | Since Linux 2.6.19, the pktcdvd module has a sysfs interface | ||
97 | and can be controlled by it. For example the "pktcdvd" tool uses | ||
98 | this interface. (see http://people.freenet.de/BalaGi#pktcdvd ) | ||
99 | |||
100 | "pktcdvd" works similar to "pktsetup", e.g.: | ||
101 | |||
102 | # pktcdvd -a dev_name /dev/hdc | ||
103 | # mkudffs /dev/pktcdvd/dev_name | ||
104 | # mount -t udf -o rw,noatime /dev/pktcdvd/dev_name /dvdram | ||
105 | # cp files /dvdram | ||
106 | # umount /dvdram | ||
107 | # pktcdvd -r dev_name | ||
108 | |||
109 | |||
110 | For a description of the sysfs interface look into the file: | ||
111 | |||
112 | Documentation/ABI/testing/sysfs-block-pktcdvd | ||
113 | |||
114 | |||
115 | Using the pktcdvd debugfs interface | ||
116 | ----------------------------------- | ||
117 | |||
118 | To read pktcdvd device infos in human readable form, do: | ||
119 | |||
120 | # cat /debug/pktcdvd/pktcdvd[0-7]/info | ||
121 | |||
122 | For a description of the debugfs interface look into the file: | ||
123 | |||
124 | Documentation/ABI/testing/debugfs-pktcdvd | ||
125 | |||
126 | |||
127 | |||
93 | Links | 128 | Links |
94 | ----- | 129 | ----- |
95 | 130 | ||
diff --git a/Documentation/fault-injection/failcmd.sh b/Documentation/fault-injection/failcmd.sh new file mode 100644 index 000000000000..63177aba8106 --- /dev/null +++ b/Documentation/fault-injection/failcmd.sh | |||
@@ -0,0 +1,4 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | echo 1 > /proc/self/make-it-fail | ||
4 | exec $* | ||
diff --git a/Documentation/fault-injection/failmodule.sh b/Documentation/fault-injection/failmodule.sh new file mode 100644 index 000000000000..474a8b971f9c --- /dev/null +++ b/Documentation/fault-injection/failmodule.sh | |||
@@ -0,0 +1,31 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # Usage: failmodule <failname> <modulename> [stacktrace-depth] | ||
4 | # | ||
5 | # <failname>: "failslab", "fail_alloc_page", or "fail_make_request" | ||
6 | # | ||
7 | # <modulename>: module name that you want to inject faults. | ||
8 | # | ||
9 | # [stacktrace-depth]: the maximum number of stacktrace walking allowed | ||
10 | # | ||
11 | |||
12 | STACKTRACE_DEPTH=5 | ||
13 | if [ $# -gt 2 ]; then | ||
14 | STACKTRACE_DEPTH=$3 | ||
15 | fi | ||
16 | |||
17 | if [ ! -d /debug/$1 ]; then | ||
18 | echo "Fault-injection $1 does not exist" >&2 | ||
19 | exit 1 | ||
20 | fi | ||
21 | if [ ! -d /sys/module/$2 ]; then | ||
22 | echo "Module $2 does not exist" >&2 | ||
23 | exit 1 | ||
24 | fi | ||
25 | |||
26 | # Disable any fault injection | ||
27 | echo 0 > /debug/$1/stacktrace-depth | ||
28 | |||
29 | echo `cat /sys/module/$2/sections/.text` > /debug/$1/require-start | ||
30 | echo `cat /sys/module/$2/sections/.exit.text` > /debug/$1/require-end | ||
31 | echo $STACKTRACE_DEPTH > /debug/$1/stacktrace-depth | ||
diff --git a/Documentation/fault-injection/fault-injection.txt b/Documentation/fault-injection/fault-injection.txt new file mode 100644 index 000000000000..b7ca560b9340 --- /dev/null +++ b/Documentation/fault-injection/fault-injection.txt | |||
@@ -0,0 +1,225 @@ | |||
1 | Fault injection capabilities infrastructure | ||
2 | =========================================== | ||
3 | |||
4 | See also drivers/md/faulty.c and "every_nth" module option for scsi_debug. | ||
5 | |||
6 | |||
7 | Available fault injection capabilities | ||
8 | -------------------------------------- | ||
9 | |||
10 | o failslab | ||
11 | |||
12 | injects slab allocation failures. (kmalloc(), kmem_cache_alloc(), ...) | ||
13 | |||
14 | o fail_page_alloc | ||
15 | |||
16 | injects page allocation failures. (alloc_pages(), get_free_pages(), ...) | ||
17 | |||
18 | o fail_make_request | ||
19 | |||
20 | injects disk IO errors on devices permitted by setting | ||
21 | /sys/block/<device>/make-it-fail or | ||
22 | /sys/block/<device>/<partition>/make-it-fail. (generic_make_request()) | ||
23 | |||
24 | Configure fault-injection capabilities behavior | ||
25 | ----------------------------------------------- | ||
26 | |||
27 | o debugfs entries | ||
28 | |||
29 | fault-inject-debugfs kernel module provides some debugfs entries for runtime | ||
30 | configuration of fault-injection capabilities. | ||
31 | |||
32 | - /debug/fail*/probability: | ||
33 | |||
34 | likelihood of failure injection, in percent. | ||
35 | Format: <percent> | ||
36 | |||
37 | Note that one-failure-per-hundred is a very high error rate | ||
38 | for some testcases. Consider setting probability=100 and configure | ||
39 | /debug/fail*/interval for such testcases. | ||
40 | |||
41 | - /debug/fail*/interval: | ||
42 | |||
43 | specifies the interval between failures, for calls to | ||
44 | should_fail() that pass all the other tests. | ||
45 | |||
46 | Note that if you enable this, by setting interval>1, you will | ||
47 | probably want to set probability=100. | ||
48 | |||
49 | - /debug/fail*/times: | ||
50 | |||
51 | specifies how many times failures may happen at most. | ||
52 | A value of -1 means "no limit". | ||
53 | |||
54 | - /debug/fail*/space: | ||
55 | |||
56 | specifies an initial resource "budget", decremented by "size" | ||
57 | on each call to should_fail(,size). Failure injection is | ||
58 | suppressed until "space" reaches zero. | ||
59 | |||
60 | - /debug/fail*/verbose | ||
61 | |||
62 | Format: { 0 | 1 | 2 } | ||
63 | specifies the verbosity of the messages when failure is | ||
64 | injected. '0' means no messages; '1' will print only a single | ||
65 | log line per failure; '2' will print a call trace too -- useful | ||
66 | to debug the problems revealed by fault injection. | ||
67 | |||
68 | - /debug/fail*/task-filter: | ||
69 | |||
70 | Format: { 'Y' | 'N' } | ||
71 | A value of 'N' disables filtering by process (default). | ||
72 | Any positive value limits failures to only processes indicated by | ||
73 | /proc/<pid>/make-it-fail==1. | ||
74 | |||
75 | - /debug/fail*/require-start: | ||
76 | - /debug/fail*/require-end: | ||
77 | - /debug/fail*/reject-start: | ||
78 | - /debug/fail*/reject-end: | ||
79 | |||
80 | specifies the range of virtual addresses tested during | ||
81 | stacktrace walking. Failure is injected only if some caller | ||
82 | in the walked stacktrace lies within the required range, and | ||
83 | none lies within the rejected range. | ||
84 | Default required range is [0,ULONG_MAX) (whole of virtual address space). | ||
85 | Default rejected range is [0,0). | ||
86 | |||
87 | - /debug/fail*/stacktrace-depth: | ||
88 | |||
89 | specifies the maximum stacktrace depth walked during search | ||
90 | for a caller within [require-start,require-end) OR | ||
91 | [reject-start,reject-end). | ||
92 | |||
93 | - /debug/fail_page_alloc/ignore-gfp-highmem: | ||
94 | |||
95 | Format: { 'Y' | 'N' } | ||
96 | default is 'N', setting it to 'Y' won't inject failures into | ||
97 | highmem/user allocations. | ||
98 | |||
99 | - /debug/failslab/ignore-gfp-wait: | ||
100 | - /debug/fail_page_alloc/ignore-gfp-wait: | ||
101 | |||
102 | Format: { 'Y' | 'N' } | ||
103 | default is 'N', setting it to 'Y' will inject failures | ||
104 | only into non-sleep allocations (GFP_ATOMIC allocations). | ||
105 | |||
106 | o Boot option | ||
107 | |||
108 | In order to inject faults while debugfs is not available (early boot time), | ||
109 | use the boot option: | ||
110 | |||
111 | failslab= | ||
112 | fail_page_alloc= | ||
113 | fail_make_request=<interval>,<probability>,<space>,<times> | ||
114 | |||
115 | How to add new fault injection capability | ||
116 | ----------------------------------------- | ||
117 | |||
118 | o #include <linux/fault-inject.h> | ||
119 | |||
120 | o define the fault attributes | ||
121 | |||
122 | DECLARE_FAULT_INJECTION(name); | ||
123 | |||
124 | Please see the definition of struct fault_attr in fault-inject.h | ||
125 | for details. | ||
126 | |||
127 | o provide a way to configure fault attributes | ||
128 | |||
129 | - boot option | ||
130 | |||
131 | If you need to enable the fault injection capability from boot time, you can | ||
132 | provide boot option to configure it. There is a helper function for it: | ||
133 | |||
134 | setup_fault_attr(attr, str); | ||
135 | |||
136 | - debugfs entries | ||
137 | |||
138 | failslab, fail_page_alloc, and fail_make_request use this way. | ||
139 | Helper functions: | ||
140 | |||
141 | init_fault_attr_entries(entries, attr, name); | ||
142 | void cleanup_fault_attr_entries(entries); | ||
143 | |||
144 | - module parameters | ||
145 | |||
146 | If the scope of the fault injection capability is limited to a | ||
147 | single kernel module, it is better to provide module parameters to | ||
148 | configure the fault attributes. | ||
149 | |||
150 | o add a hook to insert failures | ||
151 | |||
152 | Upon should_fail() returning true, client code should inject a failure. | ||
153 | |||
154 | should_fail(attr, size); | ||
155 | |||
156 | Application Examples | ||
157 | -------------------- | ||
158 | |||
159 | o inject slab allocation failures into module init/cleanup code | ||
160 | |||
161 | ------------------------------------------------------------------------------ | ||
162 | #!/bin/bash | ||
163 | |||
164 | FAILCMD=Documentation/fault-injection/failcmd.sh | ||
165 | BLACKLIST="root_plug evbug" | ||
166 | |||
167 | FAILNAME=failslab | ||
168 | echo Y > /debug/$FAILNAME/task-filter | ||
169 | echo 10 > /debug/$FAILNAME/probability | ||
170 | echo 100 > /debug/$FAILNAME/interval | ||
171 | echo -1 > /debug/$FAILNAME/times | ||
172 | echo 2 > /debug/$FAILNAME/verbose | ||
173 | echo 1 > /debug/$FAILNAME/ignore-gfp-wait | ||
174 | |||
175 | blacklist() | ||
176 | { | ||
177 | echo $BLACKLIST | grep $1 > /dev/null 2>&1 | ||
178 | } | ||
179 | |||
180 | oops() | ||
181 | { | ||
182 | dmesg | grep BUG > /dev/null 2>&1 | ||
183 | } | ||
184 | |||
185 | find /lib/modules/`uname -r` -name '*.ko' -exec basename {} .ko \; | | ||
186 | while read i | ||
187 | do | ||
188 | oops && exit 1 | ||
189 | |||
190 | if ! blacklist $i | ||
191 | then | ||
192 | echo inserting $i... | ||
193 | bash $FAILCMD modprobe $i | ||
194 | fi | ||
195 | done | ||
196 | |||
197 | lsmod | awk '{ if ($3 == 0) { print $1 } }' | | ||
198 | while read i | ||
199 | do | ||
200 | oops && exit 1 | ||
201 | |||
202 | if ! blacklist $i | ||
203 | then | ||
204 | echo removing $i... | ||
205 | bash $FAILCMD modprobe -r $i | ||
206 | fi | ||
207 | done | ||
208 | |||
209 | ------------------------------------------------------------------------------ | ||
210 | |||
211 | o inject slab allocation failures only for a specific module | ||
212 | |||
213 | ------------------------------------------------------------------------------ | ||
214 | #!/bin/bash | ||
215 | |||
216 | FAILMOD=Documentation/fault-injection/failmodule.sh | ||
217 | |||
218 | echo injecting errors into the module $1... | ||
219 | |||
220 | modprobe $1 | ||
221 | bash $FAILMOD failslab $1 10 | ||
222 | echo 25 > /debug/failslab/probability | ||
223 | |||
224 | ------------------------------------------------------------------------------ | ||
225 | |||
diff --git a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt index edc04d74ae23..5a8bd5bd88ef 100644 --- a/Documentation/ioctl-number.txt +++ b/Documentation/ioctl-number.txt | |||
@@ -191,3 +191,5 @@ Code Seq# Include File Comments | |||
191 | <mailto:aherrman@de.ibm.com> | 191 | <mailto:aherrman@de.ibm.com> |
192 | 0xF3 00-3F video/sisfb.h sisfb (in development) | 192 | 0xF3 00-3F video/sisfb.h sisfb (in development) |
193 | <mailto:thomas@winischhofer.net> | 193 | <mailto:thomas@winischhofer.net> |
194 | 0xF4 00-1F video/mbxfb.h mbxfb | ||
195 | <mailto:raph@8d.com> | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index b79bcdf16319..d8323b8893c3 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -548,6 +548,13 @@ and is between 256 and 4096 characters. It is defined in the file | |||
548 | eurwdt= [HW,WDT] Eurotech CPU-1220/1410 onboard watchdog. | 548 | eurwdt= [HW,WDT] Eurotech CPU-1220/1410 onboard watchdog. |
549 | Format: <io>[,<irq>] | 549 | Format: <io>[,<irq>] |
550 | 550 | ||
551 | failslab= | ||
552 | fail_page_alloc= | ||
553 | fail_make_request=[KNL] | ||
554 | General fault injection mechanism. | ||
555 | Format: <interval>,<probability>,<space>,<times> | ||
556 | See also /Documentation/fault-injection/. | ||
557 | |||
551 | fd_mcs= [HW,SCSI] | 558 | fd_mcs= [HW,SCSI] |
552 | See header of drivers/scsi/fd_mcs.c. | 559 | See header of drivers/scsi/fd_mcs.c. |
553 | 560 | ||