Skip to content

Commit

Permalink
kernel: rename show_stack_loglvl() => show_stack()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
0x7f454c46 authored and torvalds committed Jun 9, 2020
1 parent fe1993a commit 9cb8f06
Show file tree
Hide file tree
Showing 39 changed files with 52 additions and 205 deletions.
8 changes: 1 addition & 7 deletions arch/alpha/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ dik_show_trace(unsigned long *sp, const char *loglvl)

static int kstack_depth_to_print = 24;

void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
const char *loglvl)
void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
{
unsigned long *stack;
int i;
Expand Down Expand Up @@ -174,11 +173,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
dik_show_trace(sp, loglvl);
}

void show_stack(struct task_struct *task, unsigned long *sp)
{
show_stack_loglvl(task, sp, KERN_DEFAULT);
}

void
die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15)
{
Expand Down
8 changes: 1 addition & 7 deletions arch/arc/kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,11 @@ noinline void show_stacktrace(struct task_struct *tsk, struct pt_regs *regs,
EXPORT_SYMBOL(show_stacktrace);

/* Expected by sched Code */
void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
const char *loglvl)
void show_stack(struct task_struct *tsk, unsigned long *sp, const char *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
* Of course just returning schedule( ) would be pointless so unwind until
* the function is not in schedular code
Expand Down
8 changes: 1 addition & 7 deletions arch/arm/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,18 +247,12 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
}
#endif

void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
const char *loglvl)
void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl)
{
dump_backtrace(NULL, tsk, loglvl);
barrier();
}

void show_stack(struct task_struct *tsk, unsigned long *sp)
{
show_stack_loglvl(tsk, sp, KERN_DEFAULT);
}

#ifdef CONFIG_PREEMPT
#define S_PREEMPT " PREEMPT"
#elif defined(CONFIG_PREEMPT_RT)
Expand Down
8 changes: 1 addition & 7 deletions arch/arm64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,12 @@ void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
put_task_stack(tsk);
}

void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
const char *loglvl)
void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl)
{
dump_backtrace(NULL, tsk, loglvl);
barrier();
}

void show_stack(struct task_struct *tsk, unsigned long *sp)
{
show_stack_loglvl(tsk, sp, KERN_DEFAULT);
}

#ifdef CONFIG_PREEMPT
#define S_PREEMPT " PREEMPT"
#elif defined(CONFIG_PREEMPT_RT)
Expand Down
7 changes: 1 addition & 6 deletions arch/c6x/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ static void show_trace(unsigned long *stack, unsigned long *endstack,
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)
{
unsigned long *p, *endstack;
Expand Down Expand Up @@ -403,11 +403,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
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)
{
return __kernel_text_address(addr);
Expand Down
4 changes: 2 additions & 2 deletions arch/csky/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ asmlinkage void syscall_trace_exit(struct pt_regs *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)
{
unsigned long *sp;
Expand Down Expand Up @@ -420,6 +420,6 @@ void show_regs(struct pt_regs *fp)
}
pr_cont("\n");

show_stack(NULL, (unsigned long *)fp->regs[4]);
show_stack(NULL, (unsigned long *)fp->regs[4], KERN_INFO);
return;
}
9 changes: 1 addition & 8 deletions arch/csky/kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,12 @@ static bool print_trace_address(unsigned long pc, void *arg)
return false;
}

void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
const char *loglvl)
void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
{
pr_cont("Call Trace:\n");
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)
{
if (!in_sched_functions(pc)) {
Expand Down
8 changes: 1 addition & 7 deletions arch/h8300/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ void die(const char *str, struct pt_regs *fp, unsigned long err)

static int kstack_depth_to_print = 24;

void show_stack_loglvl(struct task_struct *task, unsigned long *esp,
const char *loglvl)
void show_stack(struct task_struct *task, unsigned long *esp, const char *loglvl)
{
unsigned long *stack, addr;
int i;
Expand Down Expand Up @@ -158,8 +157,3 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *esp,
}
printk("%s\n", loglvl);
}

void show_stack(struct task_struct *task, unsigned long *esp)
{
show_stack_loglvl(task, esp, KERN_INFO);
}
8 changes: 1 addition & 7 deletions arch/hexagon/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
const char *loglvl)
void show_stack(struct task_struct *task, unsigned long *fp, const char *loglvl)
{
/* Saved link reg is one word above FP */
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)
{
static struct {
Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/kernel/mca.c
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,7 @@ default_monarch_init_process(struct notifier_block *self, unsigned long val, voi
if (read_trylock(&tasklist_lock)) {
do_each_thread (g, t) {
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);
read_unlock(&tasklist_lock);
}
Expand Down
11 changes: 2 additions & 9 deletions arch/ia64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ ia64_do_show_stack (struct unw_frame_info *info, void *arg)
}

void
show_stack_loglvl (struct task_struct *task, unsigned long *sp,
const char *loglvl)
show_stack (struct task_struct *task, unsigned long *sp, const char *loglvl)
{
if (!task)
unw_init_running(ia64_do_show_stack, (void *)loglvl);
Expand All @@ -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
show_regs (struct pt_regs *regs)
{
Expand Down Expand Up @@ -158,7 +151,7 @@ show_regs (struct pt_regs *regs)
((i == sof - 1) || (i % 3) == 2) ? "\n" : " ");
}
} else
show_stack(NULL, NULL);
show_stack(NULL, NULL, KERN_DEFAULT);
}

