1. 30 8月, 2013 4 次提交
  2. 17 8月, 2013 2 次提交
  3. 08 8月, 2013 3 次提交
    • A
      perf evsel: Add support for enabling counters · e2407bef
      Andi Kleen 提交于
      Add support for enabling already set up counters by using an
      ioctl. I share some code with the filter setup.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Reviewed-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1375490473-1503-3-git-send-email-andi@firstfloor.org
      [ Fixed up 'err' variable indentation ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e2407bef
    • 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
    • J
      perf tools: Add support for parsing PERF_SAMPLE_READ sample type · 9ede473c
      Jiri Olsa 提交于
      Adding support to parse out the PERF_SAMPLE_READ sample bits.  The code
      contains both single and group format specification.
      
      This code parse out and prepare PERF_SAMPLE_READ data into the
      perf_sample struct. It will be used for group leader sampling feature
      comming in shortly.
      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-0tgdoln5rwk3wocshb442cl3@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9ede473c
  4. 22 7月, 2013 1 次提交
  5. 13 7月, 2013 1 次提交
  6. 09 7月, 2013 2 次提交
    • A
      perf evsel: Fix missing increment in sample parsing · 54bd2692
      Adrian Hunter 提交于
      The final sample format bit used to be PERF_SAMPLE_STACK_USER which
      neglected to do a final increment of the array pointer.  The result is
      that the following parsing might start at the wrong place.
      Signed-off-by: NAdrian Hunter <adrian.hunter@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: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1372944040-32690-16-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      54bd2692
    • D
      perf evsel: Fix count parameter to read call in event_format__new · 7cab84e8
      David Ahern 提交于
      per realloc above the length of the buffer is alloc_size, not BUFSIZ.
      Adjust length per size as done for buf start.
      
      Addresses some valgrind complaints:
      
      ==1870== Syscall param read(buf) points to unaddressable byte(s)
      ==1870==    at 0x4E3F610: __read_nocancel (in /lib64/libpthread-2.14.90.so)
      ==1870==    by 0x44AEE1: event_format__new (unistd.h:45)
      ==1870==    by 0x44B025: perf_evsel__newtp (evsel.c:158)
      ==1870==    by 0x451919: add_tracepoint_event (parse-events.c:395)
      ==1870==    by 0x479815: parse_events_parse (parse-events.y:292)
      ==1870==    by 0x45463A: parse_events_option (parse-events.c:861)
      ==1870==    by 0x44FEE4: get_value (parse-options.c:113)
      ==1870==    by 0x450767: parse_options_step (parse-options.c:192)
      ==1870==    by 0x450C40: parse_options (parse-options.c:422)
      ==1870==    by 0x42735F: cmd_record (builtin-record.c:918)
      ==1870==    by 0x419D72: run_builtin (perf.c:319)
      ==1870==    by 0x4195F2: main (perf.c:376)
      ==1870==  Address 0xcffebf0 is 0 bytes after a block of size 8,192 alloc'd
      ==1870==    at 0x4C2A62F: malloc (vg_replace_malloc.c:270)
      ==1870==    by 0x4C2A7A3: realloc (vg_replace_malloc.c:662)
      ==1870==    by 0x44AF07: event_format__new (evsel.c:121)
      ==1870==    by 0x44B025: perf_evsel__newtp (evsel.c:158)
      ==1870==    by 0x451919: add_tracepoint_event (parse-events.c:395)
      ==1870==    by 0x479815: parse_events_parse (parse-events.y:292)
      ==1870==    by 0x45463A: parse_events_option (parse-events.c:861)
      ==1870==    by 0x44FEE4: get_value (parse-options.c:113)
      ==1870==    by 0x450767: parse_options_step (parse-options.c:192)
      ==1870==    by 0x450C40: parse_options (parse-options.c:422)
      ==1870==    by 0x42735F: cmd_record (builtin-record.c:918)
      ==1870==    by 0x419D72: run_builtin (perf.c:319)
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      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>
      Link: http://lkml.kernel.org/r/1372793245-4136-2-git-send-email-dsahern@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7cab84e8
  7. 28 5月, 2013 1 次提交
  8. 01 4月, 2013 3 次提交
  9. 16 3月, 2013 3 次提交
  10. 07 2月, 2013 1 次提交
  11. 01 2月, 2013 2 次提交
  12. 30 1月, 2013 2 次提交
  13. 25 1月, 2013 3 次提交
  14. 12 12月, 2012 4 次提交
  15. 11 12月, 2012 2 次提交
    • A
      perf evsel: Introduce method to request IDs be used · 7a5a5ca5
      Arnaldo Carvalho de Melo 提交于
      When mmaping multiple events we need to find the right evsel that
      matches an event in the ring buffer.
      
      For that we need to set the PERF_FORMAT_ID bit in
      perf_event_attr.read_format so that when we read the event fds we get
      that id to then hash it and be able later to use perf_evlist__id2evsel
      to find the right evsel.
      
      We also need to set the PERF_SAMPLE_ID bit in
      perf_event_attr.sample_type to ask for that id to be stashed in each
      sample, so that we can demux it.
      
      So add a perf_evsel__set_sample_id() method to do those two things in
      one operation.
      
      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: 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/n/tip-1z4xcmbud30lamklfe80oopu@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7a5a5ca5
    • A
      perf evsel: Update sample_size when setting sample_type bits · 7be5ebe8
      Arnaldo Carvalho de Melo 提交于
      We use evsel->sample_size to detect underflows in
      perf_evsel__parse_sample, but we were failing to update it after
      perf_evsel__init(), i.e. when we decide, after creating an evsel, that
      we want some extra field bit set.
      
      Fix it by introducing methods to set a bit that will take care of
      correctly adjusting evsel->sample_size.
      
      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: 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/n/tip-2ny5pzsing0dcth7hws48x9c@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7be5ebe8
  16. 09 12月, 2012 2 次提交
  17. 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
  18. 15 11月, 2012 3 次提交
    • A
      perf evsel: Introduce is_group_member method · 07ac002f
      Arnaldo Carvalho de Melo 提交于
      To clarify what is being tested, instead of assuming that evsel->leader
      == NULL means either an 'isolated' evsel or a 'group leader'.
      
      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: 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/n/tip-lvdbvimaxw9nc5een5vmem0c@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      07ac002f
    • J
      perf tools: Fix 'disabled' attribute config for record command · 774cb499
      Jiri Olsa 提交于
      Currently the record command sets all events initially as disabled.
      
      There's non conditional perf_evlist__enable call, that enables all
      events before we exec tracee program. That actually screws whole
      enable_on_exec logic, because the event is enabled before the traced
      program got executed.
      
      What we actually want is:
      
      1) For any type of traced program:
        - all independent events and group leaders are disabled
        - all group members are enabled
      
         Group members are ruled by group leaders. They need to
         be enabled, because the group scheduling relies on that.
      
      2) For traced programs executed by perf:
         - all independent events and group leaders have
           enable_on_exec set
         - we don't specifically enable or disable any event during
           the record command
      
         Independent events and group leaders are initially disabled
         and get enabled by exec. Group members are ruled by group
         leaders as stated in 1).
      
      3) For traced programs attached by perf (pid/tid):
         - we specifically enable or disable all events during
           the record command
      
         When attaching events to already running traced we
         enable/disable events specifically, as there's no
         initial traced exec call.
      
      Fixing appropriate perf_event_attr test case to cover this change.
      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: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1352741644-16809-3-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      774cb499
    • J
      perf tools: Fix attributes for '{}' defined event groups · cac21425
      Jiri Olsa 提交于
      Fixing events attributes for groups defined via '{}'.
      
      Currently 'enable_on_exec' attribute in record command and both
      'disabled ' and 'enable_on_exec' attributes in stat command are set
      based on the 'group' option. This eliminates proper setup for '{}'
      defined groups as they don't set 'group' option.
      
      Making above attributes values based on the 'evsel->leader' as this is
      common to both group definition.
      
      Moving perf_evlist__set_leader call within builtin-record ahead
      perf_evlist__config_attrs call, because the latter needs possible group
      leader links in place.
      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: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1352741644-16809-2-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cac21425