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
     

24 Mar, 2011

1 commit

  • The %pB format specifier is for stack backtrace. Its handler
    sprint_backtrace() does symbol lookup using (address-1) to
    ensure the address will not point outside of the function.

    If there is a tail-call to the function marked "noreturn",
    gcc optimized out the code after the call then causes saved
    return address points outside of the function (i.e. the start
    of the next function), so pollutes call trace somewhat.

    This patch adds the %pB printk mechanism that allows architecture
    call-trace printout functions to improve backtrace printouts.

    Signed-off-by: Namhyung Kim
    Acked-by: Steven Rostedt
    Acked-by: Frederic Weisbecker
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Cc: linux-arch@vger.kernel.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Namhyung Kim
     

16 Dec, 2009

1 commit


31 Mar, 2009

1 commit

  • Impact: New API

    kallsyms_lookup_name only returns the first match that it finds. Ksplice
    needs information about all symbols with a given name in order to correctly
    resolve local symbols.

    kallsyms_on_each_symbol provides a generic mechanism for iterating over the
    kallsyms table.

    Cc: Jeff Arnold
    Cc: Tim Abbott
    Signed-off-by: Anders Kaseorg
    Signed-off-by: Rusty Russell

    Anders Kaseorg
     

17 Oct, 2008

1 commit

  • Use the '%pF' format to get rid of an "#ifdef DEBUG" and make some printks
    atomic.

    This removes the last in-tree uses of print_fn_descriptor_symbol(). I
    marked print_fn_descriptor_symbol() deprecated and scheduled it for
    removal next year to give time for out-of-tree modules to be updated.

    parisc's print_fn_descriptor_symbol() is currently broken there (it needs
    to dereference the function pointer similar to ia64 and power). This
    patch shouldn't make anything worse, but it means we need to fix
    dereference_function_descriptor() instead of print_fn_descriptor_symbol()
    to get meaningful initcall_debug output.

    Signed-off-by: Bjorn Helgaas
    Cc: Jesse Barnes
    Cc: Kyle McMartin
    Cc: "Rafael J. Wysocki"
    Cc: Kay Sievers
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bjorn Helgaas
     

31 Jul, 2008

1 commit


26 Jul, 2008

1 commit

  • Use the %p format string which already accounts for the padding you need
    with a pointer type on a particular architecture.

    Also replace the macro with a static inline function to match the rest of
    the file.

    Cc: Heiko Carstens
    Cc: Arjan van de Ven
    Signed-off-by: Vegard Nossum
    Cc: Sam Ravnborg
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vegard Nossum
     

16 May, 2008

1 commit

  • Everybody wants to pass it a function pointer, and in fact, that is what
    you _must_ pass it for it to make sense (since it knows that ia64 and
    ppc64 use descriptors for function pointers and fetches the actual
    address from there).

    So don't make the argument be a 'unsigned long' and force everybody to
    add a cast.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

06 Nov, 2007

1 commit

  • The Build with randconfig fails with following error with the
    2.6.24-rc4-git9

    include/linux/kallsyms.h:56: error: `NULL' undeclared (first use in this
    function)
    include/linux/kallsyms.h:56: error: (Each undeclared identifier is
    reported only once
    include/linux/kallsyms.h:56: error: for each function it appears in.)
    make[2]: *** [arch/powerpc/platforms/cell/spu_callbacks.o] Error 1
    make[1]: *** [arch/powerpc/platforms/cell] Error 2
    make: *** [arch/powerpc/platforms] Error 2

    Signed-off-by: Kamalesh Babulal
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kamalesh Babulal
     

18 Jul, 2007

1 commit

  • KSYM_NAME_LEN is peculiar in that it does not include the space for the
    trailing '\0', forcing all users to use KSYM_NAME_LEN + 1 when allocating
    buffer. This is nonsense and error-prone. Moreover, when the caller
    forgets that it's very likely to subtly bite back by corrupting the stack
    because the last position of the buffer is always cleared to zero.

    This patch increments KSYM_NAME_LEN by one and updates code accordingly.

    * off-by-one bug in asm-powerpc/kprobes.h::kprobe_lookup_name() macro
    is fixed.

    * Where MODULE_NAME_LEN and KSYM_NAME_LEN were used together,
    MODULE_NAME_LEN was treated as if it didn't include space for the
    trailing '\0'. Fix it.

    Signed-off-by: Tejun Heo
    Acked-by: Paulo Marques
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     

08 Jul, 2007

1 commit

  • This patch fixes the following 2.6.22 regression with CONFIG_KALLSYMS=n:

    ...
    CC arch/m32r/kernel/traps.o
    In file included from /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/arch/m32r/kernel/traps.c:14:
    /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/include/linux/kallsyms.h: In function 'lookup_symbol_name':
    /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/include/linux/kallsyms.h:66: error: 'ERANGE' undeclared (first use in this function)
    /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/include/linux/kallsyms.h:66: error: (Each undeclared identifier is reported only once
    /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/include/linux/kallsyms.h:66: error: for each function it appears in.)
    /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/include/linux/kallsyms.h: In function 'lookup_symbol_attrs':
    /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/include/linux/kallsyms.h:71: error: 'ERANGE' undeclared (first use in this function)
    make[2]: *** [arch/m32r/kernel/traps.o] Error 1

    Signed-off-by: Adrian Bunk
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

09 May, 2007

2 commits

  • Same story as with cat /proc/*/wchan race vs rmmod race, only
    /proc/slab_allocators want more info than just symbol name.

    Signed-off-by: Alexey Dobriyan
    Acked-by: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • kallsyms_lookup() can go iterating over modules list unprotected which is OK
    for emergency situations (oops), but not OK for regular stuff like
    /proc/*/wchan.

    Introduce lookup_symbol_name()/lookup_module_symbol_name() which copy symbol
    name into caller-supplied buffer or return -ERANGE. All copying is done with
    module_mutex held, so...

    Signed-off-by: Alexey Dobriyan
    Cc: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

01 May, 2007

1 commit

  • Today's print_symbol function dumps a kernel symbol with printk. This
    patch extends the functionality of kallsyms.c so that the symbol lookup
    function may be used without the printk. This is useful for modules that
    want to dump symbols elsewhere, for example, to debugfs. I intend to use
    the new function call in the GFS2 file system (which will be a separate
    patch).

    [akpm@linux-foundation.org: build fix]
    [clameter@sgi.com: sprint_symbol should return length of string like sprintf]
    Signed-off-by: Robert Peterson
    Cc: Rusty Russell
    Cc: Roman Zippel
    Cc: "Randy.Dunlap"
    Cc: Sam Ravnborg
    Acked-by: Paulo Marques
    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert Peterson
     

03 Oct, 2006

1 commit

  • Some uses of kallsyms_lookup() do not need to find out the name of a symbol
    and its module's name it belongs. This is specially true in arch specific
    code, which needs to unwind the stack to show the back trace during oops
    (mips is an example). In this specific case, we just need to retreive the
    function's size and the offset of the active intruction inside it.

    Adds a new entry "kallsyms_lookup_size_offset()" This new entry does
    exactly the same as kallsyms_lookup() but does not require any buffers to
    store any names.

    It returns 0 if it fails otherwise 1.

    Signed-off-by: Franck Bui-Huu
    Cc: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Franck Bui-Huu
     

04 Jul, 2006

2 commits

  • Provide a common print_ip_sym() function that prints the passed instruction
    pointer as well as the symbol belonging to it. Avoids adding a bunch of
    #ifdef CONFIG_64BIT in order to get the printk format right on 32/64 bit
    platforms.

    Acked-by: Ingo Molnar
    Cc: Arjan van de Ven
    Signed-off-by: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     
  • Have a special version of print_symbol() for s390 which clears the most
    significant bit of addr before calling __print_symbol(). This seems to be
    better than checking/changing each place in the kernel that saves an
    instruction pointer.

    Without this the output would look like:

    hardirqs last enabled at (30907): [] 0x80018c6a
    hardirqs last disabled at (30908): [] 0x8001e48c
    softirqs last enabled at (30904): [] 0x8001dc96
    softirqs last disabled at (30897): [] 0x8001dc50

    instead of this:

    hardirqs last enabled at (19421): [] cpu_idle+0x176/0x1c4
    hardirqs last disabled at (19422): [] io_no_vtime+0xa/0x1a
    softirqs last enabled at (19418): [] do_softirq+0xa6/0xe8
    softirqs last disabled at (19411): [] do_softirq+0x60/0xe8

    Acked-by: Ingo Molnar
    Cc: Arjan van de Ven
    Cc: Martin Schwidefsky
    Signed-off-by: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     

26 Apr, 2006

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds