* [11/13] irq debug: do not use print_symbol()
@ 2017-12-11 12:50 Sergey Senozhatsky
0 siblings, 0 replies; 3+ 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] 3+ messages in thread
* [11/13] irq debug: do not use print_symbol()
@ 2017-12-11 12:55 David Laight
0 siblings, 0 replies; 3+ 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] 3+ messages in thread
* [11/13] irq debug: do not use print_symbol()
@ 2017-12-12 2:50 Sergey Senozhatsky
0 siblings, 0 replies; 3+ 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] 3+ messages in thread
end of thread, other threads:[~2017-12-12 2:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-12 2:50 [11/13] irq debug: do not use print_symbol() Sergey Senozhatsky
-- strict thread matches above, loose matches on Subject: below --
2017-12-11 12:55 David Laight
2017-12-11 12:50 Sergey Senozhatsky
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).