1. 06 Aug, 2015 8 commits
    • Jiri Olsa's avatar
      perf stat: Move 'scale' into struct perf_stat_config · 711a572e
      Jiri Olsa authored
      Moving 'scale' into struct perf_stat_config. The point is to centralize
      the base stat config so it could be used localy together with other stat
      routines in other parts of perf code.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1437481927-29538-4-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      711a572e
    • Jiri Olsa's avatar
      perf stat: Introduce struct perf_stat_config · 421a50f3
      Jiri Olsa authored
      Moving 'aggr_mode' into new struct. The point is to centralize the base
      stat config so it could be used localy together with other stat routines
      in other parts of perf code.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1437481927-29538-3-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      421a50f3
    • Wang Nan's avatar
      perf tools: Add missing forward declaration of struct map to probe-event.h · 5a023b57
      Wang Nan authored
      Commit 7b6ff0bd ("perf probe ppc64le:
      Fixup function entry if using kallsyms lookup") adds 'struct map' into
      probe-event.h but not forward declares it. This patch fixes it.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Fixes: 7b6ff0bd ("perf probe ppc64le: Fixup function entry if using kallsyms lookup")
      Link: http://lkml.kernel.org/n/1436445342-1402-30-git-send-email-wangnan0@huawei.com
      [ No need to include map.h, just forward declare 'struct map' ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5a023b57
    • Wang Nan's avatar
      perf tools: Introduce veprintf · 0af0885e
      Wang Nan authored
      va_args alternative to eprintf().
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/n/1436445342-1402-19-git-send-email-wangnan0@huawei.com
      [ split from another patch ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0af0885e
    • Wang Nan's avatar
      tracing, perf: Implement BPF programs attached to uprobes · 04a22fae
      Wang Nan authored
      By copying BPF related operation to uprobe processing path, this patch
      allow users attach BPF programs to uprobes like what they are already
      doing on kprobes.
      
      After this patch, users are allowed to use PERF_EVENT_IOC_SET_BPF on a
      uprobe perf event. Which make it possible to profile user space programs
      and kernel events together using BPF.
      
      Because of this patch, CONFIG_BPF_EVENTS should be selected by
      CONFIG_UPROBE_EVENT to ensure trace_call_bpf() is compiled even if
      KPROBE_EVENT is not set.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1435716878-189507-3-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      04a22fae
    • Wang Nan's avatar
      bpf: Use correct #ifdef controller for trace_call_bpf() · 098d2164
      Wang Nan authored
      Commit e1abf2cc ("bpf: Fix the build on
      BPF_SYSCALL=y && !CONFIG_TRACING kernels, make it more configurable")
      updated the building condition of bpf_trace.o from CONFIG_BPF_SYSCALL
      to CONFIG_BPF_EVENTS, but the corresponding #ifdef controller in
      trace_events.h for trace_call_bpf() was not changed. Which, in theory,
      is incorrect.
      
      With current Kconfigs, we can create a .config with CONFIG_BPF_SYSCALL=y
      and CONFIG_BPF_EVENTS=n by unselecting CONFIG_KPROBE_EVENT and
      selecting CONFIG_BPF_SYSCALL. With these options, trace_call_bpf() will
      be defined as an extern function, but if anyone calls it a symbol missing
      error will be triggered since bpf_trace.o was not built.
      
      This patch changes the #ifdef controller for trace_call_bpf() from
      CONFIG_BPF_SYSCALL to CONFIG_BPF_EVENTS. I'll show its correctness:
      
      Before this patch:
      
         BPF_SYSCALL   BPF_EVENTS   trace_call_bpf   bpf_trace.o
         y             y           normal           compiled
         n             n           inline           not compiled
         y             n           normal           not compiled (incorrect)
         n             y          impossible (BPF_EVENTS depends on BPF_SYSCALL)
      
      After this patch:
      
         BPF_SYSCALL   BPF_EVENTS   trace_call_bpf   bpf_trace.o
         y             y           normal           compiled
         n             n           inline           not compiled
         y             n           inline           not compiled (fixed)
         n             y          impossible (BPF_EVENTS depends on BPF_SYSCALL)
      
      So this patch doesn't break anything. QED.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1435716878-189507-2-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      098d2164
    • Milian Wolff's avatar
      perf trace: Add total time column to summary. · 834fd46d
      Milian Wolff authored
      It is cumbersome to manually calculate the total time spent in a given
      syscall by multiplying the average value with the number of calls.
      
      Instead, we now do this directly inside perf trace.
      
      Note that this is also done by 'strace', which even adds a column with
      relative numbers - something we could do in the future.
      
      Example:
      
        perf trace -s find /some/folder > /dev/null
      
         Summary of events:
      
         find (19976), 700123 events, 100.0%, 0.000 msec
      
           syscall            calls    total       min       avg       max      stddev
                                       (msec)    (msec)    (msec)    (msec)        (%)
           --------------- -------- --------- --------- --------- ---------     ------
           read                   4     0.006     0.001     0.002     0.003     27.42%
           write               8046     9.617     0.001     0.001     0.035      0.56%
           open               34196    40.384     0.001     0.001     0.071      0.30%
           close              68375    57.104     0.001     0.001     0.076      0.25%
           stat                   4     0.004     0.001     0.001     0.001      3.14%
           fstat              34189    27.518     0.001     0.001     0.060      0.34%
           mmap                  13     0.029     0.001     0.002     0.003     10.74%
           mprotect               6     0.018     0.002     0.003     0.005     17.04%
           munmap                 3     0.014     0.003     0.005     0.006     24.87%
           brk                   87     0.490     0.001     0.006     0.016      6.50%
           ioctl                  3     0.004     0.001     0.001     0.003     36.39%
           access                 1     0.004     0.004     0.004     0.004      0.00%
           uname                  1     0.001     0.001     0.001     0.001      0.00%
           getdents           68393   143.600     0.001     0.002     0.187      0.95%
           fchdir             68371    56.980     0.001     0.001     0.111      0.39%
           arch_prctl             1     0.001     0.001     0.001     0.001      0.00%
           openat             34184    41.737     0.001     0.001     0.102      0.41%
           newfstatat         34184    41.180     0.001     0.001     0.064      0.34%
      Signed-off-by: default avatarMilian Wolff <milian.wolff@kdab.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      LPU-Reference: 1438853069-5902-1-git-send-email-milian.wolff@kdab.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      834fd46d
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · b6b6c18f
      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:
      
      New features:
      
        - Deref sys_enter pointer args with contents from probe:vfs_getname, showing
          pathnames instead of pointers in many syscalls in 'perf trace'. (Arnaldo Carvalho de Melo)
      
        - Make 'perf trace' write to stderr by default, just like 'strace'. (Milian Woff)
      
      Infrastructure changes:
      
        - color_vfprintf() fixes. (Andi Kleen, Jiri Olsa)
      
        - Allow enabling/disabling PERF_SAMPLE_TIME per event. (Kan Liang)
      
        - Fix build errors with mipsel-linux-uclibc compiler. (Petri Gynther)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      b6b6c18f
  2. 05 Aug, 2015 11 commits
  3. 04 Aug, 2015 21 commits