Patchwork dump_stack doc

login
register
mail settings
Submitter kevin diggs
Date Jan. 26, 2011, 8:08 p.m.
Message ID <AANLkTimRdcVtNNt2D=bZJ9n1mY1p2q1R5PN7E1GXhxNx@mail.gmail.com>
Download mbox | patch
Permalink /patch/80549/
State Rejected
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

kevin diggs - Jan. 26, 2011, 8:08 p.m.
Hi,

Does this content look ok:

kevdig@SatelliteA75:/usr/src/linux-2.6.36/arch/powerpc/kernel$ diff
-U3 process.c process-new_c
 	unsigned long sp, ip, lr, newsp;
@@ -1177,6 +1198,11 @@
 	} while (count++ < kstack_depth_to_print);
 }

+/**
+ * void dump_stack(void) - dump the contents of the stack in readable form
+ *
+ * See process.c`show_stack() for details
+ */
 void dump_stack(void)
 {
 	show_stack(current, NULL);

kevin

Patch

--- process.c	2010-10-23 20:01:13.000000000 -0500
+++ process-new_c	2011-01-26 14:04:17.000000000 -0600
@@ -1107,6 +1107,27 @@ 
 
 static int kstack_depth_to_print = CONFIG_PRINT_STACK_DEPTH;
 
+/**
+ * void show_stack() - dump the contents of the stack in readable format
+ * @struct task_struct *tsk:	pointer to task struct owning stack frame
+ * @unsigned long *stack:	pointer to stack frame	
+ *
+ * Dump the stack in bipedal carbon unit readable form. Format is:
+ * 	Call Trace:
+ * [[	--- Exception: <trap id (%lx)> at <trap handler (%pS)>	]]
+ * [[	    LR = <trapping routine (%pS)>			]]
+ * 	[<stack ("REG")>] [<instruction ("REG")>] <instruction (%pS)> [[ (unreliable)]]
+ *
+ * Information between '[[' & ']]' is optional. Additional information is
+ * printed at the beginning of what are believed to be exception frames.
+ *
+ * The first frame is considered unreliable and will have " (unreliable)"
+ * tacked on the end.
+ *
+ * kstack_depth_to_print determines how many frames to show.
+ *
+ * Value in parenthesis is the format specifier used. See printk().
+ */
 void show_stack(struct task_struct *tsk, unsigned long *stack)
 {
 	unsigned long sp, ip, lr, newsp;
@@ -1177,6 +1198,11 @@ 
 	} while (count++ < kstack_depth_to_print);
 }
 
+/**
+ * void dump_stack(void) - dump the contents of the stack in readable form
+ *
+ * See process.c`show_stack() for details
+ */
 void dump_stack(void)
 {
 	show_stack(current, NULL);