17 Oct, 2020

2 commits

  • With the patch.

    TASK PID COMM
    0xffffffff82c2b8c0 0 swapper/0
    0xffff888a0ba20040 1 systemd
    0xffff888a0ba24040 2 kthreadd
    0xffff888a0ba28040 3 rcu_gp

    w/o
    0xffffffff82c2b8c0 0 swapper/0
    0xffff888a0ba20040 1 systemd
    0xffff888a0ba24040 2 kthreadd
    0xffff888a0ba28040 3 rcu_gp

    Signed-off-by: Ritesh Harjani
    Signed-off-by: Andrew Morton
    Reviewed-by: Jan Kiszka
    Cc: Kieran Bingham
    Link: http://lkml.kernel.org/r/54c868c79b5fc364a8be7799891934a6fe6d1464.1597742951.git.riteshh@linux.ibm.com
    Signed-off-by: Linus Torvalds

    Ritesh Harjani
     
  • This is many times found useful while debugging some FS related
    issue.

    mount super_block devname pathname fstype options
    0xffff888a0bfa4b40 0xffff888a0bfc1000 none / rootfs rw 0 0
    0xffff888a033f75c0 0xffff8889fcf65000 /dev/root / ext4 rw,relatime 0 0
    0xffff8889fc8ce040 0xffff888a0bb51000 devtmpfs /dev devtmpfs rw,relatime 0 0

    Signed-off-by: Ritesh Harjani
    Signed-off-by: Andrew Morton
    Reviewed-by: Jan Kiszka
    Cc: Kieran Bingham
    Link: http://lkml.kernel.org/r/a3c4177e1597b3e06d66d55e07d72c0c46a03571.1597742951.git.riteshh@linux.ibm.com
    Signed-off-by: Linus Torvalds

    Ritesh Harjani
     

14 Oct, 2020

1 commit

  • Pull printk updates from Petr Mladek:
    "The big new thing is the fully lockless ringbuffer implementation,
    including the support for continuous lines. It will allow to store and
    read messages in any situation wihtout the risk of deadlocks and
    without the need of temporary per-CPU buffers.

    The access is still serialized by logbuf_lock. It synchronizes few
    more operations, for example, temporary buffer for formatting the
    message, syslog and kmsg_dump operations. The lock removal is being
    discussed and should be ready for the next release.

    The continuous lines are handled exactly the same way as before to
    avoid regressions in user space. It means that they are appended to
    the last message when the caller is the same. Only the last message
    can be extended.

    The data ring includes plain text of the messages. Except for an
    integer at the beginning of each message that points back to the
    descriptor ring with other metadata.

    The dictionary has to stay. journalctl uses it to filter the log. It
    allows to show messages related to a given device. The dictionary
    values are stored in the descriptor ring with the other metadata.

    This is the first part of the printk rework as discussed at Plumbers
    2019, see https://lore.kernel.org/r/87k1acz5rx.fsf@linutronix.de. The
    next big step will be handling consoles by kthreads during the normal
    system operation. It will require special handling of situations when
    the kthreads could not get scheduled, for example, early boot,
    suspend, panic.

    Other changes:

    - Add John Ogness as a reviewer for printk subsystem. He is author of
    the rework and is familiar with the code and history.

    - Fix locking in serial8250_do_startup() to prevent lockdep report.

    - Few code cleanups"

    * tag 'printk-for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: (27 commits)
    printk: Use fallthrough pseudo-keyword
    printk: reduce setup_text_buf size to LOG_LINE_MAX
    printk: avoid and/or handle record truncation
    printk: remove dict ring
    printk: move dictionary keys to dev_printk_info
    printk: move printk_info into separate array
    printk: reimplement log_cont using record extension
    printk: ringbuffer: add finalization/extension support
    printk: ringbuffer: change representation of states
    printk: ringbuffer: clear initial reserved fields
    printk: ringbuffer: add BLK_DATALESS() macro
    printk: ringbuffer: relocate get_data()
    printk: ringbuffer: avoid memcpy() on state_var
    printk: ringbuffer: fix setting state in desc_read()
    kernel.h: Move oops_in_progress to printk.h
    scripts/gdb: update for lockless printk ringbuffer
    scripts/gdb: add utils.read_ulong()
    docs: vmcoreinfo: add lockless printk ringbuffer vmcoreinfo
    printk: reduce LOG_BUF_SHIFT range for H8300
    printk: ringbuffer: support dataless records
    ...

    Linus Torvalds
     

