All of lore.kernel.org
 help / color / mirror / Atom feed
* [00/13] replace print_symbol() with printk()-s
  2017-12-12  3:10 ` Joe Perches
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-21  5:54 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-21  5:54 UTC (permalink / raw)
  To: Joe Perches
  Cc: Sergey Senozhatsky, Andrew Morton, Russell King, Catalin Marinas,
	Mark Salter, Tony Luck, David Howells, Yoshinori Sato,
	Guan Xuetao, Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu, Steven Rostedt,
	Petr Mladek, LKML, linux-arm-kernel, linux-c6x-dev, linux-ia64,
	linux-am33-list, linux-sh, linux-edac, x86, linux-snps-arc,
	Sergey Senozhatsky

On (12/11/17 19:10), Joe Perches wrote:
[..]
> As far as I'm concerned, as soon as there is
> no longer a single user in the kernel tree,
> better to delete it instead.

sounds good to me. can drop it, once the series upstreamed.

8< ---

From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: [PATCH] kallsyms: remove print_symbol() function

No more print_symbol()/__print_symbol() users left, remove these
symbols.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Suggested-by: Joe Perches <joe@perches.com>
---
 Documentation/filesystems/sysfs.txt                    |  4 ++--
 Documentation/translations/zh_CN/filesystems/sysfs.txt |  4 ++--
 include/linux/kallsyms.h                               | 18 ------------------
 kernel/kallsyms.c                                      | 11 -----------
 4 files changed, 4 insertions(+), 33 deletions(-)

diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 9a3658cc399e..a1426cabcef1 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -154,8 +154,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/Documentation/translations/zh_CN/filesystems/sysfs.txt b/Documentation/translations/zh_CN/filesystems/sysfs.txt
index 7d3b05edb8ce..452271dda141 100644
--- a/Documentation/translations/zh_CN/filesystems/sysfs.txt
+++ b/Documentation/translations/zh_CN/filesystems/sysfs.txt
@@ -167,8 +167,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 7288f9c395b6..d79d1e7486bd 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -94,9 +94,6 @@ extern int sprint_symbol(char *buffer, unsigned long address);
 extern int sprint_symbol_no_offset(char *buffer, unsigned long address);
 extern int sprint_backtrace(char *buffer, unsigned long address);
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-extern void __print_symbol(const char *fmt, unsigned long address);
-
 int lookup_symbol_name(unsigned long addr, char *symname);
 int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
 
@@ -166,23 +163,8 @@ static inline int kallsyms_show_value(void)
 	return false;
 }
 
-/* Stupid that this does nothing, but I didn't create this mess. */
-#define __print_symbol(fmt, addr)
 #endif /*CONFIG_KALLSYMS*/
 
-/* This macro allows us to keep printk typechecking */
-static __printf(1, 2)
-void __check_printsym_format(const char *fmt, ...)
-{
-}
-
-static inline void print_symbol(const char *fmt, unsigned long addr)
-{
-	__check_printsym_format(fmt, "");
-	__print_symbol(fmt, (unsigned long)
-		       __builtin_extract_return_addr((void *)addr));
-}
-
 static inline void print_ip_sym(unsigned long ip)
 {
 	printk("[<%p>] %pS\n", (void *) ip, (void *) ip);
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 24f456689f9c..a23e21ada81b 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -429,17 +429,6 @@ int sprint_backtrace(char *buffer, unsigned long address)
 	return __sprint_symbol(buffer, address, -1, 1);
 }
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-void __print_symbol(const char *fmt, unsigned long address)
-{
-	char buffer[KSYM_SYMBOL_LEN];
-
-	sprint_symbol(buffer, address);
-
-	printk(fmt, buffer);
-}
-EXPORT_SYMBOL(__print_symbol);
-
 /* To avoid using get_symbol_offset for every symbol, we carry prefix along. */
 struct kallsym_iter {
 	loff_t pos;

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [00/13] replace print_symbol() with printk()-s
  2018-01-16 16:33 ` Petr Mladek
                   ` (2 preceding siblings ...)
  (?)
@ 2018-01-17  2:36 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2018-01-17  2:36 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Sergey Senozhatsky, Andrew Morton, Russell King, Catalin Marinas,
	Mark Salter, Tony Luck, David Howells, Yoshinori Sato,
	Guan Xuetao, Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu, Steven Rostedt, LKML,
	linux-arm-kernel, linux-c6x-dev, linux-ia64, linux-am33-list,
	linux-sh, linux-edac, x86, linux-snps-arc, Sergey Senozhatsky

On (01/16/18 17:33), Petr Mladek wrote:
[..]
> > JFI, the patch is in Linus's tree as of now (d0729bc6bee797fb).
> 
> Great. I have pushed the patch that removes printk_symbol()
> into printk.git, branch for-4.16-print-symbol.
> 
> Note that I have updated the commit message similar way
> like I did for the other commits. Especially I wanted
> to mention what it was obsoleted by. The message is:
> 
>   kallsyms: remove print_symbol() function
> 
>   No more print_symbol()/__print_symbol() users left, remove these
>   symbols.
> 
>   It was a very old API that encouraged people use continuous lines.
>   It had been obsoleted by %pS format specifier in a normal printk()
>   call.
> 
> 
> See also
> https://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk.git/commit/?h=for-4.16-print-symbol&id=d2279c9d7f7db7f97567368bfc4539b3411adf8d

thanks!

	-ss
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 180+ messages in thread
* [00/13] replace print_symbol() with printk()-s
  2017-12-11 12:50 ` Sergey Senozhatsky
  (?)
  (?)
