02 Jul, 2013

1 commit

  • In order to avoid making code that deals with printing both, IPv4 and
    IPv6 addresses, unnecessary complicated as for example ...

    if (sa.sa_family == AF_INET6)
    printk("... %pI6 ...", ..sin6_addr);
    else
    printk("... %pI4 ...", ..sin_addr.s_addr);

    ... it would be better to introduce a format specifier that can deal
    with those kind of situations internally; just as we have a "struct
    sockaddr" for generic mapping into "struct sockaddr_in" or "struct
    sockaddr_in6" as e.g. done in "union sctp_addr". Then, we could
    reduce the above statement into something like:

    printk("... %pIS ..", &sockaddr);

    In case our pointer is NULL, pointer() then deals with that already at
    an earlier point in time internally. While we're at it, support for both
    %piS/%pIS, where 'S' stands for sockaddr, comes (almost) for free.

    Additionally to that, postfix specifiers 'p', 'f' and 's' are supported
    as suggested and initially implemented in 2009 by Joe Perches [1].
    Handling of those additional specifiers orientate on the initial RFC that
    was proposed. Also we support IPv6 compressed format specified by 'c' and
    various other IPv4 extensions as stated in the documentation part.

    Likely, there are many other areas than just SCTP in the kernel to make
    use of this extension as well.

    [1] http://patchwork.ozlabs.org/patch/31480/

    Signed-off-by: Daniel Borkmann
    CC: Joe Perches
    CC: linux-kernel@vger.kernel.org
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

01 May, 2013

2 commits

  • Pull fixup for trivial branch from Jiri Kosina:
    "Unfortunately I made a mistake when merging into for-linus branch, and
    omitted one pre-requisity patch for a few other patches (which have
    been Acked by the appropriate maintainers) in the series. Mea culpa
    maxima, sorry for that."

    The trivial branch added %pSR usage before actually teaching vsnprintf()
    about the 'R' part of %pSR. The 'R' causes the symbol translation to do
    a "__builtin_extract_return_addr()" before symbol lookup.

    That said, on most architectures __builtin_extract_return_addr() isn't
    likely to do anything special, so it probably is not normally
    noticeable.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial:
    vsprintf: Add extension %pSR - print_symbol replacement

    Linus Torvalds
     
  • print_symbol takes a long and converts it to a function
    name and offset. %pS does something similar, but doesn't
    translate the address via __builtin_extract_return_addr.
    %pSR does the translation.

    This will enable replacing multiple calls like
    printk(...);
    printk_symbol(addr);
    printk("\n");
    with a single non-interleavable in dmesg
    printk("... %pSR\n", (void *)addr);

    Update documentation too.

    Signed-off-by: Joe Perches
    Signed-off-by: Jiri Kosina

    Joe Perches
     

09 Mar, 2013

1 commit

  • Update email address and CREDITS info. xenotime.net is defunct.

    Signed-off-by: Randy Dunlap
    Cc: Harry Wei
    Cc: Keiichi KII
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

22 Feb, 2013

1 commit

  • Add the %pa format specifier for printing a phys_addr_t type and its
    derivative types (such as resource_size_t), since the physical address
    size on some platforms can vary based on build options, regardless of
    the native integer type.

    Signed-off-by: Stepan Moskovchenko
    Cc: Rob Landley
    Cc: George Spelvin
    Cc: Andy Shevchenko
    Cc: Stephen Boyd
    Cc: Andrei Emeltchenko
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stepan Moskovchenko
     

06 Oct, 2012

1 commit


31 Jul, 2012

2 commits

  • There are many places in the kernel where the drivers print small buffers
    as a hex string. This patch adds a support of the variable width buffer
    to print it as a hex string with a delimiter. The idea came from Pavel
    Roskin here: http://www.digipedia.pl/usenet/thread/18835/17449/

    Sample output of
    pr_info("buf[%d:%d] %*phC\n", from, len, len, &buf[from]);
    could be look like this:
    [ 0.726130] buf[51:8] e8:16:b6:ef:e3:74:45:6e
    [ 0.750736] buf[59:15] 31:81:b8:3f:35:49:06:ae:df:32:06:05:4a:af:55
    [ 0.757602] buf[17:5] ac:16:d5:2c:ef

    Signed-off-by: Andy Shevchenko
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Bluetooth uses mostly LE byte order which is reversed for visual
    interpretation. Currently in Bluetooth in use unsafe batostr function.

    This is a slightly modified version of Joe's patch (sent Sat, Dec 4,
    2010).

    Signed-off-by: Andrei Emeltchenko
    Cc: Joe Perches
    Cc: Marcel Holtmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrei Emeltchenko
     

16 Jun, 2011

1 commit


13 Nov, 2008

1 commit

  • Add printk-formats.txt so that we don't have to keep fixing the
    same things over and over again.

    Signed-off-by: Randy Dunlap
    Cc: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap