RE: [RFC 2/2] printk: Add more information about the printk caller

2020-10-21 Thread 김창기
> +static size_t info_print_caller_id(char *buf, size_t size, > +const struct printk_caller *caller) { > + enum printk_caller_ctx ctx; > + > + ctx = printk_to_caller_ctx(caller->cpu_ctx); > + > + if (ctx == printk_ctx_task) > + return snprintf

Re: [RFC 2/2] printk: Add more information about the printk caller

2020-09-25 Thread Petr Mladek
On Fri 2020-09-25 09:54:00, Sergey Senozhatsky wrote: > On (20/09/24 15:38), Petr Mladek wrote: > [..] > > > > G, I wonder why I thought that in_irq() covered also the situation > > when IRQ was disabled. It was likely my wish because disabled > > interrupts are problem for printk() because the

Re: [RFC 2/2] printk: Add more information about the printk caller

2020-09-24 Thread Sergey Senozhatsky
On (20/09/24 15:38), Petr Mladek wrote: [..] > > G, I wonder why I thought that in_irq() covered also the situation > when IRQ was disabled. It was likely my wish because disabled > interrupts are problem for printk() because the console might > cause a softlockup. preempt_disable() can also t

Re: [RFC 2/2] printk: Add more information about the printk caller

2020-09-24 Thread Petr Mladek
On Thu 2020-09-24 14:53:01, Petr Mladek wrote: > On Thu 2020-09-24 06:24:14, Ahmed S. Darwish wrote: > > On Wed, Sep 23, 2020 at 03:56:17PM +0200, Petr Mladek wrote: > > ... > > > > > > -static inline u32 printk_caller_id(void) > > > +static enum printk_caller_ctx get_printk_caller_ctx(void) > > >

Re: [RFC 2/2] printk: Add more information about the printk caller

2020-09-24 Thread Petr Mladek
On Thu 2020-09-24 10:29:31, John Ogness wrote: > On 2020-09-24, Sergey Senozhatsky wrote: > > A question. Suppose we have a task which does > > > > CPU0 > > > > pr_err(...); > > > > preempt_disable(); > > pr_err(...); > > preempt_enable(); > > > > pr_err(...); > > > > r

Re: [RFC 2/2] printk: Add more information about the printk caller

2020-09-24 Thread Petr Mladek
On Thu 2020-09-24 11:17:56, Sergey Senozhatsky wrote: > On (20/09/23 15:56), Petr Mladek wrote: > [..] > > /* > > * To reduce unnecessarily reopening, first check if the descriptor > > -* state and caller ID are correct. > > +* state and caller infromation are correct. > > */

Re: [RFC 2/2] printk: Add more information about the printk caller

2020-09-24 Thread Petr Mladek
On Thu 2020-09-24 06:24:14, Ahmed S. Darwish wrote: > On Wed, Sep 23, 2020 at 03:56:17PM +0200, Petr Mladek wrote: > ... > > > > -static inline u32 printk_caller_id(void) > > +static enum printk_caller_ctx get_printk_caller_ctx(void) > > +{ > > + if (in_nmi()) > > + return printk_ctx_nm

Re: [RFC 2/2] printk: Add more information about the printk caller

2020-09-24 Thread Petr Mladek
On Thu 2020-09-24 10:40:10, Sergey Senozhatsky wrote: > On (20/09/23 15:56), Petr Mladek wrote: > > The information about the printk caller has been added by the commit > > 15ff2069cb7f967da ("printk: Add caller information to printk() output."). > > The main motivation was to reconstruct original

Re: [RFC 2/2] printk: Add more information about the printk caller

2020-09-24 Thread John Ogness
On 2020-09-24, Sergey Senozhatsky wrote: > A question. Suppose we have a task which does > > CPU0 > > pr_err(...); > > preempt_disable(); > pr_err(...); > preempt_enable(); > > pr_err(...); > > rcu_read_lock(); > pr_info(...); > rcu_read_unlock

Re: [RFC 2/2] printk: Add more information about the printk caller

2020-09-23 Thread Ahmed S. Darwish
On Wed, Sep 23, 2020 at 03:56:17PM +0200, Petr Mladek wrote: ... > > -static inline u32 printk_caller_id(void) > +static enum printk_caller_ctx get_printk_caller_ctx(void) > +{ > + if (in_nmi()) > + return printk_ctx_nmi; > + > + if (in_irq()) > + return printk_ctx_h

Re: [RFC 2/2] printk: Add more information about the printk caller

2020-09-23 Thread Sergey Senozhatsky
On (20/09/23 15:56), Petr Mladek wrote: [..] > /* >* To reduce unnecessarily reopening, first check if the descriptor > - * state and caller ID are correct. > + * state and caller infromation are correct. >*/ > - d_state = desc_read(desc_ring, id, &desc, NULL, &c

Re: [RFC 2/2] printk: Add more information about the printk caller

2020-09-23 Thread Sergey Senozhatsky
On (20/09/23 15:56), Petr Mladek wrote: > The information about the printk caller has been added by the commit > 15ff2069cb7f967da ("printk: Add caller information to printk() output."). > The main motivation was to reconstruct original messages when they > longer output from different CPUs got mix

[RFC 2/2] printk: Add more information about the printk caller

2020-09-23 Thread Petr Mladek
The information about the printk caller has been added by the commit 15ff2069cb7f967da ("printk: Add caller information to printk() output."). The main motivation was to reconstruct original messages when they longer output from different CPUs got mixed. But there are more usecases. The number of