@ 2018-01-16 16:33 ` Petr Mladek
  -1 siblings, 0 replies; 180+ messages in thread
From: Petr Mladek @ 2018-01-16 16:33 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu, Steven Rostedt, LKML,
	linux-arm-kernel, linux-c6x-dev, linux-ia64, linux-am33-list,
	linux-sh, linux-edac, x86, linux-snps-arc, Sergey Senozhatsky

On Mon 2018-01-08 11:09:42, Sergey Senozhatsky wrote:
> On (01/05/18 15:42), Petr Mladek wrote:
> > 
> > I am all for it. But I would postpone this removal to 4.17.
> > The reason is rather ugly. 13th patch is already in arc tree.
> > We would need to shuffle the patch or coordinate pull requests.
> 
> JFI, the patch is in Linus's tree as of now (d0729bc6bee797fb).

Great. I have pushed the patch that removes printk_symbol()
into printk.git, branch for-4.16-print-symbol.

Note that I have updated the commit message similar way
like I did for the other commits. Especially I wanted
to mention what it was obsoleted by. The message is:

  kallsyms: remove print_symbol() function

  No more print_symbol()/__print_symbol() users left, remove these
  symbols.

  It was a very old API that encouraged people use continuous lines.
  It had been obsoleted by %pS format specifier in a normal printk()
  call.


See also
https://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk.git/commit/?h=for-4.16-print-symbol&id=d2279c9d7f7db7f97567368bfc4539b3411adf8d

Best Regards,
Petr
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 180+ messages in thread
* [00/13] replace print_symbol() with printk()-s
  2018-01-05 14:42 ` Petr Mladek
                   ` (2 preceding siblings ...)
  (?)
@ 2018-01-08  2:09 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2018-01-08  2:09 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Sergey Senozhatsky, Andrew Morton, Russell King, Catalin Marinas,
	Mark Salter, Tony Luck, David Howells, Yoshinori Sato,
	Guan Xuetao, Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu, Steven Rostedt, LKML,
	linux-arm-kernel, linux-c6x-dev, linux-ia64, linux-am33-list,
	linux-sh, linux-edac, x86, linux-snps-arc, Sergey Senozhatsky

On (01/05/18 15:42), Petr Mladek wrote:
> 
> I am all for it. But I would postpone this removal to 4.17.
> The reason is rather ugly. 13th patch is already in arc tree.
> We would need to shuffle the patch or coordinate pull requests.

JFI, the patch is in Linus's tree as of now (d0729bc6bee797fb).

	-ss
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 180+ messages in thread
* [00/13] replace print_symbol() with printk()-s
  2018-01-05 14:42 ` Petr Mladek
                   ` (2 preceding siblings ...)
  (?)
@ 2018-01-05 14:57 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2018-01-05 14:57 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Sergey Senozhatsky, Andrew Morton, Russell King, Catalin Marinas,
	Mark Salter, Tony Luck, David Howells, Yoshinori Sato,
	Guan Xuetao, Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu, Steven Rostedt, LKML,
	linux-arm-kernel, linux-c6x-dev, linux-ia64, linux-am33-list,
	linux-sh, linux-edac, x86, linux-snps-arc, Sergey Senozhatsky

On (01/05/18 15:42), Petr Mladek wrote:
[..]
> > oh, one more thing. one extra patch, which gets rid of
> > print_symbol()/__print_symbol().
> 
> I am all for it. But I would postpone this removal to 4.17.
> The reason is rather ugly. 13th patch is already in arc tree.
> We would need to shuffle the patch or coordinate pull requests.
> I think that it is not worth it. There is no real hurry.
> I doubt that the would be any new user in the meantime.
> 
> Best Regards,
> Petr
> 
> PS: I have just pushed 12 patches into printk.git for-4.16 branch.
> I will merge this to linux-next branch on Monday. I will not
> be around the computer over the weekend...

OK. thanks!

	-ss
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 180+ messages in thread
* [00/13] replace print_symbol() with printk()-s
  2018-01-05 10:25 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2018-01-05 14:42 ` Petr Mladek
  -1 siblings, 0 replies; 180+ messages in thread
From: Petr Mladek @ 2018-01-05 14:42 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu, Steven Rostedt, LKML,
	linux-arm-kernel, linux-c6x-dev, linux-ia64, linux-am33-list,
	linux-sh, linux-edac, x86, linux-snps-arc, Sergey Senozhatsky

On Fri 2018-01-05 19:25:38, Sergey Senozhatsky wrote:
> On (01/05/18 19:21), Sergey Senozhatsky wrote:
> > On (01/05/18 11:03), Petr Mladek wrote:
> > [..]
> > > Anyway, print_symbol() is an old weird API and it would be nice
> > > to eventually get rid of it. I could take this patches into
> > > printk.git.
> > 
> > no objections from my side if the patch set will go through the printk tree.
> > shall we wait for ACKs or can we move on? do you plan to land it in 4.16?
> > 
> > > Would you mind if I change the commit messages to something like?:
> > > 
> > >     print_symbol() is an old weird API. It has been
> > >     obsoleted by printk() and %pS format specifier.
> > 
> > I wouldn't. let's drop the "weird" part. other than that looks
> > good to me.
> 
> oh, one more thing. one extra patch, which gets rid of
> print_symbol()/__print_symbol().

I am all for it. But I would postpone this removal to 4.17.
The reason is rather ugly. 13th patch is already in arc tree.
We would need to shuffle the patch or coordinate pull requests.
I think that it is not worth it. There is no real hurry.
I doubt that the would be any new user in the meantime.

Best Regards,
Petr

PS: I have just pushed 12 patches into printk.git for-4.16 branch.
I will merge this to linux-next branch on Monday. I will not
be around the computer over the weekend...
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 180+ messages in thread
* [00/13] replace print_symbol() with printk()-s
  2018-01-05 10:21     ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2018-01-05 10:25 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2018-01-05 10:25 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Petr Mladek, Andrew Morton, Russell King, Catalin Marinas,
	Mark Salter, Tony Luck, David Howells, Yoshinori Sato,
	Guan Xuetao, Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu, Steven Rostedt, LKML,
	linux-arm-kernel, linux-c6x-dev, linux-ia64, linux-am33-list,
	linux-sh, linux-edac, x86, linux-snps-arc, Sergey Senozhatsky

On (01/05/18 19:21), Sergey Senozhatsky wrote:
> On (01/05/18 11:03), Petr Mladek wrote:
> [..]
> > Anyway, print_symbol() is an old weird API and it would be nice
> > to eventually get rid of it. I could take this patches into
> > printk.git.
> 
> no objections from my side if the patch set will go through the printk tree.
> shall we wait for ACKs or can we move on? do you plan to land it in 4.16?
> 
> > Would you mind if I change the commit messages to something like?:
> > 
> >     print_symbol() is an old weird API. It has been
> >     obsoleted by printk() and %pS format specifier.
> 
> I wouldn't. let's drop the "weird" part. other than that looks
> good to me.

oh, one more thing. one extra patch, which gets rid of
print_symbol()/__print_symbol().

8< ===

From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: [PATCH] kallsyms: remove print_symbol() function

No more print_symbol()/__print_symbol() users left, remove these
symbols.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Suggested-by: Joe Perches <joe@perches.com>
---
 Documentation/filesystems/sysfs.txt                    |  4 ++--
 Documentation/translations/zh_CN/filesystems/sysfs.txt |  4 ++--
 include/linux/kallsyms.h                               | 18 ------------------
 kernel/kallsyms.c                                      | 11 -----------
 4 files changed, 4 insertions(+), 33 deletions(-)

diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 9a3658cc399e..a1426cabcef1 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -154,8 +154,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/Documentation/translations/zh_CN/filesystems/sysfs.txt b/Documentation/translations/zh_CN/filesystems/sysfs.txt
index 7d3b05edb8ce..452271dda141 100644
--- a/Documentation/translations/zh_CN/filesystems/sysfs.txt
+++ b/Documentation/translations/zh_CN/filesystems/sysfs.txt
@@ -167,8 +167,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 23190e5c940b..657a83b943f0 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -94,9 +94,6 @@ extern int sprint_symbol(char *buffer, unsigned long address);
 extern int sprint_symbol_no_offset(char *buffer, unsigned long address);
 extern int sprint_backtrace(char *buffer, unsigned long address);
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-extern void __print_symbol(const char *fmt, unsigned long address);
-
 int lookup_symbol_name(unsigned long addr, char *symname);
 int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
 
@@ -166,23 +163,8 @@ static inline int kallsyms_show_value(void)
 	return false;
 }
 
-/* Stupid that this does nothing, but I didn't create this mess. */
-#define __print_symbol(fmt, addr)
 #endif /*CONFIG_KALLSYMS*/
 
-/* This macro allows us to keep printk typechecking */
-static __printf(1, 2)
-void __check_printsym_format(const char *fmt, ...)
-{
-}
-
-static inline void print_symbol(const char *fmt, unsigned long addr)
-{
-	__check_printsym_format(fmt, "");
-	__print_symbol(fmt, (unsigned long)
-		       __builtin_extract_return_addr((void *)addr));
-}
-
 static inline void print_ip_sym(unsigned long ip)
 {
 	printk("[<%px>] %pS\n", (void *) ip, (void *) ip);
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 24f456689f9c..a23e21ada81b 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -429,17 +429,6 @@ int sprint_backtrace(char *buffer, unsigned long address)
 	return __sprint_symbol(buffer, address, -1, 1);
 }
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-void __print_symbol(const char *fmt, unsigned long address)
-{
-	char buffer[KSYM_SYMBOL_LEN];
-
-	sprint_symbol(buffer, address);
-
-	printk(fmt, buffer);
-}
-EXPORT_SYMBOL(__print_symbol);
-
 /* To avoid using get_symbol_offset for every symbol, we carry prefix along. */
 struct kallsym_iter {
 	loff_t pos;

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [PATCHv2,11/13] irq debug: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-12  7:34 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-12  7:34 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu, David Laight
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky

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.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/debug.h | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/kernel/irq/debug.h b/kernel/irq/debug.h
index 17f05ef8f575..7e06dd275c17 100644
--- a/kernel/irq/debug.h
+++ b/kernel/irq/debug.h
@@ -3,8 +3,6 @@
  * Debugging printout:
  */
 
-#include <linux/kallsyms.h>
-
 #define ___P(f) if (desc->status_use_accessors & f) printk("%14s set\n", #f)
 #define ___PS(f) if (desc->istate & f) printk("%14s set\n", #f)
 /* FIXME */
@@ -14,14 +12,14 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
 {
 	printk("irq %d, desc: %p, depth: %d, count: %d, unhandled: %d\n",
 		irq, desc, desc->depth, desc->irq_count, desc->irqs_unhandled);
-	printk("->handle_irq():  %p, ", desc->handle_irq);
-	print_symbol("%s\n", (unsigned long)desc->handle_irq);
-	printk("->irq_data.chip(): %p, ", desc->irq_data.chip);
-	print_symbol("%s\n", (unsigned long)desc->irq_data.chip);
+	printk("->handle_irq():  %p, %pS\n",
+		desc->handle_irq, desc->handle_irq);
+	printk("->irq_data.chip(): %p, %pS\n",
+		desc->irq_data.chip, desc->irq_data.chip);
 	printk("->action(): %p\n", desc->action);
 	if (desc->action) {
-		printk("->action->handler(): %p, ", desc->action->handler);
-		print_symbol("%s\n", (unsigned long)desc->action->handler);
+		printk("->action->handler(): %p, %pS\n",
+			desc->action->handler, desc->action->handler);
 	}
 
 	___P(IRQ_LEVEL);

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [00/13] replace print_symbol() with printk()-s
  2017-12-12  2:47 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-12  3:10 ` Joe Perches
  -1 siblings, 0 replies; 180+ messages in thread
From: Joe Perches @ 2017-12-12  3:10 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu, Steven Rostedt,
	Petr Mladek, LKML, linux-arm-kernel, linux-c6x-dev, linux-ia64,
	linux-am33-list, linux-sh, linux-edac, x86, linux-snps-arc,
	Sergey Senozhatsky

On Tue, 2017-12-12 at 11:47 +0900, Sergey Senozhatsky wrote:
> On (12/11/17 08:26), Joe Perches wrote:
> > On Mon, 2017-12-11 at 21:50 +0900, Sergey Senozhatsky wrote:
> > > print_symbol
> > Yay.
> > Just about exactly 5 years earlier...
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/137121.html
> 
> indeed :)
> 
> hopefully it won't take us another 5 years to finally
[]
> diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
[]
> -static inline void print_symbol(const char *fmt, unsigned long addr)
> +static inline void __deprecated print_symbol(const char *fmt,
> +					     unsigned long addr)
>  {
>  	__check_printsym_format(fmt, "");
>  	__print_symbol(fmt, (unsigned long)

As far as I'm concerned, as soon as there is
no longer a single user in the kernel tree,
better to delete it instead.
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 180+ messages in thread
* [11/13] irq debug: do not use print_symbol()
  2017-12-11 12:55 ` David Laight
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-12  2:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-12  2:50 UTC (permalink / raw)
  To: David Laight
  Cc: 'Sergey Senozhatsky', Andrew Morton, Russell King,
	Catalin Marinas, Mark Salter, Tony Luck, David Howells,
	Yoshinori Sato, Guan Xuetao, Borislav Petkov, Greg Kroah-Hartman,
	Thomas Gleixner, Peter Zijlstra, Vineet Gupta, Fengguang Wu,
	Steven Rostedt, Petr Mladek, LKML,
	linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org,
	linux-ia64@vger.kernel.org, linux-am33-list@redhat.com,
	linux-sh@vger.kernel.org, linux-edac@vger.kernel.org,
	x86@kernel.org, linux-snps-arc@lists.infradead.org,
	Sergey Senozhatsky

On (12/11/17 12:55), David Laight wrote:
> >  kernel/irq/debug.h | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> > 
> > diff --git a/kernel/irq/debug.h b/kernel/irq/debug.h
> > index 17f05ef8f575..5766e15c1160 100644
> > --- a/kernel/irq/debug.h
> > +++ b/kernel/irq/debug.h
> ...
> > @@ -15,13 +13,13 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
> >  	printk("irq %d, desc: %p, depth: %d, count: %d, unhandled: %d\n",
> >  		irq, desc, desc->depth, desc->irq_count, desc->irqs_unhandled);
> >  	printk("->handle_irq():  %p, ", desc->handle_irq);
> > -	print_symbol("%s\n", (unsigned long)desc->handle_irq);
> > +	pr_cont("%pS\n", desc->handle_irq);
> 
> Looks like you can (and should) use a single printk() instead of pr_cont.

thanks, good point. those pr_cont()-s basically just replicate
the old behaviour; but it'll be better to get tid of them. will
follow up shortly.

	-ss
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 180+ messages in thread
* [00/13] replace print_symbol() with printk()-s
  2017-12-11 16:26   ` Joe Perches
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-12  2:47 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-12  2:47 UTC (permalink / raw)
  To: Joe Perches
  Cc: Sergey Senozhatsky, Andrew Morton, Russell King, Catalin Marinas,
	Mark Salter, Tony Luck, David Howells, Yoshinori Sato,
	Guan Xuetao, Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu, Steven Rostedt,
	Petr Mladek, LKML, linux-arm-kernel, linux-c6x-dev, linux-ia64,
	linux-am33-list, linux-sh, linux-edac, x86, linux-snps-arc,
	Sergey Senozhatsky

On (12/11/17 08:26), Joe Perches wrote:
> On Mon, 2017-12-11 at 21:50 +0900, Sergey Senozhatsky wrote:
> > print_symbol
> 
> Yay.
> 
> Just about exactly 5 years earlier...
> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/137121.html

indeed :)

hopefully it won't take us another 5 years to finally
---

 include/linux/kallsyms.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


---

	-ss
--
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 7288f9c395b6..794fd35cad4b 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -176,7 +176,8 @@ void __check_printsym_format(const char *fmt, ...)
 {
 }
 
-static inline void print_symbol(const char *fmt, unsigned long addr)
+static inline void __deprecated print_symbol(const char *fmt,
+					     unsigned long addr)
 {
 	__check_printsym_format(fmt, "");
 	__print_symbol(fmt, (unsigned long)

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [08/13] x86: do not use print_symbol()
  2017-12-11 17:45 ` Borislav Petkov
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-12  2:41 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-12  2:41 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Sergey Senozhatsky, Andrew Morton, Russell King, Catalin Marinas,
	Mark Salter, Tony Luck, David Howells, Yoshinori Sato,
	Guan Xuetao, Greg Kroah-Hartman, Thomas Gleixner, Peter Zijlstra,
	Vineet Gupta, Fengguang Wu, Steven Rostedt, Petr Mladek, LKML,
	linux-arm-kernel, linux-c6x-dev, linux-ia64, linux-am33-list,
	linux-sh, linux-edac, x86, linux-snps-arc, Sergey Senozhatsky

On (12/11/17 18:45), Borislav Petkov wrote:
> For the mce.c bit above:
> 
> Acked-by: Borislav Petkov <bp@suse.de>

thanks.

	-ss
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 180+ messages in thread
* [13/13] arc: do not use __print_symbol()
  2017-12-11 16:28 ` Vineet Gupta
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-12  2:41 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-12  2:41 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: Sergey Senozhatsky, Andrew Morton, Russell King, Catalin Marinas,
	Mark Salter, Tony Luck, David Howells, Yoshinori Sato,
	Guan Xuetao, Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Fengguang Wu, Steven Rostedt, Petr Mladek, LKML,
	linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org,
	linux-ia64@vger.kernel.org, linux-am33-list@redhat.com,
	linux-sh@vger.kernel.org, linux-edac@vger.kernel.org,
	x86@kernel.org, linux-snps-arc@lists.infradead.org,
	Sergey Senozhatsky

On (12/11/17 08:28), Vineet Gupta wrote:
> On 12/11/2017 04:53 AM, Sergey Senozhatsky wrote:
> > __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.
> > 
> > Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > Cc: Vineet Gupta <vgupta@synopsys.com>
> 
> Applied to arc for-curr

thanks.

	-ss
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 180+ messages in thread
* [08/13] x86: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 17:45 ` Borislav Petkov
  -1 siblings, 0 replies; 180+ messages in thread
From: Borislav Petkov @ 2017-12-11 17:45 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Greg Kroah-Hartman, Thomas Gleixner, Peter Zijlstra, Vineet Gupta,
	Fengguang Wu, Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky

On Mon, Dec 11, 2017 at 09:50:20PM +0900, Sergey Senozhatsky wrote:
> 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.
> 
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> ---
>  arch/x86/kernel/cpu/mcheck/mce.c | 3 +--
>  arch/x86/mm/mmio-mod.c           | 5 ++---
>  2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
> index b1d616d08eee..8ca8f6eb32db 100644
> --- a/arch/x86/kernel/cpu/mcheck/mce.c
> +++ b/arch/x86/kernel/cpu/mcheck/mce.c
> @@ -14,7 +14,6 @@
>  #include <linux/capability.h>
>  #include <linux/miscdevice.h>
>  #include <linux/ratelimit.h>
> -#include <linux/kallsyms.h>
>  #include <linux/rcupdate.h>
>  #include <linux/kobject.h>
>  #include <linux/uaccess.h>
> @@ -235,7 +234,7 @@ static void __print_mce(struct mce *m)
>  			m->cs, m->ip);
>  
>  		if (m->cs == __KERNEL_CS)
> -			print_symbol("{%s}", m->ip);
> +			pr_cont("{%pS}", (void *)m->ip);
>  		pr_cont("\n");
>  	}
>  

For the mce.c bit above:

Acked-by: Borislav Petkov <bp@suse.de>

Thx.

^ permalink raw reply	[flat|nested] 180+ messages in thread
* [13/13] arc: do not use __print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 16:28 ` Vineet Gupta
  -1 siblings, 0 replies; 180+ messages in thread
From: Vineet Gupta @ 2017-12-11 16:28 UTC (permalink / raw)
  To: Sergey Senozhatsky, Andrew Morton, Russell King, Catalin Marinas,
	Mark Salter, Tony Luck, David Howells, Yoshinori Sato,
	Guan Xuetao, Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML,
	linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org,
	linux-ia64@vger.kernel.org, linux-am33-list@redhat.com,
	linux-sh@vger.kernel.org, linux-edac@vger.kernel.org,
	x86@kernel.org, linux-snps-arc@lists.infradead.org,
	Sergey Senozhatsky

On 12/11/2017 04:53 AM, Sergey Senozhatsky wrote:
> __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.
>
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Cc: Vineet Gupta <vgupta@synopsys.com>

Applied to arc for-curr

Thx,
-Vineet

> ---
>   arch/arc/kernel/stacktrace.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arc/kernel/stacktrace.c b/arch/arc/kernel/stacktrace.c
> index 74315f302971..bf40e06f3fb8 100644
> --- a/arch/arc/kernel/stacktrace.c
> +++ b/arch/arc/kernel/stacktrace.c
> @@ -163,7 +163,7 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,
>    */
>   static int __print_sym(unsigned int address, void *unused)
>   {
> -	__print_symbol("  %s\n", address);
> +	printk("  %pS\n", (void *)address);
>   	return 0;
>   }
>
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 180+ messages in thread
* [11/13] irq debug: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:55 ` David Laight
  -1 siblings, 0 replies; 180+ messages in thread