/* local support for deprecated console_print */
Expand Down
11 changes: 3 additions & 8 deletions arch/m68k/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ void show_registers(struct pt_regs *regs)
default:
pr_cont("\n");
}
show_stack(NULL, (unsigned long *)addr);
show_stack(NULL, (unsigned long *)addr, KERN_INFO);

pr_info("Code:");
set_fs(KERNEL_DS);
Expand All @@ -935,8 +935,8 @@ void show_registers(struct pt_regs *regs)
pr_cont("\n");
}

void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
const char *loglvl)
void show_stack(struct task_struct *task, unsigned long *stack,
const char *loglvl)
{
unsigned long *p;
unsigned long *endstack;
Expand All @@ -963,11 +963,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
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 "fs" (Fault Status) bits on ColdFire. These are in the bottom
Expand Down
8 changes: 1 addition & 7 deletions arch/microblaze/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ static int __init kstack_setup(char *s)
}
__setup("kstack=", kstack_setup);

void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
const char *loglvl)
void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
{
unsigned long words_to_show;
u32 fp = (u32) sp;
Expand Down Expand Up @@ -77,8 +76,3 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *sp,

debug_show_held_locks(task);
}

void show_stack(struct task_struct *task, unsigned long *sp)
{
show_stack_loglvl(task, sp, KERN_INFO);
}
8 changes: 1 addition & 7 deletions arch/mips/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ static void show_stacktrace(struct task_struct *task,
show_backtrace(task, regs, loglvl);
}

void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
const char *loglvl)
void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
{
struct pt_regs regs;
mm_segment_t old_fs = get_fs();
Expand Down Expand Up @@ -227,11 +226,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
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)
{
long i;
Expand Down
8 changes: 1 addition & 7 deletions arch/nds32/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ static void __dump(struct task_struct *tsk, unsigned long *base_reg,
printk("%s\n", loglvl);
}

void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
const char *loglvl)
void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl)
{
unsigned long *base_reg;

Expand All @@ -157,11 +156,6 @@ void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
barrier();
}

void show_stack(struct task_struct *tsk, unsigned long *sp)
{
show_stack_loglvl(tsk, sp, KERN_EMERG);
}

DEFINE_SPINLOCK(die_lock);

/*
Expand Down
12 changes: 3 additions & 9 deletions arch/nios2/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* which we do not use ourselves.
* The show_stack() is external API which we do not use ourselves.
*/

int kstack_depth_to_print = 48;

void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
const char *loglvl)
void show_stack(struct task_struct *task, unsigned long *stack,
const char *loglvl)
{
unsigned long *endstack, addr;
int i;
Expand Down Expand Up @@ -106,11 +105,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
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)
{
/* Nothing to do here */
Expand Down
10 changes: 2 additions & 8 deletions arch/openrisc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ void print_trace(void *data, unsigned long addr, int reliable)
}

/* displays a short stack trace */
void show_stack_loglvl(struct task_struct *task, unsigned long *esp,
const char *loglvl)
void show_stack(struct task_struct *task, unsigned long *esp, const char *loglvl)
{
if (esp == NULL)
esp = (unsigned long *)&esp;
Expand All @@ -58,11 +57,6 @@ void show_stack_loglvl(struct task_struct *task, unsigned long *esp,
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)
{
int i;
Expand Down Expand Up @@ -104,7 +98,7 @@ void show_registers(struct pt_regs *regs)
if (in_kernel) {

printk("\nStack: ");
show_stack(NULL, (unsigned long *)esp);
show_stack(NULL, (unsigned long *)esp, KERN_EMERG);

printk("\nCode: ");
if (regs->pc < PAGE_OFFSET)
Expand Down
8 changes: 1 addition & 7 deletions arch/parisc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,11 @@ static void parisc_show_stack(struct task_struct *task,
do_show_stack(&info, loglvl);
}

void show_stack_loglvl(struct task_struct *t, unsigned long *sp,
const char *loglvl)
void show_stack(struct task_struct *t, unsigned long *sp, const char *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)
{
return 1;
Expand Down
Loading

0 comments on commit 9cb8f06

Please sign in to comment.