1. 22 7月, 2013 1 次提交
  2. 13 7月, 2013 1 次提交
  3. 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
  4. 28 5月, 2013 1 次提交
  5. 01 4月, 2013 3 次提交
  6. 16 3月, 2013 3 次提交
  7. 07 2月, 2013 1 次提交
  8. 01 2月, 2013 2 次提交
  9. 30 1月, 2013 2 次提交
  10. 25 1月, 2013 3 次提交
  11. 12 12月, 2012 4 次提交
  12. 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
  13. 09 12月, 2012 2 次提交
  14. 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
  15. 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
  16. 15 10月, 2012 1 次提交
  17. 27 9月, 2012 5 次提交
  18. 26 9月, 2012 2 次提交
  19. 24 9月, 2012 1 次提交
    • A
      perf evsel: Provide a new constructor for tracepoints · efd2b924
      Arnaldo Carvalho de Melo 提交于
      The existing constructor receives a perf_event_attr filled with the
      event type and the config.
      
      To reduce the boilerplate for tracepoints, provide a new constructor,
      perf_evsel__newtp() that receives the tracepoint name and will open
      the debugfs file, call into libtraceevent new pevent_parse_format file
      to fill its ->tp_format member, so that users can then just call
      perf_evsel__field() to access its fields.
      
      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>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-6du8dl1hz0y5l4cybodye7hn@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      efd2b924