12 Oct, 2020

1 commit


22 Sep, 2020

1 commit

  • Dictionaries are only used for SUBSYSTEM and DEVICE properties. The
    current implementation stores the property names each time they are
    used. This requires more space than otherwise necessary. Also,
    because the dictionary entries are currently considered optional,
    it cannot be relied upon that they are always available, even if the
    writer wanted to store them. These issues will increase should new
    dictionary properties be introduced.

    Rather than storing the subsystem and device properties in the
    dict ring, introduce a struct dev_printk_info with separate fields
    to store only the property values. Embed this struct within the
    struct printk_info to provide guaranteed availability.

    Signed-off-by: John Ogness
    Reviewed-by: Petr Mladek
    Signed-off-by: Petr Mladek
    Link: https://lore.kernel.org/r/87mu1jl6ne.fsf@jogness.linutronix.de

    John Ogness
     

15 Sep, 2020

2 commits

  • Add support for extending the newest data block. For this, introduce
    a new finalization state (desc_finalized) denoting a committed
    descriptor that cannot be extended.

    Until a record is finalized, a writer can reopen that record to
    append new data. Reopening a record means transitioning from the
    desc_committed state back to the desc_reserved state.

    A writer can explicitly finalize a record if there is no intention
    of extending it. Also, records are automatically finalized when a
    new record is reserved. This relieves writers of needing to
    explicitly finalize while also making such records available to
    readers sooner. (Readers can only traverse finalized records.)

    Four new memory barrier pairs are introduced. Two of them are
    insignificant additions (data_realloc:A/desc_read:D and
    data_realloc:A/data_push_tail:B) because they are alternate path
    memory barriers that exactly match the purpose, pairing, and
    context of the two existing memory barrier pairs they provide an
    alternate path for. The other two new memory barrier pairs are
    significant additions:

    desc_reopen_last:A / _prb_commit:B - When reopening a descriptor,
    ensure the state transitions back to desc_reserved before
    fully trusting the descriptor data.

    _prb_commit:B / desc_reserve:D - When committing a descriptor,
    ensure the state transitions to desc_committed before checking
    the head ID to see if the descriptor needs to be finalized.

    Signed-off-by: John Ogness
    Reviewed-by: Petr Mladek
    Signed-off-by: Petr Mladek
    Link: https://lore.kernel.org/r/20200914123354.832-6-john.ogness@linutronix.de

    John Ogness
     
  • Rather than deriving the state by evaluating bits within the flags
    area of the state variable, assign the states explicit values and
    set those values in the flags area. Introduce macros to make it
    simple to read and write state values for the state variable.

    Although the functionality is preserved, the binary representation
    for the states is changed.

    Signed-off-by: John Ogness
    Reviewed-by: Petr Mladek
    Signed-off-by: Petr Mladek
    Link: https://lore.kernel.org/r/20200914123354.832-5-john.ogness@linutronix.de

    John Ogness
     

08 Sep, 2020

2 commits

  • With the introduction of the lockless printk ringbuffer, the data
    structure for the kernel log buffer was changed. Update the gdb
    scripts to be able to parse/print the new log buffer structure.

    Fixes: 896fbe20b4e2333fb55 ("printk: use the lockless ringbuffer")
    Signed-off-by: John Ogness
    Reported-by: Nick Desaulniers
    Tested-by: Nick Desaulniers
    Tested-by: Petr Mladek
    [akpm@linux-foundation.org: A typo fix.]
    Signed-off-by: Petr Mladek
    Link: https://lore.kernel.org/r/20200814212525.6118-3-john.ogness@linutronix.de

    John Ogness
     
  • Add a function for reading unsigned long values, which vary in size
    depending on the architecture.

    Signed-off-by: John Ogness
    Reviewed-by: Nick Desaulniers
    Tested-by: Nick Desaulniers
    Tested-by: Petr Mladek
    Signed-off-by: Petr Mladek
    Link: https://lore.kernel.org/r/20200814212525.6118-2-john.ogness@linutronix.de

    John Ogness
     

