1. 06 Aug, 2015 3 commits
    • 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 26 commits