mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-23 23:50:51 +07:00
kernel: rename show_stack_loglvl() => show_stack()
Now the last users of show_stack() got converted to use an explicit log level, show_stack_loglvl() can drop it's redundant suffix and become once again well known show_stack(). Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/r/20200418201944.482088-51-dima@arista.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
fe1993a001
commit
9cb8f069de
@ -144,8 +144,7 @@ dik_show_trace(unsigned long *sp, const char *loglvl)
|
|||||||
|
|
||||||
static int kstack_depth_to_print = 24;
|
static int kstack_depth_to_print = 24;
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
|
void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
unsigned long *stack;
|
unsigned long *stack;
|
||||||
int i;
|
int i;
|
||||||
@ -174,11 +173,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
|
|||||||
dik_show_trace(sp, loglvl);
|
dik_show_trace(sp, loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, sp, KERN_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15)
|
die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15)
|
||||||
{
|
{
|
||||||
|
@ -228,17 +228,11 @@ noinline void show_stacktrace(struct task_struct *tsk, struct pt_regs *regs,
|
|||||||
EXPORT_SYMBOL(show_stacktrace);
|
EXPORT_SYMBOL(show_stacktrace);
|
||||||
|
|
||||||
/* Expected by sched Code */
|
/* Expected by sched Code */
|
||||||
void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
|
void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
show_stacktrace(tsk, NULL, loglvl);
|
show_stacktrace(tsk, NULL, loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *tsk, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(tsk, sp, KERN_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Another API expected by schedular, shows up in "ps" as Wait Channel
|
/* Another API expected by schedular, shows up in "ps" as Wait Channel
|
||||||
* Of course just returning schedule( ) would be pointless so unwind until
|
* Of course just returning schedule( ) would be pointless so unwind until
|
||||||
* the function is not in schedular code
|
* the function is not in schedular code
|
||||||
|
@ -247,18 +247,12 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
|
void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
dump_backtrace(NULL, tsk, loglvl);
|
dump_backtrace(NULL, tsk, loglvl);
|
||||||
barrier();
|
barrier();
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *tsk, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(tsk, sp, KERN_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_PREEMPT
|
#ifdef CONFIG_PREEMPT
|
||||||
#define S_PREEMPT " PREEMPT"
|
#define S_PREEMPT " PREEMPT"
|
||||||
#elif defined(CONFIG_PREEMPT_RT)
|
#elif defined(CONFIG_PREEMPT_RT)
|
||||||
|
@ -137,18 +137,12 @@ void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
|
|||||||
put_task_stack(tsk);
|
put_task_stack(tsk);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
|
void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
dump_backtrace(NULL, tsk, loglvl);
|
dump_backtrace(NULL, tsk, loglvl);
|
||||||
barrier();
|
barrier();
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *tsk, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(tsk, sp, KERN_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_PREEMPT
|
#ifdef CONFIG_PREEMPT
|
||||||
#define S_PREEMPT " PREEMPT"
|
#define S_PREEMPT " PREEMPT"
|
||||||
#elif defined(CONFIG_PREEMPT_RT)
|
#elif defined(CONFIG_PREEMPT_RT)
|
||||||
|
@ -374,7 +374,7 @@ static void show_trace(unsigned long *stack, unsigned long *endstack,
|
|||||||
printk("%s\n", loglvl);
|
printk("%s\n", loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
|
void show_stack(struct task_struct *task, unsigned long *stack,
|
||||||
const char *loglvl)
|
const char *loglvl)
|
||||||
{
|
{
|
||||||
unsigned long *p, *endstack;
|
unsigned long *p, *endstack;
|
||||||
@ -403,11 +403,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
|
|||||||
show_trace(stack, endstack, loglvl);
|
show_trace(stack, endstack, loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *stack)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, stack, KERN_DEBUG);
|
|
||||||
}
|
|
||||||
|
|
||||||
int is_valid_bugaddr(unsigned long addr)
|
int is_valid_bugaddr(unsigned long addr)
|
||||||
{
|
{
|
||||||
return __kernel_text_address(addr);
|
return __kernel_text_address(addr);
|
||||||
|
@ -344,7 +344,7 @@ asmlinkage void syscall_trace_exit(struct pt_regs *regs)
|
|||||||
trace_sys_exit(regs, syscall_get_return_value(current, regs));
|
trace_sys_exit(regs, syscall_get_return_value(current, regs));
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void show_stack(struct task_struct *task, unsigned long *stack);
|
extern void show_stack(struct task_struct *task, unsigned long *stack, const char *loglvl);
|
||||||
void show_regs(struct pt_regs *fp)
|
void show_regs(struct pt_regs *fp)
|
||||||
{
|
{
|
||||||
unsigned long *sp;
|
unsigned long *sp;
|
||||||
@ -420,6 +420,6 @@ void show_regs(struct pt_regs *fp)
|
|||||||
}
|
}
|
||||||
pr_cont("\n");
|
pr_cont("\n");
|
||||||
|
|
||||||
show_stack(NULL, (unsigned long *)fp->regs[4]);
|
show_stack(NULL, (unsigned long *)fp->regs[4], KERN_INFO);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -95,19 +95,12 @@ static bool print_trace_address(unsigned long pc, void *arg)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
|
void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
pr_cont("Call Trace:\n");
|
pr_cont("Call Trace:\n");
|
||||||
walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
|
walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *sp)
|
|
||||||
{
|
|
||||||
pr_cont("Call Trace:\n");
|
|
||||||
walk_stackframe(task, NULL, print_trace_address, KERN_INFO);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool save_wchan(unsigned long pc, void *arg)
|
static bool save_wchan(unsigned long pc, void *arg)
|
||||||
{
|
{
|
||||||
if (!in_sched_functions(pc)) {
|
if (!in_sched_functions(pc)) {
|
||||||
|
@ -115,8 +115,7 @@ void die(const char *str, struct pt_regs *fp, unsigned long err)
|
|||||||
|
|
||||||
static int kstack_depth_to_print = 24;
|
static int kstack_depth_to_print = 24;
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *esp,
|
void show_stack(struct task_struct *task, unsigned long *esp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
unsigned long *stack, addr;
|
unsigned long *stack, addr;
|
||||||
int i;
|
int i;
|
||||||
@ -158,8 +157,3 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *esp,
|
|||||||
}
|
}
|
||||||
printk("%s\n", loglvl);
|
printk("%s\n", loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *esp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, esp, KERN_INFO);
|
|
||||||
}
|
|
||||||
|
@ -175,18 +175,12 @@ static void do_show_stack(struct task_struct *task, unsigned long *fp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *fp,
|
void show_stack(struct task_struct *task, unsigned long *fp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
/* Saved link reg is one word above FP */
|
/* Saved link reg is one word above FP */
|
||||||
do_show_stack(task, fp, 0, loglvl);
|
do_show_stack(task, fp, 0, loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *fp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, fp, 0, KERN_INFO);
|
|
||||||
}
|
|
||||||
|
|
||||||
int die(const char *str, struct pt_regs *regs, long err)
|
int die(const char *str, struct pt_regs *regs, long err)
|
||||||
{
|
{
|
||||||
static struct {
|
static struct {
|
||||||
|
@ -1631,7 +1631,7 @@ default_monarch_init_process(struct notifier_block *self, unsigned long val, voi
|
|||||||
if (read_trylock(&tasklist_lock)) {
|
if (read_trylock(&tasklist_lock)) {
|
||||||
do_each_thread (g, t) {
|
do_each_thread (g, t) {
|
||||||
printk("\nBacktrace of pid %d (%s)\n", t->pid, t->comm);
|
printk("\nBacktrace of pid %d (%s)\n", t->pid, t->comm);
|
||||||
show_stack(t, NULL);
|
show_stack(t, NULL, KERN_DEFAULT);
|
||||||
} while_each_thread (g, t);
|
} while_each_thread (g, t);
|
||||||
read_unlock(&tasklist_lock);
|
read_unlock(&tasklist_lock);
|
||||||
}
|
}
|
||||||
|
@ -85,8 +85,7 @@ ia64_do_show_stack (struct unw_frame_info *info, void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
show_stack_loglvl (struct task_struct *task, unsigned long *sp,
|
show_stack (struct task_struct *task, unsigned long *sp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
if (!task)
|
if (!task)
|
||||||
unw_init_running(ia64_do_show_stack, (void *)loglvl);
|
unw_init_running(ia64_do_show_stack, (void *)loglvl);
|
||||||
@ -98,12 +97,6 @@ show_stack_loglvl (struct task_struct *task, unsigned long *sp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
show_stack (struct task_struct *task, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, sp, KERN_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
show_regs (struct pt_regs *regs)
|
show_regs (struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
@ -158,7 +151,7 @@ show_regs (struct pt_regs *regs)
|
|||||||
((i == sof - 1) || (i % 3) == 2) ? "\n" : " ");
|
((i == sof - 1) || (i % 3) == 2) ? "\n" : " ");
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
show_stack(NULL, NULL);
|
show_stack(NULL, NULL, KERN_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* local support for deprecated console_print */
|
/* local support for deprecated console_print */
|
||||||
|
@ -916,7 +916,7 @@ void show_registers(struct pt_regs *regs)
|
|||||||
default:
|
default:
|
||||||
pr_cont("\n");
|
pr_cont("\n");
|
||||||
}
|
}
|
||||||
show_stack(NULL, (unsigned long *)addr);
|
show_stack(NULL, (unsigned long *)addr, KERN_INFO);
|
||||||
|
|
||||||
pr_info("Code:");
|
pr_info("Code:");
|
||||||
set_fs(KERNEL_DS);
|
set_fs(KERNEL_DS);
|
||||||
@ -935,8 +935,8 @@ void show_registers(struct pt_regs *regs)
|
|||||||
pr_cont("\n");
|
pr_cont("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
|
void show_stack(struct task_struct *task, unsigned long *stack,
|
||||||
const char *loglvl)
|
const char *loglvl)
|
||||||
{
|
{
|
||||||
unsigned long *p;
|
unsigned long *p;
|
||||||
unsigned long *endstack;
|
unsigned long *endstack;
|
||||||
@ -963,11 +963,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
|
|||||||
show_trace(stack, loglvl);
|
show_trace(stack, loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *stack)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, stack, KERN_INFO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The vector number returned in the frame pointer may also contain
|
* The vector number returned in the frame pointer may also contain
|
||||||
* the "fs" (Fault Status) bits on ColdFire. These are in the bottom
|
* the "fs" (Fault Status) bits on ColdFire. These are in the bottom
|
||||||
|
@ -31,8 +31,7 @@ static int __init kstack_setup(char *s)
|
|||||||
}
|
}
|
||||||
__setup("kstack=", kstack_setup);
|
__setup("kstack=", kstack_setup);
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
|
void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
unsigned long words_to_show;
|
unsigned long words_to_show;
|
||||||
u32 fp = (u32) sp;
|
u32 fp = (u32) sp;
|
||||||
@ -77,8 +76,3 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
|
|||||||
|
|
||||||
debug_show_held_locks(task);
|
debug_show_held_locks(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, sp, KERN_INFO);
|
|
||||||
}
|
|
||||||
|
@ -198,8 +198,7 @@ static void show_stacktrace(struct task_struct *task,
|
|||||||
show_backtrace(task, regs, loglvl);
|
show_backtrace(task, regs, loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
|
void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
struct pt_regs regs;
|
struct pt_regs regs;
|
||||||
mm_segment_t old_fs = get_fs();
|
mm_segment_t old_fs = get_fs();
|
||||||
@ -227,11 +226,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
|
|||||||
set_fs(old_fs);
|
set_fs(old_fs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, sp, KERN_DEFAULT)
|
|
||||||
}
|
|
||||||
|
|
||||||
static void show_code(unsigned int __user *pc)
|
static void show_code(unsigned int __user *pc)
|
||||||
{
|
{
|
||||||
long i;
|
long i;
|
||||||
|
@ -135,8 +135,7 @@ static void __dump(struct task_struct *tsk, unsigned long *base_reg,
|
|||||||
printk("%s\n", loglvl);
|
printk("%s\n", loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
|
void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
unsigned long *base_reg;
|
unsigned long *base_reg;
|
||||||
|
|
||||||
@ -157,11 +156,6 @@ void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
|
|||||||
barrier();
|
barrier();
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *tsk, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(tsk, sp, KERN_EMERG);
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFINE_SPINLOCK(die_lock);
|
DEFINE_SPINLOCK(die_lock);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -52,14 +52,13 @@ void _exception(int signo, struct pt_regs *regs, int code, unsigned long addr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The show_stack(), show_stack_loglvl() are external API
|
* The show_stack() is external API which we do not use ourselves.
|
||||||
* which we do not use ourselves.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int kstack_depth_to_print = 48;
|
int kstack_depth_to_print = 48;
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
|
void show_stack(struct task_struct *task, unsigned long *stack,
|
||||||
const char *loglvl)
|
const char *loglvl)
|
||||||
{
|
{
|
||||||
unsigned long *endstack, addr;
|
unsigned long *endstack, addr;
|
||||||
int i;
|
int i;
|
||||||
@ -106,11 +105,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
|
|||||||
printk("%s\n", loglvl);
|
printk("%s\n", loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *stack)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, stack, KERN_EMERG);
|
|
||||||
}
|
|
||||||
|
|
||||||
void __init trap_init(void)
|
void __init trap_init(void)
|
||||||
{
|
{
|
||||||
/* Nothing to do here */
|
/* Nothing to do here */
|
||||||
|
@ -48,8 +48,7 @@ void print_trace(void *data, unsigned long addr, int reliable)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* displays a short stack trace */
|
/* displays a short stack trace */
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *esp,
|
void show_stack(struct task_struct *task, unsigned long *esp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
if (esp == NULL)
|
if (esp == NULL)
|
||||||
esp = (unsigned long *)&esp;
|
esp = (unsigned long *)&esp;
|
||||||
@ -58,11 +57,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *esp,
|
|||||||
unwind_stack((void *)loglvl, esp, print_trace);
|
unwind_stack((void *)loglvl, esp, print_trace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *esp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, esp, KERN_EMERG);
|
|
||||||
}
|
|
||||||
|
|
||||||
void show_registers(struct pt_regs *regs)
|
void show_registers(struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -104,7 +98,7 @@ void show_registers(struct pt_regs *regs)
|
|||||||
if (in_kernel) {
|
if (in_kernel) {
|
||||||
|
|
||||||
printk("\nStack: ");
|
printk("\nStack: ");
|
||||||
show_stack(NULL, (unsigned long *)esp);
|
show_stack(NULL, (unsigned long *)esp, KERN_EMERG);
|
||||||
|
|
||||||
printk("\nCode: ");
|
printk("\nCode: ");
|
||||||
if (regs->pc < PAGE_OFFSET)
|
if (regs->pc < PAGE_OFFSET)
|
||||||
|
@ -198,17 +198,11 @@ static void parisc_show_stack(struct task_struct *task,
|
|||||||
do_show_stack(&info, loglvl);
|
do_show_stack(&info, loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *t, unsigned long *sp,
|
void show_stack(struct task_struct *t, unsigned long *sp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
parisc_show_stack(t, NULL, loglvl);
|
parisc_show_stack(t, NULL, loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *t, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(t, sp, KERN_CRIT)
|
|
||||||
}
|
|
||||||
|
|
||||||
int is_valid_bugaddr(unsigned long iaoq)
|
int is_valid_bugaddr(unsigned long iaoq)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1456,7 +1456,7 @@ void show_regs(struct pt_regs * regs)
|
|||||||
printk("NIP ["REG"] %pS\n", regs->nip, (void *)regs->nip);
|
printk("NIP ["REG"] %pS\n", regs->nip, (void *)regs->nip);
|
||||||
printk("LR ["REG"] %pS\n", regs->link, (void *)regs->link);
|
printk("LR ["REG"] %pS\n", regs->link, (void *)regs->link);
|
||||||
#endif
|
#endif
|
||||||
show_stack(current, (unsigned long *) regs->gpr[1]);
|
show_stack(current, (unsigned long *) regs->gpr[1], KERN_DEFAULT);
|
||||||
if (!user_mode(regs))
|
if (!user_mode(regs))
|
||||||
show_instructions(regs);
|
show_instructions(regs);
|
||||||
}
|
}
|
||||||
@ -2063,8 +2063,8 @@ unsigned long get_wchan(struct task_struct *p)
|
|||||||
|
|
||||||
static int kstack_depth_to_print = CONFIG_PRINT_STACK_DEPTH;
|
static int kstack_depth_to_print = CONFIG_PRINT_STACK_DEPTH;
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *tsk, unsigned long *stack,
|
void show_stack(struct task_struct *tsk, unsigned long *stack,
|
||||||
const char *loglvl)
|
const char *loglvl)
|
||||||
{
|
{
|
||||||
unsigned long sp, ip, lr, newsp;
|
unsigned long sp, ip, lr, newsp;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
@ -2133,11 +2133,6 @@ void show_stack_loglvl(struct task_struct *tsk, unsigned long *stack,
|
|||||||
put_task_stack(tsk);
|
put_task_stack(tsk);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *tsk, unsigned long *stack)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(tsk, stack, KERN_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_PPC64
|
#ifdef CONFIG_PPC64
|
||||||
/* Called with hard IRQs off */
|
/* Called with hard IRQs off */
|
||||||
void notrace __ppc64_runlatch_on(void)
|
void notrace __ppc64_runlatch_on(void)
|
||||||
|
@ -260,7 +260,7 @@ static void raise_backtrace_ipi(cpumask_t *mask)
|
|||||||
pr_cont(" current pointer corrupt? (%px)\n", p->__current);
|
pr_cont(" current pointer corrupt? (%px)\n", p->__current);
|
||||||
|
|
||||||
pr_warn("Back trace of paca->saved_r1 (0x%016llx) (possibly stale):\n", p->saved_r1);
|
pr_warn("Back trace of paca->saved_r1 (0x%016llx) (possibly stale):\n", p->saved_r1);
|
||||||
show_stack(p->__current, (unsigned long *)p->saved_r1);
|
show_stack(p->__current, (unsigned long *)p->saved_r1, KERN_WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,18 +105,12 @@ static bool print_trace_address(unsigned long pc, void *arg)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
|
void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
pr_cont("Call Trace:\n");
|
pr_cont("Call Trace:\n");
|
||||||
walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
|
walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, sp, KERN_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool save_wchan(unsigned long pc, void *arg)
|
static bool save_wchan(unsigned long pc, void *arg)
|
||||||
{
|
{
|
||||||
if (!in_sched_functions(pc)) {
|
if (!in_sched_functions(pc)) {
|
||||||
|
@ -126,7 +126,7 @@ int get_stack_info(unsigned long sp, struct task_struct *task,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
|
void show_stack(struct task_struct *task, unsigned long *stack,
|
||||||
const char *loglvl)
|
const char *loglvl)
|
||||||
{
|
{
|
||||||
struct unwind_state state;
|
struct unwind_state state;
|
||||||
@ -139,11 +139,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
|
|||||||
debug_show_held_locks(task ? : current);
|
debug_show_held_locks(task ? : current);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *stack)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, stack, KERN_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void show_last_breaking_event(struct pt_regs *regs)
|
static void show_last_breaking_event(struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
printk("Last Breaking-Event-Address:\n");
|
printk("Last Breaking-Event-Address:\n");
|
||||||
@ -181,7 +176,7 @@ void show_regs(struct pt_regs *regs)
|
|||||||
show_registers(regs);
|
show_registers(regs);
|
||||||
/* Show stack backtrace if pt_regs is from kernel mode */
|
/* Show stack backtrace if pt_regs is from kernel mode */
|
||||||
if (!user_mode(regs))
|
if (!user_mode(regs))
|
||||||
show_stack(NULL, (unsigned long *) regs->gprs[15]);
|
show_stack(NULL, (unsigned long *) regs->gprs[15], KERN_DEFAULT);
|
||||||
show_last_breaking_event(regs);
|
show_last_breaking_event(regs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,8 +144,7 @@ void show_trace(struct task_struct *tsk, unsigned long *sp,
|
|||||||
debug_show_held_locks(tsk);
|
debug_show_held_locks(tsk);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
|
void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
unsigned long stack;
|
unsigned long stack;
|
||||||
|
|
||||||
@ -161,8 +160,3 @@ void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
|
|||||||
(unsigned long)task_stack_page(tsk));
|
(unsigned long)task_stack_page(tsk));
|
||||||
show_trace(tsk, sp, NULL, loglvl);
|
show_trace(tsk, sp, NULL, loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, sp, KERN_DEFAULT);
|
|
||||||
}
|
|
||||||
|
@ -145,12 +145,10 @@ void show_regs(struct pt_regs *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The show_stack(), show_stack_loglvl() are external APIs which
|
* The show_stack() is external API which we do not use ourselves.
|
||||||
* we do not use ourselves.
|
|
||||||
* The oops is printed in die_if_kernel.
|
* The oops is printed in die_if_kernel.
|
||||||
*/
|
*/
|
||||||
void show_stack_loglvl(struct task_struct *tsk, unsigned long *_ksp,
|
void show_stack(struct task_struct *tsk, unsigned long *_ksp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
unsigned long pc, fp;
|
unsigned long pc, fp;
|
||||||
unsigned long task_base;
|
unsigned long task_base;
|
||||||
@ -179,11 +177,6 @@ void show_stack_loglvl(struct task_struct *tsk, unsigned long *_ksp,
|
|||||||
printk("%s\n", loglvl);
|
printk("%s\n", loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, sp, KERN_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Free current thread data structures etc..
|
* Free current thread data structures etc..
|
||||||
*/
|
*/
|
||||||
|
@ -195,7 +195,7 @@ void show_regs(struct pt_regs *regs)
|
|||||||
regs->u_regs[15]);
|
regs->u_regs[15]);
|
||||||
printk("RPC: <%pS>\n", (void *) regs->u_regs[15]);
|
printk("RPC: <%pS>\n", (void *) regs->u_regs[15]);
|
||||||
show_regwindow(regs);
|
show_regwindow(regs);
|
||||||
show_stack(current, (unsigned long *) regs->u_regs[UREG_FP]);
|
show_stack(current, (unsigned long *)regs->u_regs[UREG_FP], KERN_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
union global_cpu_snapshot global_cpu_snapshot[NR_CPUS];
|
union global_cpu_snapshot global_cpu_snapshot[NR_CPUS];
|
||||||
|
@ -2453,8 +2453,7 @@ static void user_instruction_dump(unsigned int __user *pc)
|
|||||||
printk("\n");
|
printk("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *tsk, unsigned long *_ksp,
|
void show_stack(struct task_struct *tsk, unsigned long *_ksp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
unsigned long fp, ksp;
|
unsigned long fp, ksp;
|
||||||
struct thread_info *tp;
|
struct thread_info *tp;
|
||||||
@ -2514,11 +2513,6 @@ void show_stack_loglvl(struct task_struct *tsk, unsigned long *_ksp,
|
|||||||
} while (++count < 16);
|
} while (++count < 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *tsk, unsigned long *_ksp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, sp, KERN_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct reg_window *kernel_stack_up(struct reg_window *rw)
|
static inline struct reg_window *kernel_stack_up(struct reg_window *rw)
|
||||||
{
|
{
|
||||||
unsigned long fp = rw->ins[6];
|
unsigned long fp = rw->ins[6];
|
||||||
|
@ -648,7 +648,7 @@ static void stack_proc(void *arg)
|
|||||||
{
|
{
|
||||||
struct task_struct *task = arg;
|
struct task_struct *task = arg;
|
||||||
|
|
||||||
show_stack(task, NULL);
|
show_stack(task, NULL, KERN_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -27,7 +27,7 @@ static const struct stacktrace_ops stackops = {
|
|||||||
.address = _print_addr
|
.address = _print_addr
|
||||||
};
|
};
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
|
void show_stack(struct task_struct *task, unsigned long *stack,
|
||||||
const char *loglvl)
|
const char *loglvl)
|
||||||
{
|
{
|
||||||
struct pt_regs *segv_regs = current->thread.segv_regs;
|
struct pt_regs *segv_regs = current->thread.segv_regs;
|
||||||
@ -56,8 +56,3 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
|
|||||||
dump_trace(current, &stackops, (void *)loglvl);
|
dump_trace(current, &stackops, (void *)loglvl);
|
||||||
printk("%s\n", loglvl);
|
printk("%s\n", loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *stack)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, stack, KERN_INFO);
|
|
||||||
}
|
|
||||||
|
@ -167,18 +167,13 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
|
|||||||
c_backtrace(fp, loglvl);
|
c_backtrace(fp, loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
|
void show_stack(struct task_struct *tsk, unsigned long *sp,
|
||||||
const char *loglvl)
|
const char *loglvl)
|
||||||
{
|
{
|
||||||
dump_backtrace(NULL, tsk, loglvl);
|
dump_backtrace(NULL, tsk, loglvl);
|
||||||
barrier();
|
barrier();
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *tsk, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(tsk, sp, KERN_DEFAULT)
|
|
||||||
}
|
|
||||||
|
|
||||||
static int __die(const char *str, int err, struct thread_info *thread,
|
static int __die(const char *str, int err, struct thread_info *thread,
|
||||||
struct pt_regs *regs)
|
struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -159,7 +159,7 @@ static void dump_leak(void)
|
|||||||
return;
|
return;
|
||||||
dump = 1;
|
dump = 1;
|
||||||
|
|
||||||
show_stack_loglvl(NULL, NULL, KERN_ERR);
|
show_stack(NULL, NULL, KERN_ERR);
|
||||||
debug_dma_dump_mappings(NULL);
|
debug_dma_dump_mappings(NULL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -279,7 +279,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
|
void show_stack(struct task_struct *task, unsigned long *sp,
|
||||||
const char *loglvl)
|
const char *loglvl)
|
||||||
{
|
{
|
||||||
task = task ? : current;
|
task = task ? : current;
|
||||||
@ -294,11 +294,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
|
|||||||
show_trace_log_lvl(task, NULL, sp, loglvl);
|
show_trace_log_lvl(task, NULL, sp, loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, sp, KERN_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
void show_stack_regs(struct pt_regs *regs)
|
void show_stack_regs(struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
show_trace_log_lvl(current, regs, NULL, KERN_DEFAULT);
|
show_trace_log_lvl(current, regs, NULL, KERN_DEFAULT);
|
||||||
|
@ -501,8 +501,7 @@ static void show_trace(struct task_struct *task, unsigned long *sp,
|
|||||||
#define STACK_DUMP_LINE_SIZE 32
|
#define STACK_DUMP_LINE_SIZE 32
|
||||||
static size_t kstack_depth_to_print = CONFIG_PRINT_STACK_DEPTH;
|
static size_t kstack_depth_to_print = CONFIG_PRINT_STACK_DEPTH;
|
||||||
|
|
||||||
void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
|
void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
|
||||||
const char *loglvl)
|
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
@ -519,11 +518,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
|
|||||||
show_trace(task, sp, loglvl);
|
show_trace(task, sp, loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_stack(struct task_struct *task, unsigned long *sp)
|
|
||||||
{
|
|
||||||
show_stack_loglvl(task, sp, KERN_INFO);
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFINE_SPINLOCK(die_lock);
|
DEFINE_SPINLOCK(die_lock);
|
||||||
|
|
||||||
void die(const char * str, struct pt_regs * regs, long err)
|
void die(const char * str, struct pt_regs * regs, long err)
|
||||||
@ -540,7 +534,7 @@ void die(const char * str, struct pt_regs * regs, long err)
|
|||||||
pr_info("%s: sig: %ld [#%d]%s\n", str, err, ++die_counter, pr);
|
pr_info("%s: sig: %ld [#%d]%s\n", str, err, ++die_counter, pr);
|
||||||
show_regs(regs);
|
show_regs(regs);
|
||||||
if (!user_mode(regs))
|
if (!user_mode(regs))
|
||||||
show_stack(NULL, (unsigned long*)regs->areg[1]);
|
show_stack(NULL, (unsigned long *)regs->areg[1], KERN_INFO);
|
||||||
|
|
||||||
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
|
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
|
||||||
spin_unlock_irq(&die_lock);
|
spin_unlock_irq(&die_lock);
|
||||||
|
@ -519,7 +519,7 @@ static void dpm_watchdog_handler(struct timer_list *t)
|
|||||||
struct dpm_watchdog *wd = from_timer(wd, t, timer);
|
struct dpm_watchdog *wd = from_timer(wd, t, timer);
|
||||||
|
|
||||||
dev_emerg(wd->dev, "**** DPM device timeout ****\n");
|
dev_emerg(wd->dev, "**** DPM device timeout ****\n");
|
||||||
show_stack_loglvl(wd->tsk, NULL, KERN_EMERG);
|
show_stack(wd->tsk, NULL, KERN_EMERG);
|
||||||
panic("%s %s: unrecoverable failure\n",
|
panic("%s %s: unrecoverable failure\n",
|
||||||
dev_driver_string(wd->dev), dev_name(wd->dev));
|
dev_driver_string(wd->dev), dev_name(wd->dev));
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ static void showacpu(void *dummy)
|
|||||||
|
|
||||||
raw_spin_lock_irqsave(&show_lock, flags);
|
raw_spin_lock_irqsave(&show_lock, flags);
|
||||||
pr_info("CPU%d:\n", smp_processor_id());
|
pr_info("CPU%d:\n", smp_processor_id());
|
||||||
show_stack_loglvl(NULL, NULL, KERN_INFO);
|
show_stack(NULL, NULL, KERN_INFO);
|
||||||
raw_spin_unlock_irqrestore(&show_lock, flags);
|
raw_spin_unlock_irqrestore(&show_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,9 +30,8 @@ extern void show_regs(struct pt_regs *);
|
|||||||
* task), SP is the stack pointer of the first frame that should be shown in the back
|
* task), SP is the stack pointer of the first frame that should be shown in the back
|
||||||
* trace (or NULL if the entire call-chain of the task should be shown).
|
* 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(struct task_struct *task, unsigned long *sp,
|
||||||
extern void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
|
const char *loglvl);
|
||||||
const char *loglvl);
|
|
||||||
|
|
||||||
extern void sched_show_task(struct task_struct *p);
|
extern void sched_show_task(struct task_struct *p);
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ static void kdb_show_stack(struct task_struct *p, void *addr)
|
|||||||
kdb_dump_stack_on_cpu(kdb_process_cpu(p));
|
kdb_dump_stack_on_cpu(kdb_process_cpu(p));
|
||||||
console_loglevel = old_lvl;
|
console_loglevel = old_lvl;
|
||||||
} else {
|
} else {
|
||||||
show_stack_loglvl(p, addr, KERN_EMERG);
|
show_stack(p, addr, KERN_EMERG);
|
||||||
}
|
}
|
||||||
|
|
||||||
kdb_trap_printk--;
|
kdb_trap_printk--;
|
||||||
|
@ -125,7 +125,7 @@ void debug_rt_mutex_print_deadlock(struct rt_mutex_waiter *waiter)
|
|||||||
|
|
||||||
printk("\n%s/%d's [blocked] stackdump:\n\n",
|
printk("\n%s/%d's [blocked] stackdump:\n\n",
|
||||||
task->comm, task_pid_nr(task));
|
task->comm, task_pid_nr(task));
|
||||||
show_stack_loglvl(task, NULL, KERN_DEFAULT);
|
show_stack(task, NULL, KERN_DEFAULT);
|
||||||
printk("\n%s/%d's [current] stackdump:\n\n",
|
printk("\n%s/%d's [current] stackdump:\n\n",
|
||||||
current->comm, task_pid_nr(current));
|
current->comm, task_pid_nr(current));
|
||||||
dump_stack();
|
dump_stack();
|
||||||
|
@ -6025,7 +6025,7 @@ void sched_show_task(struct task_struct *p)
|
|||||||
(unsigned long)task_thread_info(p)->flags);
|
(unsigned long)task_thread_info(p)->flags);
|
||||||
|
|
||||||
print_worker_info(KERN_INFO, p);
|
print_worker_info(KERN_INFO, p);
|
||||||
show_stack_loglvl(p, NULL, KERN_INFO);
|
show_stack(p, NULL, KERN_INFO);
|
||||||
put_task_stack(p);
|
put_task_stack(p);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(sched_show_task);
|
EXPORT_SYMBOL_GPL(sched_show_task);
|
||||||
|
@ -74,7 +74,7 @@ void show_regs_print_info(const char *log_lvl)
|
|||||||
static void __dump_stack(void)
|
static void __dump_stack(void)
|
||||||
{
|
{
|
||||||
dump_stack_print_info(KERN_DEFAULT);
|
dump_stack_print_info(KERN_DEFAULT);
|
||||||
show_stack_loglvl(NULL, NULL, KERN_DEFAULT);
|
show_stack(NULL, NULL, KERN_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user