10 Jun, 2020

40 commits

  • Now the last users of show_stack() got converted to use an explicit log
    level, show_stack_loglvl() can drop it's redundant suffix and become once
    again well known show_stack().

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Link: http://lkml.kernel.org/r/20200418201944.482088-51-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Align the last users of show_stack() by KERN_DEFAULT as the surrounding
    headers/messages.

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Will Deacon
    Link: http://lkml.kernel.org/r/20200418201944.482088-50-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Aligning with other messages printed in sched_show_task() - use KERN_INFO
    to print the backtrace.

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Ben Segall
    Cc: Dietmar Eggemann
    Cc: Ingo Molnar
    Cc: Juri Lelli
    Cc: Mel Gorman
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Vincent Guittot
    Link: http://lkml.kernel.org/r/20200418201944.482088-49-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Print the stack trace with KERN_EMERG - it should be always visible.

    Playing with console_loglevel is a bad idea as there may be more messages
    printed than wanted. Also the stack trace might be not printed at all if
    printk() was deferred and console_loglevel was raised back before the
    trace got flushed.

    Unfortunately, after rebasing on commit 2277b492582d ("kdb: Fix stack
    crawling on 'running' CPUs that aren't the master"), kdb_show_stack() uses
    now kdb_dump_stack_on_cpu(), which for now won't be converted as it uses
    dump_stack() instead of show_stack().

    Convert for now the branch that uses show_stack() and remove
    console_loglevel exercise from that case.

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Reviewed-by: Douglas Anderson
    Acked-by: Daniel Thompson
    Cc: Jason Wessel
    Link: http://lkml.kernel.org/r/20200418201944.482088-48-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Aligning with other watchdog messages just before panic - use KERN_EMERG.

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Acked-by: Rafael J. Wysocki
    Cc: Greg Kroah-Hartman
    Cc: Len Brown
    Cc: Pavel Machek
    Link: http://lkml.kernel.org/r/20200418201944.482088-47-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • It's under CONFIG_IOMMU_LEAK option which is enabled by debug config.
    Likely the backtrace is worth to be seen - so aligning with log level of
    error message in iommu_full().

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Borislav Petkov
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/20200418201944.482088-46-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Show the stack trace on a CPU with the same log level as "CPU%d" header.

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Greg Kroah-Hartman
    Cc: Jiri Slaby
    Link: http://lkml.kernel.org/r/20200418201944.482088-45-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Chris Zankel
    Cc: Max Filippov
    Link: http://lkml.kernel.org/r/20200418201944.482088-44-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Add log level argument to show_trace() as a preparation for introducing
    show_stack_loglvl().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    [rppt@kernel.org: build fix]
    Link: http://lkml.kernel.org/r/20200511194534.GA1018386@kernel.org

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Chris Zankel
    Cc: Max Filippov
    Cc: Mike Rapoport
    Link: http://lkml.kernel.org/r/20200418201944.482088-43-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Borislav Petkov
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/20200418201944.482088-42-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Keep log_lvl const show_trace_log_lvl() and printk_stack_address() as the
    new generic show_stack_loglvl() wants to have a proper const qualifier.

    And gcc rightfully produces warnings in case it's not keept:
    arch/x86/kernel/dumpstack.c: In function `show_stack':
    arch/x86/kernel/dumpstack.c:294:37: warning: passing argument 4 of `show_trace_log_lv ' discards `const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    294 | show_trace_log_lvl(task, NULL, sp, loglvl);
    | ^~~~~~
    arch/x86/kernel/dumpstack.c:163:32: note: expected `char *' but argument is of type `const char *'
    163 | unsigned long *stack, char *log_lvl)
    | ~~~~~~^~~~~~~

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Borislav Petkov
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/20200418201944.482088-41-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    As a nice side-effect - print backtrace in __die() with the same log level
    as the rest of function.

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Guan Xuetao
    Link: http://lkml.kernel.org/r/20200418201944.482088-40-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Add log level parameter to c_backtrace() as a preparation for introducing
    show_stack_loglvl()

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Guan Xuetao
    Link: http://lkml.kernel.org/r/20200418201944.482088-39-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • The pmode parameter isn't used in assembly - remove it. Second argument
    will be reused for printk() log level.

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Guan Xuetao
    Link: http://lkml.kernel.org/r/20200418201944.482088-38-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Anton Ivanov
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Link: http://lkml.kernel.org/r/20200418201944.482088-37-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • `sp' is a needless excercise here.

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Anton Ivanov
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Link: http://lkml.kernel.org/r/20200418201944.482088-36-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Acked-by: David S. Miller
    Link: http://lkml.kernel.org/r/20200418201944.482088-35-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Rich Felker
    Cc: Yoshinori Sato
    Link: http://lkml.kernel.org/r/20200418201944.482088-34-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Add log level parameter to show_trace() as a preparation to introduce
    show_stack_loglvl().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Rich Felker
    Link: http://lkml.kernel.org/r/20200418201944.482088-33-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Add log level argument to printk_address() as a preparation to introduce
    show_stack_loglvl().

    As a good side-effect show_fault_oops() now prints the address with
    KERN_EMREG as the rest of output, making sure there won't be situation
    where "PC: " is printed without actual address.

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Rich Felker
    Link: http://lkml.kernel.org/r/20200418201944.482088-32-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently `data' is always an empty line "". No need for additional
    printk() call.

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Rich Felker
    Cc: Yoshinori Sato
    Link: http://lkml.kernel.org/r/20200418201944.482088-31-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Add log level argument to dump_mem() as a preparation to introduce
    show_stack_loglvl().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Rich Felker
    Cc: Yoshinori Sato
    Link: http://lkml.kernel.org/r/20200418201944.482088-30-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Christian Borntraeger
    Cc: Heiko Carstens
    Cc: Vasily Gorbik
    Link: http://lkml.kernel.org/r/20200418201944.482088-29-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Albert Ou
    Cc: Palmer Dabbelt
    Cc: Paul Walmsley
    Link: http://lkml.kernel.org/r/20200418201944.482088-28-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Acked-by: Michael Ellerman (powerpc)
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Link: http://lkml.kernel.org/r/20200418201944.482088-27-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Helge Deller
    Cc: "James E.J. Bottomley"
    Link: http://lkml.kernel.org/r/20200418201944.482088-26-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Jonas Bonn
    Cc: Stafford Horne
    Cc: Stefan Kristiansson
    Link: http://lkml.kernel.org/r/20200418201944.482088-25-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Ley Foon Tan
    Link: http://lkml.kernel.org/r/20200418201944.482088-24-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Greentime Hu
    Cc: Vincent Chen
    Link: http://lkml.kernel.org/r/20200418201944.482088-23-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: James Hogan
    Cc: Paul Burton
    Cc: Ralf Baechle
    Link: http://lkml.kernel.org/r/20200418201944.482088-22-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Michal Simek
    Link: http://lkml.kernel.org/r/20200418201944.482088-21-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Add log level parameter to microblaze_unwind() as a preparation to add
    show_stack_loglvl().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Michal Simek
    Link: http://lkml.kernel.org/r/20200418201944.482088-20-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Add log level argument to microblaze_unwind_inner() as a preparation for
    introducing show_stack_loglvl().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Michal Simek
    Link: http://lkml.kernel.org/r/20200418201944.482088-19-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Geert Uytterhoeven
    Link: http://lkml.kernel.org/r/20200418201944.482088-18-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Fenghua Yu
    Cc: Tony Luck
    Link: http://lkml.kernel.org/r/20200418201944.482088-17-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Add log level argument to ia64_do_show_stack() as a preparation to
    introduce show_stack_loglvl(). Also, make ia64_do_show_stack() static as
    it's not used outside.

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Fenghua Yu
    Cc: Tony Luck
    Link: http://lkml.kernel.org/r/20200418201944.482088-16-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    As a good side-effect die() now prints the stacktrace with KERN_EMERG
    aligned with other messages.

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Acked-by: Brian Cain
    Link: http://lkml.kernel.org/r/20200418201944.482088-15-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Yoshinori Sato
    Link: http://lkml.kernel.org/r/20200418201944.482088-14-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Guo Ren
    Link: http://lkml.kernel.org/r/20200418201944.482088-13-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Currently, the log-level of show_stack() depends on a platform
    realization. It creates situations where the headers are printed with
    lower log level or higher than the stacktrace (depending on a platform or
    user).

    Furthermore, it forces the logic decision from user to an architecture
    side. In result, some users as sysrq/kdb/etc are doing tricks with
    temporary rising console_loglevel while printing their messages. And in
    result it not only may print unwanted messages from other CPUs, but also
    omit printing at all in the unlucky case where the printk() was deferred.

    Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
    approach than introducing more printk buffers. Also, it will consolidate
    printings with headers.

    Introduce show_stack_loglvl(), that eventually will substitute
    show_stack().

    [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Aurelien Jacquiot
    Cc: Mark Salter
    Link: http://lkml.kernel.org/r/20200418201944.482088-12-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov