diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/ABI/testing/sysfs-fs-ext4 | 10 | ||||
-rw-r--r-- | Documentation/ABI/testing/sysfs-pps | 73 | ||||
-rw-r--r-- | Documentation/Changes | 7 | ||||
-rw-r--r-- | Documentation/cgroups/memory.txt | 16 | ||||
-rw-r--r-- | Documentation/connector/cn_test.c | 7 | ||||
-rw-r--r-- | Documentation/feature-removal-schedule.txt | 14 | ||||
-rw-r--r-- | Documentation/filesystems/ext2.txt | 2 | ||||
-rw-r--r-- | Documentation/filesystems/ext4.txt | 4 | ||||
-rw-r--r-- | Documentation/filesystems/isofs.txt | 9 | ||||
-rw-r--r-- | Documentation/filesystems/proc.txt | 268 | ||||
-rw-r--r-- | Documentation/gcov.txt | 246 | ||||
-rw-r--r-- | Documentation/ioctl/ioctl-number.txt | 2 | ||||
-rw-r--r-- | Documentation/kernel-parameters.txt | 7 | ||||
-rw-r--r-- | Documentation/pps/pps.txt | 172 | ||||
-rw-r--r-- | Documentation/rfkill.txt | 137 | ||||
-rw-r--r-- | Documentation/robust-futex-ABI.txt | 4 | ||||
-rw-r--r-- | Documentation/watchdog/hpwdt.txt | 84 |
17 files changed, 932 insertions, 130 deletions
diff --git a/Documentation/ABI/testing/sysfs-fs-ext4 b/Documentation/ABI/testing/sysfs-fs-ext4 index 4e79074de282..5fb709997d96 100644 --- a/Documentation/ABI/testing/sysfs-fs-ext4 +++ b/Documentation/ABI/testing/sysfs-fs-ext4 | |||
@@ -79,3 +79,13 @@ Description: | |||
79 | This file is read-only and shows the number of | 79 | This file is read-only and shows the number of |
80 | kilobytes of data that have been written to this | 80 | kilobytes of data that have been written to this |
81 | filesystem since it was mounted. | 81 | filesystem since it was mounted. |
82 | |||
83 | What: /sys/fs/ext4/<disk>/inode_goal | ||
84 | Date: June 2008 | ||
85 | Contact: "Theodore Ts'o" <tytso@mit.edu> | ||
86 | Description: | ||
87 | Tuning parameter which (if non-zero) controls the goal | ||
88 | inode used by the inode allocator in p0reference to | ||
89 | all other allocation hueristics. This is intended for | ||
90 | debugging use only, and should be 0 on production | ||
91 | systems. | ||
diff --git a/Documentation/ABI/testing/sysfs-pps b/Documentation/ABI/testing/sysfs-pps new file mode 100644 index 000000000000..25028c7bc37d --- /dev/null +++ b/Documentation/ABI/testing/sysfs-pps | |||
@@ -0,0 +1,73 @@ | |||
1 | What: /sys/class/pps/ | ||
2 | Date: February 2008 | ||
3 | Contact: Rodolfo Giometti <giometti@linux.it> | ||
4 | Description: | ||
5 | The /sys/class/pps/ directory will contain files and | ||
6 | directories that will provide a unified interface to | ||
7 | the PPS sources. | ||
8 | |||
9 | What: /sys/class/pps/ppsX/ | ||
10 | Date: February 2008 | ||
11 | Contact: Rodolfo Giometti <giometti@linux.it> | ||
12 | Description: | ||
13 | The /sys/class/pps/ppsX/ directory is related to X-th | ||
14 | PPS source into the system. Each directory will | ||
15 | contain files to manage and control its PPS source. | ||
16 | |||
17 | What: /sys/class/pps/ppsX/assert | ||
18 | Date: February 2008 | ||
19 | Contact: Rodolfo Giometti <giometti@linux.it> | ||
20 | Description: | ||
21 | The /sys/class/pps/ppsX/assert file reports the assert events | ||
22 | and the assert sequence number of the X-th source in the form: | ||
23 | |||
24 | <secs>.<nsec>#<sequence> | ||
25 | |||
26 | If the source has no assert events the content of this file | ||
27 | is empty. | ||
28 | |||
29 | What: /sys/class/pps/ppsX/clear | ||
30 | Date: February 2008 | ||
31 | Contact: Rodolfo Giometti <giometti@linux.it> | ||
32 | Description: | ||
33 | The /sys/class/pps/ppsX/clear file reports the clear events | ||
34 | and the clear sequence number of the X-th source in the form: | ||
35 | |||
36 | <secs>.<nsec>#<sequence> | ||
37 | |||
38 | If the source has no clear events the content of this file | ||
39 | is empty. | ||
40 | |||
41 | What: /sys/class/pps/ppsX/mode | ||
42 | Date: February 2008 | ||
43 | Contact: Rodolfo Giometti <giometti@linux.it> | ||
44 | Description: | ||
45 | The /sys/class/pps/ppsX/mode file reports the functioning | ||
46 | mode of the X-th source in hexadecimal encoding. | ||
47 | |||
48 | Please, refer to linux/include/linux/pps.h for further | ||
49 | info. | ||
50 | |||
51 | What: /sys/class/pps/ppsX/echo | ||
52 | Date: February 2008 | ||
53 | Contact: Rodolfo Giometti <giometti@linux.it> | ||
54 | Description: | ||
55 | The /sys/class/pps/ppsX/echo file reports if the X-th does | ||
56 | or does not support an "echo" function. | ||
57 | |||
58 | What: /sys/class/pps/ppsX/name | ||
59 | Date: February 2008 | ||
60 | Contact: Rodolfo Giometti <giometti@linux.it> | ||
61 | Description: | ||
62 | The /sys/class/pps/ppsX/name file reports the name of the | ||
63 | X-th source. | ||
64 | |||
65 | What: /sys/class/pps/ppsX/path | ||
66 | Date: February 2008 | ||
67 | Contact: Rodolfo Giometti <giometti@linux.it> | ||
68 | Description: | ||
69 | The /sys/class/pps/ppsX/path file reports the path name of | ||
70 | the device connected with the X-th source. | ||
71 | |||
72 | If the source is not connected with any device the content | ||
73 | of this file is empty. | ||
diff --git a/Documentation/Changes b/Documentation/Changes index 664392481c84..6d0f1efc5bf6 100644 --- a/Documentation/Changes +++ b/Documentation/Changes | |||
@@ -72,6 +72,13 @@ assembling the 16-bit boot code, removing the need for as86 to compile | |||
72 | your kernel. This change does, however, mean that you need a recent | 72 | your kernel. This change does, however, mean that you need a recent |
73 | release of binutils. | 73 | release of binutils. |
74 | 74 | ||
75 | Perl | ||
76 | ---- | ||
77 | |||
78 | You will need perl 5 and the following modules: Getopt::Long, Getopt::Std, | ||
79 | File::Basename, and File::Find to build the kernel. | ||
80 | |||
81 | |||
75 | System utilities | 82 | System utilities |
76 | ================ | 83 | ================ |
77 | 84 | ||
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index 1a608877b14e..23d1262c0775 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -152,14 +152,19 @@ When swap is accounted, following files are added. | |||
152 | 152 | ||
153 | usage of mem+swap is limited by memsw.limit_in_bytes. | 153 | usage of mem+swap is limited by memsw.limit_in_bytes. |
154 | 154 | ||
155 | Note: why 'mem+swap' rather than swap. | 155 | * why 'mem+swap' rather than swap. |
156 | The global LRU(kswapd) can swap out arbitrary pages. Swap-out means | 156 | The global LRU(kswapd) can swap out arbitrary pages. Swap-out means |
157 | to move account from memory to swap...there is no change in usage of | 157 | to move account from memory to swap...there is no change in usage of |
158 | mem+swap. | 158 | mem+swap. In other words, when we want to limit the usage of swap without |
159 | affecting global LRU, mem+swap limit is better than just limiting swap from | ||
160 | OS point of view. | ||
159 | 161 | ||
160 | In other words, when we want to limit the usage of swap without affecting | 162 | * What happens when a cgroup hits memory.memsw.limit_in_bytes |
161 | global LRU, mem+swap limit is better than just limiting swap from OS point | 163 | When a cgroup his memory.memsw.limit_in_bytes, it's useless to do swap-out |
162 | of view. | 164 | in this cgroup. Then, swap-out will not be done by cgroup routine and file |
165 | caches are dropped. But as mentioned above, global LRU can do swapout memory | ||
166 | from it for sanity of the system's memory management state. You can't forbid | ||
167 | it by cgroup. | ||
163 | 168 | ||
164 | 2.5 Reclaim | 169 | 2.5 Reclaim |
165 | 170 | ||
@@ -204,6 +209,7 @@ We can alter the memory limit: | |||
204 | 209 | ||
205 | NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, | 210 | NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, |
206 | mega or gigabytes. | 211 | mega or gigabytes. |
212 | NOTE: We can write "-1" to reset the *.limit_in_bytes(unlimited). | ||
207 | 213 | ||
208 | # cat /cgroups/0/memory.limit_in_bytes | 214 | # cat /cgroups/0/memory.limit_in_bytes |
209 | 4194304 | 215 | 4194304 |
diff --git a/Documentation/connector/cn_test.c b/Documentation/connector/cn_test.c index 6977c178729a..f688eba87704 100644 --- a/Documentation/connector/cn_test.c +++ b/Documentation/connector/cn_test.c | |||
@@ -41,6 +41,12 @@ void cn_test_callback(void *data) | |||
41 | msg->seq, msg->ack, msg->len, (char *)msg->data); | 41 | msg->seq, msg->ack, msg->len, (char *)msg->data); |
42 | } | 42 | } |
43 | 43 | ||
44 | /* | ||
45 | * Do not remove this function even if no one is using it as | ||
46 | * this is an example of how to get notifications about new | ||
47 | * connector user registration | ||
48 | */ | ||
49 | #if 0 | ||
44 | static int cn_test_want_notify(void) | 50 | static int cn_test_want_notify(void) |
45 | { | 51 | { |
46 | struct cn_ctl_msg *ctl; | 52 | struct cn_ctl_msg *ctl; |
@@ -117,6 +123,7 @@ nlmsg_failure: | |||
117 | kfree_skb(skb); | 123 | kfree_skb(skb); |
118 | return -EINVAL; | 124 | return -EINVAL; |
119 | } | 125 | } |
126 | #endif | ||
120 | 127 | ||
121 | static u32 cn_test_timer_counter; | 128 | static u32 cn_test_timer_counter; |
122 | static void cn_test_timer_func(unsigned long __data) | 129 | static void cn_test_timer_func(unsigned long __data) |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 7129846a2785..8d07ed31207e 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -6,6 +6,20 @@ be removed from this file. | |||
6 | 6 | ||
7 | --------------------------- | 7 | --------------------------- |
8 | 8 | ||
9 | What: IRQF_SAMPLE_RANDOM | ||
10 | Check: IRQF_SAMPLE_RANDOM | ||
11 | When: July 2009 | ||
12 | |||
13 | Why: Many of IRQF_SAMPLE_RANDOM users are technically bogus as entropy | ||
14 | sources in the kernel's current entropy model. To resolve this, every | ||
15 | input point to the kernel's entropy pool needs to better document the | ||
16 | type of entropy source it actually is. This will be replaced with | ||
17 | additional add_*_randomness functions in drivers/char/random.c | ||
18 | |||
19 | Who: Robin Getz <rgetz@blackfin.uclinux.org> & Matt Mackall <mpm@selenic.com> | ||
20 | |||
21 | --------------------------- | ||
22 | |||
9 | What: The ieee80211_regdom module parameter | 23 | What: The ieee80211_regdom module parameter |
10 | When: March 2010 / desktop catchup | 24 | When: March 2010 / desktop catchup |
11 | 25 | ||
diff --git a/Documentation/filesystems/ext2.txt b/Documentation/filesystems/ext2.txt index e055acb6b2d4..67639f905f10 100644 --- a/Documentation/filesystems/ext2.txt +++ b/Documentation/filesystems/ext2.txt | |||
@@ -322,7 +322,7 @@ an upper limit on the block size imposed by the page size of the kernel, | |||
322 | so 8kB blocks are only allowed on Alpha systems (and other architectures | 322 | so 8kB blocks are only allowed on Alpha systems (and other architectures |
323 | which support larger pages). | 323 | which support larger pages). |
324 | 324 | ||
325 | There is an upper limit of 32768 subdirectories in a single directory. | 325 | There is an upper limit of 32000 subdirectories in a single directory. |
326 | 326 | ||
327 | There is a "soft" upper limit of about 10-15k files in a single directory | 327 | There is a "soft" upper limit of about 10-15k files in a single directory |
328 | with the current linear linked-list directory implementation. This limit | 328 | with the current linear linked-list directory implementation. This limit |
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt index 608fdba97b72..7be02ac5fa36 100644 --- a/Documentation/filesystems/ext4.txt +++ b/Documentation/filesystems/ext4.txt | |||
@@ -235,6 +235,10 @@ minixdf Make 'df' act like Minix. | |||
235 | 235 | ||
236 | debug Extra debugging information is sent to syslog. | 236 | debug Extra debugging information is sent to syslog. |
237 | 237 | ||
238 | abort Simulate the effects of calling ext4_abort() for | ||
239 | debugging purposes. This is normally used while | ||
240 | remounting a filesystem which is already mounted. | ||
241 | |||
238 | errors=remount-ro Remount the filesystem read-only on an error. | 242 | errors=remount-ro Remount the filesystem read-only on an error. |
239 | errors=continue Keep going on a filesystem error. | 243 | errors=continue Keep going on a filesystem error. |
240 | errors=panic Panic and halt the machine if an error occurs. | 244 | errors=panic Panic and halt the machine if an error occurs. |
diff --git a/Documentation/filesystems/isofs.txt b/Documentation/filesystems/isofs.txt index 6973b980ca2a..3c367c3b3608 100644 --- a/Documentation/filesystems/isofs.txt +++ b/Documentation/filesystems/isofs.txt | |||
@@ -23,8 +23,13 @@ Mount options unique to the isofs filesystem. | |||
23 | map=off Do not map non-Rock Ridge filenames to lower case | 23 | map=off Do not map non-Rock Ridge filenames to lower case |
24 | map=normal Map non-Rock Ridge filenames to lower case | 24 | map=normal Map non-Rock Ridge filenames to lower case |
25 | map=acorn As map=normal but also apply Acorn extensions if present | 25 | map=acorn As map=normal but also apply Acorn extensions if present |
26 | mode=xxx Sets the permissions on files to xxx | 26 | mode=xxx Sets the permissions on files to xxx unless Rock Ridge |
27 | dmode=xxx Sets the permissions on directories to xxx | 27 | extensions set the permissions otherwise |
28 | dmode=xxx Sets the permissions on directories to xxx unless Rock Ridge | ||
29 | extensions set the permissions otherwise | ||
30 | overriderockperm Set permissions on files and directories according to | ||
31 | 'mode' and 'dmode' even though Rock Ridge extensions are | ||
32 | present. | ||
28 | nojoliet Ignore Joliet extensions if they are present. | 33 | nojoliet Ignore Joliet extensions if they are present. |
29 | norock Ignore Rock Ridge extensions if they are present. | 34 | norock Ignore Rock Ridge extensions if they are present. |
30 | hide Completely strip hidden files from the file system. | 35 | hide Completely strip hidden files from the file system. |
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index ebff3c10a07f..fad18f9456e4 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -5,11 +5,12 @@ | |||
5 | Bodo Bauer <bb@ricochet.net> | 5 | Bodo Bauer <bb@ricochet.net> |
6 | 6 | ||
7 | 2.4.x update Jorge Nerin <comandante@zaralinux.com> November 14 2000 | 7 | 2.4.x update Jorge Nerin <comandante@zaralinux.com> November 14 2000 |
8 | move /proc/sys Shen Feng <shen@cn.fujitsu.com> April 1 2009 | 8 | move /proc/sys Shen Feng <shen@cn.fujitsu.com> April 1 2009 |
9 | ------------------------------------------------------------------------------ | 9 | ------------------------------------------------------------------------------ |
10 | Version 1.3 Kernel version 2.2.12 | 10 | Version 1.3 Kernel version 2.2.12 |
11 | Kernel version 2.4.0-test11-pre4 | 11 | Kernel version 2.4.0-test11-pre4 |
12 | ------------------------------------------------------------------------------ | 12 | ------------------------------------------------------------------------------ |
13 | fixes/update part 1.1 Stefani Seibold <stefani@seibold.net> June 9 2009 | ||
13 | 14 | ||
14 | Table of Contents | 15 | Table of Contents |
15 | ----------------- | 16 | ----------------- |
@@ -116,7 +117,7 @@ The link self points to the process reading the file system. Each process | |||
116 | subdirectory has the entries listed in Table 1-1. | 117 | subdirectory has the entries listed in Table 1-1. |
117 | 118 | ||
118 | 119 | ||
119 | Table 1-1: Process specific entries in /proc | 120 | Table 1-1: Process specific entries in /proc |
120 | .............................................................................. | 121 | .............................................................................. |
121 | File Content | 122 | File Content |
122 | clear_refs Clears page referenced bits shown in smaps output | 123 | clear_refs Clears page referenced bits shown in smaps output |
@@ -134,46 +135,103 @@ Table 1-1: Process specific entries in /proc | |||
134 | status Process status in human readable form | 135 | status Process status in human readable form |
135 | wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan | 136 | wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan |
136 | stack Report full stack trace, enable via CONFIG_STACKTRACE | 137 | stack Report full stack trace, enable via CONFIG_STACKTRACE |
137 | smaps Extension based on maps, the rss size for each mapped file | 138 | smaps a extension based on maps, showing the memory consumption of |
139 | each mapping | ||
138 | .............................................................................. | 140 | .............................................................................. |
139 | 141 | ||
140 | For example, to get the status information of a process, all you have to do is | 142 | For example, to get the status information of a process, all you have to do is |
141 | read the file /proc/PID/status: | 143 | read the file /proc/PID/status: |
142 | 144 | ||
143 | >cat /proc/self/status | 145 | >cat /proc/self/status |
144 | Name: cat | 146 | Name: cat |
145 | State: R (running) | 147 | State: R (running) |
146 | Pid: 5452 | 148 | Tgid: 5452 |
147 | PPid: 743 | 149 | Pid: 5452 |
150 | PPid: 743 | ||
148 | TracerPid: 0 (2.4) | 151 | TracerPid: 0 (2.4) |
149 | Uid: 501 501 501 501 | 152 | Uid: 501 501 501 501 |
150 | Gid: 100 100 100 100 | 153 | Gid: 100 100 100 100 |
151 | Groups: 100 14 16 | 154 | FDSize: 256 |
152 | VmSize: 1112 kB | 155 | Groups: 100 14 16 |
153 | VmLck: 0 kB | 156 | VmPeak: 5004 kB |
154 | VmRSS: 348 kB | 157 | VmSize: 5004 kB |
155 | VmData: 24 kB | 158 | VmLck: 0 kB |
156 | VmStk: 12 kB | 159 | VmHWM: 476 kB |
157 | VmExe: 8 kB | 160 | VmRSS: 476 kB |
158 | VmLib: 1044 kB | 161 | VmData: 156 kB |
159 | SigPnd: 0000000000000000 | 162 | VmStk: 88 kB |
160 | SigBlk: 0000000000000000 | 163 | VmExe: 68 kB |
161 | SigIgn: 0000000000000000 | 164 | VmLib: 1412 kB |
162 | SigCgt: 0000000000000000 | 165 | VmPTE: 20 kb |
163 | CapInh: 00000000fffffeff | 166 | Threads: 1 |
164 | CapPrm: 0000000000000000 | 167 | SigQ: 0/28578 |
165 | CapEff: 0000000000000000 | 168 | SigPnd: 0000000000000000 |
166 | 169 | ShdPnd: 0000000000000000 | |
170 | SigBlk: 0000000000000000 | ||
171 | SigIgn: 0000000000000000 | ||
172 | SigCgt: 0000000000000000 | ||
173 | CapInh: 00000000fffffeff | ||
174 | CapPrm: 0000000000000000 | ||
175 | CapEff: 0000000000000000 | ||
176 | CapBnd: ffffffffffffffff | ||
177 | voluntary_ctxt_switches: 0 | ||
178 | nonvoluntary_ctxt_switches: 1 | ||
167 | 179 | ||
168 | This shows you nearly the same information you would get if you viewed it with | 180 | This shows you nearly the same information you would get if you viewed it with |
169 | the ps command. In fact, ps uses the proc file system to obtain its | 181 | the ps command. In fact, ps uses the proc file system to obtain its |
170 | information. The statm file contains more detailed information about the | 182 | information. But you get a more detailed view of the process by reading the |
171 | process memory usage. Its seven fields are explained in Table 1-2. The stat | 183 | file /proc/PID/status. It fields are described in table 1-2. |
172 | file contains details information about the process itself. Its fields are | 184 | |
173 | explained in Table 1-3. | 185 | The statm file contains more detailed information about the process |
186 | memory usage. Its seven fields are explained in Table 1-3. The stat file | ||
187 | contains details information about the process itself. Its fields are | ||
188 | explained in Table 1-4. | ||
174 | 189 | ||
190 | Table 1-2: Contents of the statm files (as of 2.6.30-rc7) | ||
191 | .............................................................................. | ||
192 | Field Content | ||
193 | Name filename of the executable | ||
194 | State state (R is running, S is sleeping, D is sleeping | ||
195 | in an uninterruptible wait, Z is zombie, | ||
196 | T is traced or stopped) | ||
197 | Tgid thread group ID | ||
198 | Pid process id | ||
199 | PPid process id of the parent process | ||
200 | TracerPid PID of process tracing this process (0 if not) | ||
201 | Uid Real, effective, saved set, and file system UIDs | ||
202 | Gid Real, effective, saved set, and file system GIDs | ||
203 | FDSize number of file descriptor slots currently allocated | ||
204 | Groups supplementary group list | ||
205 | VmPeak peak virtual memory size | ||
206 | VmSize total program size | ||
207 | VmLck locked memory size | ||
208 | VmHWM peak resident set size ("high water mark") | ||
209 | VmRSS size of memory portions | ||
210 | VmData size of data, stack, and text segments | ||
211 | VmStk size of data, stack, and text segments | ||
212 | VmExe size of text segment | ||
213 | VmLib size of shared library code | ||
214 | VmPTE size of page table entries | ||
215 | Threads number of threads | ||
216 | SigQ number of signals queued/max. number for queue | ||
217 | SigPnd bitmap of pending signals for the thread | ||
218 | ShdPnd bitmap of shared pending signals for the process | ||
219 | SigBlk bitmap of blocked signals | ||
220 | SigIgn bitmap of ignored signals | ||
221 | SigCgt bitmap of catched signals | ||
222 | CapInh bitmap of inheritable capabilities | ||
223 | CapPrm bitmap of permitted capabilities | ||
224 | CapEff bitmap of effective capabilities | ||
225 | CapBnd bitmap of capabilities bounding set | ||
226 | Cpus_allowed mask of CPUs on which this process may run | ||
227 | Cpus_allowed_list Same as previous, but in "list format" | ||
228 | Mems_allowed mask of memory nodes allowed to this process | ||
229 | Mems_allowed_list Same as previous, but in "list format" | ||
230 | voluntary_ctxt_switches number of voluntary context switches | ||
231 | nonvoluntary_ctxt_switches number of non voluntary context switches | ||
232 | .............................................................................. | ||
175 | 233 | ||
176 | Table 1-2: Contents of the statm files (as of 2.6.8-rc3) | 234 | Table 1-3: Contents of the statm files (as of 2.6.8-rc3) |
177 | .............................................................................. | 235 | .............................................................................. |
178 | Field Content | 236 | Field Content |
179 | size total program size (pages) (same as VmSize in status) | 237 | size total program size (pages) (same as VmSize in status) |
@@ -188,7 +246,7 @@ Table 1-2: Contents of the statm files (as of 2.6.8-rc3) | |||
188 | .............................................................................. | 246 | .............................................................................. |
189 | 247 | ||
190 | 248 | ||
191 | Table 1-3: Contents of the stat files (as of 2.6.22-rc3) | 249 | Table 1-4: Contents of the stat files (as of 2.6.30-rc7) |
192 | .............................................................................. | 250 | .............................................................................. |
193 | Field Content | 251 | Field Content |
194 | pid process id | 252 | pid process id |
@@ -222,10 +280,10 @@ Table 1-3: Contents of the stat files (as of 2.6.22-rc3) | |||
222 | start_stack address of the start of the stack | 280 | start_stack address of the start of the stack |
223 | esp current value of ESP | 281 | esp current value of ESP |
224 | eip current value of EIP | 282 | eip current value of EIP |
225 | pending bitmap of pending signals (obsolete) | 283 | pending bitmap of pending signals |
226 | blocked bitmap of blocked signals (obsolete) | 284 | blocked bitmap of blocked signals |
227 | sigign bitmap of ignored signals (obsolete) | 285 | sigign bitmap of ignored signals |
228 | sigcatch bitmap of catched signals (obsolete) | 286 | sigcatch bitmap of catched signals |
229 | wchan address where process went to sleep | 287 | wchan address where process went to sleep |
230 | 0 (place holder) | 288 | 0 (place holder) |
231 | 0 (place holder) | 289 | 0 (place holder) |
@@ -234,19 +292,99 @@ Table 1-3: Contents of the stat files (as of 2.6.22-rc3) | |||
234 | rt_priority realtime priority | 292 | rt_priority realtime priority |
235 | policy scheduling policy (man sched_setscheduler) | 293 | policy scheduling policy (man sched_setscheduler) |
236 | blkio_ticks time spent waiting for block IO | 294 | blkio_ticks time spent waiting for block IO |
295 | gtime guest time of the task in jiffies | ||
296 | cgtime guest time of the task children in jiffies | ||
237 | .............................................................................. | 297 | .............................................................................. |
238 | 298 | ||
299 | The /proc/PID/map file containing the currently mapped memory regions and | ||
300 | their access permissions. | ||
301 | |||
302 | The format is: | ||
303 | |||
304 | address perms offset dev inode pathname | ||
305 | |||
306 | 08048000-08049000 r-xp 00000000 03:00 8312 /opt/test | ||
307 | 08049000-0804a000 rw-p 00001000 03:00 8312 /opt/test | ||
308 | 0804a000-0806b000 rw-p 00000000 00:00 0 [heap] | ||
309 | a7cb1000-a7cb2000 ---p 00000000 00:00 0 | ||
310 | a7cb2000-a7eb2000 rw-p 00000000 00:00 0 | ||
311 | a7eb2000-a7eb3000 ---p 00000000 00:00 0 | ||
312 | a7eb3000-a7ed5000 rw-p 00000000 00:00 0 | ||
313 | a7ed5000-a8008000 r-xp 00000000 03:00 4222 /lib/libc.so.6 | ||
314 | a8008000-a800a000 r--p 00133000 03:00 4222 /lib/libc.so.6 | ||
315 | a800a000-a800b000 rw-p 00135000 03:00 4222 /lib/libc.so.6 | ||
316 | a800b000-a800e000 rw-p 00000000 00:00 0 | ||
317 | a800e000-a8022000 r-xp 00000000 03:00 14462 /lib/libpthread.so.0 | ||
318 | a8022000-a8023000 r--p 00013000 03:00 14462 /lib/libpthread.so.0 | ||
319 | a8023000-a8024000 rw-p 00014000 03:00 14462 /lib/libpthread.so.0 | ||
320 | a8024000-a8027000 rw-p 00000000 00:00 0 | ||
321 | a8027000-a8043000 r-xp 00000000 03:00 8317 /lib/ld-linux.so.2 | ||
322 | a8043000-a8044000 r--p 0001b000 03:00 8317 /lib/ld-linux.so.2 | ||
323 | a8044000-a8045000 rw-p 0001c000 03:00 8317 /lib/ld-linux.so.2 | ||
324 | aff35000-aff4a000 rw-p 00000000 00:00 0 [stack] | ||
325 | ffffe000-fffff000 r-xp 00000000 00:00 0 [vdso] | ||
326 | |||
327 | where "address" is the address space in the process that it occupies, "perms" | ||
328 | is a set of permissions: | ||
329 | |||
330 | r = read | ||
331 | w = write | ||
332 | x = execute | ||
333 | s = shared | ||
334 | p = private (copy on write) | ||
335 | |||
336 | "offset" is the offset into the mapping, "dev" is the device (major:minor), and | ||
337 | "inode" is the inode on that device. 0 indicates that no inode is associated | ||
338 | with the memory region, as the case would be with BSS (uninitialized data). | ||
339 | The "pathname" shows the name associated file for this mapping. If the mapping | ||
340 | is not associated with a file: | ||
341 | |||
342 | [heap] = the heap of the program | ||
343 | [stack] = the stack of the main process | ||
344 | [vdso] = the "virtual dynamic shared object", | ||
345 | the kernel system call handler | ||
346 | |||
347 | or if empty, the mapping is anonymous. | ||
348 | |||
349 | |||
350 | The /proc/PID/smaps is an extension based on maps, showing the memory | ||
351 | consumption for each of the process's mappings. For each of mappings there | ||
352 | is a series of lines such as the following: | ||
353 | |||
354 | 08048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash | ||
355 | Size: 1084 kB | ||
356 | Rss: 892 kB | ||
357 | Pss: 374 kB | ||
358 | Shared_Clean: 892 kB | ||
359 | Shared_Dirty: 0 kB | ||
360 | Private_Clean: 0 kB | ||
361 | Private_Dirty: 0 kB | ||
362 | Referenced: 892 kB | ||
363 | Swap: 0 kB | ||
364 | KernelPageSize: 4 kB | ||
365 | MMUPageSize: 4 kB | ||
366 | |||
367 | The first of these lines shows the same information as is displayed for the | ||
368 | mapping in /proc/PID/maps. The remaining lines show the size of the mapping, | ||
369 | the amount of the mapping that is currently resident in RAM, the "proportional | ||
370 | set size” (divide each shared page by the number of processes sharing it), the | ||
371 | number of clean and dirty shared pages in the mapping, and the number of clean | ||
372 | and dirty private pages in the mapping. The "Referenced" indicates the amount | ||
373 | of memory currently marked as referenced or accessed. | ||
374 | |||
375 | This file is only present if the CONFIG_MMU kernel configuration option is | ||
376 | enabled. | ||
239 | 377 | ||
240 | 1.2 Kernel data | 378 | 1.2 Kernel data |
241 | --------------- | 379 | --------------- |
242 | 380 | ||
243 | Similar to the process entries, the kernel data files give information about | 381 | Similar to the process entries, the kernel data files give information about |
244 | the running kernel. The files used to obtain this information are contained in | 382 | the running kernel. The files used to obtain this information are contained in |
245 | /proc and are listed in Table 1-4. Not all of these will be present in your | 383 | /proc and are listed in Table 1-5. Not all of these will be present in your |
246 | system. It depends on the kernel configuration and the loaded modules, which | 384 | system. It depends on the kernel configuration and the loaded modules, which |
247 | files are there, and which are missing. | 385 | files are there, and which are missing. |
248 | 386 | ||
249 | Table 1-4: Kernel info in /proc | 387 | Table 1-5: Kernel info in /proc |
250 | .............................................................................. | 388 | .............................................................................. |
251 | File Content | 389 | File Content |
252 | apm Advanced power management info | 390 | apm Advanced power management info |
@@ -283,6 +421,7 @@ Table 1-4: Kernel info in /proc | |||
283 | rtc Real time clock | 421 | rtc Real time clock |
284 | scsi SCSI info (see text) | 422 | scsi SCSI info (see text) |
285 | slabinfo Slab pool info | 423 | slabinfo Slab pool info |
424 | softirqs softirq usage | ||
286 | stat Overall statistics | 425 | stat Overall statistics |
287 | swaps Swap space utilization | 426 | swaps Swap space utilization |
288 | sys See chapter 2 | 427 | sys See chapter 2 |
@@ -597,6 +736,25 @@ on the kind of area : | |||
597 | 0xffffffffa0017000-0xffffffffa0022000 45056 sys_init_module+0xc27/0x1d00 ... | 736 | 0xffffffffa0017000-0xffffffffa0022000 45056 sys_init_module+0xc27/0x1d00 ... |
598 | pages=10 vmalloc N0=10 | 737 | pages=10 vmalloc N0=10 |
599 | 738 | ||
739 | .............................................................................. | ||
740 | |||
741 | softirqs: | ||
742 | |||
743 | Provides counts of softirq handlers serviced since boot time, for each cpu. | ||
744 | |||
745 | > cat /proc/softirqs | ||
746 | CPU0 CPU1 CPU2 CPU3 | ||
747 | HI: 0 0 0 0 | ||
748 | TIMER: 27166 27120 27097 27034 | ||
749 | NET_TX: 0 0 0 17 | ||
750 | NET_RX: 42 0 0 39 | ||
751 | BLOCK: 0 0 107 1121 | ||
752 | TASKLET: 0 0 0 290 | ||
753 | SCHED: 27035 26983 26971 26746 | ||
754 | HRTIMER: 0 0 0 0 | ||
755 | RCU: 1678 1769 2178 2250 | ||
756 | |||
757 | |||
600 | 1.3 IDE devices in /proc/ide | 758 | 1.3 IDE devices in /proc/ide |
601 | ---------------------------- | 759 | ---------------------------- |
602 | 760 | ||
@@ -614,10 +772,10 @@ IDE devices: | |||
614 | 772 | ||
615 | More detailed information can be found in the controller specific | 773 | More detailed information can be found in the controller specific |
616 | subdirectories. These are named ide0, ide1 and so on. Each of these | 774 | subdirectories. These are named ide0, ide1 and so on. Each of these |
617 | directories contains the files shown in table 1-5. | 775 | directories contains the files shown in table 1-6. |
618 | 776 | ||
619 | 777 | ||
620 | Table 1-5: IDE controller info in /proc/ide/ide? | 778 | Table 1-6: IDE controller info in /proc/ide/ide? |
621 | .............................................................................. | 779 | .............................................................................. |
622 | File Content | 780 | File Content |
623 | channel IDE channel (0 or 1) | 781 | channel IDE channel (0 or 1) |
@@ -627,11 +785,11 @@ Table 1-5: IDE controller info in /proc/ide/ide? | |||
627 | .............................................................................. | 785 | .............................................................................. |
628 | 786 | ||
629 | Each device connected to a controller has a separate subdirectory in the | 787 | Each device connected to a controller has a separate subdirectory in the |
630 | controllers directory. The files listed in table 1-6 are contained in these | 788 | controllers directory. The files listed in table 1-7 are contained in these |
631 | directories. | 789 | directories. |
632 | 790 | ||
633 | 791 | ||
634 | Table 1-6: IDE device information | 792 | Table 1-7: IDE device information |
635 | .............................................................................. | 793 | .............................................................................. |
636 | File Content | 794 | File Content |
637 | cache The cache | 795 | cache The cache |
@@ -673,12 +831,12 @@ the drive parameters: | |||
673 | 1.4 Networking info in /proc/net | 831 | 1.4 Networking info in /proc/net |
674 | -------------------------------- | 832 | -------------------------------- |
675 | 833 | ||
676 | The subdirectory /proc/net follows the usual pattern. Table 1-6 shows the | 834 | The subdirectory /proc/net follows the usual pattern. Table 1-8 shows the |
677 | additional values you get for IP version 6 if you configure the kernel to | 835 | additional values you get for IP version 6 if you configure the kernel to |
678 | support this. Table 1-7 lists the files and their meaning. | 836 | support this. Table 1-9 lists the files and their meaning. |
679 | 837 | ||
680 | 838 | ||
681 | Table 1-6: IPv6 info in /proc/net | 839 | Table 1-8: IPv6 info in /proc/net |
682 | .............................................................................. | 840 | .............................................................................. |
683 | File Content | 841 | File Content |
684 | udp6 UDP sockets (IPv6) | 842 | udp6 UDP sockets (IPv6) |
@@ -693,7 +851,7 @@ Table 1-6: IPv6 info in /proc/net | |||
693 | .............................................................................. | 851 | .............................................................................. |
694 | 852 | ||
695 | 853 | ||
696 | Table 1-7: Network info in /proc/net | 854 | Table 1-9: Network info in /proc/net |
697 | .............................................................................. | 855 | .............................................................................. |
698 | File Content | 856 | File Content |
699 | arp Kernel ARP table | 857 | arp Kernel ARP table |
@@ -817,10 +975,10 @@ The directory /proc/parport contains information about the parallel ports of | |||
817 | your system. It has one subdirectory for each port, named after the port | 975 | your system. It has one subdirectory for each port, named after the port |
818 | number (0,1,2,...). | 976 | number (0,1,2,...). |
819 | 977 | ||
820 | These directories contain the four files shown in Table 1-8. | 978 | These directories contain the four files shown in Table 1-10. |
821 | 979 | ||
822 | 980 | ||
823 | Table 1-8: Files in /proc/parport | 981 | Table 1-10: Files in /proc/parport |
824 | .............................................................................. | 982 | .............................................................................. |
825 | File Content | 983 | File Content |
826 | autoprobe Any IEEE-1284 device ID information that has been acquired. | 984 | autoprobe Any IEEE-1284 device ID information that has been acquired. |
@@ -838,10 +996,10 @@ Table 1-8: Files in /proc/parport | |||
838 | 996 | ||
839 | Information about the available and actually used tty's can be found in the | 997 | Information about the available and actually used tty's can be found in the |
840 | directory /proc/tty.You'll find entries for drivers and line disciplines in | 998 | directory /proc/tty.You'll find entries for drivers and line disciplines in |
841 | this directory, as shown in Table 1-9. | 999 | this directory, as shown in Table 1-11. |
842 | 1000 | ||
843 | 1001 | ||
844 | Table 1-9: Files in /proc/tty | 1002 | Table 1-11: Files in /proc/tty |
845 | .............................................................................. | 1003 | .............................................................................. |
846 | File Content | 1004 | File Content |
847 | drivers list of drivers and their usage | 1005 | drivers list of drivers and their usage |
@@ -883,6 +1041,7 @@ since the system first booted. For a quick look, simply cat the file: | |||
883 | processes 2915 | 1041 | processes 2915 |
884 | procs_running 1 | 1042 | procs_running 1 |
885 | procs_blocked 0 | 1043 | procs_blocked 0 |
1044 | softirq 183433 0 21755 12 39 1137 231 21459 2263 | ||
886 | 1045 | ||
887 | The very first "cpu" line aggregates the numbers in all of the other "cpuN" | 1046 | The very first "cpu" line aggregates the numbers in all of the other "cpuN" |
888 | lines. These numbers identify the amount of time the CPU has spent performing | 1047 | lines. These numbers identify the amount of time the CPU has spent performing |
@@ -918,6 +1077,11 @@ CPUs. | |||
918 | The "procs_blocked" line gives the number of processes currently blocked, | 1077 | The "procs_blocked" line gives the number of processes currently blocked, |
919 | waiting for I/O to complete. | 1078 | waiting for I/O to complete. |
920 | 1079 | ||
1080 | The "softirq" line gives counts of softirqs serviced since boot time, for each | ||
1081 | of the possible system softirqs. The first column is the total of all | ||
1082 | softirqs serviced; each subsequent column is the total for that particular | ||
1083 | softirq. | ||
1084 | |||
921 | 1085 | ||
922 | 1.9 Ext4 file system parameters | 1086 | 1.9 Ext4 file system parameters |
923 | ------------------------------ | 1087 | ------------------------------ |
@@ -926,9 +1090,9 @@ Information about mounted ext4 file systems can be found in | |||
926 | /proc/fs/ext4. Each mounted filesystem will have a directory in | 1090 | /proc/fs/ext4. Each mounted filesystem will have a directory in |
927 | /proc/fs/ext4 based on its device name (i.e., /proc/fs/ext4/hdc or | 1091 | /proc/fs/ext4 based on its device name (i.e., /proc/fs/ext4/hdc or |
928 | /proc/fs/ext4/dm-0). The files in each per-device directory are shown | 1092 | /proc/fs/ext4/dm-0). The files in each per-device directory are shown |
929 | in Table 1-10, below. | 1093 | in Table 1-12, below. |
930 | 1094 | ||
931 | Table 1-10: Files in /proc/fs/ext4/<devname> | 1095 | Table 1-12: Files in /proc/fs/ext4/<devname> |
932 | .............................................................................. | 1096 | .............................................................................. |
933 | File Content | 1097 | File Content |
934 | mb_groups details of multiblock allocator buddy cache of free blocks | 1098 | mb_groups details of multiblock allocator buddy cache of free blocks |
diff --git a/Documentation/gcov.txt b/Documentation/gcov.txt new file mode 100644 index 000000000000..e716aadb3a33 --- /dev/null +++ b/Documentation/gcov.txt | |||
@@ -0,0 +1,246 @@ | |||
1 | Using gcov with the Linux kernel | ||
2 | ================================ | ||
3 | |||
4 | 1. Introduction | ||
5 | 2. Preparation | ||
6 | 3. Customization | ||
7 | 4. Files | ||
8 | 5. Modules | ||
9 | 6. Separated build and test machines | ||
10 | 7. Troubleshooting | ||
11 | Appendix A: sample script: gather_on_build.sh | ||
12 | Appendix B: sample script: gather_on_test.sh | ||
13 | |||
14 | |||
15 | 1. Introduction | ||
16 | =============== | ||
17 | |||
18 | gcov profiling kernel support enables the use of GCC's coverage testing | ||
19 | tool gcov [1] with the Linux kernel. Coverage data of a running kernel | ||
20 | is exported in gcov-compatible format via the "gcov" debugfs directory. | ||
21 | To get coverage data for a specific file, change to the kernel build | ||
22 | directory and use gcov with the -o option as follows (requires root): | ||
23 | |||
24 | # cd /tmp/linux-out | ||
25 | # gcov -o /sys/kernel/debug/gcov/tmp/linux-out/kernel spinlock.c | ||
26 | |||
27 | This will create source code files annotated with execution counts | ||
28 | in the current directory. In addition, graphical gcov front-ends such | ||
29 | as lcov [2] can be used to automate the process of collecting data | ||
30 | for the entire kernel and provide coverage overviews in HTML format. | ||
31 | |||
32 | Possible uses: | ||
33 | |||
34 | * debugging (has this line been reached at all?) | ||
35 | * test improvement (how do I change my test to cover these lines?) | ||
36 | * minimizing kernel configurations (do I need this option if the | ||
37 | associated code is never run?) | ||
38 | |||
39 | -- | ||
40 | |||
41 | [1] http://gcc.gnu.org/onlinedocs/gcc/Gcov.html | ||
42 | [2] http://ltp.sourceforge.net/coverage/lcov.php | ||
43 | |||
44 | |||
45 | 2. Preparation | ||
46 | ============== | ||
47 | |||
48 | Configure the kernel with: | ||
49 | |||
50 | CONFIG_DEBUGFS=y | ||
51 | CONFIG_GCOV_KERNEL=y | ||
52 | |||
53 | and to get coverage data for the entire kernel: | ||
54 | |||
55 | CONFIG_GCOV_PROFILE_ALL=y | ||
56 | |||
57 | Note that kernels compiled with profiling flags will be significantly | ||
58 | larger and run slower. Also CONFIG_GCOV_PROFILE_ALL may not be supported | ||
59 | on all architectures. | ||
60 | |||
61 | Profiling data will only become accessible once debugfs has been | ||
62 | mounted: | ||
63 | |||
64 | mount -t debugfs none /sys/kernel/debug | ||
65 | |||
66 | |||
67 | 3. Customization | ||
68 | ================ | ||
69 | |||
70 | To enable profiling for specific files or directories, add a line | ||
71 | similar to the following to the respective kernel Makefile: | ||
72 | |||
73 | For a single file (e.g. main.o): | ||
74 | GCOV_PROFILE_main.o := y | ||
75 | |||
76 | For all files in one directory: | ||
77 | GCOV_PROFILE := y | ||
78 | |||
79 | To exclude files from being profiled even when CONFIG_GCOV_PROFILE_ALL | ||
80 | is specified, use: | ||
81 | |||
82 | GCOV_PROFILE_main.o := n | ||
83 | and: | ||
84 | GCOV_PROFILE := n | ||
85 | |||
86 | Only files which are linked to the main kernel image or are compiled as | ||
87 | kernel modules are supported by this mechanism. | ||
88 | |||
89 | |||
90 | 4. Files | ||
91 | ======== | ||
92 | |||
93 | The gcov kernel support creates the following files in debugfs: | ||
94 | |||
95 | /sys/kernel/debug/gcov | ||
96 | Parent directory for all gcov-related files. | ||
97 | |||
98 | /sys/kernel/debug/gcov/reset | ||
99 | Global reset file: resets all coverage data to zero when | ||
100 | written to. | ||
101 | |||
102 | /sys/kernel/debug/gcov/path/to/compile/dir/file.gcda | ||
103 | The actual gcov data file as understood by the gcov | ||
104 | tool. Resets file coverage data to zero when written to. | ||
105 | |||
106 | /sys/kernel/debug/gcov/path/to/compile/dir/file.gcno | ||
107 | Symbolic link to a static data file required by the gcov | ||
108 | tool. This file is generated by gcc when compiling with | ||
109 | option -ftest-coverage. | ||
110 | |||
111 | |||
112 | 5. Modules | ||
113 | ========== | ||
114 | |||
115 | Kernel modules may contain cleanup code which is only run during | ||
116 | module unload time. The gcov mechanism provides a means to collect | ||
117 | coverage data for such code by keeping a copy of the data associated | ||
118 | with the unloaded module. This data remains available through debugfs. | ||
119 | Once the module is loaded again, the associated coverage counters are | ||
120 | initialized with the data from its previous instantiation. | ||
121 | |||
122 | This behavior can be deactivated by specifying the gcov_persist kernel | ||
123 | parameter: | ||
124 | |||
125 | gcov_persist=0 | ||
126 | |||
127 | At run-time, a user can also choose to discard data for an unloaded | ||
128 | module by writing to its data file or the global reset file. | ||
129 | |||
130 | |||
131 | 6. Separated build and test machines | ||
132 | ==================================== | ||
133 | |||
134 | The gcov kernel profiling infrastructure is designed to work out-of-the | ||
135 | box for setups where kernels are built and run on the same machine. In | ||
136 | cases where the kernel runs on a separate machine, special preparations | ||
137 | must be made, depending on where the gcov tool is used: | ||
138 | |||
139 | a) gcov is run on the TEST machine | ||
140 | |||
141 | The gcov tool version on the test machine must be compatible with the | ||
142 | gcc version used for kernel build. Also the following files need to be | ||
143 | copied from build to test machine: | ||
144 | |||
145 | from the source tree: | ||
146 | - all C source files + headers | ||
147 | |||
148 | from the build tree: | ||
149 | - all C source files + headers | ||
150 | - all .gcda and .gcno files | ||
151 | - all links to directories | ||
152 | |||
153 | It is important to note that these files need to be placed into the | ||
154 | exact same file system location on the test machine as on the build | ||
155 | machine. If any of the path components is symbolic link, the actual | ||
156 | directory needs to be used instead (due to make's CURDIR handling). | ||
157 | |||
158 | b) gcov is run on the BUILD machine | ||
159 | |||
160 | The following files need to be copied after each test case from test | ||
161 | to build machine: | ||
162 | |||
163 | from the gcov directory in sysfs: | ||
164 | - all .gcda files | ||
165 | - all links to .gcno files | ||
166 | |||
167 | These files can be copied to any location on the build machine. gcov | ||
168 | must then be called with the -o option pointing to that directory. | ||
169 | |||
170 | Example directory setup on the build machine: | ||
171 | |||
172 | /tmp/linux: kernel source tree | ||
173 | /tmp/out: kernel build directory as specified by make O= | ||
174 | /tmp/coverage: location of the files copied from the test machine | ||
175 | |||
176 | [user@build] cd /tmp/out | ||
177 | [user@build] gcov -o /tmp/coverage/tmp/out/init main.c | ||
178 | |||
179 | |||
180 | 7. Troubleshooting | ||
181 | ================== | ||
182 | |||
183 | Problem: Compilation aborts during linker step. | ||
184 | Cause: Profiling flags are specified for source files which are not | ||
185 | linked to the main kernel or which are linked by a custom | ||
186 | linker procedure. | ||
187 | Solution: Exclude affected source files from profiling by specifying | ||
188 | GCOV_PROFILE := n or GCOV_PROFILE_basename.o := n in the | ||
189 | corresponding Makefile. | ||
190 | |||
191 | |||
192 | Appendix A: gather_on_build.sh | ||
193 | ============================== | ||
194 | |||
195 | Sample script to gather coverage meta files on the build machine | ||
196 | (see 6a): | ||
197 | |||
198 | #!/bin/bash | ||
199 | |||
200 | KSRC=$1 | ||
201 | KOBJ=$2 | ||
202 | DEST=$3 | ||
203 | |||
204 | if [ -z "$KSRC" ] || [ -z "$KOBJ" ] || [ -z "$DEST" ]; then | ||
205 | echo "Usage: $0 <ksrc directory> <kobj directory> <output.tar.gz>" >&2 | ||
206 | exit 1 | ||
207 | fi | ||
208 | |||
209 | KSRC=$(cd $KSRC; printf "all:\n\t@echo \${CURDIR}\n" | make -f -) | ||
210 | KOBJ=$(cd $KOBJ; printf "all:\n\t@echo \${CURDIR}\n" | make -f -) | ||
211 | |||
212 | find $KSRC $KOBJ \( -name '*.gcno' -o -name '*.[ch]' -o -type l \) -a \ | ||
213 | -perm /u+r,g+r | tar cfz $DEST -P -T - | ||
214 | |||
215 | if [ $? -eq 0 ] ; then | ||
216 | echo "$DEST successfully created, copy to test system and unpack with:" | ||
217 | echo " tar xfz $DEST -P" | ||
218 | else | ||
219 | echo "Could not create file $DEST" | ||
220 | fi | ||
221 | |||
222 | |||
223 | Appendix B: gather_on_test.sh | ||
224 | ============================= | ||
225 | |||
226 | Sample script to gather coverage data files on the test machine | ||
227 | (see 6b): | ||
228 | |||
229 | #!/bin/bash | ||
230 | |||
231 | DEST=$1 | ||
232 | GCDA=/sys/kernel/debug/gcov | ||
233 | |||
234 | if [ -z "$DEST" ] ; then | ||
235 | echo "Usage: $0 <output.tar.gz>" >&2 | ||
236 | exit 1 | ||
237 | fi | ||
238 | |||
239 | find $GCDA -name '*.gcno' -o -name '*.gcda' | tar cfz $DEST -T - | ||
240 | |||
241 | if [ $? -eq 0 ] ; then | ||
242 | echo "$DEST successfully created, copy to build system and unpack with:" | ||
243 | echo " tar xfz $DEST" | ||
244 | else | ||
245 | echo "Could not create file $DEST" | ||
246 | fi | ||
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt index 1f779a25c703..7bb0d934b6d8 100644 --- a/Documentation/ioctl/ioctl-number.txt +++ b/Documentation/ioctl/ioctl-number.txt | |||
@@ -149,6 +149,8 @@ Code Seq# Include File Comments | |||
149 | 'p' 40-7F linux/nvram.h | 149 | 'p' 40-7F linux/nvram.h |
150 | 'p' 80-9F user-space parport | 150 | 'p' 80-9F user-space parport |
151 | <mailto:tim@cyberelk.net> | 151 | <mailto:tim@cyberelk.net> |
152 | 'p' a1-a4 linux/pps.h LinuxPPS | ||
153 | <mailto:giometti@linux.it> | ||
152 | 'q' 00-1F linux/serio.h | 154 | 'q' 00-1F linux/serio.h |
153 | 'q' 80-FF Internet PhoneJACK, Internet LineJACK | 155 | 'q' 80-FF Internet PhoneJACK, Internet LineJACK |
154 | <http://www.quicknet.net> | 156 | <http://www.quicknet.net> |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 5578248c18a4..08def8deb5f5 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -48,6 +48,7 @@ parameter is applicable: | |||
48 | EFI EFI Partitioning (GPT) is enabled | 48 | EFI EFI Partitioning (GPT) is enabled |
49 | EIDE EIDE/ATAPI support is enabled. | 49 | EIDE EIDE/ATAPI support is enabled. |
50 | FB The frame buffer device is enabled. | 50 | FB The frame buffer device is enabled. |
51 | GCOV GCOV profiling is enabled. | ||
51 | HW Appropriate hardware is enabled. | 52 | HW Appropriate hardware is enabled. |
52 | IA-64 IA-64 architecture is enabled. | 53 | IA-64 IA-64 architecture is enabled. |
53 | IMA Integrity measurement architecture is enabled. | 54 | IMA Integrity measurement architecture is enabled. |
@@ -796,6 +797,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
796 | Format: off | on | 797 | Format: off | on |
797 | default: on | 798 | default: on |
798 | 799 | ||
800 | gcov_persist= [GCOV] When non-zero (default), profiling data for | ||
801 | kernel modules is saved and remains accessible via | ||
802 | debugfs, even when the module is unloaded/reloaded. | ||
803 | When zero, profiling data is discarded and associated | ||
804 | debugfs files are removed at module unload time. | ||
805 | |||
799 | gdth= [HW,SCSI] | 806 | gdth= [HW,SCSI] |
800 | See header of drivers/scsi/gdth.c. | 807 | See header of drivers/scsi/gdth.c. |
801 | 808 | ||
diff --git a/Documentation/pps/pps.txt b/Documentation/pps/pps.txt new file mode 100644 index 000000000000..125f4ab48998 --- /dev/null +++ b/Documentation/pps/pps.txt | |||
@@ -0,0 +1,172 @@ | |||
1 | |||
2 | PPS - Pulse Per Second | ||
3 | ---------------------- | ||
4 | |||
5 | (C) Copyright 2007 Rodolfo Giometti <giometti@enneenne.com> | ||
6 | |||
7 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | ||
11 | |||
12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | ||
16 | |||
17 | |||
18 | |||
19 | Overview | ||
20 | -------- | ||
21 | |||
22 | LinuxPPS provides a programming interface (API) to define in the | ||
23 | system several PPS sources. | ||
24 | |||
25 | PPS means "pulse per second" and a PPS source is just a device which | ||
26 | provides a high precision signal each second so that an application | ||
27 | can use it to adjust system clock time. | ||
28 | |||
29 | A PPS source can be connected to a serial port (usually to the Data | ||
30 | Carrier Detect pin) or to a parallel port (ACK-pin) or to a special | ||
31 | CPU's GPIOs (this is the common case in embedded systems) but in each | ||
32 | case when a new pulse arrives the system must apply to it a timestamp | ||
33 | and record it for userland. | ||
34 | |||
35 | Common use is the combination of the NTPD as userland program, with a | ||
36 | GPS receiver as PPS source, to obtain a wallclock-time with | ||
37 | sub-millisecond synchronisation to UTC. | ||
38 | |||
39 | |||
40 | RFC considerations | ||
41 | ------------------ | ||
42 | |||
43 | While implementing a PPS API as RFC 2783 defines and using an embedded | ||
44 | CPU GPIO-Pin as physical link to the signal, I encountered a deeper | ||
45 | problem: | ||
46 | |||
47 | At startup it needs a file descriptor as argument for the function | ||
48 | time_pps_create(). | ||
49 | |||
50 | This implies that the source has a /dev/... entry. This assumption is | ||
51 | ok for the serial and parallel port, where you can do something | ||
52 | useful besides(!) the gathering of timestamps as it is the central | ||
53 | task for a PPS-API. But this assumption does not work for a single | ||
54 | purpose GPIO line. In this case even basic file-related functionality | ||
55 | (like read() and write()) makes no sense at all and should not be a | ||
56 | precondition for the use of a PPS-API. | ||
57 | |||
58 | The problem can be simply solved if you consider that a PPS source is | ||
59 | not always connected with a GPS data source. | ||
60 | |||
61 | So your programs should check if the GPS data source (the serial port | ||
62 | for instance) is a PPS source too, and if not they should provide the | ||
63 | possibility to open another device as PPS source. | ||
64 | |||
65 | In LinuxPPS the PPS sources are simply char devices usually mapped | ||
66 | into files /dev/pps0, /dev/pps1, etc.. | ||
67 | |||
68 | |||
69 | Coding example | ||
70 | -------------- | ||
71 | |||
72 | To register a PPS source into the kernel you should define a struct | ||
73 | pps_source_info_s as follows: | ||
74 | |||
75 | static struct pps_source_info pps_ktimer_info = { | ||
76 | .name = "ktimer", | ||
77 | .path = "", | ||
78 | .mode = PPS_CAPTUREASSERT | PPS_OFFSETASSERT | \ | ||
79 | PPS_ECHOASSERT | \ | ||
80 | PPS_CANWAIT | PPS_TSFMT_TSPEC, | ||
81 | .echo = pps_ktimer_echo, | ||
82 | .owner = THIS_MODULE, | ||
83 | }; | ||
84 | |||
85 | and then calling the function pps_register_source() in your | ||
86 | intialization routine as follows: | ||
87 | |||
88 | source = pps_register_source(&pps_ktimer_info, | ||
89 | PPS_CAPTUREASSERT | PPS_OFFSETASSERT); | ||
90 | |||
91 | The pps_register_source() prototype is: | ||
92 | |||
93 | int pps_register_source(struct pps_source_info_s *info, int default_params) | ||
94 | |||
95 | where "info" is a pointer to a structure that describes a particular | ||
96 | PPS source, "default_params" tells the system what the initial default | ||
97 | parameters for the device should be (it is obvious that these parameters | ||
98 | must be a subset of ones defined in the struct | ||
99 | pps_source_info_s which describe the capabilities of the driver). | ||
100 | |||
101 | Once you have registered a new PPS source into the system you can | ||
102 | signal an assert event (for example in the interrupt handler routine) | ||
103 | just using: | ||
104 | |||
105 | pps_event(source, &ts, PPS_CAPTUREASSERT, ptr) | ||
106 | |||
107 | where "ts" is the event's timestamp. | ||
108 | |||
109 | The same function may also run the defined echo function | ||
110 | (pps_ktimer_echo(), passing to it the "ptr" pointer) if the user | ||
111 | asked for that... etc.. | ||
112 | |||
113 | Please see the file drivers/pps/clients/ktimer.c for example code. | ||
114 | |||
115 | |||
116 | SYSFS support | ||
117 | ------------- | ||
118 | |||
119 | If the SYSFS filesystem is enabled in the kernel it provides a new class: | ||
120 | |||
121 | $ ls /sys/class/pps/ | ||
122 | pps0/ pps1/ pps2/ | ||
123 | |||
124 | Every directory is the ID of a PPS sources defined in the system and | ||
125 | inside you find several files: | ||
126 | |||
127 | $ ls /sys/class/pps/pps0/ | ||
128 | assert clear echo mode name path subsystem@ uevent | ||
129 | |||
130 | Inside each "assert" and "clear" file you can find the timestamp and a | ||
131 | sequence number: | ||
132 | |||
133 | $ cat /sys/class/pps/pps0/assert | ||
134 | 1170026870.983207967#8 | ||
135 | |||
136 | Where before the "#" is the timestamp in seconds; after it is the | ||
137 | sequence number. Other files are: | ||
138 | |||
139 | * echo: reports if the PPS source has an echo function or not; | ||
140 | |||
141 | * mode: reports available PPS functioning modes; | ||
142 | |||
143 | * name: reports the PPS source's name; | ||
144 | |||
145 | * path: reports the PPS source's device path, that is the device the | ||
146 | PPS source is connected to (if it exists). | ||
147 | |||
148 | |||
149 | Testing the PPS support | ||
150 | ----------------------- | ||
151 | |||
152 | In order to test the PPS support even without specific hardware you can use | ||
153 | the ktimer driver (see the client subsection in the PPS configuration menu) | ||
154 | and the userland tools provided into Documentaion/pps/ directory. | ||
155 | |||
156 | Once you have enabled the compilation of ktimer just modprobe it (if | ||
157 | not statically compiled): | ||
158 | |||
159 | # modprobe ktimer | ||
160 | |||
161 | and the run ppstest as follow: | ||
162 | |||
163 | $ ./ppstest /dev/pps0 | ||
164 | trying PPS source "/dev/pps1" | ||
165 | found PPS source "/dev/pps1" | ||
166 | ok, found 1 source(s), now start fetching data... | ||
167 | source 0 - assert 1186592699.388832443, sequence: 364 - clear 0.000000000, sequence: 0 | ||
168 | source 0 - assert 1186592700.388931295, sequence: 365 - clear 0.000000000, sequence: 0 | ||
169 | source 0 - assert 1186592701.389032765, sequence: 366 - clear 0.000000000, sequence: 0 | ||
170 | |||
171 | Please, note that to compile userland programs you need the file timepps.h | ||
172 | (see Documentation/pps/). | ||
diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt index 1b74b5f30af4..c8acd8659e91 100644 --- a/Documentation/rfkill.txt +++ b/Documentation/rfkill.txt | |||
@@ -3,9 +3,8 @@ rfkill - RF kill switch support | |||
3 | 3 | ||
4 | 1. Introduction | 4 | 1. Introduction |
5 | 2. Implementation details | 5 | 2. Implementation details |
6 | 3. Kernel driver guidelines | 6 | 3. Kernel API |
7 | 4. Kernel API | 7 | 4. Userspace support |
8 | 5. Userspace support | ||
9 | 8 | ||
10 | 9 | ||
11 | 1. Introduction | 10 | 1. Introduction |
@@ -19,82 +18,62 @@ disable all transmitters of a certain type (or all). This is intended for | |||
19 | situations where transmitters need to be turned off, for example on | 18 | situations where transmitters need to be turned off, for example on |
20 | aircraft. | 19 | aircraft. |
21 | 20 | ||
21 | The rfkill subsystem has a concept of "hard" and "soft" block, which | ||
22 | differ little in their meaning (block == transmitters off) but rather in | ||
23 | whether they can be changed or not: | ||
24 | - hard block: read-only radio block that cannot be overriden by software | ||
25 | - soft block: writable radio block (need not be readable) that is set by | ||
26 | the system software. | ||
22 | 27 | ||
23 | 28 | ||
24 | 2. Implementation details | 29 | 2. Implementation details |
25 | 30 | ||
26 | The rfkill subsystem is composed of various components: the rfkill class, the | 31 | The rfkill subsystem is composed of three main components: |
27 | rfkill-input module (an input layer handler), and some specific input layer | 32 | * the rfkill core, |
28 | events. | 33 | * the deprecated rfkill-input module (an input layer handler, being |
29 | 34 | replaced by userspace policy code) and | |
30 | The rfkill class is provided for kernel drivers to register their radio | 35 | * the rfkill drivers. |
31 | transmitter with the kernel, provide methods for turning it on and off and, | ||
32 | optionally, letting the system know about hardware-disabled states that may | ||
33 | be implemented on the device. This code is enabled with the CONFIG_RFKILL | ||
34 | Kconfig option, which drivers can "select". | ||
35 | |||
36 | The rfkill class code also notifies userspace of state changes, this is | ||
37 | achieved via uevents. It also provides some sysfs files for userspace to | ||
38 | check the status of radio transmitters. See the "Userspace support" section | ||
39 | below. | ||
40 | 36 | ||
37 | The rfkill core provides API for kernel drivers to register their radio | ||
38 | transmitter with the kernel, methods for turning it on and off and, letting | ||
39 | the system know about hardware-disabled states that may be implemented on | ||
40 | the device. | ||
41 | 41 | ||
42 | The rfkill-input code implements a basic response to rfkill buttons -- it | 42 | The rfkill core code also notifies userspace of state changes, and provides |
43 | implements turning on/off all devices of a certain class (or all). | 43 | ways for userspace to query the current states. See the "Userspace support" |
44 | section below. | ||
44 | 45 | ||
45 | When the device is hard-blocked (either by a call to rfkill_set_hw_state() | 46 | When the device is hard-blocked (either by a call to rfkill_set_hw_state() |
46 | or from query_hw_block) set_block() will be invoked but drivers can well | 47 | or from query_hw_block) set_block() will be invoked for additional software |
47 | ignore the method call since they can use the return value of the function | 48 | block, but drivers can ignore the method call since they can use the return |
48 | rfkill_set_hw_state() to sync the software state instead of keeping track | 49 | value of the function rfkill_set_hw_state() to sync the software state |
49 | of calls to set_block(). | 50 | instead of keeping track of calls to set_block(). In fact, drivers should |
50 | 51 | use the return value of rfkill_set_hw_state() unless the hardware actually | |
51 | 52 | keeps track of soft and hard block separately. | |
52 | The entire functionality is spread over more than one subsystem: | ||
53 | |||
54 | * The kernel input layer generates KEY_WWAN, KEY_WLAN etc. and | ||
55 | SW_RFKILL_ALL -- when the user presses a button. Drivers for radio | ||
56 | transmitters generally do not register to the input layer, unless the | ||
57 | device really provides an input device (i.e. a button that has no | ||
58 | effect other than generating a button press event) | ||
59 | |||
60 | * The rfkill-input code hooks up to these events and switches the soft-block | ||
61 | of the various radio transmitters, depending on the button type. | ||
62 | |||
63 | * The rfkill drivers turn off/on their transmitters as requested. | ||
64 | |||
65 | * The rfkill class will generate userspace notifications (uevents) to tell | ||
66 | userspace what the current state is. | ||
67 | 53 | ||
68 | 54 | ||
55 | 3. Kernel API | ||
69 | 56 | ||
70 | 3. Kernel driver guidelines | ||
71 | 57 | ||
72 | 58 | Drivers for radio transmitters normally implement an rfkill driver. | |
73 | Drivers for radio transmitters normally implement only the rfkill class. | ||
74 | These drivers may not unblock the transmitter based on own decisions, they | ||
75 | should act on information provided by the rfkill class only. | ||
76 | 59 | ||
77 | Platform drivers might implement input devices if the rfkill button is just | 60 | Platform drivers might implement input devices if the rfkill button is just |
78 | that, a button. If that button influences the hardware then you need to | 61 | that, a button. If that button influences the hardware then you need to |
79 | implement an rfkill class instead. This also applies if the platform provides | 62 | implement an rfkill driver instead. This also applies if the platform provides |
80 | a way to turn on/off the transmitter(s). | 63 | a way to turn on/off the transmitter(s). |
81 | 64 | ||
82 | During suspend/hibernation, transmitters should only be left enabled when | 65 | For some platforms, it is possible that the hardware state changes during |
83 | wake-on wlan or similar functionality requires it and the device wasn't | 66 | suspend/hibernation, in which case it will be necessary to update the rfkill |
84 | blocked before suspend/hibernate. Note that it may be necessary to update | 67 | core with the current state is at resume time. |
85 | the rfkill subsystem's idea of what the current state is at resume time if | ||
86 | the state may have changed over suspend. | ||
87 | |||
88 | 68 | ||
69 | To create an rfkill driver, driver's Kconfig needs to have | ||
89 | 70 | ||
90 | 4. Kernel API | 71 | depends on RFKILL || !RFKILL |
91 | 72 | ||
92 | To build a driver with rfkill subsystem support, the driver should depend on | 73 | to ensure the driver cannot be built-in when rfkill is modular. The !RFKILL |
93 | (or select) the Kconfig symbol RFKILL. | 74 | case allows the driver to be built when rfkill is not configured, which which |
94 | 75 | case all rfkill API can still be used but will be provided by static inlines | |
95 | The hardware the driver talks to may be write-only (where the current state | 76 | which compile to almost nothing. |
96 | of the hardware is unknown), or read-write (where the hardware can be queried | ||
97 | about its current state). | ||
98 | 77 | ||
99 | Calling rfkill_set_hw_state() when a state change happens is required from | 78 | Calling rfkill_set_hw_state() when a state change happens is required from |
100 | rfkill drivers that control devices that can be hard-blocked unless they also | 79 | rfkill drivers that control devices that can be hard-blocked unless they also |
@@ -105,10 +84,33 @@ device). Don't do this unless you cannot get the event in any other way. | |||
105 | 84 | ||
106 | 5. Userspace support | 85 | 5. Userspace support |
107 | 86 | ||
108 | The following sysfs entries exist for every rfkill device: | 87 | The recommended userspace interface to use is /dev/rfkill, which is a misc |
88 | character device that allows userspace to obtain and set the state of rfkill | ||
89 | devices and sets of devices. It also notifies userspace about device addition | ||
90 | and removal. The API is a simple read/write API that is defined in | ||
91 | linux/rfkill.h, with one ioctl that allows turning off the deprecated input | ||
92 | handler in the kernel for the transition period. | ||
93 | |||
94 | Except for the one ioctl, communication with the kernel is done via read() | ||
95 | and write() of instances of 'struct rfkill_event'. In this structure, the | ||
96 | soft and hard block are properly separated (unlike sysfs, see below) and | ||
97 | userspace is able to get a consistent snapshot of all rfkill devices in the | ||
98 | system. Also, it is possible to switch all rfkill drivers (or all drivers of | ||
99 | a specified type) into a state which also updates the default state for | ||
100 | hotplugged devices. | ||
101 | |||
102 | After an application opens /dev/rfkill, it can read the current state of | ||
103 | all devices, and afterwards can poll the descriptor for hotplug or state | ||
104 | change events. | ||
105 | |||
106 | Applications must ignore operations (the "op" field) they do not handle, | ||
107 | this allows the API to be extended in the future. | ||
108 | |||
109 | Additionally, each rfkill device is registered in sysfs and there has the | ||
110 | following attributes: | ||
109 | 111 | ||
110 | name: Name assigned by driver to this key (interface or driver name). | 112 | name: Name assigned by driver to this key (interface or driver name). |
111 | type: Name of the key type ("wlan", "bluetooth", etc). | 113 | type: Driver type string ("wlan", "bluetooth", etc). |
112 | state: Current state of the transmitter | 114 | state: Current state of the transmitter |
113 | 0: RFKILL_STATE_SOFT_BLOCKED | 115 | 0: RFKILL_STATE_SOFT_BLOCKED |
114 | transmitter is turned off by software | 116 | transmitter is turned off by software |
@@ -117,7 +119,12 @@ The following sysfs entries exist for every rfkill device: | |||
117 | 2: RFKILL_STATE_HARD_BLOCKED | 119 | 2: RFKILL_STATE_HARD_BLOCKED |
118 | transmitter is forced off by something outside of | 120 | transmitter is forced off by something outside of |
119 | the driver's control. | 121 | the driver's control. |
120 | claim: 0: Kernel handles events (currently always reads that value) | 122 | This file is deprecated because it can only properly show |
123 | three of the four possible states, soft-and-hard-blocked is | ||
124 | missing. | ||
125 | claim: 0: Kernel handles events | ||
126 | This file is deprecated because there no longer is a way to | ||
127 | claim just control over a single rfkill instance. | ||
121 | 128 | ||
122 | rfkill devices also issue uevents (with an action of "change"), with the | 129 | rfkill devices also issue uevents (with an action of "change"), with the |
123 | following environment variables set: | 130 | following environment variables set: |
@@ -128,9 +135,3 @@ RFKILL_TYPE | |||
128 | 135 | ||
129 | The contents of these variables corresponds to the "name", "state" and | 136 | The contents of these variables corresponds to the "name", "state" and |
130 | "type" sysfs files explained above. | 137 | "type" sysfs files explained above. |
131 | |||
132 | An alternative userspace interface exists as a misc device /dev/rfkill, | ||
133 | which allows userspace to obtain and set the state of rfkill devices and | ||
134 | sets of devices. It also notifies userspace about device addition and | ||
135 | removal. The API is a simple read/write API that is defined in | ||
136 | linux/rfkill.h. | ||
diff --git a/Documentation/robust-futex-ABI.txt b/Documentation/robust-futex-ABI.txt index 535f69fab45f..fd1cd8aae4eb 100644 --- a/Documentation/robust-futex-ABI.txt +++ b/Documentation/robust-futex-ABI.txt | |||
@@ -135,7 +135,7 @@ manipulating this list), the user code must observe the following | |||
135 | protocol on 'lock entry' insertion and removal: | 135 | protocol on 'lock entry' insertion and removal: |
136 | 136 | ||
137 | On insertion: | 137 | On insertion: |
138 | 1) set the 'list_op_pending' word to the address of the 'lock word' | 138 | 1) set the 'list_op_pending' word to the address of the 'lock entry' |
139 | to be inserted, | 139 | to be inserted, |
140 | 2) acquire the futex lock, | 140 | 2) acquire the futex lock, |
141 | 3) add the lock entry, with its thread id (TID) in the bottom 29 bits | 141 | 3) add the lock entry, with its thread id (TID) in the bottom 29 bits |
@@ -143,7 +143,7 @@ On insertion: | |||
143 | 4) clear the 'list_op_pending' word. | 143 | 4) clear the 'list_op_pending' word. |
144 | 144 | ||
145 | On removal: | 145 | On removal: |
146 | 1) set the 'list_op_pending' word to the address of the 'lock word' | 146 | 1) set the 'list_op_pending' word to the address of the 'lock entry' |
147 | to be removed, | 147 | to be removed, |
148 | 2) remove the lock entry for this lock from the 'head' list, | 148 | 2) remove the lock entry for this lock from the 'head' list, |
149 | 2) release the futex lock, and | 149 | 2) release the futex lock, and |
diff --git a/Documentation/watchdog/hpwdt.txt b/Documentation/watchdog/hpwdt.txt new file mode 100644 index 000000000000..127839e53043 --- /dev/null +++ b/Documentation/watchdog/hpwdt.txt | |||
@@ -0,0 +1,84 @@ | |||
1 | Last reviewed: 06/02/2009 | ||
2 | |||
3 | HP iLO2 NMI Watchdog Driver | ||
4 | NMI sourcing for iLO2 based ProLiant Servers | ||
5 | Documentation and Driver by | ||
6 | Thomas Mingarelli <thomas.mingarelli@hp.com> | ||
7 | |||
8 | The HP iLO2 NMI Watchdog driver is a kernel module that provides basic | ||
9 | watchdog functionality and the added benefit of NMI sourcing. Both the | ||
10 | watchdog functionality and the NMI sourcing capability need to be enabled | ||
11 | by the user. Remember that the two modes are not dependant on one another. | ||
12 | A user can have the NMI sourcing without the watchdog timer and vice-versa. | ||
13 | |||
14 | Watchdog functionality is enabled like any other common watchdog driver. That | ||
15 | is, an application needs to be started that kicks off the watchdog timer. A | ||
16 | basic application exists in the Documentation/watchdog/src directory called | ||
17 | watchdog-test.c. Simply compile the C file and kick it off. If the system | ||
18 | gets into a bad state and hangs, the HP ProLiant iLO 2 timer register will | ||
19 | not be updated in a timely fashion and a hardware system reset (also known as | ||
20 | an Automatic Server Recovery (ASR)) event will occur. | ||
21 | |||
22 | The hpwdt driver also has three (3) module parameters. They are the following: | ||
23 | |||
24 | soft_margin - allows the user to set the watchdog timer value | ||
25 | allow_kdump - allows the user to save off a kernel dump image after an NMI | ||
26 | nowayout - basic watchdog parameter that does not allow the timer to | ||
27 | be restarted or an impending ASR to be escaped. | ||
28 | |||
29 | NOTE: More information about watchdog drivers in general, including the ioctl | ||
30 | interface to /dev/watchdog can be found in | ||
31 | Documentation/watchdog/watchdog-api.txt and Documentation/IPMI.txt. | ||
32 | |||
33 | The NMI sourcing capability is disabled when the driver discovers that the | ||
34 | nmi_watchdog is turned on (nmi_watchdog = 1). This is due to the inability to | ||
35 | distinguish between "NMI Watchdog Ticks" and "HW generated NMI events" in the | ||
36 | Linux kernel. What this means is that the hpwdt nmi handler code is called | ||
37 | each time the NMI signal fires off. This could amount to several thousands of | ||
38 | NMIs in a matter of seconds. If a user sees the Linux kernel's "dazed and | ||
39 | confused" message in the logs or if the system gets into a hung state, then | ||
40 | the user should reboot with nmi_watchdog=0. | ||
41 | |||
42 | 1. If the kernel has not been booted with nmi_watchdog turned off then | ||
43 | edit /boot/grub/menu.lst and place the nmi_watchdog=0 at the end of the | ||
44 | currently booting kernel line. | ||
45 | 2. reboot the sever | ||
46 | |||
47 | Now, the hpwdt can successfully receive and source the NMI and provide a log | ||
48 | message that details the reason for the NMI (as determined by the HP BIOS). | ||
49 | |||
50 | Below is a list of NMIs the HP BIOS understands along with the associated | ||
51 | code (reason): | ||
52 | |||
53 | No source found 00h | ||
54 | |||
55 | Uncorrectable Memory Error 01h | ||
56 | |||
57 | ASR NMI 1Bh | ||
58 | |||
59 | PCI Parity Error 20h | ||
60 | |||
61 | NMI Button Press 27h | ||
62 | |||
63 | SB_BUS_NMI 28h | ||
64 | |||
65 | ILO Doorbell NMI 29h | ||
66 | |||
67 | ILO IOP NMI 2Ah | ||
68 | |||
69 | ILO Watchdog NMI 2Bh | ||
70 | |||
71 | Proc Throt NMI 2Ch | ||
72 | |||
73 | Front Side Bus NMI 2Dh | ||
74 | |||
75 | PCI Express Error 2Fh | ||
76 | |||
77 | DMA controller NMI 30h | ||
78 | |||
79 | Hypertransport/CSI Error 31h | ||
80 | |||
81 | |||
82 | |||
83 | -- Tom Mingarelli | ||
84 | (thomas.mingarelli@hp.com) | ||