1. 21 9月, 2012 1 次提交
  2. 11 9月, 2012 1 次提交
    • I
      perf tools: Use __maybe_used for unused variables · 1d037ca1
      Irina Tirdea 提交于
      perf defines both __used and __unused variables to use for marking
      unused variables. The variable __used is defined to
      __attribute__((__unused__)), which contradicts the kernel definition to
      __attribute__((__used__)) for new gcc versions. On Android, __used is
      also defined in system headers and this leads to warnings like: warning:
      '__used__' attribute ignored
      
      __unused is not defined in the kernel and is not a standard definition.
      If __unused is included everywhere instead of __used, this leads to
      conflicts with glibc headers, since glibc has a variables with this name
      in its headers.
      
      The best approach is to use __maybe_unused, the definition used in the
      kernel for __attribute__((unused)). In this way there is only one
      definition in perf sources (instead of 2 definitions that point to the
      same thing: __used and __unused) and it works on both Linux and Android.
      This patch simply replaces all instances of __used and __unused with
      __maybe_unused.
      Signed-off-by: NIrina Tirdea <irina.tirdea@intel.com>
      Acked-by: NPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com
      [ committer note: fixed up conflict with a116e05d in builtin-sched.c ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1d037ca1
  3. 06 9月, 2012 1 次提交
  4. 15 8月, 2012 3 次提交
    • A
      perf evlist: Introduce evsel list accessors · 0c21f736
      Arnaldo Carvalho de Melo 提交于
      To replace the longer list_entry constructs for things that are widely
      used:
      
      	perf_evlist__{first,last}(evlist)
      	perf_evsel__next(evsel)
      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-ng7azq26wg1jd801qqpcozwp@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0c21f736
    • 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
  5. 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
  6. 03 8月, 2012 1 次提交
    • D
      perf tool: Save cmdline from user in file header vs what is passed to record · 56e6f602
      David Ahern 提交于
      A number of builtin commands process some user args and then pass the rest to
      cmd_record. cmd_record then saves argc/argv that it receives into the header of
      the perf data file. But this loses the arguments handled by the first command
      -- ie., the real command line from the user. This patch saves the command line
      as typed by the user rather than what was passed to cmd_record.
      
      As an example consider the command:
      $ perf kvm --guest --host --guestmount=/tmp/guest-mount record
          -fo /tmp/perf.data -ag -- sleep 10
      
      Currently the command saved to the header is:
          cmdline : /tmp/p3.5/perf record -o perf.data.kvm -fo /tmp/perf.data -ag -- sleep 1
      
      (ignore the duplicated -o -- the first would be yet another bug with perf-kvm).
      
      With this patch the command line saved to the header is:
      cmdline : /tmp/p3.5/perf kvm --guest --host --guestmount=/tmp/guest-mount
          record -fo /tmp/perf.data -ag -- sleep 1
      
      v2: simplified to saving the command in parse_options per Stephane's suggestion
      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@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1343616831-6408-1-git-send-email-dsahern@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      56e6f602
  7. 02 8月, 2012 1 次提交
  8. 20 6月, 2012 1 次提交
  9. 29 5月, 2012 1 次提交
  10. 23 5月, 2012 1 次提交
  11. 22 5月, 2012 1 次提交
  12. 17 5月, 2012 1 次提交
  13. 09 5月, 2012 2 次提交
  14. 08 5月, 2012 3 次提交
  15. 03 5月, 2012 3 次提交
  16. 12 4月, 2012 1 次提交
  17. 09 3月, 2012 3 次提交
  18. 03 3月, 2012 2 次提交
  19. 15 2月, 2012 2 次提交
  20. 14 2月, 2012 1 次提交
  21. 09 2月, 2012 1 次提交
  22. 03 2月, 2012 1 次提交
  23. 25 1月, 2012 1 次提交
  24. 24 12月, 2011 3 次提交
  25. 20 12月, 2011 1 次提交
    • A
      perf record: Add ability to record event period · 3e76ac78
      Andrew Vagin 提交于
      The problem is that when SAMPLE_PERIOD is not set, the kernel generates
      a number of samples in proportion to an event's period. Number of these
      samples may be too big and the kernel throttles all samples above a
      defined limit.
      
      E.g.: I want to trace when a process sleeps. I created a process which
      sleeps for 1ms and for 4ms.  perf got 100 events in both cases.
      
      swapper 0 [000] 1141.371830: sched_stat_sleep: comm=foo pid=1801 delay=1386750 [ns]
      swapper 0 [000] 1141.369444: sched_stat_sleep: comm=foo pid=1801 delay=4499585 [ns]
      
      In the first case a kernel want to send 4499585 events and in the second
      case it wants to send 1386750 events.  perf-reports shows that process
      sleeps in both places equal time.
      
      Instead of this we can get only one sample with an attribute period. As
      result we have less data transferring between kernel and user-space and
      we avoid throttling of samples.
      
      The patch "events: Don't divide events if it has field period" added a
      kernel part of this functionality.
      Acked-by: NArun Sharma <asharma@fb.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: devel@openvz.org
      Link: http://lkml.kernel.org/r/1324391565-1369947-1-git-send-email-avagin@openvz.orgSigned-off-by: NAndrew Vagin <avagin@openvz.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3e76ac78
  26. 29 11月, 2011 1 次提交
  27. 28 11月, 2011 1 次提交