public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Brian Cain" <bcain@codeaurora.org>
To: "'Dmitry Safonov'" <dima@arista.com>, <linux-kernel@vger.kernel.org>
Cc: "'Dmitry Safonov'" <0x7f454c46@gmail.com>,
	"'Andrew Morton'" <akpm@linux-foundation.org>,
	"'Greg Kroah-Hartman'" <gregkh@linuxfoundation.org>,
	"'Ingo Molnar'" <mingo@kernel.org>,
	"'Jiri Slaby'" <jslaby@suse.com>,
	"'Petr Mladek'" <pmladek@suse.com>,
	"'Sergey Senozhatsky'" <sergey.senozhatsky@gmail.com>,
	"'Steven Rostedt'" <rostedt@goodmis.org>,
	"'Tetsuo Handa'" <penguin-kernel@I-love.SAKURA.ne.jp>,
	<linux-hexagon@vger.kernel.org>
Subject: RE: [PATCHv2 14/50] hexagon: Add show_stack_loglvl()
Date: Tue, 17 Mar 2020 10:34:22 -0500	[thread overview]
Message-ID: <016201d5fc71$89c01ab0$9d405010$@codeaurora.org> (raw)
In-Reply-To: <20200316143916.195608-15-dima@arista.com>

Acked-by: Brian Cain <bcain@codeaurora.org>

