[PATCH 3/5] dump_stack: introduce generic show_stack_lvl()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



show_stack_lvl() works like show_stack() but allows also passing the log level.
The default implementation that should be overrided by architecture specific
code simply will call the existing show_stack().

Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: Michal Hocko <mhocko@xxxxxxxxxx>
Cc: Greg Thelen <gthelen@xxxxxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: David Rientjes <rientjes@xxxxxxxxxx>
Signed-off-by: Aristeu Rozanski <aris@xxxxxxxxxx>

---
 include/linux/sched.h |    2 ++
 lib/dump_stack.c      |    8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

--- linux-2.6.orig/lib/dump_stack.c	2015-11-05 14:31:44.581921915 -0500
+++ linux-2.6/lib/dump_stack.c	2015-11-05 14:32:47.508211219 -0500
@@ -9,10 +9,16 @@
 #include <linux/smp.h>
 #include <linux/atomic.h>
 
+void __weak show_stack_lvl(struct task_struct *task, unsigned long *sp,
+			       char *log_lvl)
+{
+	return show_stack(task, sp);
+}
+
 static void __dump_stack(char *log_lvl)
 {
 	dump_stack_print_info(log_lvl);
-	show_stack(NULL, NULL);
+	show_stack_lvl(NULL, NULL, log_lvl);
 }
 
 /**
--- linux-2.6.orig/include/linux/sched.h	2015-11-05 14:31:44.581921915 -0500
+++ linux-2.6/include/linux/sched.h	2015-11-05 14:31:52.426833314 -0500
@@ -368,6 +368,8 @@ extern void show_regs(struct pt_regs *);
  * trace (or NULL if the entire call-chain of the task should be shown).
  */
 extern void show_stack(struct task_struct *task, unsigned long *sp);
+extern void show_stack_lvl(struct task_struct *task, unsigned long *sp,
+			   char *log_lvl);
 
 extern void cpu_init (void);
 extern void trap_init(void);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]