1. 27 6月, 2014 3 次提交
    • S
      perf trace: Add pagefaults record and replay support · 1e28fe0a
      Stanislav Fomichev 提交于
      Previous commit added live pagefault trace support, this one adds record
      and replay support.
      
      Example:
      
        [root@zoo /]# echo 1 > /proc/sys/vm/drop_caches ; trace -F all record -a sleep 10
        [ perf record: Woken up 0 times to write data ]
        [ perf record: Captured and wrote 1029.722 MB perf.data (~44989242 samples) ]
      
        [root@zoo /]# ls -la perf.data
        -rw-------. 1 root root 1083921722 Jun 26 17:44 perf.data
      
        [root@zoo /]# perf evlist
        raw_syscalls:sys_enter
        raw_syscalls:sys_exit
        major-faults
        minor-faults
      
        [root@zoo /]# trace -i perf.data | grep -v trace\/ | tail -15
           156.137 ( 0.000 ms): perl/18476 minfault [0xb4243] => 0x0 (?.)
           156.139 ( 0.000 ms): perl/18476 minfault [Perl_sv_clear+0x123] => 0x0 (?.)
           156.140 ( 0.000 ms): perl/18476 minfault [Perl_sv_clear+0xc4] => 0x0 (?.)
           156.144 ( 0.000 ms): perl/18476 minfault [_int_free+0xda] => 0x0 (?.)
           156.151 ( 0.000 ms): perl/18476 minfault [_int_free+0x1df] => 0x0 (?.)
           156.158 ( 0.000 ms): perl/18476 minfault [0xb4243] => 0x0 (?.)
           156.161 ( 0.000 ms): perl/18476 minfault [0xb4243] => 0x0 (?.)
           156.168 ( 0.000 ms): perl/18476 minfault [0xb4243] => 0x0 (?.)
           156.172 ( 0.000 ms): perl/18476 minfault [0xb4243] => 0x0 (?.)
           156.173 ( 0.000 ms): perl/18476 minfault [_int_free+0xda] => 0x0 (?.)
           156.183 ( 0.000 ms): perl/18476 minfault [Perl_hfree_next_entry+0xb4] => 0x0 (?.)
           156.197 ( 0.000 ms): perl/18476 minfault [_int_free+0x1df] => 0x0 (?.)
           156.216 ( 0.000 ms): perl/18476 minfault [Perl_sv_clear+0x123] => 0x0 (?.)
           156.221 ( 0.000 ms): perl/18476 minfault [Perl_sv_clear+0x123] => 0x0 (?.)
        [root@zoo /]#
      Signed-off-by: NStanislav Fomichev <stfomichev@yandex-team.ru>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1403799268-1367-4-git-send-email-stfomichev@yandex-team.ruSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1e28fe0a
    • S
      perf trace: Add support for pagefault tracing · 598d02c5
      Stanislav Fomichev 提交于
      This patch adds optional pagefault tracing support to 'perf trace'.
      
      Using -F/--pf option user can specify whether he wants minor, major or
      all pagefault events to be traced. This patch adds only live mode,
      record and replace will come in a separate patch.
      
      Example output:
      
        1756272.905 ( 0.000 ms): curl/5937 majfault [0x7fa7261978b6] => /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0@0x85288 (d.)
        1862866.036 ( 0.000 ms): wget/8460 majfault [__clear_user+0x3f] => 0x659cb4 (?k)
      Signed-off-by: NStanislav Fomichev <stfomichev@yandex-team.ru>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1403799268-1367-3-git-send-email-stfomichev@yandex-team.ruSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      598d02c5
    • S
      perf trace: Add perf_event parameter to tracepoint_handler · 0c82adcf
      Stanislav Fomichev 提交于
      It will be used by next pagefault tracing patches in the series.
      Signed-off-by: NStanislav Fomichev <stfomichev@yandex-team.ru>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1403799268-1367-2-git-send-email-stfomichev@yandex-team.ruSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0c82adcf
  2. 20 6月, 2014 3 次提交
    • A
      perf trace: Cache the is_exit syscall test · 5089f20e
      Arnaldo Carvalho de Melo 提交于
      No need to use two strcmp calls per syscall entry, do it just once, when
      reading the per syscall info.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-lymtxhz0mg3adyt5e2pssn8f@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5089f20e
    • A
      perf trace: Remove needless reassignments · 77413534
      Arnaldo Carvalho de Melo 提交于
      The thread->priv value is already obtained a few lines earlier from the
      thread__trace() call. Leftovers from before thread__trace().
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-96laa634vzfwlwxurevo40wp@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      77413534
    • A
      perf trace: Fix up fd -> pathname resolution · cdcd1e6b
      Arnaldo Carvalho de Melo 提交于
      There was a brown paper bag bug in the patch that introduced a reference
      implementation on using 'perf probe' made wannabe tracepoints that broke fd ->
      pathname resolution, fix it:
      
        [root@zoo ~]# perf probe 'vfs_getname=getname_flags:65 pathname=result->name:string'
        Added new event:
          probe:vfs_getname    (on getname_flags:65 with pathname=result->name:string)
      
        You can now use it in all perf tools, such as:
      
      	perf record -e probe:vfs_getname -aR sleep 1
      
        [root@zoo ~]
      
      Before:
      
        [acme@zoo linux]$ trace touch -e open,fstat /tmp/b
           1.159 ( 0.007 ms): open(filename: 0x7fd73f2fe088, flags: CLOEXEC                         ) = 3
           1.163 ( 0.002 ms): fstat(fd: 3, statbuf: 0x7fff1b25e610                                  ) = 0
           1.192 ( 0.009 ms): open(filename: 0x7fd73f4fedb8, flags: CLOEXEC                         ) = 3
           1.201 ( 0.002 ms): fstat(fd: 3, statbuf: 0x7fff1b25e660                                  ) = 0
           1.501 ( 0.013 ms): open(filename: 0x7fd73f0a1610, flags: CLOEXEC                         ) = 3
           1.505 ( 0.002 ms): fstat(fd: 3, statbuf: 0x7fd73f2ddb60                                  ) = 0
           1.581 ( 0.011 ms): open(filename: 0x7fff1b2603da, flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: 438) = 3
        [acme@zoo linux]$
      
      After:
      
        [acme@zoo linux]$ trace touch -e open,fstat,dup2,mmap,close /tmp/b
           1.105 ( 0.004 ms): mmap(len: 4096, prot: READ|WRITE, flags: PRIVATE|ANONYMOUS, fd: -1    ) = 0x2fbf000
           1.136 ( 0.008 ms): open(filename: 0x7f8902dbc088, flags: CLOEXEC                         ) = 3
           1.140 ( 0.002 ms): fstat(fd: 3</etc/ld.so.cache>, statbuf: 0x7fff19889ef0                ) = 0
           1.146 ( 0.004 ms): mmap(len: 86079, prot: READ, flags: PRIVATE, fd: 3</etc/ld.so.cache>  ) = 0x2fa9000
           1.149 ( 0.001 ms): close(fd: 3</etc/ld.so.cache>                                         ) = 0
           1.170 ( 0.010 ms): open(filename: 0x7f8902fbcdb8, flags: CLOEXEC                         ) = 3
           1.178 ( 0.002 ms): fstat(fd: 3</lib64/libc.so.6>, statbuf: 0x7fff19889f40                ) = 0
           1.188 ( 0.006 ms): mmap(len: 3924576, prot: EXEC|READ, flags: PRIVATE|DENYWRITE, fd: 3</lib64/libc.so.6>) = 0x29e2000
           1.207 ( 0.007 ms): mmap(addr: 0x7f8902d96000, len: 24576, prot: READ|WRITE, flags: PRIVATE|DENYWRITE|FIXED, fd: 3</lib64/libc.so.6>, off: 1785856) = 0x2d96000
           1.217 ( 0.004 ms): mmap(addr: 0x7f8902d9c000, len: 16992, prot: READ|WRITE, flags: PRIVATE|ANONYMOUS|FIXED, fd: -1) = 0x2d9c000
           1.228 ( 0.002 ms): close(fd: 3</lib64/libc.so.6>                                         ) = 0
           1.243 ( 0.003 ms): mmap(len: 4096, prot: READ|WRITE, flags: PRIVATE|ANONYMOUS, fd: -1    ) = 0x2fa8000
           1.250 ( 0.003 ms): mmap(len: 8192, prot: READ|WRITE, flags: PRIVATE|ANONYMOUS, fd: -1    ) = 0x2fa6000
           1.452 ( 0.010 ms): open(filename: 0x7f8902b5f610, flags: CLOEXEC                         ) = 3
           1.455 ( 0.002 ms): fstat(fd: 3</usr/lib/locale/locale-archive>, statbuf: 0x7f8902d9bb60  ) = 0
           1.461 ( 0.004 ms): mmap(len: 106070960, prot: READ, flags: PRIVATE, fd: 3</usr/lib/locale/locale-archive>) = 0xfc4b9000
           1.469 ( 0.002 ms): close(fd: 3</usr/lib/locale/locale-archive>                           ) = 0
           1.528 ( 0.010 ms): open(filename: 0x7fff1988c3da, flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: 438) = 3
           1.532 ( 0.002 ms): dup2(oldfd: 3</tmp/b>                                                 ) = 0
           1.535 ( 0.001 ms): close(fd: 3</tmp/b>                                                   ) = 0
           1.544 ( 0.001 ms): close(                                                                ) = 0
           1.555 ( 0.001 ms): close(fd: 1                                                           ) = 0
           1.558 ( 0.001 ms): close(fd: 2                                                           ) = 0
        [acme@zoo linux]$
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-vcm22xpjxc3j4hbyuzjzf7ik@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cdcd1e6b
  3. 10 3月, 2014 1 次提交
  4. 14 2月, 2014 1 次提交
  5. 10 2月, 2014 1 次提交
  6. 15 1月, 2014 1 次提交
  7. 13 1月, 2014 5 次提交
  8. 28 12月, 2013 1 次提交
  9. 20 12月, 2013 1 次提交
  10. 05 12月, 2013 3 次提交
  11. 03 12月, 2013 1 次提交
  12. 28 11月, 2013 1 次提交
  13. 15 11月, 2013 1 次提交
  14. 13 11月, 2013 7 次提交
  15. 12 11月, 2013 4 次提交
  16. 07 11月, 2013 2 次提交
    • A
      perf trace: Don't relookup fields by name in each sample · 77170988
      Arnaldo Carvalho de Melo 提交于
      Instead do the lookups just when creating the tracepoints, initially for
      the most common, raw_syscalls:sys_{enter,exit}.
      
      It works by having evsel->priv have a per tracepoint structure with
      entries for the fields, for direct access, with the offset and a
      function to get the value from the sample, doing the swap if needed.
      
      Using a simple workload that does M millions write syscalls, we go from:
      
       # perf stat -i -e cycles /tmp/oldperf trace ./sc_hello 100 > /dev/null
      
       Performance counter stats for '/tmp/oldperf trace ./sc_hello 100':
      
           8,366,771,459 cycles
      
             2.668025928 seconds time elapsed
      
       # perf stat -i -e cycles perf trace ./sc_hello 100 > /dev/null
      
       Performance counter stats for 'perf trace ./sc_hello 100':
      
           8,345,187,650 cycles
      
             2.631748425 seconds time elapsed
      
      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-eyfhvoo510a5i10b27dnvm88@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      77170988
    • A
      perf evsel: Ditch evsel->handler.data field · 744a9719
      Arnaldo Carvalho de Melo 提交于
      Not needed since this cset:
      
        fcf65bf1: perf evsel: Cache associated event_format
      
      So lets trim this struct a bit.
      
      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-j8setslokt0goiwxq9dogzqm@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      744a9719
  17. 04 11月, 2013 2 次提交
  18. 29 10月, 2013 1 次提交
  19. 22 10月, 2013 1 次提交