Re: [PATCH 00/50] Add log level to show_stack()

2019-11-14 Thread Sergey Senozhatsky
On (19/11/13 10:39), Steven Rostedt wrote: [..] > > void show_stack(struct task_struct *task, unsigned long *sp, int log_level) > > { > > printk_emergency_enter(log_level); > > __show_stack(task, sp); > > printk_emergency_exit(); > > } > > // - - - - - - - - - - - - - - - - - - - - - -

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-14 Thread Sergey Senozhatsky
On (19/11/13 16:40), Dmitry Safonov wrote: > It's also not very fun for me to create those patches. > But they fix console_loglevel issues (I hope we could un-export it in > the end) and also I need it for my other patches those will produce > warnings with debug loglevel when configured through

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-13 Thread Dmitry Safonov
Hi Sergey, On 11/13/19 6:33 AM, Sergey Senozhatsky wrote: [..] > Well, here we go. There is a number of generally useful functions that > print nice data and where people might want to have better loglevel control > (for debugging purposes). show_stack() is just one of them. Patching all > those

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-13 Thread Steven Rostedt
On Wed, 13 Nov 2019 09:47:22 +0100 Petr Mladek wrote: > At the moment, I am in favor of this patchset. It is huge and > needed a lot of manual work. But the result is straightforward and > easy to understand. I'm in favor of this patchset too. If there's other areas that need to adjust the

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-13 Thread Steven Rostedt
On Wed, 6 Nov 2019 23:25:13 + Russell King - ARM Linux admin wrote: > On Wed, Nov 06, 2019 at 09:34:40PM +0100, Peter Zijlstra wrote: > > I suppose I'm surprised there are backtraces that are not important. > > Either badness happened and it needs printing, or the user asked for it > > and

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-13 Thread Steven Rostedt
On Wed, 6 Nov 2019 21:34:40 +0100 Peter Zijlstra wrote: > I suppose I'm surprised there are backtraces that are not important. > Either badness happened and it needs printing, or the user asked for it > and it needs printing. Unfortunately that is the case. As my tests will fail if a backtrace

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-13 Thread Steven Rostedt
On Tue, 12 Nov 2019 11:17:47 +0900 Sergey Senozhatsky wrote: > void show_stack(struct task_struct *task, unsigned long *sp, int log_level) > { > printk_emergency_enter(log_level); > __show_stack(task, sp); > printk_emergency_exit(); > } > // - - - - - - - - - - - - - - - - - -

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-13 Thread Steven Rostedt
On Tue, 12 Nov 2019 13:44:47 +0900 Sergey Senozhatsky wrote: > > > I do recall that we talked about per-CPU printk state bit which would > > > start/end "just print it" section. We probably can extend it to "just > > > log_store" type of functionality. Doesn't look like a very bad idea. > > >

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-12 Thread Sergey Senozhatsky
On (19/11/13 02:41), Dmitry Safonov wrote: [..] > > I don't strongly disagree, but if you look at those results: > git grep 'printk("%s.*", \(lvl\|level\)' > > it seems to be used in quite a few places. Yes, you are right, it is used in some places. That's why I said that I'd prefer to keep

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-12 Thread Dmitry Safonov
On 11/12/19 4:25 AM, Sergey Senozhatsky wrote: > On (19/11/12 02:40), Dmitry Safonov wrote: > [..] >> In my point of view the cost of one-time [mostly build] testing every >> architecture is cheaper than introducing some new smart code that will >> live forever. > > Well, there may be the need to

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-12 Thread Dmitry Safonov
On 11/13/19 1:23 AM, Sergey Senozhatsky wrote: > On (19/11/12 19:12), Sergey Senozhatsky wrote: >> On (19/11/12 09:35), Petr Mladek wrote: >> [..] >>> This is getting too complicated. It would introduce too many >>> hidden rules. While the explicitly passed loglevel parameter >>> is

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-12 Thread Sergey Senozhatsky
On (19/11/12 19:12), Sergey Senozhatsky wrote: > On (19/11/12 09:35), Petr Mladek wrote: > [..] > > This is getting too complicated. It would introduce too many > > hidden rules. While the explicitly passed loglevel parameter > > is straightforward and clear. > > If loglevel is DEFAULT or NOTICE

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-12 Thread Sergey Senozhatsky
On (19/11/12 09:35), Petr Mladek wrote: [..] > This is getting too complicated. It would introduce too many > hidden rules. While the explicitly passed loglevel parameter > is straightforward and clear. If loglevel is DEFAULT or NOTICE or INFO then we can overwrite it (either downgrade or

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-12 Thread Petr Mladek
On Tue 2019-11-12 13:57:04, Sergey Senozhatsky wrote: > On (19/11/12 13:44), Sergey Senozhatsky wrote: > [..] > > > But yes, this per-code-section loglevel is problematic. The feedback > > > against the patchset shows that people want it also the other way. > > > I mean to keep pr_debug() as

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-11 Thread Sergey Senozhatsky
On (19/11/12 13:44), Sergey Senozhatsky wrote: [..] > > But yes, this per-code-section loglevel is problematic. The feedback > > against the patchset shows that people want it also the other way. > > I mean to keep pr_debug() as pr_debug(). > > Hmm. Right. > > > A solution might be to use the

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-11 Thread Sergey Senozhatsky
On (19/11/11 10:12), Petr Mladek wrote: [..] > > I do recall that we talked about per-CPU printk state bit which would > > start/end "just print it" section. We probably can extend it to "just > > log_store" type of functionality. Doesn't look like a very bad idea. > > The problem with per-CPU

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-11 Thread Sergey Senozhatsky
On (19/11/12 02:40), Dmitry Safonov wrote: [..] > In my point of view the cost of one-time [mostly build] testing every > architecture is cheaper than introducing some new smart code that will > live forever. Well, there may be the need to pass loglevel deeper due to "hey __show_stack() on that

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-11 Thread Dmitry Safonov
Hi Sergey, On 11/12/19 2:17 AM, Sergey Senozhatsky wrote: > On (19/11/11 19:47), Dmitry Safonov wrote: [..] >> What I'm going to do - is to fix all build and reported issues, I'll >> send v2 this week and feel free to NAK it, I will forget about those >> patches and won't be offended. > >

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-11 Thread Sergey Senozhatsky
On (19/11/11 19:47), Dmitry Safonov wrote: [..] > I don't see how bits on task_struct or in per-cpu are easier than > supplying a log level parameter down the stack. > How would it work if sysrq_handle_crash() called by key-press? > How would that interact with deferred printing? > How would it

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-11 Thread Dmitry Safonov
Hi Sergey, Petr, On 11/11/19 1:23 AM, Sergey Senozhatsky wrote: > On (19/11/08 14:04), Petr Mladek wrote: > [..] >> I agree that it is complicated to pass the loglevel as >> a parameter. It would be better define the default >> log level for a given code section. It might be stored >> in

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-11 Thread Petr Mladek
On Mon 2019-11-11 10:23:36, Sergey Senozhatsky wrote: > On (19/11/08 14:04), Petr Mladek wrote: > [..] > > I agree that it is complicated to pass the loglevel as > > a parameter. It would be better define the default > > log level for a given code section. It might be stored > > in task_struct for

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-10 Thread Sergey Senozhatsky
On (19/11/08 14:04), Petr Mladek wrote: [..] > I agree that it is complicated to pass the loglevel as > a parameter. It would be better define the default > log level for a given code section. It might be stored > in task_struct for the normal context and in per-CPU > variables for interrupt

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-08 Thread Dmitry Safonov
On 11/8/19 5:30 PM, Russell King - ARM Linux admin wrote: > On Fri, Nov 08, 2019 at 04:28:30PM +, Dmitry Safonov wrote: [..] >> >> Well, the use-case for lower log-level is that everything goes into logs >> (/var/log/dmesg or /var/log/messages whatever rsyslog has settting). >> >> That has

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-08 Thread Russell King - ARM Linux admin
On Fri, Nov 08, 2019 at 04:28:30PM +, Dmitry Safonov wrote: > On 11/6/19 8:34 PM, Peter Zijlstra wrote: > > On Wed, Nov 06, 2019 at 04:27:33PM +, Dmitry Safonov wrote: > [..] > >> Sorry, I should have tried to describe better. > >> > >> I'm trying to remove external users of

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-08 Thread Dmitry Safonov
On 11/6/19 8:34 PM, Peter Zijlstra wrote: > On Wed, Nov 06, 2019 at 04:27:33PM +, Dmitry Safonov wrote: [..] >> Sorry, I should have tried to describe better. >> >> I'm trying to remove external users of console_loglevel by following >> reasons: > > I suppose since all my machines have 'debug

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-08 Thread Petr Mladek
On Fri 2019-11-08 19:37:19, Sergey Senozhatsky wrote: > On (19/11/06 09:35), Petr Mladek wrote: > > I agree with all the other justification. > > > > I would add. The backtrace is really useful for debugging. It should > > be possible to print it even in less critical situations. > > Hmm, I

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-08 Thread Sergey Senozhatsky
On (19/11/06 09:35), Petr Mladek wrote: > I agree with all the other justification. > > I would add. The backtrace is really useful for debugging. It should > be possible to print it even in less critical situations. Hmm, I don't know. Do we really need debug/info level backtraces? May be all

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-06 Thread Russell King - ARM Linux admin
On Wed, Nov 06, 2019 at 09:34:40PM +0100, Peter Zijlstra wrote: > I suppose I'm surprised there are backtraces that are not important. > Either badness happened and it needs printing, or the user asked for it > and it needs printing. Or utterly meaningless. > Perhaps we should be removing

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-06 Thread Peter Zijlstra
On Wed, Nov 06, 2019 at 04:27:33PM +, Dmitry Safonov wrote: > Hi Peter, > > On 11/6/19 9:20 AM, Peter Zijlstra wrote: > > On Wed, Nov 06, 2019 at 03:04:51AM +, Dmitry Safonov wrote: > >> Add log level argument to show_stack(). > >> Done in three stages: > >> 1. Introducing

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-06 Thread Dmitry Safonov
Hi Peter, On 11/6/19 9:20 AM, Peter Zijlstra wrote: > On Wed, Nov 06, 2019 at 03:04:51AM +, Dmitry Safonov wrote: >> Add log level argument to show_stack(). >> Done in three stages: >> 1. Introducing show_stack_loglvl() for every architecture >> 2. Migrating old users with an explicit log

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-06 Thread Dmitry Safonov
On 11/6/19 8:35 AM, Petr Mladek wrote: > On Wed 2019-11-06 03:04:51, Dmitry Safonov wrote: >> Add log level argument to show_stack(). >> Done in three stages: >> 1. Introducing show_stack_loglvl() for every architecture >> 2. Migrating old users with an explicit log level >> 3. Renaming

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-06 Thread Peter Zijlstra
On Wed, Nov 06, 2019 at 03:04:51AM +, Dmitry Safonov wrote: > Add log level argument to show_stack(). > Done in three stages: > 1. Introducing show_stack_loglvl() for every architecture > 2. Migrating old users with an explicit log level > 3. Renaming show_stack_loglvl() into show_stack() > >

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-06 Thread Petr Mladek
On Wed 2019-11-06 03:04:51, Dmitry Safonov wrote: > Add log level argument to show_stack(). > Done in three stages: > 1. Introducing show_stack_loglvl() for every architecture > 2. Migrating old users with an explicit log level > 3. Renaming show_stack_loglvl() into show_stack() > >