1. 02 11月, 2013 1 次提交
    • M
      scripts/kallsyms: filter symbols not in kernel address space · f6537f2f
      Ming Lei 提交于
      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 b9b32bf7)
      
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Michal Marek <mmarek@suse.cz>
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: stable@vger.kernel.org
      f6537f2f
  2. 12 5月, 2011 1 次提交
    • X
      scripts/kallsyms.c: fix potential segfault · e0a04b11
      Xiaochen Wang 提交于
      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: NXiaochen Wang <wangxiaochen0@gmail.com>
      Acked-by: NPaulo Marques <pmarques@grupopie.com>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      e0a04b11
  3. 29 9月, 2010 1 次提交
  4. 02 2月, 2010 1 次提交
  5. 23 9月, 2009 1 次提交
    • P
      kallsyms: fix segfault in prefix_underscores_count() · a9ece53c
      Paul Mundt 提交于
      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: NPaul Mundt <lethal@linux-sh.org>
      Reviewed-by: NLi 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: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a9ece53c
  6. 20 6月, 2009 1 次提交
  7. 15 6月, 2009 2 次提交
  8. 14 3月, 2009 1 次提交
    • L
      kallsyms, tracing: output more proper symbol name · b478b782
      Lai Jiangshan 提交于
      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: NLai Jiangshan <laijs@cn.fujitsu.com>
      Acked-by: NSam Ravnborg <sam@ravnborg.org>
      Reviewed-by: NPaulo Marques <pmarques@grupopie.com>
      LKML-Reference: <49BA06E2.7080807@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b478b782
  9. 15 1月, 2009 1 次提交
  10. 20 12月, 2008 1 次提交
    • J
      allow stripping of generated symbols under CONFIG_KALLSYMS_ALL · 9bb48247
      Jan Beulich 提交于
      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: NJan Beulich <jbeulich@novell.com>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      9bb48247
  11. 20 5月, 2008 1 次提交
    • S
      kbuild: filter away debug symbols from kernel symbols · aab34ac8
      Sam Ravnborg 提交于
      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: NSam Ravnborg <sam@ravnborg.org>
      Cc: Paulo Marques <pmarques@grupopie.com>
      aab34ac8
  12. 30 4月, 2008 1 次提交
  13. 07 2月, 2008 2 次提交
  14. 18 7月, 2007 1 次提交
    • T
      kallsyms: make KSYM_NAME_LEN include space for trailing '\0' · 9281acea
      Tejun Heo 提交于
      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: NTejun Heo <htejun@gmail.com>
      Acked-by: NPaulo Marques <pmarques@grupopie.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9281acea
  15. 17 7月, 2007 1 次提交
  16. 09 12月, 2006 1 次提交
  17. 07 12月, 2006 2 次提交
  18. 26 3月, 2006 1 次提交
  19. 08 9月, 2005 2 次提交
  20. 28 7月, 2005 1 次提交
  21. 06 5月, 2005 1 次提交
  22. 01 5月, 2005 1 次提交
  23. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      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