From: David Laight @ 2017-12-11 12:55 UTC (permalink / raw)
  To: 'Sergey Senozhatsky', Andrew Morton, Russell King,
	Catalin Marinas, Mark Salter, Tony Luck, David Howells,
	Yoshinori Sato, Guan Xuetao, Borislav Petkov, Greg Kroah-Hartman,
	Thomas Gleixner, Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML,
	linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org,
	linux-ia64@vger.kernel.org, linux-am33-list@redhat.com,
	linux-sh@vger.kernel.org, linux-edac@vger.kernel.org,
	x86@kernel.org, linux-snps-arc@lists.infradead.org,
	Sergey Senozhatsky

From: Sergey Senozhatsky
> Sent: 11 December 2017 12:50
> 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.
> 
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> ---
>  kernel/irq/debug.h | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/kernel/irq/debug.h b/kernel/irq/debug.h
> index 17f05ef8f575..5766e15c1160 100644
> --- a/kernel/irq/debug.h
> +++ b/kernel/irq/debug.h
...
> @@ -15,13 +13,13 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
>  	printk("irq %d, desc: %p, depth: %d, count: %d, unhandled: %d\n",
>  		irq, desc, desc->depth, desc->irq_count, desc->irqs_unhandled);
>  	printk("->handle_irq():  %p, ", desc->handle_irq);
> -	print_symbol("%s\n", (unsigned long)desc->handle_irq);
> +	pr_cont("%pS\n", desc->handle_irq);

Looks like you can (and should) use a single printk() instead of pr_cont.

	David
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 180+ messages in thread
* [13/13] arc: do not use __print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky

__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.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
---
 arch/arc/kernel/stacktrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arc/kernel/stacktrace.c b/arch/arc/kernel/stacktrace.c
index 74315f302971..bf40e06f3fb8 100644
--- a/arch/arc/kernel/stacktrace.c
+++ b/arch/arc/kernel/stacktrace.c
@@ -163,7 +163,7 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,
  */
 static int __print_sym(unsigned int address, void *unused)
 {
-	__print_symbol("  %s\n", address);
+	printk("  %pS\n", (void *)address);
 	return 0;
 }
 

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [12/13] lib: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky

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.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 lib/smp_processor_id.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c
index 835cc6df2776..85925aaa4fff 100644
--- a/lib/smp_processor_id.c
+++ b/lib/smp_processor_id.c
@@ -5,7 +5,6 @@
  * DEBUG_PREEMPT variant of smp_processor_id().
  */
 #include <linux/export.h>
-#include <linux/kallsyms.h>
 #include <linux/sched.h>
 
 notrace static unsigned int check_preemption_disabled(const char *what1,
@@ -43,7 +42,7 @@ notrace static unsigned int check_preemption_disabled(const char *what1,
 	printk(KERN_ERR "BUG: using %s%s() in preemptible [%08x] code: %s/%d\n",
 		what1, what2, preempt_count() - 1, current->comm, current->pid);
 
-	print_symbol("caller is %s\n", (long)__builtin_return_address(0));
+	printk("caller is %pS\n", __builtin_return_address(0));
 	dump_stack();
 
 out_enable:

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [11/13] irq debug: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky

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.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/debug.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/kernel/irq/debug.h b/kernel/irq/debug.h
index 17f05ef8f575..5766e15c1160 100644
--- a/kernel/irq/debug.h
+++ b/kernel/irq/debug.h
@@ -3,8 +3,6 @@
  * Debugging printout:
  */
 
-#include <linux/kallsyms.h>
-
 #define ___P(f) if (desc->status_use_accessors & f) printk("%14s set\n", #f)
 #define ___PS(f) if (desc->istate & f) printk("%14s set\n", #f)
 /* FIXME */
@@ -15,13 +13,13 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
 	printk("irq %d, desc: %p, depth: %d, count: %d, unhandled: %d\n",
 		irq, desc, desc->depth, desc->irq_count, desc->irqs_unhandled);
 	printk("->handle_irq():  %p, ", desc->handle_irq);
-	print_symbol("%s\n", (unsigned long)desc->handle_irq);
+	pr_cont("%pS\n", desc->handle_irq);
 	printk("->irq_data.chip(): %p, ", desc->irq_data.chip);
-	print_symbol("%s\n", (unsigned long)desc->irq_data.chip);
+	pr_cont("%pS\n", desc->irq_data.chip);
 	printk("->action(): %p\n", desc->action);
 	if (desc->action) {
 		printk("->action->handler(): %p, ", desc->action->handler);
-		print_symbol("%s\n", (unsigned long)desc->action->handler);
+		pr_cont("%pS\n", desc->action->handler);
 	}
 
 	___P(IRQ_LEVEL);

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [10/13] sysfs: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky

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.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/sysfs/file.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 39c75a86c67f..bfcbe486d385 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -12,7 +12,6 @@
 
 #include <linux/module.h>
 #include <linux/kobject.h>
-#include <linux/kallsyms.h>
 #include <linux/slab.h>
 #include <linux/list.h>
 #include <linux/mutex.h>
@@ -70,8 +69,8 @@ static int sysfs_kf_seq_show(struct seq_file *sf, void *v)
 	 * indicate truncated result or overflow in normal use cases.
 	 */
 	if (count >= (ssize_t)PAGE_SIZE) {
-		print_symbol("fill_read_buffer: %s returned bad count\n",
-			(unsigned long)ops->show);
+		printk("fill_read_buffer: %pS returned bad count\n",
+				ops->show);
 		/* Try to struggle along */
 		count = PAGE_SIZE - 1;
 	}

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [09/13] drivers: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky

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.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/base/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index bf45587bcb46..36e20498159b 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -20,7 +20,6 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/genhd.h>
-#include <linux/kallsyms.h>
 #include <linux/mutex.h>
 #include <linux/pm_runtime.h>
 #include <linux/netdevice.h>
@@ -685,8 +684,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
 	if (dev_attr->show)
 		ret = dev_attr->show(dev, dev_attr, buf);
 	if (ret >= (ssize_t)PAGE_SIZE) {
-		print_symbol("dev_attr_show: %s returned bad count\n",
-				(unsigned long)dev_attr->show);
+		printk("dev_attr_show: %pS returned bad count\n",
+				dev_attr->show);
 	}
 	return ret;
 }

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [08/13] x86: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky

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.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/cpu/mcheck/mce.c | 3 +--
 arch/x86/mm/mmio-mod.c           | 5 ++---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index b1d616d08eee..8ca8f6eb32db 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -14,7 +14,6 @@
 #include <linux/capability.h>
 #include <linux/miscdevice.h>
 #include <linux/ratelimit.h>
-#include <linux/kallsyms.h>
 #include <linux/rcupdate.h>
 #include <linux/kobject.h>
 #include <linux/uaccess.h>
@@ -235,7 +234,7 @@ static void __print_mce(struct mce *m)
 			m->cs, m->ip);
 
 		if (m->cs == __KERNEL_CS)