13 Aug, 2020

1 commit

  • Fixes the observed warnings:
    scripts/gdb/linux/rbtree.py:20: SyntaxWarning: "is" with a literal. Did
    you mean "=="?
    if node is 0:
    scripts/gdb/linux/rbtree.py:36: SyntaxWarning: "is" with a literal. Did
    you mean "=="?
    if node is 0:

    It looks like this is a new warning added in Python 3.8. I've only seen
    this once after adding the add-auto-load-safe-path rule to my ~/.gdbinit
    for a new tree.

    Fixes: commit 449ca0c95ea2 ("scripts/gdb: add rb tree iterating utilities")
    Signed-off-by: Nick Desaulniers
    Signed-off-by: Andrew Morton
    Reviewed-by: Stephen Boyd
    Cc: Jan Kiszka
    Cc: Kieran Bingham
    Cc: Aymeric Agon-Rambosson
    Link: http://lkml.kernel.org/r/20200805225015.2847624-1-ndesaulniers@google.com
    Link: https://adamj.eu/tech/2020/01/21/why-does-python-3-8-syntaxwarning-for-is-literal/
    Signed-off-by: Linus Torvalds

    Nick Desaulniers
     

03 Aug, 2020

1 commit

  • * pm-sleep:
    PM: sleep: spread "const char *" correctness
    PM: hibernate: fix white space in a few places
    freezer: Add unsafe version of freezable_schedule_timeout_interruptible() for NFS
    PM: sleep: core: Emit changed uevent on wakeup_sysfs_add/remove

    * pm-domains:
    PM: domains: Restore comment indentation for generic_pm_domain.child_links
    PM: domains: Fix up terminology with parent/child

    * powercap:
    powercap: Add Power Limit4 support
    powercap: idle_inject: Replace play_idle() with play_idle_precise() in comments
    powercap: intel_rapl: add support for Sapphire Rapids

    * pm-tools:
    pm-graph v5.7 - important s2idle fixes
    cpupower: Replace HTTP links with HTTPS ones
    cpupower: Fix NULL but dereferenced coccicheck errors
    cpupower: Fix comparing pointer to 0 coccicheck warns

    Rafael J. Wysocki
     

25 Jul, 2020

1 commit

  • Commit ed66f991bb19 ("module: Refactor section attr into bin attribute")
    removed the 'name' field from 'struct module_sect_attr' triggering the
    following error when invoking lx-symbols:

    (gdb) lx-symbols
    loading vmlinux
    scanning for modules in linux/build
    loading @0xffffffffc014f000: linux/build/drivers/net/tun.ko
    Python Exception There is no member named name.:
    Error occurred in Python: There is no member named name.

    This patch fixes the issue taking the module name from the 'struct
    attribute'.

    Fixes: ed66f991bb19 ("module: Refactor section attr into bin attribute")
    Signed-off-by: Stefano Garzarella
    Signed-off-by: Andrew Morton
    Reviewed-by: Jan Kiszka
    Reviewed-by: Kieran Bingham
    Link: http://lkml.kernel.org/r/20200722102239.313231-1-sgarzare@redhat.com
    Signed-off-by: Linus Torvalds

    Stefano Garzarella
     

09 Jul, 2020

