1. 31 Oct, 2012 1 commit
  2. 30 Oct, 2012 2 commits
    • Peter Huewe's avatar
      perf/x86: Fix sparse warnings · 95d18aa2
      Peter Huewe authored
      FYI, there are new sparse warnings:
      
       arch/x86/kernel/cpu/perf_event.c:1356:18: sparse: symbol 'events_attr' was not declared. Should it be static?
      
      This patch makes it static and also adds the static keyword to
      fix arch/x86/kernel/cpu/perf_event.c:1344:9: warning: symbol
      'events_sysfs_show' was not declared.
      Signed-off-by: default avatarPeter Huewe <peterhuewe@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>
      Cc: fengguang.wu@intel.com
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/n/tip-lerdpXlnruh0yvWs2owwuizl@git.kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      95d18aa2
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 8748dd9b
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements, fixes and code move from Arnaldo Carvalho de Melo:
      
       * Initialize 'page_size' variable in the python binding, this was sent
         for perf/urgent by mistake, then when merging Ingo removed it, fixing
         the problem for perf/urgent, but when perf/urgent was merged with
         perf/core, where that initialization is needed, made the python
         binding mmap call to fail, fix it by initializing page_size again.
      
       * Add a browser for 'perf script' and make it available from the report
         and annotate browsers. It does filtering to find the scripts that
         handle events found in the perf.data file used. From Feng Tang
      
       * Move some functions from symbol.c to more appropriate files, creating
         dso.[ch] in the process, no code changes. From Jiri Olsa
      
       * Fix mmap error output message for when perf_mmap fails and returns
         !-EPERM, where the default for mmap_pages, INT_MAX, was causing a
         !power of 2 error message, fix from Jiri Olsa.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      8748dd9b
  3. 29 Oct, 2012 13 commits
  4. 28 Oct, 2012 1 commit
  5. 26 Oct, 2012 11 commits
  6. 25 Oct, 2012 4 commits
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Use sched:sched_stat_runtime to provide a thread summary · 1302d88e
      Arnaldo Carvalho de Melo authored
      [root@sandy ~]# perf trace --sched --duration 0.100 --pid `pidof firefox`
      <SNIP>
       17079.847 ( 0.009 ms): 17643 poll(ufds: 140037623086496, nfds: 11, timeout_msecs: 0) = 0 Timeout
       17079.892 ( 0.010 ms): 17643 read(fd: 4, buf: 140038178943092, count: 4096         ) = -1 EAGAIN Resource temporarily unavailable
       17079.921 ( 0.013 ms): 17643 poll(ufds: 140037623086496, nfds: 11, timeout_msecs: 0) = 0 Timeout
       17079.949 ( 0.009 ms): 17643 read(fd: 4, buf: 140038178943092, count: 4096         ) = -1 EAGAIN Resource temporarily unavailable
      ^C
       _____________________________________________________________________
       __)    Summary of events    (__
      
                    [ task - pid ]     [ events ] [ ratio ]  [ runtime ]
       _____________________________________________________________________
      
                   firefox - 17643 :      18013   [ 72.2% ]    359.110 ms
                   firefox - 17663 :         41   [  0.2% ]     21.439 ms
                   firefox - 17664 :       6840   [ 27.4% ]    133.642 ms
                   firefox - 17667 :         46   [  0.2% ]      0.682 ms
      [root@sandy ~]#
      
      This is equivalent to the 'perf trace summary' subcomand in the tmp.perf/trace2
      branch.
      
      Another example, setting a huge duration filter to get just a system
      wide summary:
      
      [root@sandy ~]# perf trace --duration 10000.0 --sched
      ^C
       _____________________________________________________________________
       __)    Summary of events    (__
      
                    [ task - pid ]     [ events ] [ ratio ]  [ runtime ]
       _____________________________________________________________________
      
                 scsi_eh_1 - 258   :         15   [  0.0% ]      0.133 ms
              kworker/0:1H - 322   :         13   [  0.0% ]      0.032 ms
               jbd2/dm-0-8 - 384   :          4   [  0.0% ]      0.115 ms
               flush-253:0 - 470   :          1   [  0.0% ]      0.027 ms
                   firefox - 950   :       4783   [  0.1% ]     24.863 ms
                   firefox - 992   :       1883   [  0.1% ]      6.808 ms
                   firefox - 995   :         35   [  0.0% ]      0.111 ms
               ksoftirqd/6 - 4362  :          2   [  0.0% ]      0.005 ms
               ksoftirqd/7 - 4365  :          1   [  0.0% ]      0.007 ms
                      Xorg - 4671  :        148   [  0.0% ]      0.912 ms
           gnome-settings- - 4846  :         14   [  0.0% ]      0.086 ms
           seahorse-daemon - 4847  :         14   [  0.0% ]      0.092 ms
               gnome-panel - 4875  :         46   [  0.0% ]      0.159 ms
           gnome-power-man - 4918  :         16   [  0.0% ]      0.065 ms
           gvfs-afc-volume - 4992  :         77   [  0.0% ]      0.136 ms
           gnome-screensav - 5114  :         24   [  0.0% ]      0.128 ms
                     xchat - 8082  :        466   [  0.0% ]      2.019 ms
                  synergyc - 8369  :        941   [  0.0% ]      3.291 ms
                  synergyc - 8371  :         85   [  0.0% ]      1.817 ms
               jbd2/dm-4-8 - 9352  :          4   [  0.0% ]      0.109 ms
                   rpcbind - 9786  :          3   [  0.0% ]      0.017 ms
              rtkit-daemon - 12802 :         10   [  0.0% ]      0.038 ms
              rtkit-daemon - 12803 :          8   [  0.0% ]      0.000 ms
             udisks-daemon - 13020 :         27   [  0.0% ]      0.240 ms
               kworker/7:0 - 14651 :        669   [  0.0% ]      2.616 ms
               kworker/5:1 - 16220 :          2   [  0.0% ]      0.069 ms
               kworker/4:0 - 19776 :         13   [  0.0% ]      0.176 ms
                   openvpn - 20131 :        133   [  0.0% ]      0.762 ms
           plugin-containe - 20508 :      60658   [  1.7% ]    131.153 ms
              npviewer.bin - 20520 :      72208   [  2.0% ]    138.945 ms
              npviewer.bin - 20542 :         35   [  0.0% ]      0.074 ms
              npviewer.bin - 20543 :         30   [  0.0% ]      0.074 ms
              npviewer.bin - 20547 :         35   [  0.0% ]      0.092 ms
              npviewer.bin - 20552 :         35   [  0.0% ]      0.093 ms
                      sshd - 20645 :         32   [  0.0% ]      0.071 ms
              npviewer.bin - 21053 :         35   [  0.0% ]      0.074 ms
              npviewer.bin - 21054 :         35   [  0.0% ]      0.097 ms
               kworker/0:2 - 21169 :        149   [  0.0% ]      1.143 ms
               kworker/3:0 - 22171 :        113   [  0.0% ]     96.892 ms
               flush-253:4 - 22410 :          1   [  0.0% ]      0.028 ms
               kworker/6:0 - 24581 :         25   [  0.0% ]      0.275 ms
               kworker/1:0 - 25572 :          4   [  0.0% ]      0.103 ms
               kworker/2:1 - 26299 :        138   [  0.0% ]      1.440 ms
               kworker/0:0 - 26325 :          1   [  0.0% ]      0.003 ms
                      perf - 26330 :    3506967   [ 96.1% ]   6648.310 ms
      [root@sandy ~]#
      
      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: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/n/tip-mzuli0srnxyi1o029py6537x@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1302d88e
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Count number of events for each thread and globally · efd5745e
      Arnaldo Carvalho de Melo authored
      The nr_events in trace__run was local, but we will need it in other
      trace methods, move it to struct trace.
      
      We'll also need the number of events per thread, so introduce a
      nr_events method for that in struct thread_trace.
      
      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-ksutaz0mtejnf7e6az3ca1td@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      efd5745e
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Don't stop synthesizing threads when one vanishes · ba361c92
      Arnaldo Carvalho de Melo authored
      The perf_event__synthesize_threads routine synthesizes all the existing
      threads in the system, because we don't have any kernel facilities to
      ask for PERF_RECORD_{FORK,MMAP,COMM} for existing threads.
      
      It was returning an error as soon as one thread couldn't be synthesized,
      which is a bit extreme when, for instance, a forkish workload is
      running, like a kernel compile.
      
      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-i7oas1eodpoer2bx38fwyasv@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ba361c92
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 6ca2a9c6
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
       * Align the 'Ok'/'FAILED!' test results in 'perf test.
      
       * Support interrupted syscalls in 'trace'
      
       * Add an event duration column and filter in 'trace'.
      
       * There are references to the man pages in some tools, so try to build
         Documentation when installing, warning the user if that is not possible,
         from Borislav Petkov.
      
       * Give user better message if precise is not supported, from David Ahern.
      
       * Try to find cross-built objdump path by using the session environment
         information in the perf.data file header, from Irina Tirdea, original
         patch and idea by Namhyung Kim.
      
       * Diplays more output on features check for make V=1, so that one can figure
         out what is happening by looking at gcc output, etc. From Jiri Olsa.
      
       * Account the nr_entries in rblist properly, fix by Suzuki K. Poulose.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6ca2a9c6
  7. 24 Oct, 2012 8 commits
    • Borislav Petkov's avatar
      perf tools: Try to build Documentation when installing · af3df2cf
      Borislav Petkov authored
      There's a portion in the "perf list" output refering to the exact
      specification of raw hardware events.
      
      Since this description is in the perf-list manpage, try to build and
      install the man pages, warning the user when that is not possible
      due to missing packages (xmlto and asciidoc).
      Signed-off-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/n/tip-ij71ysszkdvz3fy3wr331bke@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      af3df2cf
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Print the name of a syscall when failing to read its info · 814d7a4d
      Arnaldo Carvalho de Melo authored
      When failing to read the tracepoint event format, like currently with
      sys_execve, that is not defined via SYSCALL_DEFINE macros and thus
      doesn't have an entry in:
      
        $ ls -d /sys/kernel/debug/tracing/events/syscalls/sys_enter_*exec*
        /sys/kernel/debug/tracing/events/syscalls/sys_enter_kexec_load
        $
      
      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>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      echo Link: http://lkml.kernel.org/n/tip-`ranpwd -l 24`@git.kernel.org
      Link: http://lkml.kernel.org/n/tip-q3ak0j8b81yxylykq5wp2uwi@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      814d7a4d
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Pretty print errno for some more functions · 8b745263
      Arnaldo Carvalho de Melo authored
      This time: access, open and socket.
      
      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-e19dmpz8zxqo2uebxnp7ilkf@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8b745263
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Add duration filter · ae9ed035
      Arnaldo Carvalho de Melo authored
      Example:
      
      [acme@sandy linux]$ perf trace --duration 0.025 usleep 1
           2.221 ( 0.958 ms): 6724 execve(arg0: 140733557168278, arg1: 140733557178768, arg2: 16134304, arg3: 140733557167840, arg4: 7955998171588342573, arg5: 6723) = -2
           3.690 ( 1.443 ms): 6724 execve(arg0: 140733557168295, arg1: 140733557178768, arg2: 16134304, arg3: 140733557167840, arg4: 7955998171588342573, arg5: 6723) = 0
           3.979 ( 0.048 ms): 6724 open(filename: 208733843841, flags: 0, mode: 1                        ) = 3
           4.071 ( 0.075 ms): 6724 open(filename: 139744419925673, flags: 0, mode: 0                     ) = 3
           4.318 ( 0.056 ms): 6724 nanosleep(rqtp: 140734030404608, rmtp: 0                              ) = 0
      [acme@sandy linux]$ perf trace --duration 0.100 usleep 1
           1.143 ( 1.021 ms): 6726 execve(arg0: 140736323962279, arg1: 140736323972752, arg2: 34926752, arg3: 140736323961824, arg4: 7955998171588342573, arg5: 6725) = 0
      [acme@sandy linux]$
      
      Cherry picked from tmp.perf/trace2 branch.
      
      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: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/n/tip-oslw2j2958we9qf0ctra4whd@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ae9ed035
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Add an event duration column · 60c907ab
      Arnaldo Carvalho de Melo authored
       # perf trace usleep 1 | tail -10
           0.453 ( 0.002 ms): mmap(addr: 0, len: 4096, prot: 3, flags: 34, fd: 4294967295, off: 0   ) = -763342848
           0.456 ( 0.001 ms): mmap(addr: 0, len: 4096, prot: 3, flags: 34, fd: 4294967295, off: 0   ) = -763346944
           0.459 ( 0.001 ms): arch_prctl(option: 4098, arg2: 140126839658240, arg3: 140126839652352, arg4: 34, arg5: 4294967295) = 0
           0.473 ( 0.003 ms): mprotect(start: 208741634048, len: 16384, prot: 1                     ) = 0
           0.477 ( 0.003 ms): mprotect(start: 208735956992, len: 4096, prot: 1                      ) = 0
           0.483 ( 0.004 ms): munmap(addr: 140126839664640, len: 91882                              ) = 0
           0.540 ( 0.001 ms): brk(brk: 0                                                            ) = 31928320
           0.542 ( 0.002 ms): brk(brk: 32063488                                                     ) = 32063488
           1.456 ( 0.901 ms): nanosleep(rqtp: 140735472817168, rmtp: 0                              ) = 0
           1.462 ( 0.000 ms): exit_group(error_code: 0
       #
      
      This also comes from the tmp.perf/trace2 branch.
      
      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: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/n/tip-g9akh5hjw2kvjerpo9xror6f@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      60c907ab
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Support interrupted syscalls · 752fde44
      Arnaldo Carvalho de Melo authored
      Using the same strategies as in the tmp.perf/trace2, i.e. the 'trace'
      tool implemented by tglx, just updated to the current codebase.
      
      Example:
      
      [root@sandy linux]# perf trace usleep 1  | tail
           2.003: mmap(addr: 0, len: 4096, prot: 3, flags: 34, fd: 4294967295, off: 0   ) = -2128396288
           2.017: mmap(addr: 0, len: 4096, prot: 3, flags: 34, fd: 4294967295, off: 0   ) = -2128400384
           2.029: arch_prctl(option: 4098, arg2: 140146949441280, arg3: 140146949435392, arg4: 34, arg5: 4294967295) = 0
           2.084: mprotect(start: 208741634048, len: 16384, prot: 1                     ) = 0
           2.098: mprotect(start: 208735956992, len: 4096, prot: 1                      ) = 0
           2.122: munmap(addr: 140146949447680, len: 91882                              ) = 0
           2.359: brk(brk: 0                                                            ) = 28987392
           2.371: brk(brk: 29122560                                                     ) = 29122560
           2.490: nanosleep(rqtp: 140735694241504, rmtp: 0                              ) = 0
           2.507: exit_group(error_code: 0
      [root@sandy linux]#
      
      For now the timestamp and duration are always on, will be selectable.
      
      Also if multiple threads are being monitored, its tid will appear.
      
      The ret output continues to be interpreted a la strace.
      
      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-ly9ulroru4my5isn0xe9gr0m@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      752fde44
    • Arnaldo Carvalho de Melo's avatar
      perf test: Align the 'Ok'/'FAILED!' test results · 9a8e85ad
      Arnaldo Carvalho de Melo authored
      And also print 'FAILED!' in red.
      Suggested-by: default avatarIngo 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-rkisq85w24il3e2yl3nzumhu@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9a8e85ad
    • David Ahern's avatar
      perf tools: Give user better message if precise is not supported · 2305c82f
      David Ahern authored
      Platforms (e.g., VM's) without support for precise mode get a confusing
      error message. e.g.,
      $ perf record -e cycles:p -a -- sleep 1
      
        Error: sys_perf_event_open() syscall returned with 95 (Operation not
        supported).  /bin/dmesg may provide additional information.
      
        No hardware sampling interrupt available. No APIC? If so then you can
        boot the kernel with the "lapic" boot parameter to force-enable it.
        sleep: Terminated
      
      which is not clear that precise mode might be the root problem. With this
      patch:
      
      $ perf record -e cycles:p -fo /tmp/perf.data -- sleep 1
        Error:
        'precise' request may not be supported. Try removing 'p' modifier
        sleep: Terminated
      
      v2: softened message to 'may not be' supported per Robert's suggestion
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <robert.richter@amd.com>
      Link: http://lkml.kernel.org/r/1347569955-54626-4-git-send-email-dsahern@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2305c82f