1. 07 6月, 2015 1 次提交
  2. 04 6月, 2015 1 次提交
  3. 03 6月, 2015 4 次提交
    • W
      perf tools: Deal with kernel module names in '[]' correctly · 1f121b03
      Wang Nan 提交于
      Before patch ba92732e ('perf kmaps: Check kmaps to make code more
      robust'), 'perf report' and 'perf annotate' will segfault if trace data
      contains kernel module information like this:
      
       # perf report -D -i ./perf.data
       ...
       0 0 0x188 [0x50]: PERF_RECORD_MMAP -1/0: [0xffffffbff1018000(0xf068000) @ 0]: x [test_module]
       ...
      
       # perf report -i ./perf.data --objdump=/path/to/objdump --kallsyms=/path/to/kallsyms
      
       perf: Segmentation fault
       -------- backtrace --------
       /path/to/perf[0x503478]
       /lib64/libc.so.6(+0x3545f)[0x7fb201f3745f]
       /path/to/perf[0x499b56]
       /path/to/perf(dso__load_kallsyms+0x13c)[0x49b56c]
       /path/to/perf(dso__load+0x72e)[0x49c21e]
       /path/to/perf(map__load+0x6e)[0x4ae9ee]
       /path/to/perf(thread__find_addr_map+0x24c)[0x47deec]
       /path/to/perf(perf_event__preprocess_sample+0x88)[0x47e238]
       /path/to/perf[0x43ad02]
       /path/to/perf[0x4b55bc]
       /path/to/perf(ordered_events__flush+0xca)[0x4b57ea]
       /path/to/perf[0x4b1a01]
       /path/to/perf(perf_session__process_events+0x3be)[0x4b428e]
       /path/to/perf(cmd_report+0xf11)[0x43bfc1]
       /path/to/perf[0x474702]
       /path/to/perf(main+0x5f5)[0x42de95]
       /lib64/libc.so.6(__libc_start_main+0xf4)[0x7fb201f23bd4]
       /path/to/perf[0x42dfc4]
      
      This is because __kmod_path__parse treats '[' leading names as kernel
      name instead of names of kernel module.
      
      If perf.data contains build information and the buildid of such modules
      can be found, the dso->kernel of it will be set to DSO_TYPE_KERNEL by
      __event_process_build_id(), not kernel module.
      
      It will then be passed to dso__load() -> dso__load_kernel_sym() ->
      dso__load_kcore() if --kallsyms is provided.
      
      The refered patch adds NULL pointer checker to avoid segfault. However,
      such kernel modules are still processed incorrectly.
      
      This patch fixes __kmod_path__parse, makes it treat names like
      '[test_module]' as kernel modules.
      
      kmod-path.c is also update to reflect the above changes.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Link: http://lkml.kernel.org/r/1433321541-170245-1-git-send-email-wangnan0@huawei.com
      [ Fixed the merged with 0443f36b ("perf machine: Fix the search
        for the kernel DSO on the unified list" ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1f121b03
    • W
      tools: Move tools/perf/util/include/linux/{list.h,poison.h} to tools/include · 4fc62a89
      Wang Nan 提交于
      This patch moves list.h from tools/perf/util/include/linux/list.h to
      tools/include/linux/list.h to enable other libraries use macros in it,
      like libbpf which will be introduced by further patches. Since list.h
      depend on poison.h, poison.h is also moved.
      
      Both file use relative path, so one '..' is removed for each header to
      make them suit for new directory.
      
      MANIFEST is also updated for 'make perf-*-src-pkg'.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1433144296-74992-3-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4fc62a89
    • W
      perf tools: Move linux/kernel.h to tools/include · 37fbe0a4
      Wang Nan 提交于
      This patch moves kernel.h from tools/perf/util/include/linux/kernel.h
      to tools/include/linux/kernel.h to enable other libraries use macros in
      it, like libbpf which will be introduced by further patches.
      
      MANIFEST is also updated for 'make perf-*-src-pkg'.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Acked-by: NAlexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1433144296-74992-2-git-send-email-wangnan0@huawei.com
      [ Fixed up the ifdef guard to match other entries in tools/include/linux ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      37fbe0a4
    • A
      perf machine: Fix the search for the kernel DSO on the unified list · 0443f36b
      Arnaldo Carvalho de Melo 提交于
      When unifying the user_dsos and kernel_dsos a bug was introduced by
      inverting the check for dso->kernel, fix it.
      
      Fixes: 3d39ac53 ("perf machine: No need to have two DSOs lists")
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/n/tip-xnrnq0kams3s2z9ek1wjb506@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0443f36b
  4. 01 6月, 2015 1 次提交
  5. 30 5月, 2015 2 次提交
    • W
      perf probe: Fix segfault when glob matching function without debuginfo · 6bb536cc
      Wang Nan 提交于
      Commit 4c859351 ("perf probe: Support
      glob wildcards for function name") introduces segfault problems when
      debuginfo is not available:
      
       # perf probe 'sys_w*'
        Added new events:
        Segmentation fault
      
      The first problem resides in find_probe_trace_events_from_map(). In
      that function, find_probe_functions() is called to match each symbol
      against glob to find the number of matching functions, but still use
      map__for_each_symbol_by_name() to find 'struct symbol' for matching
      functions. Unfortunately, map__for_each_symbol_by_name() does
      exact matching by searching in an rbtree.
      
      It doesn't know glob matching, and not easy for it to support it because
      it use rbtree based binary search, but we are unable to ensure all names
      matched by the glob (any glob passed by user) reside in one subtree.
      
      This patch drops map__for_each_symbol_by_name(). Since there is no
      rbtree again, re-matching all symbols costs a lot. This patch avoid it
      by saving all matching results into an array (syms).
      
      The second problem is the lost of tp->realname. In
      __add_probe_trace_events(), if pev->point.function is glob, the event
      name should be set to tev->point.realname. This patch ensures its
      existence by strdup sym->name instead of leaving a NULL pointer there.
      
      After this patch:
      
       # perf probe 'sys_w*'
       Added new events:
         probe:sys_waitid     (on sys_w*)
         probe:sys_wait4      (on sys_w*)
         probe:sys_waitpid    (on sys_w*)
         probe:sys_write      (on sys_w*)
         probe:sys_writev     (on sys_w*)
      
       You can now use it in all perf tools, such as:
      
               perf record -e probe:sys_writev -aR sleep 1
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Link: http://lkml.kernel.org/r/1432892747-232506-1-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6bb536cc
    • I
      Merge tag 'perf-core-for-mingo' of... · 5c9b9bc6
      Ingo Molnar 提交于
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      User visible changes:
      
        - Make Ctrl-C stop processing on TUI, allowing interrupting the load of big
          perf.data files (Namhyung Kim)
      
        - Fix 'perf annotate' -i option, which is currently ignored (Martin Liška)
      
        - Add ARM64 perf_regs_load to support libunwind and enable testing (Wang Nan)
      
      Infrastructure changes:
      
        - Fix thread ref-counting in db-export (Adrian Hunter)
      
        - Fix compiler warning about may be accessing uninitialized (Arnaldo Carvalho de Melo)
      
        - No need to have two lists for user and kernel DSOs, unify them (Arnaldo Carvalho de Melo)
      
        - Function namespace consistency fixups (Arnaldo Carvalho de Melo)
      
        - Do not fail on missing Build file, fixing the build on MIPS (Jiri Olsa)
      
        - Fix up syscall tests, making those tests pass on ARM64 (Riku Voipio)
      
        - Fix 'function unused' warning in 'perf probe' (Wang Nan)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5c9b9bc6
  6. 29 5月, 2015 14 次提交
  7. 28 5月, 2015 10 次提交
  8. 27 5月, 2015 7 次提交