> Cc: Brian Cain <bcain@codeaurora.org>
> Cc: linux-hexagon@vger.kernel.org
> [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-
> dima@arista.com/T/#u
> Signed-off-by: Dmitry Safonov <dima@arista.com>
> ---
>  arch/hexagon/kernel/traps.c | 31 +++++++++++++++++--------------
>  1 file changed, 17 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/hexagon/kernel/traps.c b/arch/hexagon/kernel/traps.c
> index 69c623b14ddd..a8a3a210d781 100644
> --- a/arch/hexagon/kernel/traps.c
> +++ b/arch/hexagon/kernel/traps.c
> @@ -79,7 +79,7 @@ static const char *ex_name(int ex)  }
> 
>  static void do_show_stack(struct task_struct *task, unsigned long *fp,
> -			  unsigned long ip)
> +			  unsigned long ip, const char *loglvl)
>  {
>  	int kstack_depth_to_print = 24;
>  	unsigned long offset, size;
> @@ -93,9 +93,8 @@ static void do_show_stack(struct task_struct *task,
> unsigned long *fp,
>  	if (task == NULL)
>  		task = current;
> 
> -	printk(KERN_INFO "CPU#%d, %s/%d, Call Trace:\n",
> -	       raw_smp_processor_id(), task->comm,
> -	       task_pid_nr(task));
> +	printk("%sCPU#%d, %s/%d, Call Trace:\n", loglvl,
> raw_smp_processor_id(),
> +		task->comm, task_pid_nr(task));
> 
>  	if (fp == NULL) {
>  		if (task == current) {
> @@ -108,7 +107,7 @@ static void do_show_stack(struct task_struct *task,
> unsigned long *fp,
>  	}
> 
>  	if ((((unsigned long) fp) & 0x3) || ((unsigned long) fp < 0x1000)) {
> -		printk(KERN_INFO "-- Corrupt frame pointer %p\n", fp);
> +		printk("%s-- Corrupt frame pointer %p\n", loglvl, fp);
>  		return;
>  	}
> 
> @@ -125,8 +124,7 @@ static void do_show_stack(struct task_struct *task,
> unsigned long *fp,
> 
>  		name = kallsyms_lookup(ip, &size, &offset, &modname,
> tmpstr);
> 
> -		printk(KERN_INFO "[%p] 0x%lx: %s + 0x%lx", fp, ip, name,
> -			offset);
> +		printk("%s[%p] 0x%lx: %s + 0x%lx", loglvl, fp, ip, name,
> offset);
>  		if (((unsigned long) fp < low) || (high < (unsigned long)
fp))
>  			printk(KERN_CONT " (FP out of bounds!)");
>  		if (modname)
> @@ -136,8 +134,7 @@ static void do_show_stack(struct task_struct *task,
> unsigned long *fp,
>  		newfp = (unsigned long *) *fp;
> 
>  		if (((unsigned long) newfp) & 0x3) {
> -			printk(KERN_INFO "-- Corrupt frame pointer %p\n",
> -				newfp);
> +			printk("%s-- Corrupt frame pointer %p\n", loglvl,
> newfp);
>  			break;
>  		}
> 
> @@ -147,7 +144,7 @@ static void do_show_stack(struct task_struct *task,
> unsigned long *fp,
>  						+ 8);
> 
>  			if (regs->syscall_nr != -1) {
> -				printk(KERN_INFO "-- trap0 -- syscall_nr:
> %ld",
> +				printk("%s-- trap0 -- syscall_nr: %ld",
loglvl,
>  					regs->syscall_nr);
>  				printk(KERN_CONT "  psp: %lx  elr: %lx\n",
>  					 pt_psp(regs), pt_elr(regs));
> @@ -155,7 +152,7 @@ static void do_show_stack(struct task_struct *task,
> unsigned long *fp,
>  			} else {
>  				/* really want to see more ... */
>  				kstack_depth_to_print += 6;
> -				printk(KERN_INFO "-- %s (0x%lx)  badva:
> %lx\n",
> +				printk("%s-- %s (0x%lx)  badva: %lx\n",
loglvl,
>  					ex_name(pt_cause(regs)),
> pt_cause(regs),
>  					pt_badva(regs));
>  			}
> @@ -178,10 +175,16 @@ static void do_show_stack(struct task_struct
> *task, unsigned long *fp,
>  	}
>  }
> 
> -void show_stack(struct task_struct *task, unsigned long *fp)
> +void show_stack_loglvl(struct task_struct *task, unsigned long *fp,
> +		       const char *loglvl)
>  {
>  	/* Saved link reg is one word above FP */
> -	do_show_stack(task, fp, 0);
> +	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) @@ -207,7 +210,7
> @@ int die(const char *str, struct pt_regs *regs, long err)
> 
>  	print_modules();
>  	show_regs(regs);
> -	do_show_stack(current, &regs->r30, pt_elr(regs));
> +	do_show_stack(current, &regs->r30, pt_elr(regs), KERN_EMERG);
> 
>  	bust_spinlocks(0);
>  	add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
> --
> 2.25.1


  reply	other threads:[~2020-03-17 15:34 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200316143916.195608-1-dima@arista.com>
2020-03-16 14:38 ` [PATCHv2 01/50] kallsyms/printk: Add loglvl to print_ip_sym() Dmitry Safonov
2020-03-16 15:29   ` Joe Perches
2020-04-17 22:59     ` Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 02/50] alpha: Add show_stack_loglvl() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 03/50] arc: " Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 04/50] arm/asm: Add loglvl to c_backtrace() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 05/50] arm: Add loglvl to unwind_backtrace() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 06/50] arm: Add loglvl to dump_backtrace() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 07/50] arm: Wire up dump_backtrace_{entry,stm} Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 08/50] arm: Add show_stack_loglvl() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 09/50] arm64: Add loglvl to dump_backtrace() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 10/50] arm64: Add show_stack_loglvl() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 11/50] c6x: " Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 12/50] csky: " Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 13/50] h8300: " Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 14/50] hexagon: " Dmitry Safonov
2020-03-17 15:34   ` Brian Cain [this message]
2020-03-16 14:38 ` [PATCHv2 15/50] ia64: Pass log level as arg into ia64_do_show_stack() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 16/50] ia64: Add show_stack_loglvl() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 17/50] m68k: " Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 18/50] microblaze: Add loglvl to microblaze_unwind_inner() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 19/50] microblaze: Add loglvl to microblaze_unwind() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 20/50] microblaze: Add show_stack_loglvl() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 21/50] mips: " Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 22/50] nds32: " Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 23/50] nios2: " Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 24/50] openrisc: " Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 25/50] parisc: " Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 26/50] powerpc: " Dmitry Safonov
2020-03-19  4:03   ` Michael Ellerman
2020-03-16 14:38 ` [PATCHv2 27/50] riscv: " Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 28/50] s390: " Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 29/50] sh: Add loglvl to dump_mem() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 30/50] sh: Remove needless printk() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 31/50] sh: Add loglvl to printk_address() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 32/50] sh: Add loglvl to show_trace() Dmitry Safonov
2020-03-16 14:38 ` [PATCHv2 33/50] sh: Add show_stack_loglvl() Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 34/50] sparc: " Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 35/50] um/sysrq: Remove needless variable sp Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 36/50] um: Add show_stack_loglvl() Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 37/50] unicore32: Remove unused pmode argument in c_backtrace() Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 38/50] unicore32: Add loglvl to c_backtrace() Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 39/50] unicore32: Add show_stack_loglvl() Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 40/50] x86: Add missing const qualifiers for log_lvl Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 41/50] x86: Add show_stack_loglvl() Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 42/50] xtensa: Add loglvl to show_trace() Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 43/50] xtensa: Add show_stack_loglvl() Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 44/50] sysrq: Use show_stack_loglvl() Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 45/50] x86/amd_gart: Print stacktrace for a leak with KERN_ERR Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 46/50] power: Use show_stack_loglvl() Dmitry Safonov
2020-03-18 12:54   ` Rafael J. Wysocki
2020-03-16 14:39 ` [PATCHv2 47/50] kdb: Don't play with console_loglevel Dmitry Safonov
2020-03-17  0:06   ` Doug Anderson
2020-03-17 16:00   ` Daniel Thompson
2020-03-16 14:39 ` [PATCHv2 48/50] sched: Print stack trace with KERN_INFO Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 49/50] kernel: Use show_stack_loglvl() Dmitry Safonov
2020-03-16 14:39 ` [PATCHv2 50/50] kernel: Rename show_stack_loglvl() => show_stack() Dmitry Safonov
2020-03-17  2:54   ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='016201d5fc71$89c01ab0$9d405010$@codeaurora.org' \
    --to=bcain@codeaurora.org \
    --cc=0x7f454c46@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dima@arista.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-hexagon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox