1. 16 Dec, 2013 1 commit
    • Ming Lei's avatar
      scripts/kallsyms: filter symbols not in kernel address space · 4fa4c84d
      Ming Lei authored
      
      This patch uses CONFIG_PAGE_OFFSET to filter symbols which
      are not in kernel address space because these symbols are
      generally for generating code purpose and can't be run at
      kernel mode, so we needn't keep them in /proc/kallsyms.
      
      For example, on ARM there are some symbols which may be
      linked in relocatable code section, then perf can't parse
      symbols any more from /proc/kallsyms, this patch fixes the
      problem (introduced b9b32bf70f2fb710b07c94e13afbc729afe221da)
      
      Change-Id: I3d6321b7d87727c7c2802b3924f2e89a28e4b9ca
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Michal Marek <mmarek@suse.cz>
      Signed-off-by: default avatarMing Lei <tom.leiming@gmail.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Cc: stable@vger.kernel.org
      Git-commit: f6537f2f0eba4eba3354e48dbe3047db6d8b6254
      Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
      
      
      CRs-fixed: 583755
      [nleeder@codeaurora.org: move flag to Makefile because original file
       scripts/link-vmlinux.sh does not exist in 3.4]
      Signed-off-by: default avatarNeil Leeder <nleeder@codeaurora.org>
      4fa4c84d
  2. 12 May, 2011 1 commit
    • Xiaochen Wang's avatar
      scripts/kallsyms.c: fix potential segfault · e0a04b11
      Xiaochen Wang authored
      
      Description:
      This bug hardly appears during real kernel compiling,
       because the vmlinux symbols table is huge.
      
      But we can still catch it under strict condition , as follows.
         $ echo "c101b97b T do_fork" | ./scripts/kallsyms --all-symbols
         #include <asm/types.h>
         ......
         ......
         .globl kallsyms_token_table
                 ALGN
         kallsyms_token_table:
         Segmentation fault (core dumped)
         $
      
      If symbols table is small, all entries in token_profit[0x10000] may
      decrease to 0 after several calls of compress_symbols() in optimize_result().
      In that case, find_best_token() always return 0 and
      best_table[i] is set to "\0\0" and best_table_len[i] is set to 2.
      
      As a result, expand_symbol(best_table[0]="\0\0", best_table_len[0]=2, buf)
      in write_src() will run in infinite recursion until stack overflows,
      causing segfault.
      
      This patch checks the find_best_token() return value. If all entries in
      token_profit[0x10000] become 0 according to return value, it breaks the loop
      in optimize_result().
      And expand_symbol() works well when best_table_len[i] is 0.
      Signed-off-by: default avatarXiaochen Wang <wangxiaochen0@gmail.com>
      Acked-by: default avatarPaulo Marques <pmarques@grupopie.com>
      Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
      e0a04b11
  3. 29 Sep, 2010 1 commit
  4. 02 Feb, 2010 1 commit
  5. 23 Sep, 2009 1 commit
    • Paul Mundt's avatar
      kallsyms: fix segfault in prefix_underscores_count() · a9ece53c
      Paul Mundt authored
      Commit b478b782
      
       "kallsyms, tracing: output
      more proper symbol name" introduces a "bugfix" that introduces a segfault
      in kallsyms in my configurations.
      
      The cause is the introduction of prefix_underscores_count() which attempts
      to count underscores, even in symbols that do not have them.  As a result,
      it just uselessly runs past the end of the buffer until it crashes:
      
        CC      init/version.o
        LD      init/built-in.o
        LD      .tmp_vmlinux1
        KSYM    .tmp_kallsyms1.S
      /bin/sh: line 1: 16934 Done                    sh-linux-gnu-nm -n .tmp_vmlinux1
           16935 Segmentation fault      | scripts/kallsyms > .tmp_kallsyms1.S
      make: *** [.tmp_kallsyms1.S] Error 139
      
      This simplifies the logic and just does a straightforward count.
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      Reviewed-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Paulo Marques <pmarques@grupopie.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: <stable@kernel.org>		[2.6.30.x, 2.6.31.x]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a9ece53c
  6. 20 Jun, 2009 1 commit
  7. 14 Jun, 2009 2 commits
  8. 14 Mar, 2009 1 commit
    • Lai Jiangshan's avatar
      kallsyms, tracing: output more proper symbol name · b478b782
      Lai Jiangshan authored
      
      Impact: bugfix, output more reliable symbol lookup result
      
      Debug tools(dump_stack(), ftrace...) are like to print out symbols.
      But it is always print out the first aliased symbol.(Aliased symbols
      are symbols with the same address), and the first aliased symbol is
      sometime not proper.
      
       # echo function_graph > current_tracer
       # cat trace
      ......
       1)   1.923 us    |    select_nohz_load_balancer();
       1) + 76.692 us   |  }
       1)               |  default_idle() {
       1)   ==========> |    __irqentry_text_start() {
       1)   0.000 us    |      native_apic_mem_write();
       1)               |      irq_enter() {
       1)   0.000 us    |        idle_cpu();
       1)               |        tick_check_idle() {
       1)   0.000 us    |          tick_check_oneshot_broadcast();
       1)               |          tick_nohz_stop_idle() {
      ......
      
      It's very embarrassing, it ouputs "__irqentry_text_start()",
      actually, it should output "smp_apic_timer_interrupt()".
      (these two symbol are the same address, but "__irqentry_text_start"
      is deemed to the first aliased symbol by scripts/kallsyms)
      
      This patch puts symbols like "__irqentry_text_start" to the second
      aliased symbols. And a more proper symbol name becomes the first.
      
      Aliased symbols mostly come from linker script. The solution is
      guessing "is this symbol defined in linker script", the symbols
      defined in linker script will not become the first aliased symbol.
      
      And if symbols are found to be equal in this "linker script provided"
      criteria, symbols are sorted by the number of prefix underscores.
      Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Reviewed-by: default avatarPaulo Marques <pmarques@grupopie.com>
      LKML-Reference: <49BA06E2.7080807@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      b478b782
  9. 14 Jan, 2009 1 commit
  10. 19 Dec, 2008 1 commit
    • Jan Beulich's avatar
      allow stripping of generated symbols under CONFIG_KALLSYMS_ALL · 9bb48247
      Jan Beulich authored
      
      Building upon parts of the module stripping patch, this patch
      introduces similar stripping for vmlinux when CONFIG_KALLSYMS_ALL=y.
      Using CONFIG_KALLSYMS_STRIP_GENERATED reduces the overhead of
      CONFIG_KALLSYMS_ALL from 245k/310k to 65k/80k for the (i386/x86-64)
      kernels I tested with.
      
      The patch also does away with the need to special case the kallsyms-
      internal symbols by making them available even in the first linking
      stage.
      
      While it is a generated file, the patch includes the changes to
      scripts/genksyms/keywords.c_shipped, as I'm unsure what the procedure
      here is.
      Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      9bb48247
  11. 19 May, 2008 1 commit
    • Sam Ravnborg's avatar
      kbuild: filter away debug symbols from kernel symbols · aab34ac8
      Sam Ravnborg authored
      
      Andi Kleen <andi@firstfloor.org>
      reported that he saw a lot of symbols like this:
      
      0000000000000b24 N DW.aio.h.903a6d92.2
      0000000000000bce N DW.task_io_accounting.h.8d8de327.0
      0000000000000bec N DW.hrtimer.h.c23659c6.0
      
      in his System.map / kallsyms output.
      
      Simple solution is to skip all debugging
      symbols (they are marked 'N').
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: Paulo Marques <pmarques@grupopie.com>
      aab34ac8
  12. 30 Apr, 2008 1 commit
  13. 06 Feb, 2008 2 commits
  14. 17 Jul, 2007 2 commits
  15. 08 Dec, 2006 1 commit
  16. 06 Dec, 2006 2 commits
  17. 25 Mar, 2006 1 commit
  18. 07 Sep, 2005 2 commits
  19. 27 Jul, 2005 1 commit
  20. 05 May, 2005 1 commit
  21. 01 May, 2005 1 commit
  22. 16 Apr, 2005 1 commit
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      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!
      1da177e4