1. 11 5月, 2016 9 次提交
  2. 10 5月, 2016 15 次提交
  3. 09 5月, 2016 1 次提交
  4. 07 5月, 2016 9 次提交
  5. 06 5月, 2016 6 次提交
    • C
      perf callchain: Fix incorrect ordering of entries · 9919a65e
      Chris Phlipot 提交于
      The existing implementation of thread__resolve_callchain, under certain
      circumstances, can assemble callchain entries in the incorrect order.
      
      The callchain entries are resolved incorrectly for a sample when all of
      the following conditions are met:
      
      1. callchain_param.order is set to ORDER_CALLER
      
      2. thread__resolve_callchain_sample is able to resolve callchain entries
         for the sample.
      
      3. unwind__get_entries is also able to resolve callchain entries for the
         sample.
      
      The fix is accomplished by reversing the order in which
      thread__resolve_callchain_sample and unwind__get_entries are called when
      callchain_param.order is set to ORDER_CALLER.
      
      Unwind specific code from thread__resolve_callchain is also moved into a
      new static function to improve readability of the fix.
      
      How to Reproduce the Existing Bug:
      
      Modifying perf script to print call trees in the opposite order or
      applying the remaining patches from this series and comparing the
      results output from export-to-postgtresql.py are the easiest ways to see
      the bug, however it can still be seen in current builds using perf
      report.
      
      Here is how i can reproduce the bug using perf report:
      
        # perf record --call-graph=dwarf stress -c 1 -t 5
      
      when i run this command:
      
        # perf report --call-graph=flat,0,0,callee
      
      This callchain, containing kernel (handle_irq_event, etc) and userspace
      samples (__libc_start_main, etc) is contained in the output, which looks
      correct (callee order):
      
                      gen8_irq_handler
                      handle_irq_event_percpu
                      handle_irq_event
                      handle_edge_irq
                      handle_irq
                      do_IRQ
                      ret_from_intr
                      __random
                      rand
                      0x558f2a04dded
                      0x558f2a04c774
                      __libc_start_main
                      0x558f2a04dcd9
      
      Now run this command using caller order:
      
        # perf report --call-graph=flat,0,0,caller
      
      It is expected to see the exact reverse of the above when using caller
      order (with "0x558f2a04dcd9" at the top and "gen8_irq_handler" at the
      bottom) in the output, but it is nowhere to be found.
      
      instead you see this:
      
                      ret_from_intr
                      do_IRQ
                      handle_irq
                      handle_edge_irq
                      handle_irq_event
                      handle_irq_event_percpu
                      gen8_irq_handler
                      0x558f2a04dcd9
                      __libc_start_main
                      0x558f2a04c774
                      0x558f2a04dded
                      rand
                      __random
      
      Notice how internally the kernel symbols are reversed and the user space
      symbols are reversed, but the kernel symbols still appear above the user
      space symbols.
      
      if this patch is applied and perf script is re-run, you will see the
      expected output (with "0x558f2a04dcd9" at the top and "gen8_irq_handler"
      at the bottom):
      
                      0x558f2a04dcd9
                      __libc_start_main
                      0x558f2a04c774
                      0x558f2a04dded
                      rand
                      __random
                      ret_from_intr
                      do_IRQ
                      handle_irq
                      handle_edge_irq
                      handle_irq_event
                      handle_irq_event_percpu
                      gen8_irq_handler
      Signed-off-by: NChris Phlipot <cphlipot0@gmail.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1461831551-12213-2-git-send-email-cphlipot0@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9919a65e
    • A
      perf trace: Do not print raw args list for syscalls with no args · 4c4d6e51
      Arnaldo Carvalho de Melo 提交于
      The test to check if the arg format had been read from the
      syscall:sys_enter_name/format file was looking at the list of non-commom
      fields, and if that is empty, it would think it had failed to read it,
      because it doesn't exist, for instance, for the clone() syscall.
      
      So instead before dumping the raw syscall args list check
      IS_ERR(sc->tp_format), if that is true, then an attempt was made to read
      the format file and failed, in which case dump the raw arg list values.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-ls7pmdqb2xy9339vdburwvnk@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4c4d6e51
    • W
      perf evlist: Rename variable in perf_mmap__read() · b6b85dad
      Wang Nan 提交于
      In perf_mmap__read(), give better names to pointers. Original name 'old'
      and 'head' directly related to pointers in ring buffer control page. For
      backward ring buffer, the meaning of 'head' point is not 'the first byte
      of free space', but 'the first byte of the last record'. To reduce
      confusion, rename 'old' to 'start', 'head' to 'end'.  'start' -> 'end'
      is the direction the records should be read from.
      
      Change parameter order.
      
      Change 'overwrite' to 'check_messup'. When reading from 'head', no need
      to check messup for for backward ring buffer.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1461723563-67451-3-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b6b85dad
    • W
      perf evlist: Extract perf_mmap__read() · 0f4ccd11
      Wang Nan 提交于
      Extract event reader from perf_evlist__mmap_read() to perf__mmap_read().
      Future commit will feed it with manually computed 'head' and 'old'
      pointers.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1461723563-67451-2-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0f4ccd11
    • N
      perf symbols: Fix kallsyms perf test on ppc64le · 0b3c2264
      Naveen N. Rao 提交于
      ppc64le functions have a Global Entry Point (GEP) and a Local Entry
      Point (LEP). While placing a probe, we always prefer the LEP since it
      catches function calls through both the GEP and the LEP. In order to do
      this, we fixup the function entry points during elf symbol table lookup
      to point to the LEPs. This works, but breaks 'perf test kallsyms' since
      the symbols loaded from the symbol table (pointing to the LEP) do not
      match the symbols in kallsyms.
      
      To fix this, we do not adjust all the symbols during symbol table load.
      Instead, we note down st_other in a newly introduced arch-specific
      member of perf symbol structure, and later use this to adjust the probe
      trace point.
      Reported-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Acked-by: NAnanth N Mavinakayanahalli <ananth@in.ibm.com>
      Acked-by: NBalbir Singh <bsingharora@gmail.com>
      Cc: Mark Wielaard <mjw@redhat.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Link: http://lkml.kernel.org/r/6be7c2b17e370100c2f79dd444509df7929bdd3e.1460451721.git.naveen.n.rao@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0b3c2264
    • N
      perf powerpc: Fix kprobe and kretprobe handling with kallsyms on ppc64le · 239aeba7
      Naveen N. Rao 提交于
      So far, we used to treat probe point offsets as being offset from the
      LEP. However, userspace applications (objdump/readelf) always show
      disassembly and offsets from the function GEP. This is confusing to the
      user as we will end up probing at an address different from what the
      user expects when looking at the function disassembly with
      readelf/objdump. Fix this by changing how we modify probe address with
      perf.
      
      If only the function name is provided, we assume the user needs the LEP.
      Otherwise, if an offset is specified, we assume that the user knows the
      exact address to probe based on function disassembly, and so we just
      place the probe from the GEP offset.
      
      Finally, kretprobe was also broken with kallsyms as we were trying to
      specify an offset. This patch also fixes that issue.
      Reported-by: NAnanth N Mavinakayanahalli <ananth@in.ibm.com>
      Signed-off-by: NNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Acked-by: NBalbir Singh <bsingharora@gmail.com>
      Cc: Mark Wielaard <mjw@redhat.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Link: http://lkml.kernel.org/r/75df860aad8216bf4b9bcd10c6351ecc0e3dee54.1460451721.git.naveen.n.rao@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      239aeba7