Skip to content
  1. Nov 07, 2013
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 4d9218da
      Ingo Molnar authored
      
      Merge tag 'perf-core-for-mingo' 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:
      
        * Fix version when building out of tree, as when using one of these:
      
          $ make help | grep perf
            perf-tar-src-pkg    - Build perf-3.12.0.tar source tarball
            perf-targz-src-pkg  - Build perf-3.12.0.tar.gz source tarball
            perf-tarbz2-src-pkg - Build perf-3.12.0.tar.bz2 source tarball
            perf-tarxz-src-pkg  - Build perf-3.12.0.tar.xz source tarball
          $
      
          from David Ahern.
      
        * Don't relookup fields by name in each sample in 'trace',
          by Arnaldo Carvalho de Melo.
      
        * 'perf record' code cleanups, from David Ahern.
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      4d9218da
    • Rodrigo Campos's avatar
      perf tools: Remove unneeded include · 8ce000e8
      Rodrigo Campos authored
      There is no point in sort.h including itself.
      
      The include was added when the file was created, in commit "perf tools:
      Create util/sort.and use it" (dd68ada2
      
      ) and added a include to "sort.h"
      in lot of files (all the files that started using the file). It was
      probably added by mistake on sort.h too.
      
      Signed-off-by: default avatarRodrigo Campos <rodrigo@sdfg.com.ar>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1383776454-10595-1-git-send-email-rodrigo@sdfg.com.ar
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8ce000e8
    • David Ahern's avatar
      perf record: Remove post_processing_offset variable · 7ab75cff
      David Ahern authored
      
      
      Duplicates the data_offset from header in the session.
      
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1383763297-27066-4-git-send-email-dsahern@gmail.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7ab75cff
    • David Ahern's avatar
      perf record: Remove advance_output function · f34b9001
      David Ahern authored
      
      
      1 line function with only 1 user; might as well embed directly.
      
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Suggested-by: default avatarIngo Molnar <mingo@kernel.org>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1383763297-27066-3-git-send-email-dsahern@gmail.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f34b9001
    • David Ahern's avatar
      perf record: Refactor feature handling into a separate function · 57706abc
      David Ahern authored
      
      
      Code move only. No logic changes.
      
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1383763297-27066-2-git-send-email-dsahern@gmail.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      57706abc
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Don't relookup fields by name in each sample · 77170988
      Arnaldo Carvalho de Melo authored
      
      
      Instead do the lookups just when creating the tracepoints, initially for
      the most common, raw_syscalls:sys_{enter,exit}.
      
      It works by having evsel->priv have a per tracepoint structure with
      entries for the fields, for direct access, with the offset and a
      function to get the value from the sample, doing the swap if needed.
      
      Using a simple workload that does M millions write syscalls, we go from:
      
       # perf stat -i -e cycles /tmp/oldperf trace ./sc_hello 100 > /dev/null
      
       Performance counter stats for '/tmp/oldperf trace ./sc_hello 100':
      
           8,366,771,459 cycles
      
             2.668025928 seconds time elapsed
      
       # perf stat -i -e cycles perf trace ./sc_hello 100 > /dev/null
      
       Performance counter stats for 'perf trace ./sc_hello 100':
      
           8,345,187,650 cycles
      
             2.631748425 seconds time elapsed
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      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-eyfhvoo510a5i10b27dnvm88@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      77170988
    • David Ahern's avatar
      perf tools: Fix version when building out of tree · a614d01b
      David Ahern authored
      
      
      When building perf out of tree:
      
        $ make perf-tar-src-pkg
        $ tar -xf perf-<ver>.tar -C /tmp
        $ cd /tmp/perf<ver>
        $ make -C tools/perf
      
      you get this warning message:
          make[1]: *** No rule to make target `kernelversion'.  Stop.
      
      Fix it by saving the perf version in the tar file and using that for the
      out of tree builds.
      
      v2: removed short form request and fixed up version string from usual output.
      
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Suggested-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/1383753335-25782-1-git-send-email-dsahern@gmail.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a614d01b
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: Ditch evsel->handler.data field · 744a9719
      Arnaldo Carvalho de Melo authored
      Not needed since this cset:
      
        fcf65bf1
      
      : perf evsel: Cache associated event_format
      
      So lets trim this struct a bit.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      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-j8setslokt0goiwxq9dogzqm@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      744a9719
    • Ingo Molnar's avatar
      Merge branch 'uprobes/core' of... · 8a4d0b56
      Ingo Molnar authored
      
      Merge branch 'uprobes/core' of git://git.kernel.org/pub/scm/linux/kernel/git/oleg/misc into perf/core
      
      Pull uprobes updates from Oleg Nesterov:
      
       " [...] this way the upcoming ARM port doesn't (almost) need
         changes outside of arch/arm and thus it would be simpler to
         route everything via the ARM trees. "
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      8a4d0b56
    • Oleg Nesterov's avatar
      uprobes: Export write_opcode() as uprobe_write_opcode() · f72d41fa
      Oleg Nesterov authored
      
      
      set_swbp() and set_orig_insn() are __weak, but this is pointless
      because write_opcode() is static.
      
      Export write_opcode() as uprobe_write_opcode() for the upcoming
      arm port, this way it can actually override set_swbp() and use
      __opcode_to_mem_arm(bpinsn) instead if UPROBE_SWBP_INSN.
      
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      f72d41fa
    • Oleg Nesterov's avatar
      uprobes: Introduce arch_uprobe->ixol · 8a8de66c
      Oleg Nesterov authored
      
      
      Currently xol_get_insn_slot() assumes that we should simply copy
      arch_uprobe->insn[] which is (ignoring arch_uprobe_analyze_insn)
      just the copy of the original insn.
      
      This is not true for arm which needs to create another insn to
      execute it out-of-line.
      
      So this patch simply adds the new member, ->ixol into the union.
      This doesn't make any difference for x86 and powerpc, but arm
      can divorce insn/ixol and initialize the correct xol insn in
      arch_uprobe_analyze_insn().
      
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      8a8de66c
    • Oleg Nesterov's avatar
      uprobes: Kill module_init() and module_exit() · 736e89d9
      Oleg Nesterov authored
      
      
      Turn module_init() into __initcall() and kill module_exit().
      
      This code can't be compiled as a module so these module_*()
      calls only add the confusion, especially if arch-dependant
      code needs its own initialization hooks.
      
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      736e89d9
    • David A. Long's avatar
      uprobes: Move function declarations out of arch · 3820b4d2
      David A. Long authored
      
      
      Move the function declarations from the arch headers to the common
      header, since only the function bodies are architecture-specific.
      These changes are from Vincent Rabin's uprobes patch.
      
      [ oleg: update arch/powerpc/include/asm/uprobes.h ]
      
      Signed-off-by: default avatarRabin Vincent <rabin@rab.in>
      Signed-off-by: default avatarDavid A. Long <dave.long@linaro.org>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      3820b4d2
  2. Nov 06, 2013
    • Yan, Zheng's avatar
      perf/x86/intel: Add Ivy Bridge-EP uncore IRP box support · f891d8cf
      Yan, Zheng authored
      
      
      Unlike other uncore boxes, IRP boxes live in PCI buses with no UBOX
      device. For PCI bus without UBOX device, we find the next bus that
      has UBOX device and use its 'bus to socket' mapping.
      
      Besides the counter/control registers in IRP boxes are not properly
      aligned.
      
      Signed-off-by: default avatarYan, Zheng <zheng.z.yan@intel.com>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: eranian@google.com
      Cc: "Yan Zheng" <zheng.z.yan@intel.com>
      Link: http://lkml.kernel.org/r/1383197815-17706-2-git-send-email-zheng.z.yan@intel.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f891d8cf
    • Yan, Zheng's avatar
      perf/x86/intel/uncore: Add filter support for IvyBridge-EP QPI boxes · d1e8f4a8
      Yan, Zheng authored
      
      
      The encoding for filter registers of IvyBridge-EP uncore QPI boxes is
      completely the same as SandyBridge-EP.
      
      Signed-off-by: default avatarYan, Zheng <zheng.z.yan@intel.com>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: eranian@google.com
      Cc: "Yan Zheng" <zheng.z.yan@intel.com>
      Link: http://lkml.kernel.org/r/1383197815-17706-1-git-send-email-zheng.z.yan@intel.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      d1e8f4a8
    • Oleg Nesterov's avatar
      perf: Factor out strncpy() in perf_event_mmap_event() · c7e548b4
      Oleg Nesterov authored
      
      
      While this is really minor, but strncpy() does the unnecessary
      zero-padding till the end of tmp[16] and it is called every time
      we are going to use the string literal.
      
      Turn these strncpy()'s into the single strlcpy() under the new
      label, saves 72 bytes.
      
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20131017182417.GA17753@redhat.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      c7e548b4
    • Peter Zijlstra's avatar
      tools/perf: Add required memory barriers · a94d342b
      Peter Zijlstra authored
      To match patch bf378d34
      
       ("perf: Fix perf ring buffer memory
      ordering") change userspace to also adhere to the ordering outlined.
      
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Michael Neuling <mikey@neuling.org>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: james.hogan@imgtec.com
      Cc: Vince Weaver <vince@deater.net>
      Cc: Victor Kaplansky <VICTORK@il.ibm.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Link: http://lkml.kernel.org/r/20131030104246.GH16117@laptop.programming.kicks-ass.net
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a94d342b
    • Peter Zijlstra's avatar
      perf: Fix arch_perf_out_copy_user default · 0a196848
      Peter Zijlstra authored
      
      
      The arch_perf_output_copy_user() default of
      __copy_from_user_inatomic() returns bytes not copied, while all other
      argument functions given DEFINE_OUTPUT_COPY() return bytes copied.
      
      Since copy_from_user_nmi() is the odd duck out by returning bytes
      copied where all other *copy_{to,from}* functions return bytes not
      copied, change it over and ammend DEFINE_OUTPUT_COPY() to expect bytes
      not copied.
      
      Oddly enough DEFINE_OUTPUT_COPY() already returned bytes not copied
      while expecting its worker functions to return bytes copied.
      
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Acked-by: default avatar <will.deacon@arm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Link: http://lkml.kernel.org/r/20131030201622.GR16117@laptop.programming.kicks-ass.net
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      0a196848
    • Peter Zijlstra's avatar
      perf: Update a stale comment · 394570b7
      Peter Zijlstra authored
      
      
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Michael Neuling <mikey@neuling.org>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: james.hogan@imgtec.com
      Cc: Vince Weaver <vince@deater.net>
      Cc: Victor Kaplansky <VICTORK@il.ibm.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Anton Blanchard <anton@samba.org>
      Link: http://lkml.kernel.org/n/tip-9s5mze78gmlz19agt39i8rii@git.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      394570b7
    • Peter Zijlstra's avatar
      perf: Optimize perf_output_begin() -- address calculation · 524feca5
      Peter Zijlstra authored
      
      
      Rewrite the handle address calculation code to be clearer.
      
      Saves 8 bytes on x86_64-defconfig.
      
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Michael Neuling <mikey@neuling.org>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: james.hogan@imgtec.com
      Cc: Vince Weaver <vince@deater.net>
      Cc: Victor Kaplansky <VICTORK@il.ibm.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Anton Blanchard <anton@samba.org>
      Link: http://lkml.kernel.org/n/tip-3trb2n2henb9m27tncef3ag7@git.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      524feca5
    • Peter Zijlstra's avatar
      perf: Optimize perf_output_begin() -- lost_event case · d20a973f
      Peter Zijlstra authored
      
      
      Avoid touching the lost_event and sample_data cachelines twince. Its
      not like we end up doing less work, but it might help to keep all
      accesses to these cachelines in one place.
      
      Due to code shuffle, this looses 4 bytes on x86_64-defconfig.
      
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Michael Neuling <mikey@neuling.org>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: james.hogan@imgtec.com
      Cc: Vince Weaver <vince@deater.net>
      Cc: Victor Kaplansky <VICTORK@il.ibm.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Anton Blanchard <anton@samba.org>
      Link: http://lkml.kernel.org/n/tip-zfxnc58qxj0eawdoj31hhupv@git.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      d20a973f
    • Peter Zijlstra's avatar
      perf: Optimize perf_output_begin() · 85f59edf
      Peter Zijlstra authored
      
      
      There's no point in re-doing the memory-barrier when we fail the
      cmpxchg(). Also placing it after the space reservation loop makes it
      clearer it only separates the userpage->tail read from the data
      stores.
      
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Michael Neuling <mikey@neuling.org>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: james.hogan@imgtec.com
      Cc: Vince Weaver <vince@deater.net>
      Cc: Victor Kaplansky <VICTORK@il.ibm.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Anton Blanchard <anton@samba.org>
      Link: http://lkml.kernel.org/n/tip-c19u6egfldyx86tpyc3zgkw9@git.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      85f59edf
    • Peter Zijlstra's avatar
      perf: Add unlikely() to the ring-buffer code · c72b42a3
      Peter Zijlstra authored
      
      
      Add unlikely() annotations to 'slow' paths:
      
      When having a sampling event but no output buffer; you have bigger
      issues -- also the bail is still faster than actually doing the work.
      
      When having a sampling event but a control page only buffer, you have
      bigger issues -- again the bail is still faster than actually doing
      work.
      
      Optimize for the case where you're not loosing events -- again, not
      doing the work is still faster but make sure that when you have to
      actually do work its as fast as possible.
      
      The typical watermark is 1/2 the buffer size, so most events will not
      take this path.
      
      Shrinks perf_output_begin() by 16 bytes on x86_64-defconfig.
      
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Michael Neuling <mikey@neuling.org>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: james.hogan@imgtec.com
      Cc: Vince Weaver <vince@deater.net>
      Cc: Victor Kaplansky <VICTORK@il.ibm.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Anton Blanchard <anton@samba.org>
      Link: http://lkml.kernel.org/n/tip-wlg3jew3qnutm8opd0hyeuwn@git.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      c72b42a3
    • Peter Zijlstra's avatar
      perf: Simplify the ring-buffer code · 26c86da8
      Peter Zijlstra authored
      
      
      By using CIRC_SPACE() we can obviate the need for perf_output_space().
      
      Shrinks the size of perf_output_begin() by 17 bytes on
      x86_64-defconfig.
      
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Michael Neuling <mikey@neuling.org>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: james.hogan@imgtec.com
      Cc: Vince Weaver <vince@deater.net>
      Cc: Victor Kaplansky <VICTORK@il.ibm.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Anton Blanchard <anton@samba.org>
      Link: http://lkml.kernel.org/n/tip-vtb0xb0llebmsdlfn1v5vtfj@git.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      26c86da8
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 83bf9702
      Ingo Molnar authored
      
      Merge tag 'perf-core-for-mingo' 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:
      
        * Check maximum frequency rate for record/top, emitting better error
          messages, from Jiri Olsa.
      
        * Disable live kvm command if timerfd is not supported, from David Ahern.
      
        * Add usage to 'perf list', from David Ahern.
      
        * Fix detection of non-core features, from David Ahern.
      
        * Consolidate __hists__add_*entry(), cleanup from Namhyung Kim.
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      83bf9702
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Finish the removal of 'self' arguments · 316c7136
      Arnaldo Carvalho de Melo authored
      
      
      They convey no information, perhaps I was bitten by some snake at some
      point, complete the detox by naming the last of those arguments more
      sensibly.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      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-u1r0dnjoro08dgztiy2g3t2q@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      316c7136
    • Jiri Olsa's avatar
      perf tools: Check maximum frequency rate for record/top · 714647bd
      Jiri Olsa authored
      
      
      Adding the check for maximum allowed frequency rate defined in following
      file:
      
        /proc/sys/kernel/perf_event_max_sample_rate
      
      When we cross the maximum value we fail and display detailed error
      message with advise.
      
        $ perf record -F 3000 ls
        Maximum frequency rate (2000) reached.
        Please use -F freq option with lower value or consider
        tweaking /proc/sys/kernel/perf_event_max_sample_rate.
      
      In case user does not specify the frequency and the default value cross
      the maximum, we display warning and set the frequency value to the
      current maximum.
      
        $ perf record ls
        Lowering default frequency rate to 2000.
        Please consider tweaking /proc/sys/kernel/perf_event_max_sample_rate.
      
      Same messages are used for 'perf top'.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1383660887-1734-4-git-send-email-jolsa@redhat.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      714647bd
    • Jiri Olsa's avatar
      perf fs: Add procfs support · a9862418
      Jiri Olsa authored
      
      
      Adding procfs support into fs class.
      
      The interface function:
        const char *procfs__mountpoint(void);
      
      provides existing mountpoint path for procfs.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1383660887-1734-3-git-send-email-jolsa@redhat.com
      [ Fixup namespace ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a9862418
    • Arnaldo Carvalho de Melo's avatar
      perf fs: Rename NAME_find_mountpoint() to NAME__mountpoint() · cf38fada
      Arnaldo Carvalho de Melo authored
      
      
      Shorten it, "finding" it is an implementation detail, what callers want
      is the pathname, not to ask for it to _always_ do the lookup.
      
      And the existing implementation already caches it, i.e. it doesn't
      "finds" it on every call.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      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-r24wa4bvtccg7mnkessrbbdj@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cf38fada
    • Jiri Olsa's avatar
      perf tools: Factor sysfs code into generic fs object · 4299a549
      Jiri Olsa authored
      
      
      Moving sysfs code into generic fs object and preparing it to carry
      procfs support.
      
      This should be merged with tools/lib/lk/debugfs.c at some point in the
      future.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1383660887-1734-2-git-send-email-jolsa@redhat.com
      [ Added fs__ namespace qualifier to some more functions ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4299a549
    • David Ahern's avatar
      perf list: Add usage · 44d742e0
      David Ahern authored
      
      
      Currently 'perf list' is not very helpful if you forget the syntax:
      
        $ perf list -h
      
        List of pre-defined events (to be used in -e):
      
      After:
        $ perf list -h
      
         usage: perf list [hw|sw|cache|tracepoint|pmu|event_glob]
      
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/527133AD.4030003@gmail.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      44d742e0
    • David Ahern's avatar
      perf list: Remove a level of indentation · 8e00ddc9
      David Ahern authored
      
      
      With a return after the if check an indentation level can be removed.
      Indentation shift only; no functional changes.
      
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1383149707-1008-1-git-send-email-dsahern@gmail.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8e00ddc9
  3. Nov 05, 2013
    • David Ahern's avatar
      tools/perf/build: Fix detection of non-core features · 5febff00
      David Ahern authored
      
      
      feature_check needs to be invoked through call, and LDFLAGS may not be
      set so quotes are needed.
      
      Thanks to Jiri for spotting the quotes around LDFLAGS; that one was
      driving me nuts with the upcoming timerfd feature detection.
      
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Reviewed-by: default avatarJiri Olsa <jolsa@redhat.com>
      Tested-by: default avatarJiri Olsa <jolsa@redhat.com>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      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/1383064996-20933-1-git-send-email-dsahern@gmail.com
      [ Fixed conflict with 8a0c4c28
      
       ("perf tools: Fix libunwind build and feature detection for 32-bit build") ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5febff00
    • David Ahern's avatar
      perf kvm: Disable live command if timerfd is not supported · 87419c9a
      David Ahern authored
      
      
      If the OS does not have timerfd support (e.g., older OS'es like RHEL5)
      disable perf kvm stat live.
      
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Reviewed-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      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/1383064996-20933-2-git-send-email-dsahern@gmail.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      87419c9a
    • Namhyung Kim's avatar
      perf hists: Consolidate __hists__add_*entry() · 41a4e6e2
      Namhyung Kim authored
      
      
      The __hists__add_{branch,mem}_entry() does almost the same thing that
      __hists__add_entry() does.  Consolidate them into one.
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Rodrigo Campos <rodrigo@sdfg.com.ar>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1383202576-28141-2-git-send-email-namhyung@kernel.org
      [ Fixup clash with new COMM infrastructure ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      41a4e6e2
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 87968f94
      Ingo Molnar authored
      
      Merge tag 'perf-core-for-mingo' 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:
      
        * Add new COMM infrastructure, further improving histogram processing, from
          Frédéric Weisbecker, one fix from Namhyung Kim.
      
        * Enhance option parse error message, showing just the help lines of the
          options affected, from Namhyung Kim.
      
        * Fixup PERF_SAMPLE_TRANSACTION handling in sample synthesizing and
          'perf test', from Adrian Hunter.
      
        * Set up output options for in-stream attributes, from Adrian Hunter.
      
        * Fix 32-bit cross build, from Adrian Hunter.
      
        * Fix libunwind build and feature detection for 32-bit build, from Adrian Hunter.
      
        * Always use perf_evsel__set_sample_bit to set sample_type, from Adrian Hunter.
          perf evlist: Add a debug print if event buffer mmap fails
      
        * Add missing data.h into LIB_H headers, fix from Jiri Olsa.
      
        * libtraceevent updates from upstream trace-cmd repo, from Steven Rostedt.
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      87968f94
    • Steven Rostedt's avatar
      tools lib traceevent: Add pevent_print_func_field() helper function · 6d862b8c
      Steven Rostedt authored
      
      
      Add the pevent_print_func_field() that will look up a field that is
      expected to be a function pointer, and it will print the function name
      and offset of the address given by the field.
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20131101215501.869542711@goodmis.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6d862b8c
    • Steven Rostedt's avatar
      tools lib traceevent: Add flags NOHANDLE and PRINTRAW to individual events · c6c2b960
      Steven Rostedt authored
      
      
      Add the flags EVENT_FL_NOHANDLE and EVENT_FL_PRINTRAW to the event flags
      to have the event either ignore the register handler or to ignore the
      handler and also print the raw format respectively.
      
      This allows a tool to force a raw format or non handle for an event.
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20131101215501.655258742@goodmis.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c6c2b960
    • Steven Rostedt (Red Hat)'s avatar
      tools lib traceevent: Check for spaces in character array · 5efb9fbd
      Steven Rostedt (Red Hat) authored
      
      
      Currently when using the raw format for fields, when looking at a
      character array, to determine if it is a string or not, we make sure all
      characters are "isprint()". If not, then we consider it a numeric array,
      and print the hex numbers of the characters instead.
      
      But it seems that '\n' fails the isprint() check! Add isspace() to the
      check as well, such that if all characters pass isprint() or isspace()
      it will assume the character array is a string.
      
      Reported-by: default avatarXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Xenia Ragiadakou <burzalodowa@gmail.com>
      Link: http://lkml.kernel.org/r/20131101215501.465091682@goodmis.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5efb9fbd
    • Steven Rostedt (Red Hat)'s avatar
      tools lib traceevent: Have bprintk output the same as the kernel does · 0883d9d7
      Steven Rostedt (Red Hat) authored
      
      
      The trace_bprintk() in the kernel looks like:
      
       ring_buffer_producer_thread: Missed:   0
       ring_buffer_producer_thread: Hit:      62174350
       ring_buffer_producer_thread: Entries per millisec: 6296
       ring_buffer_producer_thread: 158 ns per entry
       ring_buffer_producer_thread: Sleeping for 10 secs
       ring_buffer_producer_thread: Starting ring buffer hammer
       ring_buffer_producer_thread: End ring buffer hammer
      
      But the current output looks like this:
      
       ring_buffer_producer_thread : Time:     9407018 (usecs)
       ring_buffer_producer_thread : Overruns: 43285485
       ring_buffer_producer_thread : Read:     4405365  (by events)
       ring_buffer_producer_thread : Entries:  0
       ring_buffer_producer_thread : Total:    47690850
       ring_buffer_producer_thread : Missed:   0
       ring_buffer_producer_thread : Hit:      47690850
      
      Remove the space between the function and the colon.
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20131101215501.272654481@goodmis.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0883d9d7