1. 09 5月, 2015 4 次提交
  2. 06 5月, 2015 1 次提交
  3. 04 5月, 2015 4 次提交
  4. 29 4月, 2015 1 次提交
  5. 14 4月, 2015 2 次提交
  6. 10 4月, 2015 1 次提交
    • M
      perf probe: Support multiple probes on different binaries · 7afb3fab
      Masami Hiramatsu 提交于
      Support multiple probes on different binaries with just
      one command.
      
      In the result, this example sets up the probes on icmp_rcv in
      kernel, on main and set_target in perf, and on pcspkr_event
      in pcspker.ko driver.
        -----
        # perf probe -a icmp_rcv -x ./perf -a main -a set_target \
         -m /lib/modules/4.0.0-rc5+/kernel/drivers/input/misc/pcspkr.ko \
         -a pcspkr_event
        Added new event:
          probe:icmp_rcv       (on icmp_rcv)
      
        You can now use it in all perf tools, such as:
      
                perf record -e probe:icmp_rcv -aR sleep 1
      
        Added new event:
          probe_perf:main      (on main in /home/mhiramat/ksrc/linux-3/tools/perf/perf)
      
        You can now use it in all perf tools, such as:
      
                perf record -e probe_perf:main -aR sleep 1
      
        Added new event:
          probe_perf:set_target (on set_target in /home/mhiramat/ksrc/linux-3/tools/perf/perf)
      
        You can now use it in all perf tools, such as:
      
                perf record -e probe_perf:set_target -aR sleep 1
      
        Added new event:
          probe:pcspkr_event   (on pcspkr_event in pcspkr)
      
        You can now use it in all perf tools, such as:
      
                perf record -e probe:pcspkr_event -aR sleep 1
        -----
      Reported-by: NArnaldo Carvalho de Melo <acme@infradead.org>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20150401102539.17137.46454.stgit@localhost.localdomainSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7afb3fab
  7. 08 4月, 2015 2 次提交
  8. 24 3月, 2015 1 次提交
  9. 22 3月, 2015 1 次提交
    • H
      perf probe: Fix failure to add multiple probes without debuginfo · 0560a0c4
      He Kuang 提交于
      Perf tries to find probe function addresses from map when debuginfo
      could not be found.
      
      To the first added function, the value of ref_reloc_sym was set in
      maps__set_kallsyms_ref_reloc_sym() and can be obtained from
      host_machine->kmaps->maps. After that, new maps are added to
      host_machine->kmaps->maps in dso__load_kcore(), all these new added maps
      do not have a valid ref_reloc_sym.
      
      When adding a second function, get_target_map() may get a map without
      valid ref_reloc_sym, and raise the error "Relocated base symbol is not
      found".
      
      Fix this by using kernel_get_ref_reloc_sym() to get ref_reloc_sym.
      
      This problem can be reproduced as following:
      
        $ perf probe --add='sys_write' --add='sys_open'
        Relocated base symbol is not found!
          Error: Failed to add events.
      
      After this patch:
      
        $ perf probe --add='sys_write' --add='sys_open'
        Added new event:
          probe:sys_write      (on sys_write)
      
        You can now use it in all perf tools, such as:
      
            perf record -e probe:sys_write -aR sleep 1
      
        Added new event:
          probe:sys_open       (on sys_open)
      
        You can now use it in all perf tools, such as:
      
            perf record -e probe:sys_open -aR sleep 1
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1426816616-2394-1-git-send-email-hekuang@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0560a0c4
  10. 12 3月, 2015 7 次提交
  11. 02 3月, 2015 1 次提交
  12. 27 2月, 2015 2 次提交
  13. 26 2月, 2015 2 次提交
  14. 11 2月, 2015 1 次提交
  15. 21 1月, 2015 3 次提交
  16. 17 1月, 2015 1 次提交
  17. 02 1月, 2015 1 次提交
    • M
      perf probe: Fix to fall back to find probe point in symbols · 906451b9
      Masami Hiramatsu 提交于
      Fix to fall back to find a probe point in symbols if perf fails to find
      it in debuginfo.
      
      This can happen when the target function is an alias of another
      function. Such alias doesn't have an entry in debuginfo but in symbols.
      
      David Ahern reported this problem in https://lkml.org/lkml/2014/12/29/355
      
      I ensured the problem and deeper investigation discovers it.
       -----
       eu-readelf --debug-dump=info /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.19.so | grep \"malloc\" -A6
                   name                 (strp) "malloc"
                   decl_file            (data1) 25
                   decl_line            (data2) 466
                   prototyped           (flag_present)
                   type                 (ref4) [  81b5]
                   declaration          (flag_present)
       [  8f58]      formal_parameter
       --
                   name                 (strp) "malloc"
                   decl_file            (data1) 23
                   decl_line            (data2) 466
                   prototyped           (flag_present)
                   type                 (ref4) [  9f4a]
                   declaration          (flag_present)
                   sibling              (ref4) [  bb29]
       ...
       -----
      All these entires have no instances (all of them are declarations)
      This is why the perf probe failed to find it in debuginfo.
      
      However, there are some malloc instances in symbols.
       -----
       eu-readelf --symbols /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.19.so | grep malloc$
        1181: 0000000000080700   5332 FUNC    LOCAL  DEFAULT       12 _int_malloc
        4537: 00000000000831d0    339 FUNC    LOCAL  DEFAULT       12 __GI___libc_malloc
        5545: 00000000000831d0    339 FUNC    LOCAL  DEFAULT       12 __malloc
        6063: 00000000000831d0    339 FUNC    GLOBAL DEFAULT       12 malloc
        7302: 00000000000831d0    339 FUNC    GLOBAL DEFAULT       12 __libc_malloc
       -----
      As you an see, malloc and __libc_malloc have same address, and actually
      __libc_malloc has an entry in debuginfo. So you can set up a probe on
      __libc_malloc.
      
      To fix this problem shortly, perf probe simply falls back to find probe
      point(malloc) in symbols if it is not found in debuginfo.
      Reported-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20141231062747.2087.80961.stgit@localhost.localdomainSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      906451b9
  18. 29 10月, 2014 1 次提交
  19. 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
  20. 18 9月, 2014 1 次提交
    • M
      perf probe: Do not access kallsyms when analyzing user binaries · 2b394bc4
      Masami Hiramatsu 提交于
      Do not access kallsyms to show available variables and show source lines
      in user binaries.
      
      This behavior always requires the root privilege when sysctl sets
      kernel.kptr_restrict=1, but we don't need it just for analyzing user
      binaries.
      
      Without this patch (by normal user, kptr_restrict=1):
        ----
        $ perf probe -x ./perf -V add_cmdname
        Failed to init vmlinux path.
          Error: Failed to show vars.
        $ perf probe -x ./perf -L add_cmdname
        Failed to init vmlinux path.
          Error: Failed to show lines.
        ----
      
      With this patch:
        ----
        $ perf probe -x ./perf -V add_cmdname
        Available variables at add_cmdname
                @<perf_unknown_cmd_config+144>
                        (No matched variables)
                @<list_commands_in_dir+160>
                        (No matched variables)
                @<add_cmdname+0>
                        char*   name
                        size_t  len
                        struct cmdnames*        cmds
        $ perf probe -x ./perf -L add_cmdname
        <add_cmdname@/home/fedora/ksrc/linux-3/tools/perf/util/help.c:0>
              0  void add_cmdname(struct cmdnames *cmds, const char *name, size_t len)
              1  {
              2         struct cmdname *ent = malloc(sizeof(*ent) + len + 1);
      
              4         ent->len = len;
              5         memcpy(ent->name, name, len);
              6         ent->name[len] = 0;
        ...
        ----
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: david lerner <dlernerdroid@gmail.com>
      Cc: linux-perf-user@vger.kernel.org
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20140917084054.3722.73975.stgit@kbuild-f20.novalocal
      [ Added missing 'bool user' argument to the !DWARF show_line_range() stub ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2b394bc4
  21. 15 8月, 2014 2 次提交