-			print_symbol("{%s}", m->ip);
+			pr_cont("{%pS}", (void *)m->ip);
 		pr_cont("\n");
 	}
 
diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c
index 4d434ddb75db..2c1ecf4763c4 100644
--- a/arch/x86/mm/mmio-mod.c
+++ b/arch/x86/mm/mmio-mod.c
@@ -29,7 +29,6 @@
 #include <linux/slab.h>
 #include <linux/uaccess.h>
 #include <linux/io.h>
-#include <linux/kallsyms.h>
 #include <asm/pgtable.h>
 #include <linux/mmiotrace.h>
 #include <asm/e820/api.h> /* for ISA_START_ADDRESS */
@@ -123,8 +122,8 @@ static void die_kmmio_nesting_error(struct pt_regs *regs, unsigned long addr)
 	pr_emerg("unexpected fault for address: 0x%08lx, last fault for address: 0x%08lx\n",
 		 addr, my_reason->addr);
 	print_pte(addr);
-	print_symbol(KERN_EMERG "faulting IP is at %s\n", regs->ip);
-	print_symbol(KERN_EMERG "last faulting IP was at %s\n", my_reason->ip);
+	pr_emerg("faulting IP is at %pS\n", (void *)regs->ip);
+	pr_emerg("last faulting IP was at %pS\n", (void *)my_reason->ip);
 #ifdef __i386__
 	pr_emerg("eax: %08lx   ebx: %08lx   ecx: %08lx   edx: %08lx\n",
 		 regs->ax, regs->bx, regs->cx, regs->dx);

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [07/13] unicore32: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky

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.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
---
 arch/unicore32/kernel/process.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c
index ddaf78ae6854..9a9d49bccc02 100644
--- a/arch/unicore32/kernel/process.c
+++ b/arch/unicore32/kernel/process.c
@@ -23,7 +23,6 @@
 #include <linux/delay.h>
 #include <linux/reboot.h>
 #include <linux/interrupt.h>
-#include <linux/kallsyms.h>
 #include <linux/init.h>
 #include <linux/cpu.h>
 #include <linux/elfcore.h>
@@ -139,8 +138,8 @@ void __show_regs(struct pt_regs *regs)
 	char buf[64];
 
 	show_regs_print_info(KERN_DEFAULT);
-	print_symbol("PC is at %s\n", instruction_pointer(regs));
-	print_symbol("LR is at %s\n", regs->UCreg_lr);
+	printk("PC is at %pS\n", instruction_pointer(regs));
+	printk("LR is at %pS\n", (void *)regs->UCreg_lr);
 	printk(KERN_DEFAULT "pc : [<%08lx>]    lr : [<%08lx>]    psr: %08lx\n"
 	       "sp : %08lx  ip : %08lx  fp : %08lx\n",
 		regs->UCreg_pc, regs->UCreg_lr, regs->UCreg_asr,

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [06/13] sh: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky,
	Rich Felker

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.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
---
 arch/sh/kernel/process_32.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c
index 2c7bdf8cb934..5c88e7cb9c18 100644
--- a/arch/sh/kernel/process_32.c
+++ b/arch/sh/kernel/process_32.c
@@ -20,7 +20,6 @@
 #include <linux/sched/task_stack.h>
 #include <linux/slab.h>
 #include <linux/elfcore.h>
-#include <linux/kallsyms.h>
 #include <linux/fs.h>
 #include <linux/ftrace.h>
 #include <linux/hw_breakpoint.h>
@@ -37,8 +36,8 @@ void show_regs(struct pt_regs * regs)
 	printk("\n");
 	show_regs_print_info(KERN_DEFAULT);
 
-	print_symbol("PC is at %s\n", instruction_pointer(regs));
-	print_symbol("PR is at %s\n", regs->pr);
+	printk("PC is at %pS\n", instruction_pointer(regs));
+	printk("PR is at %pS\n", (void *)regs->pr);
 
 	printk("PC  : %08lx SP  : %08lx SR  : %08lx ",
 	       regs->pc, regs->regs[15], regs->sr);

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [05/13] mn10300: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky

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.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: David Howells <dhowells@redhat.com>
---
 arch/mn10300/kernel/traps.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/mn10300/kernel/traps.c b/arch/mn10300/kernel/traps.c
index 800fd0801969..72d1015b2ae7 100644
--- a/arch/mn10300/kernel/traps.c
+++ b/arch/mn10300/kernel/traps.c
@@ -22,7 +22,6 @@
 #include <linux/delay.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
-#include <linux/kallsyms.h>
 #include <linux/pci.h>
 #include <linux/kdebug.h>
 #include <linux/bug.h>
@@ -262,8 +261,7 @@ void show_trace(unsigned long *sp)
 				raslot = ULONG_MAX;
 			else
 				printk(" ?");
-			print_symbol(" %s", addr);
-			printk("\n");
+			printk(" %pS\n", (void *)addr);
 		}
 	}
 

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [04/13] ia64: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky,
	Fenghua Yu

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",

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [03/13] c6x: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky,
	Aurelien Jacquiot

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.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Aurelien Jacquiot <jacquiot.aurelien@gmail.com>
---
 arch/c6x/kernel/traps.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/c6x/kernel/traps.c b/arch/c6x/kernel/traps.c
