1. 16 10月, 2014 1 次提交
  2. 02 10月, 2014 1 次提交
  3. 30 9月, 2014 1 次提交
  4. 18 9月, 2014 2 次提交
    • A
      perf tools: Let default config be defined for a PMU · dc0a6202
      Adrian Hunter 提交于
      This allows default config terms to be provided for a PMU. So, for
      example, when the Intel PT PMU is added, it will be possible to specify:
      
      	intel_pt//
      
      which will be the same as:
      
      	intel_pt/tsc=1,noretcomp=0/
      
      meaning that the trace should contain TSC timestamps and perform 'return
      compression'.
      
      An important consideration of this patch is that it must be possible to
      overwrite the default values.  That has meant changing the logic so that
      a zero value can replace a non-zero value.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1406786474-9306-7-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      dc0a6202
    • A
      perf tools: Let a user specify a PMU event without any config terms · ad962273
      Adrian Hunter 提交于
      This enables a PMU event to be specified in the form:
      
      	pmu//
      
      which is effectively the same as:
      
      	pmu/config=0/
      
      This patch is a precursor to defining default config for a PMU.
      
      Further explanation extracted from lkml thread:
      
      Imagine that the 'tsc' term did not exist.
      
      Intel PT trace data would not contain TSC packets, and the decoder would
      not know how to decode them.
      
      Then imagine that a new version of the hardware adds 'tsc'.
      
      It is such a useful feature that we want it by default, but older
      versions of the tools don't know how to decode it, so the kernel cannot
      turn it on by default.
      
      It is similar to why the kernel does not select perf_event_attr.mmap2 by
      default.
      
      The kernel doesn't know whether the tool supports it.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1408129739-17368-6-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ad962273
  5. 15 8月, 2014 1 次提交
  6. 10 2月, 2014 1 次提交
  7. 21 1月, 2014 1 次提交
  8. 13 1月, 2014 1 次提交
  9. 28 12月, 2013 1 次提交
  10. 17 12月, 2013 1 次提交
    • B
      tools/: Convert to new topic libraries · 553873e1
      Borislav Petkov 提交于
      Move debugfs.* to api/fs/. We have a common tools/lib/api/ place where
      the Makefile lives and then we place the headers in subdirs.
      
      For example, all the fs-related stuff goes to tools/lib/api/fs/ from
      which we get libapikfs.a (acme got almost the naming he wanted :-)) and
      we link it into the tools which need it - in this case perf and
      tools/vm/page-types.
      
      acme:
      
      "Looking at the implementation, I think some tools can even link
      directly to the .o files, avoiding the .a file altogether.
      
      But that is just an optimization/finer granularity tools/lib/
      cherrypicking that toolers can make use of."
      
      Fixup documentation cleaning target while at it.
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      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@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Stanislav Fomichev <stfomichev@yandex-team.ru>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386605664-24041-2-git-send-email-bp@alien8.deSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      553873e1
  11. 27 11月, 2013 1 次提交
    • S
      tools/perf/stat: Add event unit and scale support · 410136f5
      Stephane Eranian 提交于
      This patch adds perf stat support for handling event units and
      scales as exported by the kernel.
      
      The kernel can export PMU events actual unit and scaling factor
      via sysfs:
      
        $ ls -1 /sys/devices/power/events/energy-*
        /sys/devices/power/events/energy-cores
        /sys/devices/power/events/energy-cores.scale
        /sys/devices/power/events/energy-cores.unit
        /sys/devices/power/events/energy-pkg
        /sys/devices/power/events/energy-pkg.scale
        /sys/devices/power/events/energy-pkg.unit
        $ cat /sys/devices/power/events/energy-cores.scale
        2.3283064365386962890625e-10
        $ cat cat /sys/devices/power/events/energy-cores.unit
        Joules
      
      This patch modifies the pmu event alias code to check
      for the presence of the .unit and .scale files to load
      the corresponding values. They are then used by perf stat
      transparently:
      
         # perf stat -a -e power/energy-pkg/,power/energy-cores/,cycles -I 1000 sleep 1000
         #          time             counts   unit events
             1.000214717               3.07 Joules power/energy-pkg/         [100.00%]
             1.000214717               0.53 Joules power/energy-cores/
             1.000214717           12965028        cycles                    [100.00%]
             2.000749289               3.01 Joules power/energy-pkg/
             2.000749289               0.52 Joules power/energy-cores/
             2.000749289           15817043        cycles
      
      When the event does not have an explicit unit exported by
      the kernel, nothing is printed. In csv output mode, there
      will be an empty field.
      
      Special thanks to Jiri for providing the supporting code
      in the parser to trigger reading of the scale and unit files.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Reviewed-by: NJiri Olsa <jolsa@redhat.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: zheng.z.yan@intel.com
      Cc: bp@alien8.de
      Cc: maria.n.dimakopoulou@gmail.com
      Cc: acme@redhat.com
      Link: http://lkml.kernel.org/r/1384275531-10892-3-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      410136f5
  12. 12 11月, 2013 1 次提交
    • A
      perf evsel: Remove idx parm from constructor · ef503831
      Arnaldo Carvalho de Melo 提交于
      Most uses of the evsel constructor are followed by a call to
      perf_evlist__add with an idex of evlist->nr_entries, so make rename
      the current constructor to perf_evsel__new_idx and remove the need
      for passing the constructor for the common case.
      
      We still need the new_idx variant because the way groups are handled,
      with evsel->nr_members holding the number of entries in an evlist,
      partitioning the evlist into sublists inside a single linked list.
      
      This asks for a clarifying refactoring, but for now simplify the non
      parser cases, so that tool writers don't have to bother with evsel idx
      setting.
      
      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-zy9tskx6jqm2rmw7468zze2a@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ef503831
  13. 22 10月, 2013 1 次提交
  14. 03 9月, 2013 2 次提交
  15. 08 8月, 2013 2 次提交
    • M
      perf tools: Add support for pinned modifier · e9a7c414
      Michael Ellerman 提交于
      This commit adds support for a new modifier "D", which requests that the
      event, or group of events, be pinned to the PMU.
      
      The "p" modifier is already taken for precise, and "P" may be used in
      future to mean "fully precise".
      
      So we use "D", which stands for pinneD - and looks like a padlock, or if
      you're using the ":D" syntax perf smiles at you.
      
      This is an oft-requested feature from our HW folks, who want to be able
      to run a large number of events, but also want 100% accurate results for
      instructions per cycle.
      
      Comparison of results with and without pinning:
      
      $ perf stat -e '{cycles,instructions}:D' -e cycles,instructions,...
      
        79,590,480,683 cycles         #  0.000 GHz
       166,123,716,524 instructions   #  2.09  insns per cycle
                                      #  0.11  stalled cycles per insn
      
        79,352,134,463 cycles         #  0.000 GHz                     [11.11%]
       165,178,301,818 instructions   #  2.08  insns per cycle
                                      #  0.11  stalled cycles per insn [11.13%]
      
      As you can see although perf does a very good job of scaling the values
      in the non-pinned case, there is some small discrepancy.
      
      The patch is fairly straight forward, the one detail is that we need to
      make sure we only request pinning for the group leader when we have a
      group.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Tested-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1375795686-4226-1-git-send-email-michael@ellerman.id.au
      [ Use perf_evsel__is_group_leader instead of open coded equivalent, as
        suggested by Jiri Olsa ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e9a7c414
    • J
      perf tools: Add 'S' event/group modifier to read sample value · 3c176311
      Jiri Olsa 提交于
      Adding 'S' event/group modifier to specify that the event value/s are
      read by PERF_SAMPLE_READ sample type processing, instead of the period
      value offered by lower layers.
      
      There's additional behaviour change for 'S' modifier being specified on
      event group:
      
      Currently all the events within a group makes samples. If user now
      specifies 'S' within group modifier, only the leader will trigger
      samples. The rest of events in the group will have sampling disabled.
      
      And same as for single events, values of all events within the group
      (including leader) are read by PERF_SAMPLE_READ sample type processing.
      
      Following example will create event group with cycles and cache-misses
      events, setting the cycles as group leader and the only event to
      actually sample. Both cycles and cache-misses event period values are
      read by PERF_SAMPLE_READ sample type processing with PERF_FORMAT_GROUP
      read format.
      
      Example:
      
        $ perf record -e '{cycles,cache-misses}:S' ls
        ...
        $ perf report --group --show-total-period --stdio
        ...
        # Samples: 36  of event 'anon group { cycles, cache-misses }'
        # Event count (approx.): 12585593
        #
        #       Overhead          Period  Command      Shared Object                      Symbol
        # ..............  ..............  .......  .................  ..........................
        #
          19.92%   1.20%  2505936     31       ls  [kernel.kallsyms]  [k] mark_held_locks
          13.74%   0.47%  1729327     12       ls  [kernel.kallsyms]  [k] sched_clock_local
          13.64%  23.72%  1716147    612       ls  ld-2.14.90.so      [.] check_match.10805
          13.12%  23.22%  1650778    599       ls  libc-2.14.90.so    [.] _nl_intern_locale_data
          11.24%  29.19%  1414554    753       ls  [kernel.kallsyms]  [k] sched_clock_cpu
           8.50%   0.35%  1070150      9       ls  [kernel.kallsyms]  [k] check_chain_key
        ...
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      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/n/tip-iyoinu3axi11mymwnh2b7fxj@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3c176311
  16. 13 7月, 2013 5 次提交
  17. 09 7月, 2013 2 次提交
  18. 16 3月, 2013 1 次提交
  19. 07 2月, 2013 1 次提交
  20. 01 2月, 2013 1 次提交
  21. 25 1月, 2013 5 次提交
  22. 20 11月, 2012 1 次提交
    • D
      perf: Make perf build for x86 with UAPI disintegration applied · d2709c7c
      David Howells 提交于
      Make perf build for x86 once the UAPI disintegration patches for that arch
      have been applied by adding the appropriate -I flags - in the right order -
      and then converting some #includes that use ../.. notation to find main kernel
      headerfiles to use <asm/foo.h> and <linux/foo.h> instead.
      
      Note that -Iarch/foo/include/uapi is present _before_ -Iarch/foo/include.
      This makes sure we get the userspace version of the pt_regs struct.  Ideally,
      we wouldn't have the latter -I flag at all, but unfortunately we want
      asm/svm.h and asm/vmx.h in builtin-kvm.c and these aren't part of the UAPI -
      at least not for x86.  I wonder if the bits outside of the __KERNEL__ guards
      *should* be transferred there.
      
      I note also that perf seems to do its dependency handling manually by listing
      all the header files it might want to use in LIB_H in the Makefile.  Can this
      be changed to use -MD?
      
      Note that to do make this work, we need to export and UAPI disintegrate
      linux/hw_breakpoint.h, which I think should've been exported previously so that
      perf can access the bits.  We have to do this in the same patch to maintain
      bisectability.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      d2709c7c
  23. 15 11月, 2012 1 次提交
  24. 28 10月, 2012 1 次提交
  25. 25 10月, 2012 1 次提交
  26. 24 10月, 2012 1 次提交
  27. 16 10月, 2012 1 次提交
    • D
      perf tool: Precise mode requires exclude_guest · 1342798c
      David Ahern 提交于
      Summary of events per Peter:
      
        "Intel PEBS in VT-x context uses the DS address as a guest linear address,
        even though its programmed by the host as a host linear address. This
        either results in guest memory corruption and or the hardware faulting and
        'crashing' the virtual machine.  Therefore we have to disable PEBS on VT-x
        enter and re-enable on VT-x exit, enforcing a strict exclude_guest.
      
        AMB IBS does work but doesn't currently support exclude_* at all,
        setting an exclude_* bit will make it fail."
      
      This patch handles userspace perf command, setting the exclude_guest
      attribute if precise mode is requested, but only if a user has not
      specified a request for guest or host only profiling (G or H attribute).
      
      Kernel side AMD currently ignores all exclude_* bits, so there is no impact
      to existing IBS code paths. Robert Richter has a patch where IBS code will
      return EINVAL if an exclude_* bit is set. When this goes in it means use
      of :p on AMD with IBS will first fail with EINVAL (because exclude_guest
      will be set). Then the existing fallback code within perf will unset
      exclude_guest and try again. The second attempt will succeed if the CPU
      supports IBS profiling.
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Acked-by: NRobert Richter <robert.richter@amd.com>
      Tested-by: NRobert Richter <robert.richter@amd.com>
      Reviewed-by: NRobert Richter <robert.richter@amd.com>
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Gleb Natapov <gleb@redhat.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <robert.richter@amd.com>
      Link: http://lkml.kernel.org/r/1347569955-54626-2-git-send-email-dsahern@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1342798c
  28. 27 9月, 2012 1 次提交