1. 04 5月, 2015 3 次提交
  2. 08 4月, 2015 1 次提交
  3. 24 3月, 2015 1 次提交
    • A
      perf symbols: Save DSO loading errno to better report errors · 18425f13
      Arnaldo Carvalho de Melo 提交于
      Before, when some problem happened while trying to load the kernel
      symtab, 'perf top' would show:
      
            ┌─Warning:───────────────────────────┐
            │The vmlinux file can't be used.     │
            │Kernel samples will not be resolved.│
            │                                    │
            │                                    │
            │Press any key...                    │
            └────────────────────────────────────┘
      
      Now, it reports:
      
        # perf top --vmlinux /dev/null
      
            ┌─Warning:───────────────────────────────────────────┐
            │The /tmp/passwd file can't be used: Invalid ELF file│
            │Kernel samples will not be resolved.                │
            │                                                    │
            │                                                    │
            │Press any key...                                    │
            └────────────────────────────────────────────────────┘
      
      This is possible because we now register the reason for not being able
      to load the symtab in the dso->load_errno member, and provide a
      dso__strerror_load() routine to format this error into a strerror like
      string with a short reason for the error while loading.
      
      That can be just forwarding the dso__strerror_load() call to
      strerror_r(), or, for a separate errno range providing a custom message.
      Reported-by: NIngo Molnar <mingo@kernel.org>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-u5rb5uq63xqhkfb8uv2lxd5u@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      18425f13
  4. 23 3月, 2015 1 次提交
  5. 12 3月, 2015 1 次提交
  6. 26 2月, 2015 1 次提交
  7. 11 2月, 2015 1 次提交
  8. 06 2月, 2015 1 次提交
  9. 30 1月, 2015 1 次提交
  10. 25 11月, 2014 1 次提交
    • A
      perf symbols: Move bfd_demangle stubbing to its only user · aaba4e12
      Arnaldo Carvalho de Melo 提交于
      We need to define bfd_demangle() to either a wrapper for
      cplus_demangle() or to a stub when NO_DEMANGLE is defined.
      
      That is at odds with using bfd.h for some other reason, as it defines
      bfd_demangle() and then if code that wants to use symbol.h, where the
      above stubbing/wrapping is done, and bfd.h for other reasons, we end up
      with a build error where bfd_demangle() is found to be redefined.
      
      Avoid that by moving the stubbing/wrapping to symbol-elf.c, that is the
      only user of such function. If we ever get to a point where there are
      more valid users, we can then introduce a header for that.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-6wzjpe2fy9xtgchshulixlzw@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      aaba4e12
  11. 04 11月, 2014 1 次提交
  12. 30 9月, 2014 1 次提交
    • W
      perf symbols: Encapsulate dsos list head into struct dsos · 8fa7d87f
      Waiman Long 提交于
      This is a precursor patch to enable long name searching of DSOs using
      a rbtree.
      
      In this patch, a new dsos structure is created which contains only a
      list head structure for the moment.
      
      The new dsos structure is used, in turn, in the machine structure for
      the user_dsos and kernel_dsos fields.
      
      Only the following 3 dsos functions are modified to accept the new dsos
      structure parameter instead of list_head:
      
       - dsos__add()
       - dsos__find()
       - __dsos__findnew()
      Signed-off-by: NWaiman Long <Waiman.Long@hp.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Douglas Hatch <doug.hatch@hp.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Scott J Norton <scott.norton@hp.com>
      Link: http://lkml.kernel.org/r/1412021249-19201-2-git-send-email-Waiman.Long@hp.com
      [ Move struct dsos to dso.h to reduce the dso methods depends on machine.h ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8fa7d87f
  13. 18 9月, 2014 2 次提交
  14. 14 8月, 2014 2 次提交
  15. 24 7月, 2014 2 次提交
  16. 17 7月, 2014 2 次提交
  17. 20 4月, 2014 1 次提交
  18. 10 3月, 2014 1 次提交
  19. 25 2月, 2014 1 次提交
  20. 01 2月, 2014 1 次提交
  21. 27 1月, 2014 1 次提交
  22. 17 1月, 2014 1 次提交
  23. 28 12月, 2013 1 次提交
  24. 13 12月, 2013 1 次提交
  25. 14 10月, 2013 3 次提交
    • C
      perf symbols: Fix a mmap and munmap mismatched bug · 784f3390
      Chenggang Qin 提交于
      In function filename__read_debuglink(), while the ELF file is opend and
      mmapped in elf_begin(), but if this file is considered to not be usable
      during the following code, we will goto the close(fd) directly. The
      elf_end() is skipped.  So, the mmaped ELF file cannot be munmapped. The
      mmapped areas exist during the life of perf.
      
      This is a memory leak.  This patch fixed this bug.
      Reviewed-by: NNamhyung Kim <namhyung@kernel.org>
      Signed-off-by: NChenggang Qin <chenggang.qcg@taobao.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Chenggang Qin <chenggang.qcg@taobao.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Cc: Yanmin Zhang <yanmin.zhang@intel.com>
      Link: http://lkml.kernel.org/r/1381451279-4109-1-git-send-email-chenggang.qin@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      784f3390
    • A
      perf buildid-cache: Add ability to add kcore to the cache · fc1b691d
      Adrian Hunter 提交于
      kcore can be used to view the running kernel object code.  However,
      kcore changes as modules are loaded and unloaded, and when the kernel
      decides to modify its own code.  Consequently it is useful to create a
      copy of kcore at a particular time.  Unlike vmlinux, kcore is not unique
      for a given build-id.  And in addition, the kallsyms and modules files
      are also needed.  The tool therefore creates a directory:
      
      	~/.debug/[kernel.kcore]/<build-id>/<YYYYmmddHHMMSShh>
      
      which contains: kcore, kallsyms and modules.
      
      Note that the copied kcore contains only code sections.  See the
      kcore_copy() function for how that is determined.
      
      The tool will not make additional copies of kcore if there is already
      one with the same modules at the same addresses.
      
      Currently, perf tools will not look for kcore in the cache.  That is
      addressed in another patch.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/525BF849.5030405@intel.com
      [ renamed 'index' to 'idx' to avoid shadowing string.h symbol in f12,
        use at least one member initializer when initializing a struct to
        zeros, also to fix the build on f12 ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fc1b691d
    • A
      perf symbols: Workaround objdump difficulties with kcore · afba19d9
      Adrian Hunter 提交于
      The objdump tool fails to annotate module symbols when looking at kcore.
      
      Workaround this by extracting object code from kcore and putting it in a
      temporary file for objdump to use instead.
      
      The temporary file is created to look like kcore but contains only the
      function being disassembled.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1381320078-16497-3-git-send-email-adrian.hunter@intel.com
      [ Renamed 'index' to 'idx' to avoid shadowing string.h's 'index' in Fedora 12,
        Replace local with variable length with malloc/free to fix build in Fedora 12 ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      afba19d9
  26. 09 10月, 2013 1 次提交
  27. 29 9月, 2013 1 次提交
    • I
      Revert "perf symbols: Demangle cloned functions" · 14951f22
      Ingo Molnar 提交于
      This reverts commit de95ab53.
      
      Markus Trippelsdorf reported that this commit broke 'perf top':
      
       > I just see a gray screen with no text at all. Sometimes the
       > following error messages are printed:
       >
       >  *** Error in `perf': invalid fastbin entry (free): 0x00000000029b18c0
       >  ***
       >  *** Error in `perf': malloc(): memory corruption (fast): 0x0000000000ee0b10 ***
      
      While this code is fixable, the commit itself fails on several levels:
      
       - it should have been a separate helper function
       - why the heck does it do strchr() twice
       - it casts a const char * over into char *
       - sloppy style
       - it's not even a regression fix!
      
      So lets revert it and re-try the patch in v3.13.
      Reported-by: NMarkus Trippelsdorf <markus@trippelsdorf.de>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      14951f22
  28. 25 9月, 2013 1 次提交
  29. 19 9月, 2013 1 次提交
  30. 08 8月, 2013 3 次提交
    • A
      perf symbols: Add support for reading from /proc/kcore · 8e0cf965
      Adrian Hunter 提交于
      In the absence of vmlinux, perf tools uses kallsyms for symbols.  If the
      user has access, now also map to /proc/kcore.
      
      The dso data_type is now set to either DSO_BINARY_TYPE__KCORE or
      DSO_BINARY_TYPE__GUEST_KCORE as approprite.
      
      This patch breaks the "vmlinux symtab matches kallsyms" test.  That is
      fixed in a following patch.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1375875537-4509-8-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8e0cf965
    • A
      perf tools: Make it possible to read object code from kernel modules · 0131c4ec
      Adrian Hunter 提交于
      The new "object code reading" test shows that it is not possible to read
      object code from kernel modules.  That is because the mappings do not
      map to the dsos.  This patch fixes that.
      
      This involves identifying and flagging relocatable (ELF type ET_REL)
      files (e.g. kernel modules) for symbol adjustment and updating
      map__rip_2objdump() accordingly.  The kmodule parameter of
      dso__load_sym() is taken into use and the module map altered to map to
      the dso.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1375875537-4509-7-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0131c4ec
    • A
      perf tools: Make it possible to read object code from vmlinux · 39b12f78
      Adrian Hunter 提交于
      The new "object code reading" test shows that it is not possible to read
      object code from vmlinux.  That is because the mappings do not map to
      the dso.  This patch fixes that.
      
      A side-effect of changing the kernel map is that the "reloc" offset must
      be taken into account.  As a result of that separate map functions for
      relocation are no longer needed.
      
      Also fixing up the maps to match the symbols no longer makes sense and
      so is not done.
      
      The vmlinux dso data_type is now set to either DSO_BINARY_TYPE__VMLINUX
      or DSO_BINARY_TYPE__GUEST_VMLINUX as approprite, which enables the
      correct file name to be determined by dso__binary_type_file().
      
      This patch breaks the "vmlinux symtab matches kallsyms" test.  That is
      fixed in a following patch.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1375875537-4509-4-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      39b12f78