1. 14 2月, 2017 1 次提交
  2. 24 10月, 2016 1 次提交
  3. 14 9月, 2016 1 次提交
    • A
      perf tools: Do hugetlb handling in more systems · fbef103f
      Arnaldo Carvalho de Melo 提交于
      The csets:
      
        0ac3348e ("perf tools: Recognize hugetlb mapping as anon mapping")
        d7e404af ("perf record: Mark MAP_HUGETLB when synthesizing mmap events")
      
      Added code conditional on MAP_HUGETLB, to make it build in older systems
      where that define wasn't available. Now that we grabbed copies of
      uapi/linux/mmap.h to have all those definitions in tools/, use it so
      that we can support building the tools for older systems (without the
      MAP_HUGETLB define in its libc headers) using new kernels that support
      such maps.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Link: http://lkml.kernel.org/n/tip-wv6oqbfkpxbix4umj2kcfmaz@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fbef103f
  4. 08 9月, 2016 1 次提交
  5. 05 9月, 2016 1 次提交
  6. 19 7月, 2016 1 次提交
  7. 05 7月, 2016 1 次提交
  8. 12 5月, 2016 1 次提交
  9. 08 4月, 2016 1 次提交
    • W
      perf symbols: Record text offset in dso to calculate objdump address · a58f7033
      Wang Nan 提交于
      In this patch, the offset of '.text' section is stored into dso
      and used here to re-calculate address to objdump.
      
      In most of the cases, executable code is in '.text' section, so the
      adjustment made to a symbol in dso__load_sym (using
      sym.st_value -= shdr.sh_addr - shdr.sh_offset) should equal to
      'sym.st_value -= dso->text_offset'. Therefore, adding text_offset back
      get objdump address from symbol address (rip). However, it is not true
      for kernel and kernel module since there could be multiple executable
      sections with different offset. Exclude kernel for this reason.
      
      After this patch, even dso->adjust_symbols is set to true for shared
      objects, map__rip_2objdump() and map__objdump_2mem() would return
      correct result, so perf behavior of annotate won't be changed.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Cody P Schafer <dev@codyps.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kirill Smelkov <kirr@nexedi.com>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1460024671-64774-2-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a58f7033
  10. 10 12月, 2015 2 次提交
    • M
      perf tools: Fix maps__fixup_overlappings to put used maps · d91130e9
      Masami Hiramatsu 提交于
      Since the __map_groups__insert got the given map, we don't need to keep
      it. So put the maps.
      
      Refcnt debugger shows that map_groups__fixup_overlappings() got a map
      twice but the group released it just once. This pattern usually
      indicates the leak happens in caller site.
      
        ----
        ==== [0] ====
        Unreclaimed map@0x39d3ae0
        Refcount +1 => 1 at
          ./perf(map_groups__fixup_overlappings+0x335) [0x4c1865]
          ./perf(thread__insert_map+0x30) [0x4c8e00]
          ./perf(machine__process_mmap2_event+0x106) [0x4bd876]
          ./perf() [0x4c378e]
          ./perf() [0x4c4393]
          ./perf(perf_session__process_events+0x38a) [0x4c654a]
          ./perf(cmd_record+0xe24) [0x42fc94]
          ./perf() [0x47b745]
          ./perf(main+0x617) [0x422547]
          /lib64/libc.so.6(__libc_start_main+0xf5) [0x7f2eca2deaf5]
          ./perf() [0x4226bd]
        Refcount +1 => 2 at
          ./perf(map_groups__fixup_overlappings+0x3c5) [0x4c18f5]
          ./perf(thread__insert_map+0x30) [0x4c8e00]
          ./perf(machine__process_mmap2_event+0x106) [0x4bd876]
          ./perf() [0x4c378e]
          ./perf() [0x4c4393]
          ./perf(perf_session__process_events+0x38a) [0x4c654a]
          ./perf(cmd_record+0xe24) [0x42fc94]
          ./perf() [0x47b745]
          ./perf(main+0x617) [0x422547]
          /lib64/libc.so.6(__libc_start_main+0xf5) [0x7f2eca2deaf5]
          ./perf() [0x4226bd]
        Refcount -1 => 1 at
          ./perf(map_groups__exit+0x92) [0x4c0962]
          ./perf(map_groups__put+0x60) [0x4c0bc0]
          ./perf(thread__put+0x90) [0x4c8a40]
          ./perf(machine__delete_threads+0x7e) [0x4bad9e]
          ./perf(perf_session__delete+0x4f) [0x4c499f]
          ./perf(cmd_record+0xb6d) [0x42f9dd]
          ./perf() [0x47b745]
          ./perf(main+0x617) [0x422547]
          /lib64/libc.so.6(__libc_start_main+0xf5) [0x7f2eca2deaf5]
          ./perf() [0x4226bd]
        ----
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20151209021131.10245.41485.stgit@localhost.localdomainSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d91130e9
    • M
      perf tools: Fix map_groups__clone to put cloned map · bae32b50
      Masami Hiramatsu 提交于
      Fix map_groups__clone to put cloned map after inserting it to the
      map_groups.
      
      Refcnt debugger shows:
        ----
        ==== [0] ====
        Unreclaimed map: 0x2a27ee0
        Refcount +1 => 1 at
          ./perf(map_groups__clone+0x8d) [0x4bb7ed]
          ./perf(thread__fork+0xbe) [0x4c1f9e]
          ./perf(machine__process_fork_event+0x216) [0x4b79a6]
          ./perf(perf_event__synthesize_threads+0x38b) [0x48135b]
          ./perf(cmd_top+0xdc6) [0x43cb76]
          ./perf() [0x477223]
          ./perf(main+0x617) [0x422077]
          /lib64/libc.so.6(__libc_start_main+0xf0) [0x7ff806af8fe0]
          ./perf() [0x4221ed]
        Refcount +1 => 2 at
          ./perf(map_groups__clone+0x128) [0x4bb888]
          ./perf(thread__fork+0xbe) [0x4c1f9e]
          ./perf(machine__process_fork_event+0x216) [0x4b79a6]
          ./perf(perf_event__synthesize_threads+0x38b) [0x48135b]
          ./perf(cmd_top+0xdc6) [0x43cb76]
          ./perf() [0x477223]
          ./perf(main+0x617) [0x422077]
          /lib64/libc.so.6(__libc_start_main+0xf0) [0x7ff806af8fe0]
          ./perf() [0x4221ed]
        Refcount -1 => 1 at
          ./perf(map_groups__exit+0x87) [0x4ba757]
          ./perf(map_groups__put+0x68) [0x4ba9a8]
          ./perf(thread__put+0x8b) [0x4c1aeb]
          ./perf(machine__delete_threads+0x81) [0x4b48f1]
          ./perf(perf_session__delete+0x4f) [0x4be63f]
          ./perf(cmd_top+0x1094) [0x43ce44]
          ./perf() [0x477223]
          ./perf(main+0x617) [0x422077]
          /lib64/libc.so.6(__libc_start_main+0xf0) [0x7ff806af8fe0]
          ./perf() [0x4221ed]
        ----
      
      This shows map_groups__clone get the map twice and put it when
      map_groups__exit.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20151209021120.10245.95388.stgit@localhost.localdomainSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bae32b50
  11. 27 11月, 2015 1 次提交
  12. 05 11月, 2015 1 次提交
    • J
      perf tools: Insert split maps correctly into origin group · cb8382e0
      Jiri Olsa 提交于
      When new maps are cloned out of split map they are added into origin
      map's group, but their groups pointer is not updated.
      
      This could lead to a segfault, because map->groups is expected to be
      always set as reported by Markus:
      
        __map__is_kernel (map=map@entry=0x1abb7a0) at util/map.c:238
        238             return __machine__kernel_map(map->groups->machine, map->type) =
        (gdb) bt
        #0  __map__is_kernel (map=map@entry=0x1abb7a0) at util/map.c:238
        #1  0x00000000004393e4 in symbol_filter (map=map@entry=0x1abb7a0, sym=sym@entry
        #2  0x00000000004fcd4d in dso__load_sym (dso=dso@entry=0x166dae0, map=map@entry
        #3  0x00000000004a64e0 in dso__load (dso=0x166dae0, map=map@entry=0x1abb7a0, fi
        #4  0x00000000004b941f in map__load (filter=0x4393c0 <symbol_filter>, map=<opti
        #5  map__find_symbol (map=0x1abb7a0, addr=40188, filter=0x4393c0 <symbol_filter
        ...
      
      Adding __map_groups__insert function to add map into groups together
      with map->groups pointer update. It takes no lock as opposed to existing
      map_groups__insert, as maps__fixup_overlappings(), where it is being
      called, already has the necessary lock held.
      
      Using __map_groups__insert to add new maps after map split.
      Reported-by: NMarkus Trippelsdorf <markus@trippelsdorf.de>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NMarkus Trippelsdorf <markus@trippelsdorf.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20151104140811.GA32664@krava.brq.redhat.com
      Fixes: cfc5acd4 ("perf top: Filter symbols based on __map__is_kernel(map)")
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cb8382e0
  13. 01 10月, 2015 3 次提交
  14. 21 8月, 2015 1 次提交
  15. 23 7月, 2015 1 次提交
  16. 16 6月, 2015 1 次提交
  17. 08 6月, 2015 1 次提交
    • A
      perf tools: Reference count struct dso · d3a7c489
      Arnaldo Carvalho de Melo 提交于
      This has a different model than the 'thread' and 'map' struct lifetimes:
      there is not a definitive "don't use this DSO anymore" event, i.e. we may
      get many 'struct map' holding references to the '/usr/lib64/libc-2.20.so'
      DSO but then at some point some DSO may have no references but we still
      don't want to straight away release its resources, because "soon" we may
      get a new 'struct map' that needs it and we want to reuse its symtab or
      other resources.
      
      So we need some way to garbage collect it when crossing some memory
      usage threshold, which is left for anoter patch, for now it is
      sufficient to release it when calling dsos__exit(), i.e. when deleting
      the whole list as part of deleting the 'struct machine' containing it,
      which will leave only referenced objects being used.
      
      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-majzgz07cm90t2tejrjy4clf@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d3a7c489
  18. 29 5月, 2015 3 次提交
  19. 28 5月, 2015 4 次提交
  20. 27 5月, 2015 3 次提交
  21. 16 5月, 2015 1 次提交
  22. 04 5月, 2015 1 次提交
  23. 08 4月, 2015 1 次提交
  24. 25 11月, 2014 1 次提交
  25. 29 10月, 2014 1 次提交
    • A
      perf tools: Set thread->mg.machine in all places · 11246c70
      Arnaldo Carvalho de Melo 提交于
      We were setting this only in machine__init(), i.e. for the map_groups that
      holds the kernel module maps, not for the one used for a thread's executable
      mmaps.
      
      Now we are sure that we can obtain the machine where a thread is by going
      via thread->mg->machine, thus we can, in the following patch, make all
      codepaths that receive machine _and_ thread, drop the machine one.
      
      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: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-y6zgaqsvhrf04v57u15e4ybm@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      11246c70
  26. 15 10月, 2014 2 次提交
  27. 20 8月, 2014 1 次提交
  28. 24 7月, 2014 2 次提交