index 09b8a40d5680..4c1d4b84dd2b 100644
--- a/arch/c6x/kernel/traps.c
+++ b/arch/c6x/kernel/traps.c
@@ -11,7 +11,6 @@
 #include <linux/module.h>
 #include <linux/ptrace.h>
 #include <linux/sched/debug.h>
-#include <linux/kallsyms.h>
 #include <linux/bug.h>
 
 #include <asm/soc.h>
@@ -375,8 +374,7 @@ static void show_trace(unsigned long *stack, unsigned long *endstack)
 			if (i % 5 == 0)
 				pr_debug("\n	    ");
 #endif
-			pr_debug(" [<%08lx>]", addr);
-			print_symbol(" %s\n", addr);
+			pr_debug(" [<%08lx>] %pS\n", addr, (void *)addr);
 			i++;
 		}
 	}

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [02/13] arm64: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky,
	Will Deacon

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.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/kernel/process.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 6b7dcf4310ac..44bed43814e2 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -35,7 +35,6 @@
 #include <linux/delay.h>
 #include <linux/reboot.h>
 #include <linux/interrupt.h>
-#include <linux/kallsyms.h>
 #include <linux/init.h>
 #include <linux/cpu.h>
 #include <linux/elfcore.h>
@@ -221,8 +220,8 @@ void __show_regs(struct pt_regs *regs)
 
 	show_regs_print_info(KERN_DEFAULT);
 	print_pstate(regs);
-	print_symbol("pc : %s\n", regs->pc);
-	print_symbol("lr : %s\n", lr);
+	printk("pc : %pS\n", (void *)regs->pc);
+	printk("lr : %pS\n", (void *)lr);
 	printk("sp : %016llx\n", sp);
 
 	i = top_reg;

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [01/13] arm: do not use print_symbol()
  2017-12-11 12:50 ` Sergey Senozhatsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  -1 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
	Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
	Borislav Petkov, Greg Kroah-Hartman, Thomas Gleixner,
	Peter Zijlstra, Vineet Gupta, Fengguang Wu
  Cc: Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
	linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
	x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky

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.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
---
 arch/arm/kernel/process.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index d96714e1858c..db004f6f547a 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -21,7 +21,6 @@
 #include <linux/unistd.h>
 #include <linux/user.h>
 #include <linux/interrupt.h>
-#include <linux/kallsyms.h>
 #include <linux/init.h>
 #include <linux/elfcore.h>
 #include <linux/pm.h>
@@ -121,8 +120,8 @@ void __show_regs(struct pt_regs *regs)
 
 	show_regs_print_info(KERN_DEFAULT);
 
-	print_symbol("PC is at %s\n", instruction_pointer(regs));
-	print_symbol("LR is at %s\n", regs->ARM_lr);
+	printk("PC is at %pS\n", instruction_pointer(regs));
+	printk("LR is at %pS\n", (void *)regs->ARM_lr);
 	printk("pc : [<%08lx>]    lr : [<%08lx>]    psr: %08lx\n",
 	       regs->ARM_pc, regs->ARM_lr, regs->ARM_cpsr);
 	printk("sp : %08lx  ip : %08lx  fp : %08lx\n",

^ permalink raw reply related	[flat|nested] 180+ messages in thread
* [PATCH 00/13] replace print_symbol() with printk()-s
@ 2017-12-11 12:50 ` Sergey Senozhatsky
  0 siblings, 0 replies; 180+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
  To: linux-arm-kernel

	Hello,

	A rather automatic replacement of print_symbol()
with direct printk() calls. print_symbol() uses extra stack
buffer (KSYM_SYMBOL_LEN 128 bytes) and, basically, should
be identical to printk(%pS).

	I can't test all of the patches, because I don't
own any of those exotic arch-s. Sorry for the inconvenience.

Sergey Senozhatsky (13):
  arm: do not use print_symbol()
  arm64: do not use print_symbol()
  c6x: do not use print_symbol()
  ia64: do not use print_symbol()
  mn10300: do not use print_symbol()
  sh: do not use print_symbol()
  unicore32: do not use print_symbol()
  x86: do not use print_symbol()
  drivers: do not use print_symbol()
  sysfs: do not use print_symbol()
  irq debug: do not use print_symbol()
  lib: do not use print_symbol()
  arc: do not use __print_symbol()

 arch/arc/kernel/stacktrace.c     |  2 +-
 arch/arm/kernel/process.c        |  5 ++---
 arch/arm64/kernel/process.c      |  5 ++---
 arch/c6x/kernel/traps.c          |  4 +---
 arch/ia64/kernel/process.c       | 10 +++-------
 arch/mn10300/kernel/traps.c      |  4 +---
 arch/sh/kernel/process_32.c      |  5 ++---
 arch/unicore32/kernel/process.c  |  5 ++---
 arch/x86/kernel/cpu/mcheck/mce.c |  3 +--
 arch/x86/mm/mmio-mod.c           |  5 ++---
 drivers/base/core.c              |  5 ++---
 fs/sysfs/file.c                  |  5 ++---
 kernel/irq/debug.h               |  8 +++-----
 lib/smp_processor_id.c           |  3 +--
 14 files changed, 25 insertions(+), 44 deletions(-)

-- 
2.15.1


^ permalink raw reply	[flat|nested] 180+ messages in thread

end of thread, other threads:[~2018-01-17  2:36 UTC | newest]

Thread overview: 180+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-21  5:54 [00/13] replace print_symbol() with printk()-s Sergey Senozhatsky
2017-12-21  5:54 ` [PATCH 00/13] " Sergey Senozhatsky
2017-12-21  5:54 ` Sergey Senozhatsky
2017-12-21  5:54 ` Sergey Senozhatsky
2017-12-21  5:54 ` Sergey Senozhatsky
  -- strict thread matches above, loose matches on Subject: below --
