25 Oct, 2011

1 commit

  • * 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (38 commits)
    mm: memory hotplug: Check if pages are correctly reserved on a per-section basis
    Revert "memory hotplug: Correct page reservation checking"
    Update email address for stable patch submission
    dynamic_debug: fix undefined reference to `__netdev_printk'
    dynamic_debug: use a single printk() to emit messages
    dynamic_debug: remove num_enabled accounting
    dynamic_debug: consolidate repetitive struct _ddebug descriptor definitions
    uio: Support physical addresses >32 bits on 32-bit systems
    sysfs: add unsigned long cast to prevent compile warning
    drivers: base: print rejected matches with DEBUG_DRIVER
    memory hotplug: Correct page reservation checking
    memory hotplug: Refuse to add unaligned memory regions
    remove the messy code file Documentation/zh_CN/SubmitChecklist
    ARM: mxc: convert device creation to use platform_device_register_full
    new helper to create platform devices with dma mask
    docs/driver-model: Update device class docs
    docs/driver-model: Document device.groups
    kobj_uevent: Ignore if some listeners cannot handle message
    dynamic_debug: make netif_dbg() call __netdev_printk()
    dynamic_debug: make netdev_dbg() call __netdev_printk()
    ...

    Linus Torvalds
     

19 Oct, 2011

3 commits

  • Dynamic debug recently added support for netdev_printk. It uses
    __netdev_printk() to support this functionality. However, when CONFIG_NET
    is not set, we get the following error:

    lib/built-in.o: In function `__dynamic_netdev_dbg':
    (.text+0x9fda): undefined reference to `__netdev_printk'

    Fix this by making the call to netdev_printk() contingent upon CONFIG_NET.
    We could have fixed this by defining netdev_printk() to a 'no-op' in the
    !CONFIG_NET case. However, this is not consistent with how the networking
    layer uses netdev_printk. For example, CONFIG_NET is not set,
    netdev_printk() does not have a 'no-op' definition defined.

    Signed-off-by: Jason Baron
    Acked-by: Randy Dunlap
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Jason Baron
     
  • We were using KERN_CONT to combine messages with their prefix. However,
    KERN_CONT is not smp safe, in the sense that it can interleave messages.
    This interleaving can result in printks coming out at the wrong loglevel.
    With the high frequency of printks that dynamic debug can produce this is
    not desirable.

    So make dynamic_emit_prefix() fill a char buf[64] instead of doing a
    printk directly. If we enable printing out of function, module, line, or
    pid info, they are placed in this 64 byte buffer. In my testing 64 bytes
    was enough size to fulfill all requests. Even if it's not, we can match
    up the printk itself to see where it's from, so to me this is no big deal.

    [akpm@linux-foundation.org: convert dangerous macro to C]
    Signed-off-by: Jason Baron
    Cc: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Jason Baron
     
  • The num_enabled accounting isn't actually used anywhere - remove them.

    Signed-off-by: Jason Baron
    Cc: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Jason Baron
     

15 Sep, 2011

1 commit


23 Aug, 2011

5 commits


04 Feb, 2011

2 commits


08 Jan, 2011

1 commit

  • On older gcc (3.3) dynamic debug fails to compile:

    include/net/inet_connection_sock.h: In function `inet_csk_reset_xmit_timer':
    include/net/inet_connection_sock.h:236: error: duplicate label declaration `do_printk'
    include/net/inet_connection_sock.h:219: error: this is a previous declaration
    include/net/inet_connection_sock.h:236: error: duplicate label declaration `out'
    include/net/inet_connection_sock.h:219: error: this is a previous declaration
    include/net/inet_connection_sock.h:236: error: duplicate label `do_printk'
    include/net/inet_connection_sock.h:236: error: duplicate label `out'

    Fix, by reverting the usage of JUMP_LABEL() in dynamic debug for now.

    Cc:
    Reported-by: Tetsuo Handa
    Tested-by: Tetsuo Handa
    Signed-off-by: Jason Baron
    Signed-off-by: Steven Rostedt

    Jason Baron
     

23 Oct, 2010

4 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (31 commits)
    driver core: Display error codes when class suspend fails
    Driver core: Add section count to memory_block struct
    Driver core: Add mutex for adding/removing memory blocks
    Driver core: Move find_memory_block routine
    hpilo: Despecificate driver from iLO generation
    driver core: Convert link_mem_sections to use find_memory_block_hinted.
    driver core: Introduce find_memory_block_hinted which utilizes kset_find_obj_hinted.
    kobject: Introduce kset_find_obj_hinted.
    driver core: fix build for CONFIG_BLOCK not enabled
    driver-core: base: change to new flag variable
    sysfs: only access bin file vm_ops with the active lock
    sysfs: Fail bin file mmap if vma close is implemented.
    FW_LOADER: fix kconfig dependency warning on HOTPLUG
    uio: Statically allocate uio_class and use class .dev_attrs.
    uio: Support 2^MINOR_BITS minors
    uio: Cleanup irq handling.
    uio: Don't clear driver data
    uio: Fix lack of locking in init_uio_class
    SYSFS: Allow boot time switching between deprecated and modern sysfs layout
    driver core: remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices
    ...

    Linus Torvalds
     
  • Having the ddebug_query= boot parameter it makes sense to set up
    dynamic debug as soon as possible.

    I expect sysfs files cannot be set up via an arch_initcall, because
    this one is even before fs_initcall. Therefore I splitted the
    dynamic_debug_init function into an early one and a later one providing
    /sys/../dynamic_debug/control file.

    Possibly dynamic_debug can be initialized even earlier, not sure whether
    this still makes sense then. I picked up arch_initcall as it covers
    quite a lot already.

    Dynamic debug needs to allocate memory, therefore it's not easily possible to
    set it up even before the command line gets parsed.
    Therefore the boot param query string is stored in a temp string which is
    applied when dynamic debug gets set up.

    This has been tested with ddebug_query="file ec.c +p"
    and I could retrieve pr_debug() messages early at boot during ACPI setup:
    ACPI: EC: Look up EC in DSDT
    ACPI: EC: ---> status = 0x08
    ACPI: EC: transaction start
    ACPI: EC: interrupt
    ACPI: EC: ---> status = 0x08
    ACPI: EC: status = 0x00
    ACPI: EC: transaction start
    ACPI: EC:
    Acked-by: jbaron@redhat.com
    Acked-by: Pekka Enberg
    CC: linux-acpi@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Thomas Renninger
     
  • Dynamic debug lacks the ability to enable debug messages at boot time.
    One could patch initramfs or service startup scripts to write to
    /sys/../dynamic_debug/control, but this sucks.

    This patch makes it possible to pass a query in the same format one can
    write to /sys/../dynamic_debug/control via boot param.
    When dynamic debug gets initialized, this query will automatically be
    applied.

    Signed-off-by: Thomas Renninger
    Acked-by: jbaron@redhat.com
    Acked-by: Pekka Enberg
    Signed-off-by: Greg Kroah-Hartman

    Thomas Renninger
     
  • The parsing and applying of dynamic debug strings is not only useful for
    /sys/../dynamic_debug/control write access, but can also be used for
    boot parameter parsing.
    The boot parameter is introduced in a follow up patch.

    Signed-off-by: Thomas Renninger
    Acked-by: jbaron@redhat.com
    Acked-by: Pekka Enberg
    Signed-off-by: Greg Kroah-Hartman

    Thomas Renninger
     

19 Oct, 2010

1 commit


23 Sep, 2010

1 commit


05 Jul, 2010

1 commit

  • We should initialize the module dynamic debug datastructures
    only after determining that the module is not loaded yet. This
    fixes a bug that introduced in 2.6.35-rc2, where when a trying
    to load a module twice, we also load it's dynamic printing data
    twice which causes all sorts of nasty issues. Also handle
    the dynamic debug cleanup later on failure.

    Signed-off-by: Yehuda Sadeh
    Signed-off-by: Rusty Russell (removed a #ifdef)
    Signed-off-by: Linus Torvalds

    Yehuda Sadeh
     

25 May, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

16 Dec, 2009

1 commit

  • Makes use of skip_spaces() defined in lib/string.c for removing leading
    spaces from strings all over the tree.

    It decreases lib.a code size by 47 bytes and reuses the function tree-wide:
    text data bss dec hex filename
    64688 584 592 65864 10148 (TOTALS-BEFORE)
    64641 584 592 65817 10119 (TOTALS-AFTER)

    Also, while at it, if we see (*str && isspace(*str)), we can be sure to
    remove the first condition (*str) as the second one (isspace(*str)) also
    evaluates to 0 whenever *str == 0, making it redundant. In other words,
    "a char equals zero is never a space".

    Julia Lawall tried the semantic patch (http://coccinelle.lip6.fr) below,
    and found occurrences of this pattern on 3 more files:
    drivers/leds/led-class.c
    drivers/leds/ledtrig-timer.c
    drivers/video/output.c

    @@
    expression str;
    @@

    ( // ignore skip_spaces cases
    while (*str && isspace(*str)) { \(str++;\|++str;\) }
    |
    - *str &&
    isspace(*str)
    )

    Signed-off-by: André Goddard Rosa
    Cc: Julia Lawall
    Cc: Martin Schwidefsky
    Cc: Jeff Dike
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: Richard Purdie
    Cc: Neil Brown
    Cc: Kyle McMartin
    Cc: Henrique de Moraes Holschuh
    Cc: David Howells
    Cc:
    Cc: Samuel Ortiz
    Cc: Patrick McHardy
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     

29 Jul, 2009

1 commit


25 Mar, 2009

2 commits

  • Allow simple quoting of words in the dynamic debug control language.

    This allows more natural specification when using the control language
    to match against printk formats, e.g

    #echo -n 'format "Setting node for non-present cpu" +p' >
    /mnt/debugfs/dynamic_debug/control

    instead of

    #echo -n 'format Setting\040node\040for\040non-present\040cpu +p' >
    /mnt/debugfs/dynamic_debug/control

    Adjust the dynamic debug documention to describe that and provide a
    new example. Adjust the existing examples in the documentation to
    reflect the current whitespace escaping behaviour when reading the
    control file. Fix some minor documentation trailing whitespace.

    Signed-off-by: Greg Banks
    Acked-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Greg Banks
     
  • This patch combines Greg Bank's dprintk() work with the existing dynamic
    printk patchset, we are now calling it 'dynamic debug'.

    The new feature of this patchset is a richer /debugfs control file interface,
    (an example output from my system is at the bottom), which allows fined grained
    control over the the debug output. The output can be controlled by function,
    file, module, format string, and line number.

    for example, enabled all debug messages in module 'nf_conntrack':

    echo -n 'module nf_conntrack +p' > /mnt/debugfs/dynamic_debug/control

    to disable them:

    echo -n 'module nf_conntrack -p' > /mnt/debugfs/dynamic_debug/control

    A further explanation can be found in the documentation patch.

    Signed-off-by: Greg Banks
    Signed-off-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Jason Baron