1. 28 5月, 2015 2 次提交
    • A
      perf tools: Reference count struct map · 84c2cafa
      Arnaldo Carvalho de Melo 提交于
      We have pointers to struct map instances in several places, like in the
      hist_entry instances, so we need a way to know when we can destroy them,
      otherwise we may either keep leaking them or end up referencing deleted
      instances.
      
      Start fixing it by reference counting them.
      
      This patch puts the reference count for struct map in place, replacing
      direct map__delete() calls with map__put() ones and then grabbing a
      reference count when adding it to the maps struct where maps for a
      struct thread are kept.
      
      Next we'll grab reference counts when setting pointers to struct map
      instances, in places like in the hist_entry code.
      
      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: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-wi19xczk0t2a41r1i2chuio5@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      84c2cafa
    • A
      perf tools: Introduce struct maps · 1eee78ae
      Arnaldo Carvalho de Melo 提交于
      That for now has the maps rbtree and the list for the dead maps, that
      may be still referenced from some hist_entry, etc.
      
      This paves the way for protecting the rbtree with a lock, then refcount
      the maps and finally remove the removed_maps list, as it'll not ne
      anymore needed.
      
      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: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-fl0fa6142pj8khj97fow3uw0@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1eee78ae
  2. 27 5月, 2015 4 次提交
  3. 18 5月, 2015 1 次提交
    • W
      perf probe: Load map before glob matching · 75e4a2a6
      Wang Nan 提交于
      Commit 4c859351 ("perf probe: Support
      glob wildcards for function name") introduces a problem:
      
        # /root/perf probe kmem_cache_free
       Failed to find symbol kmem_cache_free in kernel
         Error: Failed to add events.
      
      The reason is the replacement of map__for_each_symbol_by_name() (by
      map__for_each_symbol()). Although their names are similar,
      map__for_each_symbol doesn't call map__load() and dso__sort_by_name()
      before searching. The missing of map__load() causes this problem because
      it search symbol before load dso map.
      
      This patch ensures map__load() is called before using
      map__for_each_symbol().
      
      After this patch:
      
       # /root/perf probe kmem_cache_free
        Added new event:
          probe:kmem_cache_free (on kmem_cache_free%return)
      
      You can now use it in all perf tools, such as:
      
              perf record -e probe:kmem_cache_free -aR sleep 1
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.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/1431692084-46287-1-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      75e4a2a6
  4. 09 5月, 2015 7 次提交
  5. 06 5月, 2015 1 次提交
  6. 05 5月, 2015 1 次提交
  7. 04 5月, 2015 4 次提交
  8. 29 4月, 2015 1 次提交
  9. 14 4月, 2015 2 次提交
  10. 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
  11. 08 4月, 2015 2 次提交
  12. 24 3月, 2015 1 次提交
  13. 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
  14. 12 3月, 2015 7 次提交
  15. 02 3月, 2015 1 次提交
  16. 27 2月, 2015 2 次提交
  17. 26 2月, 2015 2 次提交