01 May, 2012

3 commits

  • drivers/infiniband/ulp/srp/ib_srp.c #defines pr_fmt() PFX fmt, but PFX
    is not #defined until after headers are included.

    This results in a bad expansion of the pr_warn() in the stub function.

    2084c2084
    < printk("" PFX "dyndbg supported only in " "CONFIG_DYNAMIC_DEBUG builds\n")

    Signed-off-by: Greg Kroah-Hartman

    Jim Cromie
     
  • This introduces a fake module param $module.dyndbg. Its based upon
    Thomas Renninger's $module.ddebug boot-time debugging patch from
    https://lkml.org/lkml/2010/9/15/397

    The 'fake' module parameter is provided for all modules, whether or
    not they need it. It is not explicitly added to each module, but is
    implemented in callbacks invoked from parse_args.

    For builtin modules, dynamic_debug_init() now directly calls
    parse_args(..., &ddebug_dyndbg_boot_params_cb), to process the params
    undeclared in the modules, just after the ddebug tables are processed.

    While its slightly weird to reprocess the boot params, parse_args() is
    already called repeatedly by do_initcall_levels(). More importantly,
    the dyndbg queries (given in ddebug_query or dyndbg params) cannot be
    activated until after the ddebug tables are ready, and reusing
    parse_args is cleaner than doing an ad-hoc parse. This reparse would
    break options like inc_verbosity, but they probably should be params,
    like verbosity=3.

    ddebug_dyndbg_boot_params_cb() handles both bare dyndbg (aka:
    ddebug_query) and module-prefixed dyndbg params, and ignores all other
    parameters. For example, the following will enable pr_debug()s in 4
    builtin modules, in the order given:

    dyndbg="module params +p; module aio +p" module.dyndbg=+p pci.dyndbg

    For loadable modules, parse_args() in load_module() calls
    ddebug_dyndbg_module_params_cb(). This handles bare dyndbg params as
    passed from modprobe, and errors on other unknown params.

    Note that modprobe reads /proc/cmdline, so "modprobe foo" grabs all
    foo.params, strips the "foo.", and passes these to the kernel.
    ddebug_dyndbg_module_params_cb() is again called for the unknown
    params; it handles dyndbg, and errors on others. The "doing" arg
    added previously contains the module name.

    For non CONFIG_DYNAMIC_DEBUG builds, the stub function accepts
    and ignores $module.dyndbg params, other unknowns get -ENOENT.

    If no param value is given (as in pci.dyndbg example above), "+p" is
    assumed, which enables all pr_debug callsites in the module.

    The dyndbg fake parameter is not shown in /sys/module/*/parameters,
    thus it does not use any resources. Changes to it are made via the
    control file.

    Also change pr_info in ddebug_exec_queries to vpr_info,
    no need to see it all the time.

    Signed-off-by: Jim Cromie
    CC: Thomas Renninger
    CC: Rusty Russell
    Acked-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Jim Cromie
     
  • clean up some space-before-tabs problems.

    Signed-off-by: Jim Cromie
    Acked-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Jim Cromie
     

25 Jan, 2012

4 commits

  • lineno:24 allows files with 4 million lines, an insane file-size, even
    for never-to-get-in-tree machine generated code. Reduce this to 18
    bits, which still allows 256k lines. This is still insanely big, but
    its not raving mad.

    Signed-off-by: Jim Cromie
    Signed-off-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Jim Cromie
     
  • Change describe_flags() to emit '=[pmflt_]+' for current callsite
    flags, or just '=_' when they're disabled. Having '=' in output
    allows a more selective grep expression; in contrast '-' may appear
    in filenames, line-ranges, and format-strings. '=' also has better
    mnemonics, saying; "the current setting is equal to ".

    This allows grep "=_" /dynamic_debug/control to see disabled
    callsites while avoiding the many occurrences of " = " seen in format
    strings.

    Enlarge flagsbufs to handle additional flag char, and alter
    ddebug_parse_flags() to allow flags=0, so that user can turn off all
    debug flags via:

    ~# echo =_ > /dynamic_debug/control

    Signed-off-by: Jim Cromie
    Signed-off-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Jim Cromie
     
  • If CONFIG_DYNAMIC_DEBUG is defined, honor it over DEBUG, so that
    pr_debug()s are controllable, instead of always-on. When DEBUG is
    also defined, change _DPRINTK_FLAGS_DEFAULT to enable printing by
    default.

    Also adding _DPRINTK_FLAGS_INCL_MODNAME would be nice, but there are
    numerous cases of pr_debug(NAME ": ...), which would result in double
    printing of module-name. So defer this until things settle.

    Cc: David Miller
    Cc: Joe Perches
    Signed-off-by: Jim Cromie
    Signed-off-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Jim Cromie
     
  • Currently any enabled dynamic-debug flag on a pr_debug callsite will
    enable printing, even if _DPRINTK_FLAGS_PRINT is off. Checking print
    flag directly allows "-p" to disable callsites without fussing with
    other flags, so the following disables everything, without altering
    flags user may have set:

    echo -p > $DBGFS/dynamic_debug/control

    Signed-off-by: Jim Cromie
    Signed-off-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Jim Cromie
     

01 Nov, 2011

1 commit

  • Standardize the style for compiler based printf format verification.
    Standardized the location of __printf too.

    Done via script and a little typing.

    $ grep -rPl --include=*.[ch] -w "__attribute__" * | \
    grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
    xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'

    [akpm@linux-foundation.org: revert arch bits]
    Signed-off-by: Joe Perches
    Cc: "Kirill A. Shutemov"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

19 Oct, 2011

1 commit


23 Aug, 2011

3 commits

  • Previously, if dynamic debug was enabled netdev_dbg() was using
    dynamic_dev_dbg() to print out the underlying msg. Fix this by making
    sure netdev_dbg() uses __netdev_printk().

    Cc: David S. Miller
    Signed-off-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Jason Baron
     
  • Remove no longer used dynamic debug control variables. The
    definitions were removed a while ago, but we forgot to clean
    up the extern references.

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

    Jason Baron
     
  • Unlike dynamic_pr_debug, dynamic uses of dev_dbg can not
    currently add task_pid/KBUILD_MODNAME/__func__/__LINE__
    to selected debug output.

    Add a new function similar to dynamic_pr_debug to
    optionally emit these prefixes.

    Cc: Aloisio Almeida
    Noticed-by: Aloisio Almeida
    Signed-off-by: Joe Perches
    Signed-off-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Joe Perches
     

05 Apr, 2011

1 commit

  • Introduce:

    static __always_inline bool static_branch(struct jump_label_key *key);

    instead of the old JUMP_LABEL(key, label) macro.

    In this way, jump labels become really easy to use:

    Define:

    struct jump_label_key jump_key;

    Can be used as:

    if (static_branch(&jump_key))
    do unlikely code

    enable/disale via:

    jump_label_inc(&jump_key);
    jump_label_dec(&jump_key);

    that's it!

    For the jump labels disabled case, the static_branch() becomes an
    atomic_read(), and jump_label_inc()/dec() are simply atomic_inc(),
    atomic_dec() operations. We show testing results for this change below.

    Thanks to H. Peter Anvin for suggesting the 'static_branch()' construct.

    Since we now require a 'struct jump_label_key *key', we can store a pointer into
    the jump table addresses. In this way, we can enable/disable jump labels, in
    basically constant time. This change allows us to completely remove the previous
    hashtable scheme. Thanks to Peter Zijlstra for this re-write.

    Testing:

    I ran a series of 'tbench 20' runs 5 times (with reboots) for 3
    configurations, where tracepoints were disabled.

    jump label configured in
    avg: 815.6

    jump label *not* configured in (using atomic reads)
    avg: 800.1

    jump label *not* configured in (regular reads)
    avg: 803.4

    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Jason Baron
    Suggested-by: H. Peter Anvin
    Tested-by: David Daney
    Acked-by: Ralf Baechle
    Acked-by: David S. Miller
    Acked-by: Mathieu Desnoyers
    Signed-off-by: Steven Rostedt

    Jason Baron
     

04 Feb, 2011

1 commit

  • Add flags that allow the user to specify via debugfs whether or not the
    module name, function name, line number and/or thread ID have to be
    included in the printed message.

    Signed-off-by: Bart Van Assche
    Cc: Greg Banks
    Cc: Konrad Rzeszutek Wilk
    Signed-off-by: Greg Kroah-Hartman

    Bart Van Assche
     

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

1 commit

  • * 'for-2.6.37/drivers' of git://git.kernel.dk/linux-2.6-block: (95 commits)
    cciss: fix PCI IDs for new Smart Array controllers
    drbd: add race-breaker to drbd_go_diskless
    drbd: use dynamic_dev_dbg to optionally log uuid changes
    dynamic_debug.h: Fix dynamic_dev_dbg() macro if CONFIG_DYNAMIC_DEBUG not set
    drbd: cleanup: change "s
    drbd: add explicit drbd_md_sync to drbd_resync_finished
    drbd: Do not log an ASSERT for P_OV_REQUEST packets while C_CONNECTED
    drbd: fix for possible deadlock on IO error during resync
    drbd: fix unlikely access after free and list corruption
    drbd: fix for spurious fullsync (uuids rotated too fast)
    drbd: allow for explicit resync-finished notifications
    drbd: preparation commit, using full state in receive_state()
    drbd: drbd_send_ack_dp must not rely on header information
    drbd: Fix regression in recv_bm_rle_bits (compressed bitmap)
    drbd: Fixed a stupid copy and paste error
    drbd: Allow larger values for c-fill-target.
    ...

    Fix up trivial conflict in drivers/block/ataflop.c due to BKL removal

    Linus Torvalds
     

15 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


16 Dec, 2009

1 commit

  • If CONFIG_DYNAMIC_DEBUG is enabled and a source file has:

    #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
    #include

    dynamic_debug.h will duplicate KBUILD_MODNAME
    in the output string.

    Remove the use of KBUILD_MODNAME from the
    output format string generated by dynamic_debug.h

    If CONFIG_DYNAMIC_DEBUG is not enabled, no compile-time
    check is done to printk/dev_printk arguments.

    Add it.

    Signed-off-by: Joe Perches
    Cc: Jason Baron
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

17 Apr, 2009

1 commit


25 Mar, 2009

2 commits

  • When CONFIG_DYNAMIC_DEBUG is enabled, allow callers of pr_debug()
    to provide their own definition of pr_fmt() even if that definition
    uses tricks like

    #define pr_fmt(fmt) "%s:" fmt, __func__

    Signed-off-by: Greg Banks
    Cc: Jason Baron
    Acked-by: Geert Uytterhoeven
    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