Whamcloud - gitweb
merge b_devel into HEAD, which will become 0.7.3
[fs/lustre-release.git] / lustre / kernel_patches / patches / kgdb-ga-docco-fixes-2.5.73.patch
1
2 From: "Randy.Dunlap" <rddunlap@osdl.org>
3
4 Just some readability fixes.
5
6
7
8  Documentation/i386/kgdb/kgdb.txt |  135 +++++++++++++++++++--------------------
9  1 files changed, 68 insertions(+), 67 deletions(-)
10
11 diff -puN Documentation/i386/kgdb/kgdb.txt~kgdb-gs-docco-fixes Documentation/i386/kgdb/kgdb.txt
12 --- 25/Documentation/i386/kgdb/kgdb.txt~kgdb-gs-docco-fixes     2003-06-26 17:32:25.000000000 -0700
13 +++ 25-akpm/Documentation/i386/kgdb/kgdb.txt    2003-06-26 17:32:25.000000000 -0700
14 @@ -6,10 +6,10 @@ New features: 
15  ============
16  20030505.1827.27
17  We are starting to align with the sourceforge version, at least in 
18 -commands.  To this end, the boot command sting to start kgdb at
19 +commands.  To this end, the boot command string to start kgdb at
20  boot time has been changed from "kgdb" to "gdb".
21  
22 -Andrew Morton sent a couple of patchs which are now included as follows:
23 +Andrew Morton sent a couple of patches which are now included as follows:
24  1.) We now return a flag to the interrupt handler.
25  2.) We no longer use smp_num_cpus (a conflict with the lock meter).
26  3.) And from William Lee Irwin III <wli@holomorphy.com> code to make
27 @@ -27,18 +27,18 @@ This is currently the version for the 2.
28  
29  We have several new "features" beginning with this version:
30   
31 -1.) Kgdb now syncs the "other" cpus with a cross cpu NMI.  No more
32 -    waiting and it will pull that guy out of an irq off spin lock :)
33 +1.) Kgdb now syncs the "other" CPUs with a cross-CPU NMI.  No more
34 +    waiting and it will pull that guy out of an IRQ off spin lock :)
35  
36  2.) We doctored up the code that tells where a task is waiting and
37      included it so that the "info thread" command will show a bit more
38      than "schedule()".  Try it...
39  
40  3.) Added the ability to call a function from gdb.  All the standard gdb
41 -    issues apply, i.e. if you hit a break point in the function you are
42 -    not allowed to call another (gdb limitation, not kgdb).  T0 help
43 +    issues apply, i.e. if you hit a breakpoint in the function, you are
44 +    not allowed to call another (gdb limitation, not kgdb).  To help
45      this capability we added a memory allocation function.  Gdb does not
46 -    return this memory (it is used for stings you pass to that function
47 +    return this memory (it is used for strings that you pass to that function
48      you are calling from gdb) so we fixed up a way to allow you to
49      manually return the memory (see below).
50  
51 @@ -61,23 +61,23 @@ $2 = {used_malloc = 0, called_from = 0xc
52      Things to note here: a.) used_malloc is the amount of memory that
53      has been malloc'ed to do calls from gdb.  You can reclaim this
54      memory like this: "p kgdb_info.used_malloc=0" Cool, huh?  b.)
55 -    cpus_waiting is now "sized" by the number of cpus you enter at
56 -    configure time in the kgdb configure section.  This is NOT used any
57 -    where else in the system, but it is "nice" here.  c.)  The tasks
58 +    cpus_waiting is now "sized" by the number of CPUs you enter at
59 +    configure time in the kgdb configure section.  This is NOT used
60 +    anywhere else in the system, but it is "nice" here.  c.)  The task's
61      "pid" is now in the structure.  This is the pid you will need to use
62      to decode to the thread id to get gdb to look at that thread.
63      Remember that the "info thread" command prints a list of threads
64 -    where in it numbers each thread with its reference number followed
65 -    by the threads pid.  Note that the per cpu idle threads actually
66 -    have pids of 0 (yes there is more than one pid 0 in an SMP system).
67 +    wherein it numbers each thread with its reference number followed
68 +    by the thread's pid.  Note that the per-CPU idle threads actually
69 +    have pids of 0 (yes, there is more than one pid 0 in an SMP system).
70      To avoid confusion, kgdb numbers these threads with numbers beyond
71 -    the MAX_PID.  That is why you see 32768 above.
72 +    the MAX_PID.  That is why you see 32768 and above.
73  
74  6.) A subtle change, we now provide the complete register set for tasks
75 -    that are active on the other cpus.  This allows better trace back on
76 +    that are active on the other CPUs.  This allows better trace back on
77      those tasks.
78  
79 -    And, lets mention what we could not fix.  Back-trace from all but the
80 +    And, let's mention what we could not fix.  Back-trace from all but the
81      thread that we trapped will, most likely, have a bogus entry in it.
82      The problem is that gdb does not recognize the entry code for
83      functions that use "current" near (at all?) the entry.  The compiler
84 @@ -88,9 +88,9 @@ $2 = {used_malloc = 0, called_from = 0xc
85  
86  20011220.0050.35
87  Major enhancement with this version is the ability to hold one or more
88 -cpus in an SMP system while allowing the others to continue.  Also, by
89 -default only the current cpu is enabled on single step commands (please
90 -note that gdb issues single step commands at times other than when you
91 +CPUs in an SMP system while allowing the others to continue.  Also, by
92 +default only the current CPU is enabled on single-step commands (please
93 +note that gdb issues single-step commands at times other than when you
94  use the si command).
95   
96  Another change is to collect some useful information in
97 @@ -111,14 +111,14 @@ $4 = {called_from = 0xc010732c, entry_ts
98  
99  "Called_from" is the return address from the current entry into kgdb.  
100  Sometimes it is useful to know why you are in kgdb, for example, was 
101 -it an NMI or a real break point?  The simple way to interrogate this 
102 +it an NMI or a real breakpoint?  The simple way to interrogate this
103  return address is:
104  
105  l *0xc010732c
106  
107  which will print the surrounding few lines of source code.
108  
109 -"Entry_tsc" is the cpu TSC on entry to kgdb (useful to compare to the
110 +"Entry_tsc" is the CPU TSC on entry to kgdb (useful to compare to the
111  kgdb_ts entries).
112  
113  "errcode" and "vector" are other entry parameters which may be helpful on
114 @@ -139,34 +139,34 @@ $7 = {called_from = 0xc0112739, entry_ts
115        hold = 0, regs = 0x0}, {task = 0x0, hold = 0, regs = 0x0}, {task = 0x0, 
116        hold = 0, regs = 0x0}}}
117  
118 -"Cpus_waiting" has an entry for each cpu other than the current one that 
119 +"Cpus_waiting" has an entry for each CPU other than the current one that
120  has been stopped.  Each entry contains the task_struct address for that
121 -cpu, the address of the regs for that task and a hold flag.  All these
122 +CPU, the address of the regs for that task and a hold flag.  All these
123  have the proper typing so that, for example:
124  
125  p *kgdb_info.cpus_waiting[1].regs
126  
127 -will print the registers for cpu 1.
128 +will print the registers for CPU 1.
129  
130  "Hold_on_sstep" is a new feature with this version and comes up set or
131 -true.  What is means is that whenever kgdb is asked to single step all
132 -other cpus are held (i.e. not allowed to execute).  The flag applies to
133 -all but the current cpu and, again, can be changed:
134 +true.  What this means is that whenever kgdb is asked to single-step all
135 +other CPUs are held (i.e. not allowed to execute).  The flag applies to
136 +all but the current CPU and, again, can be changed:
137  
138  p kgdb_info.hold_on_sstep=0
139  
140 -restores the old behavior of letting all cpus run during single stepping.
141 +restores the old behavior of letting all CPUs run during single-stepping.
142  
143 -Likewise, each cpu has a "hold" flag, which if set, locks that cpu out
144 -of execution.  Note that this has some risk in cases where the cpus need
145 -to communicate with each other.  If kgdb finds no cpu available on exit,
146 +Likewise, each CPU has a "hold" flag, which if set, locks that CPU out
147 +of execution.  Note that this has some risk in cases where the CPUs need
148 +to communicate with each other.  If kgdb finds no CPU available on exit,
149  it will push a message thru gdb and stay in kgdb.  Note that it is legal
150 -to hold the current cpu as long as at least one cpu can execute.
151 +to hold the current CPU as long as at least one CPU can execute.
152  
153  20010621.1117.09
154  This version implements an event queue.  Events are signaled by calling
155  a function in the kgdb stub and may be examined from gdb.  See EVENTS 
156 -below for details.  This version also tighten up the interrupt and SMP
157 +below for details.  This version also tightens up the interrupt and SMP
158  handling to not allow interrupts on the way to kgdb from a breakpoint 
159  trap.  It is fine to allow these interrupts for user code, but not
160  system debugging.
161 @@ -190,18 +190,18 @@ machine.  This is the machine that will 
162  kernel.
163  
164  The two machines will be connected together via a serial line out
165 -one or the other of the COM ports of the PC.  You will need a modem
166 -eliminator and the appropriate cables.
167 +one or the other of the COM ports of the PC.  You will need the
168 +appropriate modem eliminator (null modem) cable(s) for this.
169  
170  Decide on which tty port you want the machines to communicate, then
171 -cable them up back-to-back using the null modem.  COM1 is /dev/ttyS0 and
172 -COM2 is /dev/ttyS1. You should test this connection with the two
173 -machines prior to trying to debug a kernel.  Once you have it working,
174 -on the TARGET machine, enter:
175 +connect them up back-to-back using the null modem cable.  COM1 is
176 +/dev/ttyS0 and COM2 is /dev/ttyS1. You should test this connection
177 +with the two machines prior to trying to debug a kernel.  Once you
178 +have it working, on the TARGET machine, enter:
179  
180  setserial /dev/ttyS0 (or what ever tty you are using)
181  
182 -and record the port and the irq addresses. 
183 +and record the port address and the IRQ number.
184  
185  On the DEVELOPMENT machine you need to apply the patch for the kgdb
186  hooks.  You have probably already done that if you are reading this
187 @@ -212,7 +212,7 @@ On your DEVELOPMENT machine, go to your 
188  configuring in the standard serial driver, it must not be a module.
189  Either yes or no is ok, but making the serial driver a module means it
190  will initialize after kgdb has set up the UART interrupt code and may
191 -cause a failure of the control C option discussed below.  The configure
192 +cause a failure of the control-C option discussed below.  The configure
193  question for the serial driver is under the "Character devices" heading
194  and is:
195  
196 @@ -231,16 +231,16 @@ The baud rate.  Default is 115200.  What
197  the host machine is set to the same speed.  I recommend the default.
198  
199  The port.  This is the I/O address of the serial UART that you should
200 -have gotten using setserial as described above.  The standard com1 port
201 -(3f8) using irq 4 is default .  Com2 is 2f8 which by convention uses irq
202 +have gotten using setserial as described above.  The standard COM1 port
203 +(3f8) using IRQ 4 is default.  COM2 is 2f8 which by convention uses IRQ
204  3.
205  
206 -The port irq (see above).
207 +The port IRQ (see above).
208  
209  Stack overflow test.  This option makes a minor change in the trap,
210  system call and interrupt code to detect stack overflow and transfer
211 -control to kgdb if it happens.  (Some platforms have this in the base
212 -line code, but the i386 does not.)
213 +control to kgdb if it happens.  (Some platforms have this in the
214 +baseline code, but the i386 does not.)
215  
216  You can also configure the system to recognize the boot option
217  "console=kgdb" which if given will cause all console output during
218 @@ -251,9 +251,9 @@ This will happen before any kernel outpu
219  and will stall the boot until the connection is made.
220  
221  You can also configure in a patch to SysRq to enable the kGdb SysRq.
222 -This request generates a breakpoint.  Since the serial port irq line is
223 +This request generates a breakpoint.  Since the serial port IRQ line is
224  set up after any serial drivers, it is possible that this command will
225 -work when the control C will not.
226 +work when the control-C will not.
227  
228  Save and exit the Xconfig program.  Then do "make clean" , "make dep"
229  and "make bzImage" (or whatever target you want to make).  This gets the
230 @@ -360,11 +360,11 @@ Triggering kgdbstub at other times
231  Often you don't need to enter the debugger until much later in the boot
232  or even after the machine has been running for some time.  Once the
233  kernel is booted and interrupts are on, you can force the system to
234 -enter the debugger by sending a control C to the debug port. This is
235 +enter the debugger by sending a control-C to the debug port. This is
236  what the first line of the recommended .gdbinit file does.  This allows
237  you to start gdb any time after the system is up as well as when the
238 -system is already at a break point.  (In the case where the system is
239 -already at a break point the control C is not needed, however, it will
240 +system is already at a breakpoint.  (In the case where the system is
241 +already at a breakpoint the control-C is not needed, however, it will
242  be ignored by the target so no harm is done.  Also note the the echo
243  command assumes that the port speed is already set.  This will be true
244  once gdb has connected, but it is best to set the port speed before you
245 @@ -442,7 +442,7 @@ turn on a debug switch with the followin
246  This will print out the protocol messages that gdb is exchanging with
247  the target machine.
248  
249 -Another place to look is /usr/src/arch/i386/lib/kgdb_serial.c This is
250 +Another place to look is /usr/src/arch/i386/lib/kgdb_serial.c. This is
251  the code that talks to the serial port on the target side.  There might
252  be a problem there.  In particular there is a section of this code that
253  tests the UART which will tell you what UART you have if you define
254 @@ -454,7 +454,7 @@ it finds.  (You need to wait so that the
255  printed.  Early in the boot they are cached, waiting for the console to
256  be enabled.  Also, if kgdb is entered thru a breakpoint it is possible
257  to cause a dead lock by calling printk when the console is locked.  The
258 -stub, thus avoids doing printks from break points especially in the
259 +stub thus avoids doing printks from breakpoints, especially in the
260  serial code.)  At this time, if the UART fails to do the expected thing,
261  kgdb will print out (using printk) information on what failed.  (These
262  messages will be buried in all the other boot up messages.  Look for
263 @@ -464,7 +464,7 @@ don't connect, review your answers for t
264  
265  setserial /dev/ttyS0 
266  
267 -to get the current port and irq information.  This command will also
268 +to get the current port and IRQ information.  This command will also
269  tell you what the system found for the UART type. The stub recognizes
270  the following UART types:
271  
272 @@ -581,11 +581,11 @@ When a breakpoint occurs or user issues 
273  client, all the processors are forced to enter the debugger. Current
274  thread corresponds to the thread running on the processor where
275  breakpoint occurred.  Threads running on other processor(s) appear
276 -similar to other non running threads in the 'info threads' output.  With
277 -in the kgdb stub there is a structure "waiting_cpus" in which kgdb
278 -records the values of "current" and "regs" for each cpu other than the
279 +similar to other non-running threads in the 'info threads' output.
280 +Within the kgdb stub there is a structure "waiting_cpus" in which kgdb
281 +records the values of "current" and "regs" for each CPU other than the
282  one that hit the breakpoint.  "current" is a pointer to the task
283 -structure for the task that cpu is running, while "regs" points to the
284 +structure for the task that CPU is running, while "regs" points to the
285  saved registers for the task.  This structure can be examined with the
286  gdb "p" command.
287  
288 @@ -601,22 +601,23 @@ Kill it. restart gdb. Connect to target 
289  2. gdb cannot connect to target machine (after killing a gdb and
290  restarting another) If the target machine was not inside debugger when
291  you killed gdb, gdb cannot connect because the target machine won't
292 -respond.  In this case echo "Ctrl+C"(ASCII 3) in the serial line.
293 -e.g. echo -e "\003" > /dev/ttyS1 This forces that target machine into
294 -debugger after which you can connect.
295 +respond.  In this case echo "Ctrl+C"(ASCII 3) to the serial line.
296 +e.g. echo -e "\003" > /dev/ttyS1
297 +This forces that target machine into the debugger, after which you
298 +can connect.
299  
300  3. gdb cannot connect even after echoing Ctrl+C into serial line
301  Try changing serial line settings min to 1 and time to 0
302  e.g. stty min 1 time 0 < /dev/ttyS1
303  Try echoing again
304  
305 -check serial line speed and set it to correct value if required
306 +Check serial line speed and set it to correct value if required
307  e.g. stty ispeed 115200 ospeed 115200 < /dev/ttyS1
308  
309  EVENTS
310  ======
311  
312 -Ever want to know the order of things happening?  Which cpu did what and
313 +Ever want to know the order of things happening?  Which CPU did what and
314  when?  How did the spinlock get the way it is?  Then events are for
315  you.  Events are defined by calls to an event collection interface and
316  saved for later examination.  In this case, kgdb events are saved by a
317 @@ -631,7 +632,7 @@ Events are signaled to kgdb by calling:
318  kgdb_ts(data0,data1)
319  
320  For each call kgdb records each call in an array along with other info.
321 -Here is the array def:
322 +Here is the array definition:
323  
324  struct kgdb_and_then_struct {
325  #ifdef CONFIG_SMP
326 @@ -646,7 +647,7 @@ struct kgdb_and_then_struct {
327         int     data1;
328  };
329  
330 -For SMP machines the cpu is recorded, for all machines the TSC is
331 +For SMP machines the CPU is recorded, for all machines the TSC is
332  recorded (gets a time stamp) as well as the line number and source file
333  the call was made from.  The address of the (from), the "if" (interrupt
334  flag) and the two data items are also recorded.  The macro kgdb_ts casts
335 @@ -709,7 +710,7 @@ Amit S. Kale
336      Extended threads to include the idle threads.
337      Enhancements to allow breakpoint() at first C code.
338      Use of module_init() and __setup() to automate the configure.
339 -    Enhanced the cpu "collection" code to work in early bring up.
340 +    Enhanced the cpu "collection" code to work in early bring-up.
341      Added ability to call functions from gdb
342      Print info thread stuff without going back to schedule()
343 -    Now collect the "other" cpus with a IPI/ NMI.
344 \ No newline at end of file
345 +    Now collect the "other" cpus with an IPI/ NMI.
346
347 _