1. 28 6月, 2016 8 次提交
    • J
      perf symbols: Use proper dso name for is_regular_file · ed7b630b
      Jiri Olsa 提交于
      Marc reported use of uninitialized memory:
      
      > In commit "40356721 perf symbols: Do not read symbols/data from
      > device files" a check to uninitialzied memory was added. This leads to
      > the following valgrind output:
      >
      >  ==24515== Syscall param stat(file_name) points to uninitialised byte(s)
      >  ==24515==    at 0x75B26D5: _xstat (in /lib/x86_64-linux-gnu/libc-2.22.so)
      >  ==24515==    by 0x4E548D: stat (stat.h:454)
      >  ==24515==    by 0x4E548D: is_regular_file (util.c:687)
      >  ==24515==    by 0x4A5BEE: dso__load (symbol.c:1435)
      >  ==24515==    by 0x4BB1AE: map__load (map.c:289)
      >  ==24515==    by 0x4BB1AE: map__find_symbol (map.c:333)
      >  ==24515==    by 0x4835B3: thread__find_addr_location (event.c:1300)
      >  ==24515==    by 0x4B5342: add_callchain_ip (machine.c:1652)
      >  ==24515==    by 0x4B5342: thread__resolve_callchain_sample (machine.c:1906)
      >  ==24515==    by 0x4B9E7D: thread__resolve_callchain (machine.c:1958)
      >  ==24515==    by 0x441B3E: process_event (builtin-script.c:795)
      >  ==24515==    by 0x441B3E: process_sample_event (builtin-script.c:920)
      >  ==24515==    by 0x4BEE29: perf_evlist__deliver_sample (session.c:1192)
      >  ==24515==    by 0x4BEE29: machines__deliver_event (session.c:1229)
      >  ==24515==    by 0x4BF770: perf_session__deliver_event (session.c:1286)
      >  ==24515==    by 0x4BF770: ordered_events__deliver_event (session.c:114)
      >  ==24515==    by 0x4C1D17: __ordered_events__flush (ordered-events.c:207)
      >  ==24515==    by 0x4C1D17: ordered_events__flush.part.3 (ordered-events.c:274)
      >  ==24515==    by 0x4BF44C: perf_session__process_user_event (session.c:1325)
      >  ==24515==    by 0x4BF44C: perf_session__process_event (session.c:1451)
      >  ==24515==  Address 0x807c6a0 is 0 bytes inside a block of size 4,096 alloc'd
      >  ==24515==    at 0x4C29C0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
      >  ==24515==    by 0x4A5BCB: dso__load (symbol.c:1421)
      >  ==24515==    by 0x4BB1AE: map__load (map.c:289)
      >  ==24515==    by 0x4BB1AE: map__find_symbol (map.c:333)
      >  ==24515==    by 0x4835B3: thread__find_addr_location (event.c:1300)
      >  ==24515==    by 0x4B5342: add_callchain_ip (machine.c:1652)
      >  ==24515==    by 0x4B5342: thread__resolve_callchain_sample (machine.c:1906)
      >  ==24515==    by 0x4B9E7D: thread__resolve_callchain (machine.c:1958)
      >  ==24515==    by 0x441B3E: process_event (builtin-script.c:795)
      >  ==24515==    by 0x441B3E: process_sample_event (builtin-script.c:920)
      >  ==24515==    by 0x4BEE29: perf_evlist__deliver_sample (session.c:1192)
      >  ==24515==    by 0x4BEE29: machines__deliver_event (session.c:1229)
      >  ==24515==    by 0x4BF770: perf_session__deliver_event (session.c:1286)
      >  ==24515==    by 0x4BF770: ordered_events__deliver_event (session.c:114)
      >  ==24515==    by 0x4C1D17: __ordered_events__flush (ordered-events.c:207)
      >  ==24515==    by 0x4C1D17: ordered_events__flush.part.3 (ordered-events.c:274)
      >  ==24515==    by 0x4BF44C: perf_session__process_user_event (session.c:1325)
      >  ==24515==    by 0x4BF44C: perf_session__process_event (session.c:1451)
      >  ==24515==    by 0x4C0EAC: __perf_session__process_events (session.c:1804)
      >  ==24515==    by 0x4C0EAC: perf_session__process_events (session.c:1858)
      
      The reason was a typo that passed global 'name' variable as the
      is_regular_file argument instead dso->long_name.
      Reported-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Acked-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 40356721 ("perf symbols: Do not read symbols/data from device files")
      Link: http://lkml.kernel.org/r/1466772025-17471-2-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ed7b630b
    • W
      perf record: Prepare picking perf_event_mmap_page from multiple evlists · ee667f94
      Wang Nan 提交于
      Following commits introduce new evlists to record. This patch adjusts
      record__pick_pc() and introduces perf_evlist__pick_pc() to read control
      page from one specific evlist. record__pick_pc() will be improved to
      search control page from multiple evlists.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nilay Vaish <nilayvaish@gmail.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1467023052-146749-4-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ee667f94
    • W
      perf record: Prepare reading from multiple evlists in record__mmap_read_all() · cb21686b
      Wang Nan 提交于
      Following commits introduce new evlists to record. This patch adjusts
      record__mmap_read_all() and record__mmap_read(): converting original
      record__mmap_read_all() to record__mmap_read_evlist(), read from one
      evlist; makes record__mmap_read() reading from specific evlist.
      record__mmap_read_all() will be improved to read from multiple evlists.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nilay Vaish <nilayvaish@gmail.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1467023052-146749-3-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cb21686b
    • W
      perf record: Move mmap setup block to separate function · cda57a8c
      Wang Nan 提交于
      Following commits introduce multiple evlists to record. This patch
      extracts perf_evlist__mmap_ex() processing to a new function, creates
      record__mmap() and record__mmap_evlist() to wrap perf_evlist__mmap_ex()
      and its error processing. They will be improvemented to create mmap for
      all evlists.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nilay Vaish <nilayvaish@gmail.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1467023052-146749-2-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cda57a8c
    • J
      perf data convert: Include config.h header · f6c12a00
      Jiri Olsa 提交于
      Otherwise some compiler might scream:
      
        $ make LIBBABELTRACE_DIR=/opt/libbabeltrace/ LIBBABELTRACE=1
          BUILD:   Doing 'make -j4' parallel build
          CC       util/data-convert-bt.o
        util/data-convert-bt.c: In function ‘convert__config’:
        util/data-convert-bt.c:1299:19: error: implicit declaration of function ‘perf_config_u64’ [-Werror=implicit-function-declaration]
           c->queue_size = perf_config_u64(var, value);
        ...
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Marc Kleine-Budde <mkl@pengutronix.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 41840d21 ("perf config: Move config declarations from util/cache.h to util/config.h")
      Link: http://lkml.kernel.org/r/1466772025-17471-1-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f6c12a00
    • W
      perf build: Add libbabeltrace to build-test · f5ce4573
      Wang Nan 提交于
      'make build-test' doesn't test LIBBABELTRACE=1. It misses a building
      failure caused by commit 41840d21 ("perf config: Move config
      declarations from util/cache.h to util/config.h"), breaks bisect.
      
      Add LIBBABELTRACE=1 to build-test.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1466818918-131281-1-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f5ce4573
    • R
      perf tools: Add more toolchain triplets · 78f69b58
      Ravi Bangoria 提交于
      Add few more triplets based on Fedora and Ubuntu binutils (cross tools).
      
      Before applying patch on x86:
      
        ( Install binutils-powerpc64-linux-gnu.x86_64 )
        $ perf report -i perf.data.powerpc --vmlinux vmlinux.powerpc \
            --objdump powerpc64-linux-gnu-objdump
      
      After applying patch on x86:
      
        $ perf report -i perf.data.powerpc --vmlinux vmlinux.powerpc
      
      I.e. it will find the right objdump from the environment data recorded
      in the perf.data file + these triplets.
      Signed-off-by: NRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Anton Blanchard <anton@ozlabs.org>
      Cc: Daniel Axtens <dja@axtens.net>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Link: http://lkml.kernel.org/r/1466769240-12376-7-git-send-email-ravi.bangoria@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      78f69b58
    • N
      perf annotate: Generalize handling of 'ret' instructions · 6ef94929
      Naveen N. Rao 提交于
      Introduce helper to detect 'ret' instructions and use the same in the TUI.
      A helper is needed since some architectures such as powerpc have more
      than one return instruction.
      Signed-off-by: NNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Anton Blanchard <anton@ozlabs.org>
      Cc: Daniel Axtens <dja@axtens.net>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Link: http://lkml.kernel.org/r/1466769240-12376-5-git-send-email-ravi.bangoria@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6ef94929
  2. 27 6月, 2016 10 次提交
  3. 26 6月, 2016 1 次提交
    • I
      Merge tag 'perf-core-for-mingo-20160623' of... · 9840b1ae
      Ingo Molnar 提交于
      Merge tag 'perf-core-for-mingo-20160623' 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:
      
      New features:
      
      - Add 'callindent' option to 'perf script -F', to indent the Intel PT
        call stack, making this output more ftrace-like (Adrian Hunter, Andi Kleen)
      
      User visible changes:
      
      - Enlarge 'pid' column width, to cope with large pids (Jiri Olsa)
      
      Infrastructure changes:
      
      - Fix cross platform unwind (He Kuang)
      
      - Make destructors accept NULL, behaving like free() (Arnaldo Carvalho de Melo)
      
      - Remove reference to perl interpreted in the recently added 'perf script'
        stackcollapse python script (Arnaldo Carvalho de Melo)
      
      - Rename CLASS__for_each() macros to CLASS__for_each_entry(), to use the
        list_for_each_entry() semantics, as most of these class specific loop helpers
        are list_for_each_entry*() wrappers  (Arnaldo Carvalho de Melo)
      
      - Expose the hist_browser code, will be used with data structures other
        than perf_evsel (Jiri Olsa)
      
      - Refactor 'perf config' (Taeung Song)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      9840b1ae
  4. 25 6月, 2016 21 次提交