1 commit

  • The genpd infrastructure uses the terms master/slave, but such uses have
    no external exposures (not even in Documentation/driver-api/pm/*) and are
    not mandated by nor associated with any external specifications. Change
    the language used through-out to parent/child.

    There was one possible exception in the debugfs node
    "pm_genpd/pm_genpd_summary" but its path has no hits outside of the
    kernel itself when performing a code search[1], and it seems even this
    single usage has been non-functional since it was introduced due to a
    typo in the Python ("apend" instead of correct "append"). Fix the typo
    while we're at it.

    Link: https://codesearch.debian.net/ # [1]
    Signed-off-by: Kees Cook
    Reviewed-by: Greg Kroah-Hartman
    Reviewed-by: Kieran Bingham
    Signed-off-by: Rafael J. Wysocki

    Kees Cook
     

08 May, 2020

1 commit

  • The current implementations of the rb_first() and rb_last() gdb
    functions have a variable that references itself in its instanciation,
    which causes the function to throw an error if a specific condition on
    the argument is met. The original author rather intended to reference
    the argument and made a typo. Referring the argument instead makes the
    function work as intended.

    Signed-off-by: Aymeric Agon-Rambosson
    Signed-off-by: Andrew Morton
    Reviewed-by: Stephen Boyd
    Cc: Jan Kiszka
    Cc: Kieran Bingham
    Cc: Douglas Anderson
    Cc: Nikolay Borisov
    Cc: Jackie Liu
    Cc: Jason Wessel
    Link: http://lkml.kernel.org/r/20200427051029.354840-1-aymeric.agon@yandex.com
    Signed-off-by: Linus Torvalds

    Aymeric Agon-Rambosson
     

25 Mar, 2020

1 commit


07 Nov, 2019

1 commit

  • gcc's -freorder-blocks-and-partition option makes it group frequently
    and infrequently used code in .text.hot and .text.unlikely sections
    respectively. At least when building modules on s390, this option is
    used by default.

    gdb assumes that all code is located in .text section, and that .text
    section is located at module load address. With such modules this is no
    longer the case: there is code in .text.hot and .text.unlikely, and
    either of them might precede .text.

    Fix by explicitly telling gdb the addresses of code sections.

    It might be tempting to do this for all sections, not only the ones in
    the white list. Unfortunately, gdb appears to have an issue, when
    telling it about e.g. loadable .note.gnu.build-id section causes it to
    think that non-loadable .note.Linux section is loaded at address 0,
    which in turn causes NULL pointers to be resolved to bogus symbols. So
    keep using the white list approach for the time being.

    Link: http://lkml.kernel.org/r/20191028152734.13065-1-iii@linux.ibm.com
    Signed-off-by: Ilya Leoshkevich
    Reviewed-by: Jan Kiszka
    Cc: Kieran Bingham
    Cc: Heiko Carstens
    Cc: Vasily Gorbik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ilya Leoshkevich
     

19 Oct, 2019

2 commits

  • Currently lx-symbols assumes that module text is always located at
    module->core_layout->base, but s390 uses the following layout:

    +------+ core_layout->base
    | GOT |
    +------+ core_layout->base + module->arch->plt_offset
    | PLT |
    +------+ core_layout->base + module->arch->plt_offset +
    | TEXT | module->arch->plt_size
    +------+

    Therefore, when trying to debug modules on s390, all the symbol
    addresses are skewed by plt_offset + plt_size.

    Fix by adding plt_offset + plt_size to module_addr in
    load_module_symbols().

    Link: http://lkml.kernel.org/r/20191017085917.81791-1-iii@linux.ibm.com
    Signed-off-by: Ilya Leoshkevich
    Reviewed-by: Jan Kiszka
    Cc: Kieran Bingham
    Cc: Heiko Carstens
    Cc: Vasily Gorbik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ilya Leoshkevich
     
  • When CONFIG_PRINTK_CALLER is set, struct printk_log contains an
    additional member caller_id. This affects the offset of the log text.
    Account for this by using the type information from gdb to determine all
    the offsets instead of using hardcoded values.

    This fixes following error:

    (gdb) lx-dmesg
    Python Exception embedded null character:
    Error occurred in Python command: embedded null character

    The read_u* utility functions now take an offset argument to make them
    easier to use.

    Link: http://lkml.kernel.org/r/20191011142500.2339-1-joel.colledge@linbit.com
    Signed-off-by: Joel Colledge
    Reviewed-by: Jan Kiszka
    Cc: Kieran Bingham
    Cc: Leonard Crestez
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joel Colledge
     

26 Sep, 2019

1 commit

  • Some systems (like Chrome OS) may use "split debug" for kernel modules.
    That means that the debug symbols are in a different file than the main
    elf file. Let's handle that by also searching for debug symbols that end
    in ".ko.debug".

    This is a packaging topic. You can take a normal elf file and split the
    debug out of it using objcopy. Try "man objcopy" and then take a look at
    the "--only-keep-debug" option. It'll give you a whole recipe for doing
    splitdebug. The suffix used for the debug symbols is arbitrary. If
    people have other another suffix besides ".ko.debug" then we could
    presumably support that too...

    For portage (which is the packaging system used by Chrome OS) split debug
    is supported by default (and the suffix is .ko.debug). ...and so in
    Chrome OS we always get the installed elf files stripped and then the
    symbols stashed away.

    At the moment we don't actually use the normal portage magic to do this
    for the kernel though since it affects our ability to get good stack dumps
    in the kernel. We instead pass a script as "strip" [1].

    [1] https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/refs/heads/master/eclass/cros-kernel/strip_splitdebug

    Link: http://lkml.kernel.org/r/20190730234052.148744-1-dianders@chromium.org
    Signed-off-by: Douglas Anderson
    Reviewed-by: Stephen Boyd
    Reviewed-by: Jan Kiszka
    Cc: Kieran Bingham
    Cc: Jason Wessel
    Cc: Daniel Thompson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Douglas Anderson
     

17 Jul, 2019

2 commits

  • Add helper commands and functions for finding pointers to struct device
    by enumerating linux device bus/class infrastructure. This can be used
    to fetch subsystem and driver-specific structs:

    (gdb) p *$container_of($lx_device_find_by_class_name("net", "eth0"), "struct net_device", "dev")
    (gdb) p *$container_of($lx_device_find_by_bus_name("i2c", "0-004b"), "struct i2c_client", "dev")
    (gdb) p *(struct imx_port*)$lx_device_find_by_class_name("tty", "ttymxc1")->parent->driver_data

    Several generic "lx-device-list" functions are included to enumerate
    devices by bus and class:

    (gdb) lx-device-list-bus usb
    (gdb) lx-device-list-class
    (gdb) lx-device-list-tree &platform_bus

    Similar information is available in /sys but pointer values are
    deliberately hidden.

    Link: http://lkml.kernel.org/r/c948628041311cbf1b9b4cff3dda7d2073cb3eaa.1561492937.git.leonard.crestez@nxp.com
    Signed-off-by: Leonard Crestez
    Reviewed-by: Stephen Boyd
    Cc: Kieran Bingham
    Cc: Jan Kiszka
    Cc: "Rafael J. Wysocki"
    Cc: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Leonard Crestez
     
  • This is like /sys/kernel/debug/pm/pm_genpd_summary except it's
    accessible through a debugger.

    This can be useful if the target crashes or hangs because power domains
    were not properly enabled.

    Link: http://lkml.kernel.org/r/f9ee627a0d4f94b894aa202fee8a98444049bed8.1561492937.git.leonard.crestez@nxp.com
    Signed-off-by: Leonard Crestez
    Reviewed-by: Stephen Boyd
    Cc: Kieran Bingham
    Cc: Jan Kiszka
    Cc: "Rafael J. Wysocki"
    Cc: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Leonard Crestez
     

10 Jul, 2019

1 commit

  • Commit 25b146c5b8ce ("kbuild: allow Kbuild to start from any directory")
    deprecated KBUILD_SRCTREE.

    It is only used in tools/testing/selftest/ to distinguish out-of-tree
    build. Replace it with a new boolean flag, building_out_of_srctree.

    I also replaced the conditional ($(srctree),.) because the next commit
    will allow an absolute path to be used for $(srctree) even when building
    in the source tree.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

02 Jun, 2019

1 commit

  • CLK_GET_RATE_NOCACHE depends on CONFIG_COMMON_CLK. Importing constants.py
    when CONFIG_COMMON_CLK is not defined causes:

    (gdb) lx-symbols
    (...)
    File "scripts/gdb/linux/proc.py", line 15, in
    from linux import constants
    File "scripts/gdb/linux/constants.py", line 2, in
    LX_CLK_GET_RATE_NOCACHE = gdb.parse_and_eval("CLK_GET_RATE_NOCACHE")
    gdb.error: No symbol "CLK_GET_RATE_NOCACHE" in current context.

    Link: http://lkml.kernel.org/r/20190523195313.24701-1-farosas@linux.ibm.com
    Fixes: e7e6f462c1be ("scripts/gdb: print cached rate in lx-clk-summary")
    Signed-off-by: Fabiano Rosas
    Reviewed-by: Stephen Boyd
    Cc: Jan Kiszka
    Cc: Kieran Bingham
    Cc: Leonard Crestez
    Cc: Jackie Liu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabiano Rosas
     

21 May, 2019

1 commit


15 May, 2019

10 commits

  • The clk rate is always stored in clk_core but might be out of date and
    require calls to update from hardware.

    Deal with that case by printing a (c) suffix.

    Link: http://lkml.kernel.org/r/1a474318982a5f0125f2360c4161029b17f56bd1.1556881728.git.leonard.crestez@nxp.com
    Signed-off-by: Leonard Crestez
    Cc: Jan Kiszka
    Cc: Jason Wessel
    Cc: Kieran Bingham
    Cc: Stephen Boyd
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Leonard Crestez
     
  • An incorrect argument to list_for_each is an internal error in gdb
    scripts so a TypeError should be raised. The gdb.GdbError exception
    type is intended for user errors such as incorrect invocation.

    Drop the type assertion in list_for_each_entry because list_for_each
    isn't going to suddenly yield something else.

    Applies to both list and hlist

    Link: http://lkml.kernel.org/r/c1d3fd4db13d999a3ba57f5bbc1924862d824f61.1556881728.git.leonard.crestez@nxp.com
    Signed-off-by: Leonard Crestez
    Reviewed-by: Stephen Boyd
    Cc: Jan Kiszka
    Cc: Jason Wessel
    Cc: Kieran Bingham
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Leonard Crestez
     
  • Finding an individual clk_core requires walking the tree which can be
    quite complicated so add a helper for easy access.

    (gdb) print *(struct clk_scu*)$lx_clk_core_lookup("uart0_clk")->hw

    Link: http://lkml.kernel.org/r/Message-ID:
    Signed-off-by: Leonard Crestez
    Cc: Jan Kiszka
    Cc: Jason Wessel
    Cc: Kieran Bingham
    Cc: Stephen Boyd
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Leonard Crestez
     
  • Add an lx-clk-summary command which prints a subset of
    /sys/kernel/debug/clk/clk_summary.

    This can be used to examine hangs caused by clk not being enabled.

    Link: http://lkml.kernel.org/r/Message-ID:
    Signed-off-by: Leonard Crestez
    Cc: Jan Kiszka
    Cc: Jason Wessel
    Cc: Kieran Bingham
    Cc: Stephen Boyd
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Leonard Crestez
     
  • This allows easily examining kernel hlists in python.

    Link: http://lkml.kernel.org/r/Message-ID:
    Signed-off-by: Leonard Crestez
    Reviewed-by: Stephen Boyd
    Cc: Jason Wessel
    Cc: Jan Kiszka
    Cc: Kieran Bingham
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Leonard Crestez
     
  • These scripts have some pep8 style warnings. Fix them up so that this
    directory is all pep8 clean.

    Link: http://lkml.kernel.org/r/20190329220844.38234-6-swboyd@chromium.org
    Signed-off-by: Stephen Boyd
    Cc: Douglas Anderson
    Cc: Nikolay Borisov
    Cc: Kieran Bingham
    Cc: Jan Kiszka
    Cc: Jackie Liu
    Cc: Jason Wessel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • Implement a command to print the timer list, much like how
    /proc/timer_list is implemented. This can be used to look at the
    pending timers on a crashed system.

    [swboyd@chromium.org: v2]
    Link: http://lkml.kernel.org/r/20190329220844.38234-5-swboyd@chromium.org
    Link: http://lkml.kernel.org/r/20190325184522.260535-5-swboyd@chromium.org
    Signed-off-by: Stephen Boyd
    Cc: Douglas Anderson
    Cc: Nikolay Borisov
    Cc: Kieran Bingham
    Cc: Jan Kiszka
    Cc: Jackie Liu
    Cc: Jason Wessel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • Implement gdb functions for rb_first(), rb_last(), rb_next(), and
    rb_prev(). These can be useful to iterate through the kernel's
    red-black trees.

    [swboyd@chromium.org: v2]
    Link: http://lkml.kernel.org/r/20190329220844.38234-4-swboyd@chromium.org
    Link: http://lkml.kernel.org/r/20190325184522.260535-4-swboyd@chromium.org
    Signed-off-by: Stephen Boyd
    Cc: Douglas Anderson
    Cc: Nikolay Borisov
    Cc: Kieran Bingham
    Cc: Jan Kiszka
    Cc: Jackie Liu
    Cc: Jason Wessel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • lx-configdump dumps the contents of the gzipped .config to a text
    file when the config is included in the kernel with CONFIG_IKCONFIG. By
    default, the file written is called config.txt, but it can be any user
    supplied filename as well. If the kernel config is in a module
    (configs.ko), then it can be loaded along with symbols for the module
    loaded with 'lx-symbols' and then this command will still work.

    Obviously if you have the whole vmlinux then this can also be achieved
    with scripts/extract-ikconfig, but this gdb script can be useful to
    confirm that the memory contents of the config in memory and the vmlinux
    contents on disk match what is expected.

    [swboyd@chromium.org: v2]
    Link: http://lkml.kernel.org/r/20190329220844.38234-3-swboyd@chromium.org
    Link: http://lkml.kernel.org/r/20190325184522.260535-3-swboyd@chromium.org
    Signed-off-by: Stephen Boyd
    Cc: Douglas Anderson
    Cc: Nikolay Borisov
    Cc: Kieran Bingham
    Cc: Jan Kiszka
    Cc: Jackie Liu
    Cc: Jason Wessel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • Patch series "gdb script for kconfig and timer list".

    This is a handful of changes to the kernel's gdb scripts to do some more
    debugging with kgdb. The first patch allows the vmlinux to be reloaded
    from where it was specified on the command line so that this set of
    scripts can be used from anywhere. The second patch adds a script to
    dump the config.gz to a file on the host debugging machine. The third
    patch adds some rb tree utilities and the last patch uses those rb tree
    walking utilities to dump out the contents of /proc/timer_list from a
    system under debug.

    This patch (of 5):

    If I run 'gdb ' and there's the vmlinux-gdb.py file
    there I can properly see symbols and use the lx commands provided by the
    GDB scripts. But once I run 'lx-symbols' at the command prompt, gdb
    reloads the vmlinux symbols assuming that this script was run from the
    directory that has vmlinux at the root. That isn't always true, but we
    could just look and see what symbols were already loaded and use that
    instead. Let's do that so this can work by being invoked anywhere.

    Link: http://lkml.kernel.org/r/20190325184522.260535-2-swboyd@chromium.org
    Signed-off-by: Stephen Boyd
    Cc: Douglas Anderson
    Cc: Nikolay Borisov
    Cc: Kieran Bingham
    Cc: Jan Kiszka
    Cc: Jackie Liu
    Cc: Jason Wessel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     

02 Apr, 2019

1 commit

  • KBUILD_SRC was conventionally used for some different purposes:
    [1] To remember the source tree path
    [2] As a flag to check if sub-make is already done
    [3] As a flag to check if Kbuild runs out of tree

    For [1], we do not need to remember it because the top Makefile
    can compute it by $(realpath $(dir $(lastword $(MAKEFILE_LIST))))

    [2] has been replaced with self-commenting 'sub_make_done'.

    For [3], we can distinguish in-tree/out-of-tree by comparing
    $(srctree) and '.'

    This commit converts [3] to prepare for the KBUILD_SRC removal.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

11 Mar, 2019

1 commit

  • Pull Kbuild updates from Masahiro Yamada:

    - do not generate unneeded top-level built-in.a

    - let git ignore O= directory entirely

    - optimize scripts/kallsyms slightly

    - exclude DWARF info from *.s regardless of config options

    - fix GCC toolchain search path for Clang to prepare ld.lld support

    - do not generate modules.order when CONFIG_MODULES is disabled

    - simplify single target rules and remove VPATH for external module
    build

    - allow to add optional flags to dpkg-buildpackage when building
    deb-pkg

    - move some compiler option tests from Makefile to Kconfig

    - various Makefile cleanups

    * tag 'kbuild-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (40 commits)
    kbuild: remove scripts/basic/% build target
    kbuild: use -Werror=implicit-... instead of -Werror-implicit-...
    kbuild: clean up scripts/gcc-version.sh
    kbuild: remove cc-version macro
    kbuild: update comment block of scripts/clang-version.sh
    kbuild: remove commented-out INITRD_COMPRESS
    kbuild: move -gsplit-dwarf, -gdwarf-4 option tests to Kconfig
    kbuild: [bin]deb-pkg: add DPKG_FLAGS variable
    kbuild: move ".config not found!" message from Kconfig to Makefile
    kbuild: invoke syncconfig if include/config/auto.conf.cmd is missing
    kbuild: simplify single target rules
    kbuild: remove empty rules for makefiles
    kbuild: make -r/-R effective in top Makefile for old Make versions
    kbuild: move tools_silent to a more relevant place
    kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig
    kbuild: refactor cc-cross-prefix implementation
    kbuild: hardcode genksyms path and remove GENKSYMS variable
    scripts/gdb: refactor rules for symlink creation
    kbuild: create symlink to vmlinux-gdb.py in scripts_gdb target
    scripts/gdb: do not descend into scripts/gdb from scripts
    ...

    Linus Torvalds
     

08 Mar, 2019

1 commit

  • Since commit 1751e8a6cb93 ("Rename superblock flags (MS_xyz ->
    SB_xyz)"), scripts/gdb should be updated to replace MS_xyz with SB_xyz.

    This change didn't directly affect the running operation of scripts/gdb
    until commit e262e32d6bde "vfs: Suppress MS_* flag defs within the
    kernel unless explicitly enabled" removed the definitions used by
    constants.py.

    Update constants.py.in to utilise the new internal flags, matching the
    implementation at fs/proc_namespace.c::show_sb_opts.

    Note to stable, e262e32d6bde landed in v5.0-rc1 (which was just
    released), so we'll want this picked back to 5.0 stable once this patch
    hits mainline (akpm just picked it up). Without this, debugging a
    kernel a kernel via GDB+QEMU is broken in the 5.0 release.

    [kieran.bingham@ideasonboard.com: add fixes tag, reword commit message]
    Link: http://lkml.kernel.org/r/20190305103014.25847-1-kieran.bingham@ideasonboard.com
    Fixes: e262e32d6bde "vfs: Suppress MS_* flag defs within the kernel unless explicitly enabled"
    Signed-off-by: Jackie Liu
    Signed-off-by: Kieran Bingham
    Tested-by: Nick Desaulniers
    Tested-by: Kieran Bingham
    Cc: Felipe Balbi
    Cc: Dan Robertson
    Cc: Jan Kiszka
    Cc: David Howells
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jackie Liu
     

27 Feb, 2019

2 commits


05 Jan, 2019

1 commit

  • A bug is present in GDB which causes early string termination when
    parsing variables. This has been reported [0], but we should ensure
    that we can support at least basic printing of the core kernel strings.

    For current gdb version (has been tested with 7.3 and 8.1), 'lx-version'
    only prints one character.

    (gdb) lx-version
    L(gdb)

    This can be fixed by casting 'linux_banner' as (char *).

    (gdb) lx-version
    Linux version 4.19.0-rc1+ (changbin@acer) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #21 SMP Sat Sep 1 21:43:30 CST 2018

    [0] https://sourceware.org/bugzilla/show_bug.cgi?id=20077

    [kbingham@kernel.org: add detail to commit message]
    Link: http://lkml.kernel.org/r/20181111162035.8356-1-kieran.bingham@ideasonboard.com
    Fixes: 2d061d999424 ("scripts/gdb: add version command")
    Signed-off-by: Du Changbin
    Signed-off-by: Kieran Bingham
    Acked-by: Jan Kiszka
    Cc: Jan Kiszka
    Cc: Jason Wessel
    Cc: Daniel Thompson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Du Changbin