1. 06 11月, 2013 1 次提交
    • J
      perf tools: Check maximum frequency rate for record/top · 714647bd
      Jiri Olsa 提交于
      Adding the check for maximum allowed frequency rate defined in following
      file:
      
        /proc/sys/kernel/perf_event_max_sample_rate
      
      When we cross the maximum value we fail and display detailed error
      message with advise.
      
        $ perf record -F 3000 ls
        Maximum frequency rate (2000) reached.
        Please use -F freq option with lower value or consider
        tweaking /proc/sys/kernel/perf_event_max_sample_rate.
      
      In case user does not specify the frequency and the default value cross
      the maximum, we display warning and set the frequency value to the
      current maximum.
      
        $ perf record ls
        Lowering default frequency rate to 2000.
        Please consider tweaking /proc/sys/kernel/perf_event_max_sample_rate.
      
      Same messages are used for 'perf top'.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.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>
      Link: http://lkml.kernel.org/r/1383660887-1734-4-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      714647bd
  2. 29 10月, 2013 1 次提交
  3. 18 10月, 2013 2 次提交
    • A
      perf trace: Improve messages related to /proc/sys/kernel/perf_event_paranoid · a8f23d8f
      Arnaldo Carvalho de Melo 提交于
      kernel/events/core.c has:
      
        /*
         * perf event paranoia level:
         *  -1 - not paranoid at all
         *   0 - disallow raw tracepoint access for unpriv
         *   1 - disallow cpu events for unpriv
         *   2 - disallow kernel profiling for unpriv
         */
        int sysctl_perf_event_paranoid __read_mostly = 1;
      
      So, with the default being 1, a non-root user can trace his stuff:
      
        [acme@zoo ~]$ cat /proc/sys/kernel/perf_event_paranoid
        1
        [acme@zoo ~]$ yes > /dev/null &
        [1] 15338
        [acme@zoo ~]$ trace -p 15338 | head -5
             0.005 ( 0.005 ms): write(fd: 1</dev/null>, buf: 0x7fe6db765000, count: 4096 ) = 4096
             0.045 ( 0.001 ms): write(fd: 1</dev/null>, buf: 0x7fe6db765000, count: 4096 ) = 4096
             0.085 ( 0.001 ms): write(fd: 1</dev/null>, buf: 0x7fe6db765000, count: 4096 ) = 4096
             0.125 ( 0.001 ms): write(fd: 1</dev/null>, buf: 0x7fe6db765000, count: 4096 ) = 4096
             0.165 ( 0.001 ms): write(fd: 1</dev/null>, buf: 0x7fe6db765000, count: 4096 ) = 4096
        [acme@zoo ~]$
        [acme@zoo ~]$ trace --duration 1 sleep 1
          1002.148 (1001.218 ms): nanosleep(rqtp: 0x7fff46c79250                           ) = 0
        [acme@zoo ~]$
        [acme@zoo ~]$ trace -- usleep 1 | tail -5
             0.905 ( 0.002 ms): brk(                                                     ) = 0x1c82000
             0.910 ( 0.003 ms): brk(brk: 0x1ca3000                                       ) = 0x1ca3000
             0.913 ( 0.001 ms): brk(                                                     ) = 0x1ca3000
             0.990 ( 0.059 ms): nanosleep(rqtp: 0x7fffe31a3280                           ) = 0
             0.995 ( 0.000 ms): exit_group(
        [acme@zoo ~]$
      
      But can't do system wide tracing:
      
        [acme@zoo ~]$ trace
        Error:	Operation not permitted.
        Hint:	Check /proc/sys/kernel/perf_event_paranoid setting.
        Hint:	For system wide tracing it needs to be set to -1.
        Hint:	The current value is 1.
        [acme@zoo ~]$
      
        [acme@zoo ~]$ trace --cpu 0
        Error:	Operation not permitted.
        Hint:	Check /proc/sys/kernel/perf_event_paranoid setting.
        Hint:	For system wide tracing it needs to be set to -1.
        Hint:	The current value is 1.
        [acme@zoo ~]$
      
      If the paranoid level is >= 2, i.e. turn this perf stuff off for !root users:
      
        [acme@zoo ~]$ sudo sh -c 'echo 2 > /proc/sys/kernel/perf_event_paranoid'
        [acme@zoo ~]$ cat /proc/sys/kernel/perf_event_paranoid
        2
        [acme@zoo ~]$
        [acme@zoo ~]$ trace usleep 1
        Error:	Permission denied.
        Hint:	Check /proc/sys/kernel/perf_event_paranoid setting.
        Hint:	For your workloads it needs to be <= 1
        Hint:	For system wide tracing it needs to be set to -1.
        Hint:	The current value is 2.
        [acme@zoo ~]$
        [acme@zoo ~]$ trace
        Error:	Permission denied.
        Hint:	Check /proc/sys/kernel/perf_event_paranoid setting.
        Hint:	For your workloads it needs to be <= 1
        Hint:	For system wide tracing it needs to be set to -1.
        Hint:	The current value is 2.
        [acme@zoo ~]$
        [acme@zoo ~]$ trace --cpu 1
        Error:	Permission denied.
        Hint:	Check /proc/sys/kernel/perf_event_paranoid setting.
        Hint:	For your workloads it needs to be <= 1
        Hint:	For system wide tracing it needs to be set to -1.
        Hint:	The current value is 2.
        [acme@zoo ~]$
      
      If the user manages to get what he/she wants, convincing root not
      to be paranoid at all...
      
        [root@zoo ~]# echo -1 > /proc/sys/kernel/perf_event_paranoid
        [root@zoo ~]# cat /proc/sys/kernel/perf_event_paranoid
        -1
        [root@zoo ~]#
      
        [acme@zoo ~]$ ps -eo user,pid,comm | grep Xorg
        root       729 Xorg
        [acme@zoo ~]$
        [acme@zoo ~]$ trace -a --duration 0.001 -e \!select,ioctl,writev | grep Xorg  | head -5
            23.143 ( 0.003 ms): Xorg/729 setitimer(which: REAL, value: 0x7fffaadf16e0 ) = 0
            23.152 ( 0.004 ms): Xorg/729 read(fd: 31, buf: 0x2544af0, count: 4096     ) = 8
            23.161 ( 0.002 ms): Xorg/729 read(fd: 31, buf: 0x2544af0, count: 4096     ) = -1 EAGAIN Resource temporarily unavailable
            23.175 ( 0.002 ms): Xorg/729 setitimer(which: REAL, value: 0x7fffaadf16e0 ) = 0
            23.235 ( 0.002 ms): Xorg/729 setitimer(which: REAL, value: 0x7fffaadf16e0 ) = 0
        [acme@zoo ~]$
      
      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-di28olfwd28rvkox7v3hqhu1@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a8f23d8f
    • A
      perf evlist: Introduce perf_evlist__strerror_tp method · 6ef068cb
      Arnaldo Carvalho de Melo 提交于
      Out of 'perf trace', should be used by other tools that uses
      tracepoints.
      
      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: Ramkumar Ramachandra <artagnon@gmail.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-lyvtxhchz4ga8fwht15x8wou@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6ef068cb
  4. 11 10月, 2013 1 次提交
    • J
      perf evlist: Fix perf_evlist__mmap_read event overflow · a65cb4b9
      Jiri Olsa 提交于
      The perf_evlist__mmap_read used 'union perf_event' as a placeholder for
      event crossing the mmap boundary.
      
      This is ok for sample shorter than ~PATH_MAX. However we could grow up
      to the maximum sample size which is 16 bits max.
      
      I hit this overflow issue when using 'perf top -G dwarf' which produces
      sample with the size around 8192 bytes.  We could configure any valid
      sample size here using: '-G dwarf,size'.
      
      Using array with sample max size instead for the event placeholder. Also
      adding another safe check for the dynamic size of the user stack.
      
      TODO: The 'struct perf_mmap' is quite big now, maybe we could use some
      lazy allocation for event_copy size.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.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>
      Link: http://lkml.kernel.org/r/1380721599-24285-1-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a65cb4b9
  5. 09 10月, 2013 2 次提交
  6. 03 9月, 2013 1 次提交
  7. 30 8月, 2013 2 次提交
  8. 08 8月, 2013 2 次提交
  9. 16 3月, 2013 5 次提交
  10. 07 2月, 2013 1 次提交
    • D
      perf evlist: Make event_copy local to mmaps · 0479b8b9
      David Ahern 提交于
      I am getting segfaults *after* the time sorting of perf samples where
      the event type is off the charts:
      
      (gdb) bt
      \#0  0x0807b1b2 in hists__inc_nr_events (hists=0x80a99c4, type=1163281902) at util/hist.c:1225
      \#1  0x08070795 in perf_session_deliver_event (session=0x80a9b90, event=0xf7a6aff8, sample=0xffffc318, tool=0xffffc520,
          file_offset=0) at util/session.c:884
      \#2  0x0806f9b9 in flush_sample_queue (s=0x80a9b90, tool=0xffffc520) at util/session.c:555
      \#3  0x0806fc53 in process_finished_round (tool=0xffffc520, event=0x0, session=0x80a9b90) at util/session.c:645
      
      This is bizarre because the event has already been processed once --
      before it was added to the samples queue -- and the event was found to
      be sane at that time.
      
      There seem to be 2 causes:
      
      1. perf_evlist__mmap_read updates the read location even though there
      are outstanding references to events sitting in the mmap buffers via the
      ordered samples queue.
      
      2. There is a single evlist->event_copy for all evlist entries.
      event_copy is used to handle an event wrapping at the mmap buffer
      boundary.
      
      This patch addresses the second problem - making event_copy local to
      each perf_mmap. With this change my highly repeatable use case no longer
      fails.
      
      The first problem is much more complicated and will be the subject of a
      future patch.
      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/1360098762-61827-1-git-send-email-dsahern@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0479b8b9
  11. 01 2月, 2013 1 次提交
  12. 12 12月, 2012 1 次提交
  13. 03 10月, 2012 2 次提交
  14. 27 9月, 2012 2 次提交
  15. 26 9月, 2012 1 次提交
  16. 07 9月, 2012 1 次提交
  17. 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
  18. 02 8月, 2012 2 次提交
  19. 28 6月, 2012 1 次提交
    • A
      perf tools: Stop using a global trace events description list · da378962
      Arnaldo Carvalho de Melo 提交于
      The pevent thing is per perf.data file, so I made it stop being static
      and become a perf_session member, so tools processing perf.data files
      use perf_session and _there_ we read the trace events description into
      session->pevent and then change everywhere to stop using that single
      global pevent variable and use the per session one.
      
      Note that it _doesn't_ fall backs to trace__event_id, as we're not
      interested at all in what is present in the
      /sys/kernel/debug/tracing/events in the workstation doing the analysis,
      just in what is in the perf.data file.
      
      This patch also introduces perf_session__set_tracepoints_handlers that
      is the perf perf.data/session way to associate handlers to tracepoint
      events by resolving their IDs using the events descriptions stored in a
      perf.data file. Make 'perf sched' use it.
      Reported-by: NDmitry Antipov <dmitry.antipov@linaro.org>
      Tested-by: NDmitry Antipov <dmitry.antipov@linaro.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: linaro-dev@lists.linaro.org
      Cc: patches@linaro.org
      Link: http://lkml.kernel.org/r/20120625232016.GA28525@infradead.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      da378962
  20. 31 5月, 2012 1 次提交
    • A
      perf stat: Initialize default events wrt exclude_{guest,host} · 79695e1b
      Arnaldo Carvalho de Melo 提交于
      When no event is specified the tools use perf_evlist__add_default(), that will
      call event_attr_init to initialize the KVM exclusion bits.
      
      When the change was made to the tools so that by default guest samples would be
      excluded, the changes were made just to the parsing routines and to
      perf_evlist__add_default(), not to perf_evlist__add_attrs, that is used so far
      just by perf stat to add multiple events, according to the level of detail
      specified.
      
      Recently the tools were changed to reconstruct the event name from all the
      details in perf_event_attr, not just from .type and .config, but taking into
      account all the feature bits (.exclude_{guest,host,user,kernel,etc},
      .precise_ip, etc).
      
      That is when we noticed that the default for perf stat wasn't the one for the
      rest of the tools, i.e. the .exclude_guest bit wasn't being set.
      
      I.e. the default, that doesn't call event_attr_init was showing the :HG
      modifier:
      
        $ perf stat usleep 1
      
         Performance counter stats for 'usleep 1':
      
                  0.942119 task-clock                #    0.454 CPUs utilized
                         1 context-switches          #    0.001 M/sec
                         0 CPU-migrations            #    0.000 K/sec
                       126 page-faults               #    0.134 M/sec
                   693,193 cycles:HG                 #    0.736 GHz                     [40.11%]
                   407,461 stalled-cycles-frontend:HG #   58.78% frontend cycles idle    [72.29%]
                   365,403 stalled-cycles-backend:HG #   52.71% backend  cycles idle
                   465,982 instructions:HG           #    0.67  insns per cycle
                                                     #    0.87  stalled cycles per insn
                    89,760 branches:HG               #   95.275 M/sec
                     6,178 branch-misses:HG          #    6.88% of all branches
      
               0.002077228 seconds time elapsed
      
      While if one explicitely specifies the same events, which will make the parsing code
      to be called and thus event_attr_init is called:
      
        $ perf stat -e task-clock,context-switches,migrations,page-faults,cycles,stalled-cycles-frontend,stalled-cycles-backend,instructions,branches,branch-misses usleep 1
      
         Performance counter stats for 'usleep 1':
      
                  1.040349 task-clock                #    0.500 CPUs utilized
                         2 context-switches          #    0.002 M/sec
                         0 CPU-migrations            #    0.000 K/sec
                       127 page-faults               #    0.122 M/sec
                   587,966 cycles                    #    0.565 GHz                     [13.18%]
                   459,167 stalled-cycles-frontend   #   78.09% frontend cycles idle
                   390,249 stalled-cycles-backend    #   66.37% backend  cycles idle
                   504,006 instructions              #    0.86  insns per cycle
                                                     #    0.91  stalled cycles per insn
                    96,455 branches                  #   92.714 M/sec
                     6,522 branch-misses             #    6.76% of all branches         [96.12%]
      
               0.002078681 seconds time elapsed
      
      Fix it by introducing a perf_evlist__add_default_attrs method that will call
      evlist_attr_init in all the perf_event_attr entries before adding the events.
      Reported-by: NIngo Molnar <mingo@kernel.org>
      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-4eysr236r0pgiyum9epwxw7s@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      79695e1b
  21. 03 5月, 2012 1 次提交
  22. 14 2月, 2012 1 次提交
  23. 02 2月, 2012 1 次提交
  24. 25 1月, 2012 1 次提交
  25. 29 11月, 2011 2 次提交
    • A
      perf evlist: Always do automatic allocation of pollfd and mmap structures · 806fb630
      Arnaldo Carvalho de Melo 提交于
      At first tools were required to do that, but while writing the python
      bindings to simplify the API I made them auto-allocate when needed.
      
      This just makes record, stat and top use that auto allocation,
      simplifying them a bit.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.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-iokhcvkzzijr3keioubx8hlq@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      806fb630
    • A
      perf tools: Save some loops using perf_evlist__id2evsel · ee29be62
      Arnaldo Carvalho de Melo 提交于
      Since we already ask for PERF_SAMPLE_ID and use it to quickly find the
      associated evsel, add handler func + data to struct perf_evsel to avoid
      using chains of if(strcmp(event_name)) and also to avoid all the linear
      list searches via trace_event_find.
      
      To demonstrate the technique convert 'perf sched' to it:
      
       # perf sched record sleep 5m
      
      And then:
      
       Performance counter stats for '/tmp/oldperf sched lat':
      
              646.929438 task-clock                #    0.999 CPUs utilized
                       9 context-switches          #    0.000 M/sec
                       0 CPU-migrations            #    0.000 M/sec
                  20,901 page-faults               #    0.032 M/sec
           1,290,144,450 cycles                    #    1.994 GHz
         <not supported> stalled-cycles-frontend
         <not supported> stalled-cycles-backend
           1,606,158,439 instructions              #    1.24  insns per cycle
             339,088,395 branches                  #  524.151 M/sec
               4,550,735 branch-misses             #    1.34% of all branches
      
             0.647524759 seconds time elapsed
      
      Versus:
      
       Performance counter stats for 'perf sched lat':
      
              473.564691 task-clock                #    0.999 CPUs utilized
                       9 context-switches          #    0.000 M/sec
                       0 CPU-migrations            #    0.000 M/sec
                  20,903 page-faults               #    0.044 M/sec
             944,367,984 cycles                    #    1.994 GHz
         <not supported> stalled-cycles-frontend
         <not supported> stalled-cycles-backend
           1,442,385,571 instructions              #    1.53  insns per cycle
             308,383,106 branches                  #  651.195 M/sec
               4,481,784 branch-misses             #    1.45% of all branches
      
             0.474215751 seconds time elapsed
      
      [root@emilia ~]#
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.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-1kbzpl74lwi6lavpqke2u2p3@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ee29be62
  26. 28 11月, 2011 1 次提交