From: sergey.senozhatsky.work@gmail.com (Sergey Senozhatsky)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 04/13] ia64: do not use print_symbol()
Date: Mon, 11 Dec 2017 21:50:16 +0900 [thread overview]
Message-ID: <20171211125025.2270-5-sergey.senozhatsky@gmail.com> (raw)
In-Reply-To: <20171211125025.2270-1-sergey.senozhatsky@gmail.com>
print_symbol() uses extra stack space to sprintf() symbol
information and then to feed that buffer to printk()
char buffer[KSYM_SYMBOL_LEN];
sprint_symbol(buffer, address);
printk(fmt, buffer);
Replace print_symbol() with a direct printk("%pS") call.
Additionally ia64_do_show_stack() had extra buffer [128
bytes on stack], which we also can drop now.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
---
arch/ia64/kernel/process.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index dda0082056b3..968b5f33e725 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -13,7 +13,6 @@
#include <linux/pm.h>
#include <linux/elf.h>
#include <linux/errno.h>
-#include <linux/kallsyms.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/slab.h>
@@ -69,7 +68,6 @@ void
ia64_do_show_stack (struct unw_frame_info *info, void *arg)
{
unsigned long ip, sp, bsp;
- char buf[128]; /* don't make it so big that it overflows the stack! */
printk("\nCall Trace:\n");
do {
@@ -79,11 +77,9 @@ ia64_do_show_stack (struct unw_frame_info *info, void *arg)
unw_get_sp(info, &sp);
unw_get_bsp(info, &bsp);
- snprintf(buf, sizeof(buf),
- " [<%016lx>] %%s\n"
+ printk(" [<%016lx>] %pS\n"
" sp=%016lx bsp=%016lx\n",
- ip, sp, bsp);
- print_symbol(buf, ip);
+ ip, (void *)ip, sp, bsp);
} while (unw_unwind(info) >= 0);
}
@@ -111,7 +107,7 @@ show_regs (struct pt_regs *regs)
printk("psr : %016lx ifs : %016lx ip : [<%016lx>] %s (%s)\n",
regs->cr_ipsr, regs->cr_ifs, ip, print_tainted(),
init_utsname()->release);
- print_symbol("ip is at %s\n", ip);
+ printk("ip is at %pS\n", (void *)ip);
printk("unat: %016lx pfs : %016lx rsc : %016lx\n",
regs->ar_unat, regs->ar_pfs, regs->ar_rsc);
printk("rnat: %016lx bsps: %016lx pr : %016lx\n",
--
2.15.1
next prev parent reply other threads:[~2017-12-11 12:50 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-11 12:50 [PATCH 00/13] replace print_symbol() with printk()-s Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 01/13] arm: do not use print_symbol() Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 02/13] arm64: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 03/13] c6x: " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky [this message]
2017-12-11 12:50 ` [PATCH 05/13] mn10300: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 06/13] sh: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 07/13] unicore32: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 08/13] x86: " Sergey Senozhatsky
2017-12-11 17:45 ` Borislav Petkov
2017-12-12 2:41 ` Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 09/13] drivers: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 10/13] sysfs: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 11/13] irq debug: " Sergey Senozhatsky
2017-12-11 12:55 ` David Laight
2017-12-12 2:50 ` Sergey Senozhatsky
2017-12-12 7:34 ` [PATCHv2 " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 12/13] lib: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 13/13] arc: do not use __print_symbol() Sergey Senozhatsky
2017-12-11 16:28 ` Vineet Gupta
2017-12-12 2:41 ` Sergey Senozhatsky
2017-12-11 16:26 ` [PATCH 00/13] replace print_symbol() with printk()-s Joe Perches
2017-12-12 2:47 ` Sergey Senozhatsky
2017-12-12 3:10 ` Joe Perches
2017-12-21 5:54 ` Sergey Senozhatsky
2017-12-20 10:20 ` Sergey Senozhatsky
2018-01-05 10:03 ` Petr Mladek
2018-01-05 10:21 ` Sergey Senozhatsky
2018-01-05 10:25 ` Sergey Senozhatsky
2018-01-05 14:42 ` Petr Mladek
2018-01-05 14:57 ` Sergey Senozhatsky
2018-01-08 2:09 ` Sergey Senozhatsky
[not found] ` <20180116163301.lh76kvjheyobjgkp@pathway.suse.cz>
2018-01-17 2:36 ` Sergey Senozhatsky
2018-01-05 11:38 ` Petr Mladek
2018-01-05 12:01 ` Sergey Senozhatsky
2018-01-05 12:23 ` Sergey Senozhatsky
2018-01-05 13:09 ` Petr Mladek
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=20171211125025.2270-5-sergey.senozhatsky@gmail.com \
--to=sergey.senozhatsky.work@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).