1. 01 2月, 2013 2 次提交
  2. 30 1月, 2013 2 次提交
  3. 25 1月, 2013 3 次提交
  4. 12 12月, 2012 4 次提交
  5. 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
  6. 09 12月, 2012 2 次提交
  7. 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
  8. 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
  9. 15 10月, 2012 1 次提交
  10. 27 9月, 2012 5 次提交
  11. 26 9月, 2012 2 次提交
  12. 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
  13. 12 9月, 2012 1 次提交
  14. 07 9月, 2012 1 次提交
  15. 18 8月, 2012 1 次提交
  16. 15 8月, 2012 2 次提交
    • A
      perf evlist: Rename __group method to __set_leader · 63dab225
      Arnaldo Carvalho de Melo 提交于
      Just like was done for parse_events__set_leader.
      
      Also we need to have the list_entry set_leader method in evlist.c so that we
      don't grow another dep in the python binding:
      
       # ~acme/git/linux/tools/perf/python/twatch.py
       Traceback (most recent call last):
         File "/home/acme/git/linux/tools/perf/python/twatch.py", line 16, in <module>
           import perf
       ImportError: /home/acme/git/build/perf/python/perf.so: undefined symbol: parse_events__set_leader
      
      And also remove a pr_debug from evsel.c so that we avoid this one too:
      
       # ~acme/git/linux/tools/perf/python/twatch.py
       Traceback (most recent call last):
         File "/home/acme/git/linux/tools/perf/python/twatch.py", line 16, in <module>
           import perf
       ImportError: /home/acme/git/build/perf/python/perf.so: undefined symbol: eprintf
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: NNamhyung Kim <namhyung@gmail.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: 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-0hk9dazg9pora9jylkqngovm@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      63dab225
    • J
      perf tools: Enable grouping logic for parsed events · 6a4bb04c
      Jiri Olsa 提交于
      This patch adds a functionality that allows to create event groups
      based on the way they are specified on the command line. Adding
      functionality to the '{}' group syntax introduced in earlier patch.
      
      The current '--group/-g' option behaviour remains intact. If you
      specify it for record/stat/top command, all the specified events
      become members of a single group with the first event as a group
      leader.
      
      With the new '{}' group syntax you can create group like:
        # perf record -e '{cycles,faults}' ls
      
      resulting in single event group containing 'cycles' and 'faults'
      events, with cycles event as group leader.
      
      All groups are created with regards to threads and cpus. Thus
      recording an event group within a 2 threads on server with
      4 CPUs will create 8 separate groups.
      
      Examples (first event in brackets is group leader):
      
        # 1 group (cpu-clock,task-clock)
        perf record --group -e cpu-clock,task-clock ls
        perf record -e '{cpu-clock,task-clock}' ls
      
        # 2 groups (cpu-clock,task-clock) (minor-faults,major-faults)
        perf record -e '{cpu-clock,task-clock},{minor-faults,major-faults}' ls
      
        # 1 group (cpu-clock,task-clock,minor-faults,major-faults)
        perf record --group -e cpu-clock,task-clock -e minor-faults,major-faults ls
        perf record -e '{cpu-clock,task-clock,minor-faults,major-faults}' ls
      
        # 2 groups (cpu-clock,task-clock) (minor-faults,major-faults)
        perf record -e '{cpu-clock,task-clock} -e '{minor-faults,major-faults}' \
         -e instructions ls
      
        # 1 group
        # (cpu-clock,task-clock,minor-faults,major-faults,instructions)
        perf record --group -e cpu-clock,task-clock \
         -e minor-faults,major-faults -e instructions ls perf record -e
      '{cpu-clock,task-clock,minor-faults,major-faults,instructions}' ls
      
      It's possible to use standard event modifier for a group, which spans
      over all events in the group and updates each event modifier settings,
      for example:
      
        # perf record -r '{faults:k,cache-references}:p'
      
      resulting in ':kp' modifier being used for 'faults' and ':p' modifier
      being used for 'cache-references' event.
      Reviewed-by: NNamhyung Kim <namhyung@kernel.org>
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.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>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ulrich Drepper <drepper@gmail.com>
      Link: http://lkml.kernel.org/n/tip-ho42u0wcr8mn1otkalqi13qp@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6a4bb04c
  17. 12 8月, 2012 1 次提交
    • J
      perf tools: Support for DWARF mode callchain · 26d33022
      Jiri Olsa 提交于
      This patch enables perf to use the DWARF unwind code.
      
      It extends the perf record '-g' option with following arguments:
        'fp'           - provides framepointer based user
                         stack backtrace
        'dwarf[,size]' - provides DWARF (libunwind) based user stack
                         backtrace. The size specifies the size of the
                         user stack dump. If omitted it is 8192 by default.
      
      If libunwind is found during the perf build, then the 'dwarf' argument
      becomes available for record command. The 'fp' stays as default option
      in any case.
      
      Examples: (perf compiled with libunwind)
      
         perf record -g dwarf ls
            - provides dwarf unwind with 8192 as stack dump size
      
         perf record -g dwarf,4096 ls
            - provides dwarf unwind with 4096 as stack dump size
      
         perf record -g -- ls
         perf record -g fp ls
            - provides frame pointer unwind
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Original-patch-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: "Frank Ch. Eigler" <fche@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Benjamin Redelings <benjamin.redelings@nescent.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Ulrich Drepper <drepper@gmail.com>
      Link: http://lkml.kernel.org/r/1344345647-11536-13-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      26d33022
  18. 11 8月, 2012 1 次提交
    • J
      perf tools: Support user regs and stack in sample parsing · 0f6a3015
      Jiri Olsa 提交于
      Adding following info to be parsed out of the event sample:
       - user register set
       - user stack dump
      
      Both are global and specific to all events within the session.
      This info will be used in the unwind patches coming in shortly.
      
      Adding simple output printout (report -D) for both register and
      stack dumps.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Original-patch-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: "Frank Ch. Eigler" <fche@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Benjamin Redelings <benjamin.redelings@nescent.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Ulrich Drepper <drepper@gmail.com>
      Link: http://lkml.kernel.org/r/1344345647-11536-11-git-send-email-jolsa@redhat.com
      [ Use evsel->attr.sample_regs_user ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0f6a3015
  19. 02 8月, 2012 2 次提交
  20. 30 6月, 2012 1 次提交
  21. 26 6月, 2012 1 次提交
    • N
      perf evsel: Fix a build failure on cross compilation · 35a46873
      Namhyung Kim 提交于
      The commit c410431c ("perf tools: Reconstruct event with modifiers
      from perf_event_attr") added the line, but it's broken since it needs to
      go up 3 directories to get to the kernel root directory, not 2.
      
      However host gcc contains /usr/local/include in its search path, so that
      it can find the perf_event.h in /usr/include. This why we didn't notice
      the problem yet.  But when I tried to cross compile it appears like:
      
            CC util/evsel.o
        util/evsel.c:18:44: error: ../../include/linux/perf_event.h: No such file or directory
        make: *** [util/evsel.o] Error 1
      
      Looking at the source, it isn't needed at all as evsel.h already
      included the perf_event.h. So simply remove it would solve the problem.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1340268772-5737-1-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      35a46873
  22. 20 6月, 2012 1 次提交