2018-01-17  2:36 [00/13] " Sergey Senozhatsky
2018-01-17  2:36 ` [PATCH 00/13] " Sergey Senozhatsky
2018-01-17  2:36 ` Sergey Senozhatsky
2018-01-17  2:36 ` Sergey Senozhatsky
2018-01-17  2:36 ` Sergey Senozhatsky
2018-01-16 16:33 [00/13] " Petr Mladek
2018-01-16 16:33 ` [PATCH 00/13] " Petr Mladek
2018-01-16 16:33 ` Petr Mladek
2018-01-16 16:33 ` Petr Mladek
2018-01-08  2:09 [00/13] " Sergey Senozhatsky
2018-01-08  2:09 ` [PATCH 00/13] " Sergey Senozhatsky
2018-01-08  2:09 ` Sergey Senozhatsky
2018-01-08  2:09 ` Sergey Senozhatsky
2018-01-08  2:09 ` Sergey Senozhatsky
2018-01-05 14:57 [00/13] " Sergey Senozhatsky
2018-01-05 14:57 ` [PATCH 00/13] " Sergey Senozhatsky
2018-01-05 14:57 ` Sergey Senozhatsky
2018-01-05 14:57 ` Sergey Senozhatsky
2018-01-05 14:57 ` Sergey Senozhatsky
2018-01-05 14:42 [00/13] " Petr Mladek
2018-01-05 14:42 ` [PATCH 00/13] " Petr Mladek
2018-01-05 14:42 ` Petr Mladek
2018-01-05 14:42 ` Petr Mladek
2018-01-05 14:42 ` Petr Mladek
2018-01-05 10:25 [00/13] " Sergey Senozhatsky
2018-01-05 10:25 ` [PATCH 00/13] " Sergey Senozhatsky
2018-01-05 10:25 ` Sergey Senozhatsky
2018-01-05 10:25 ` Sergey Senozhatsky
2018-01-05 10:25 ` Sergey Senozhatsky
2017-12-12  7:34 [PATCHv2,11/13] irq debug: do not use print_symbol() Sergey Senozhatsky
2017-12-12  7:34 ` [PATCHv2 11/13] " Sergey Senozhatsky
2017-12-12  7:34 ` Sergey Senozhatsky
2017-12-12  7:34 ` Sergey Senozhatsky
2017-12-12  7:34 ` Sergey Senozhatsky
2017-12-12  3:10 [00/13] replace print_symbol() with printk()-s Joe Perches
2017-12-12  3:10 ` [PATCH 00/13] " Joe Perches
2017-12-12  3:10 ` Joe Perches
2017-12-12  3:10 ` Joe Perches
2017-12-12  3:10 ` Joe Perches
2017-12-12  2:50 [11/13] irq debug: do not use print_symbol() Sergey Senozhatsky
2017-12-12  2:50 ` [PATCH 11/13] " Sergey Senozhatsky
2017-12-12  2:50 ` Sergey Senozhatsky
2017-12-12  2:50 ` Sergey Senozhatsky
2017-12-12  2:50 ` Sergey Senozhatsky
2017-12-12  2:47 [00/13] replace print_symbol() with printk()-s Sergey Senozhatsky
2017-12-12  2:47 ` [PATCH 00/13] " Sergey Senozhatsky
2017-12-12  2:47 ` Sergey Senozhatsky
2017-12-12  2:47 ` Sergey Senozhatsky
2017-12-12  2:47 ` Sergey Senozhatsky
2017-12-12  2:41 [08/13] x86: do not use print_symbol() Sergey Senozhatsky
2017-12-12  2:41 ` [PATCH 08/13] " Sergey Senozhatsky
2017-12-12  2:41 ` Sergey Senozhatsky
2017-12-12  2:41 ` Sergey Senozhatsky
2017-12-12  2:41 ` Sergey Senozhatsky
2017-12-12  2:41 [13/13] arc: do not use __print_symbol() Sergey Senozhatsky
2017-12-12  2:41 ` [PATCH 13/13] " Sergey Senozhatsky
2017-12-12  2:41 ` Sergey Senozhatsky
2017-12-12  2:41 ` Sergey Senozhatsky
2017-12-12  2:41 ` Sergey Senozhatsky
2017-12-11 17:45 [08/13] x86: do not use print_symbol() Borislav Petkov
2017-12-11 17:45 ` [PATCH 08/13] " Borislav Petkov
2017-12-11 17:45 ` Borislav Petkov
2017-12-11 17:45 ` Borislav Petkov
2017-12-11 17:45 ` Borislav Petkov
2017-12-11 16:28 [13/13] arc: do not use __print_symbol() Vineet Gupta
2017-12-11 16:28 ` [PATCH 13/13] " Vineet Gupta
2017-12-11 16:28 ` Vineet Gupta
2017-12-11 16:28 ` Vineet Gupta
2017-12-11 16:28 ` Vineet Gupta
2017-12-11 12:55 [11/13] irq debug: do not use print_symbol() David Laight
2017-12-11 12:55 ` [PATCH 11/13] " David Laight
2017-12-11 12:55 ` David Laight
2017-12-11 12:55 ` David Laight
2017-12-11 12:55 ` David Laight
2017-12-11 12:50 [13/13] arc: do not use __print_symbol() Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 13/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [12/13] lib: do not use print_symbol() Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 12/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [11/13] irq debug: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 11/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [10/13] sysfs: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 10/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [09/13] drivers: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 09/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [08/13] x86: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 08/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [07/13] unicore32: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 07/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [06/13] sh: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 06/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [05/13] mn10300: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 05/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [04/13] ia64: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 04/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [03/13] c6x: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 03/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [02/13] arm64: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 02/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [01/13] arm: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 01/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [PATCH 00/13] replace print_symbol() with printk()-s Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 16:26 ` Joe Perches
2017-12-11 16:26   ` Joe Perches
2017-12-11 16:26   ` Joe Perches
2017-12-11 16:26   ` Joe Perches
2017-12-20 10:20 ` Sergey Senozhatsky
2017-12-20 10:20   ` Sergey Senozhatsky
2017-12-20 10:20   ` Sergey Senozhatsky
2017-12-20 10:20   ` Sergey Senozhatsky
2018-01-05 10:03 ` Petr Mladek
2018-01-05 10:03   ` Petr Mladek
2018-01-05 10:03   ` Petr Mladek
2018-01-05 10:03   ` Petr Mladek
2018-01-05 10:21   ` Sergey Senozhatsky
2018-01-05 10:21     ` Sergey Senozhatsky
2018-01-05 10:21     ` Sergey Senozhatsky
2018-01-05 10:21     ` Sergey Senozhatsky
2018-01-05 11:38     ` Petr Mladek
2018-01-05 11:38       ` Petr Mladek
2018-01-05 11:38       ` Petr Mladek
2018-01-05 11:38       ` Petr Mladek
2018-01-05 12:01     ` Sergey Senozhatsky
2018-01-05 12:01       ` Sergey Senozhatsky
2018-01-05 12:01       ` Sergey Senozhatsky
2018-01-05 12:01       ` Sergey Senozhatsky
2018-01-05 12:23       ` Sergey Senozhatsky
2018-01-05 12:23         ` Sergey Senozhatsky
2018-01-05 12:23         ` Sergey Senozhatsky
2018-01-05 12:23         ` Sergey Senozhatsky
2018-01-05 13:09         ` Petr Mladek
2018-01-05 13:09           ` Petr Mladek
2018-01-05 13:09           ` Petr Mladek
2018-01-05 13:09           ` Petr Mladek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.