1. 01 8月, 2017 3 次提交
    • A
      tools headers: Fixup tools/include/uapi/linux/bpf.h copy of kernel ABI header · f1d6cb2d
      Arnaldo Carvalho de Melo 提交于
      In 04df41e3 ("bpf: update tools/include/uapi/linux/bpf.h") the files
      added in 40304b2a ("bpf: BPF support for sock_ops") were added to
      tools/include, but not in a verbatim way, missing the comments, which
      ends up triggering this warning when build tools/perf/:
      
        make: Entering directory '/home/acme/git/linux/tools/perf'
          BUILD:   Doing 'make -j4' parallel build
        Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'
      
      Make sure the the lines are equal, to fix the simple header copy
      drift detector in tools/perf/.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Lawrence Brakmo <brakmo@fb.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 04df41e3 ("bpf: update tools/include/uapi/linux/bpf.h")
      Link: http://lkml.kernel.org/n/tip-z9qyyqht9qq3yyxu76sfy0dh@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f1d6cb2d
    • A
      tools perf: Do not check spaces/blank lines when checking header file copy drift · 470de0f3
      Arnaldo Carvalho de Melo 提交于
      We copy headers from include/, arch/ to allow tools/ use defines,
      structs from newer kernels and still be able to build on older systems.
      
      We then, as part of a build, check if those copies got out of sync, when
      we emit a warning, so that we can check if something needs to be
      reflected on the tools, e.g. a 'perf trace' syscall argument beautifier
      needs tweaking.
      
      But we don't have to be super strict with that, for instance, extra
      spaces, tabs or blank lines aren't problematic, so change
      check-headers.sh to have "--ignore-blank-lines --ignore-space-change" as
      default "diff" arguments.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-d8emqpdc3m2qtzt1ei8ra2tf@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      470de0f3
    • A
      tools include uapi: Grab a copy of asm-generic/ioctls.h · 6375f0ab
      Arnaldo Carvalho de Melo 提交于
      So that we can build on older systems where otherwise we would end up
      with:
      
          CC       /tmp/build/perf/trace/beauty/ioctl.o
        trace/beauty/ioctl.c: In function 'ioctl__scnprintf_tty_cmd':
        trace/beauty/ioctl.c:25:17: error: 'TIOCGEXCL' undeclared (first use in this function)
        trace/beauty/ioctl.c:25:17: note: each undeclared identifier is reported only once for each function it appears in
        trace/beauty/ioctl.c:25:2: error: array index in initializer not of integer type
        trace/beauty/ioctl.c:25:2: error: (near initialization for 'ioctl_tty_cmd')
      
      This way we can build a tool on an older system and it will still be
      capable of processing perf.data files generated on newer systems.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-8qvkv6txwuzua6d0yvt65wl3@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6375f0ab
  2. 31 7月, 2017 4 次提交
    • A
      tools headers: Fixup tools/include/uapi/linux/bpf.h copy of kernel ABI header · d62c1d72
      Arnaldo Carvalho de Melo 提交于
      In 2be7e212 ("bpf: add bpf_skb_adjust_room helper") BPF_ADJ_ROOM_NET was
      added to include/uapi/linux/bpf.h but BPF_ADJ_ROOM_NET_OPS was added to
      tools/include/uapi/linux/bpf.h, making these files differ, fix it by using the
      same name in both, BPF_ADJ_ROOM_NET, the one in the kernel headers copy.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 2be7e212 ("bpf: add bpf_skb_adjust_room helper")
      Link: http://lkml.kernel.org/n/tip-2bmwovi9lymplyz6wsszppyf@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d62c1d72
    • I
      tools headers: Sync kernel ABI headers with tooling headers · a40f6177
      Ingo Molnar 提交于
      Sync up (copy) the following v4.13 kernel headers to the tooling headers:
      
        arch/arm/include/uapi/asm/kvm.h:
        arch/arm64/include/uapi/asm/kvm.h:
        arch/powerpc/include/uapi/asm/kvm.h:
        arch/s390/include/uapi/asm/kvm.h:
      
         - KVM ABI extensions, which do not affect perf tooling
      
        arch/x86/include/asm/cpufeatures.h:
        arch/x86/include/asm/disabled-features.h:
      
         - New PCID CPU feature on Intel CPUs - does not affect tooling.
      
      I.e. no real changes were needed to resolve the build warnings, just a plain copy
      of the latest kernel header version.
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
      Cc: Geneviève Bastien <gbastien@versatic.net>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Julien Desfossez <jdesfossez@efficios.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Simon Que <sque@chromium.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20170730095232.4j4xigsoqwufl5hu@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a40f6177
    • I
      perf build: Clarify open-coded header version warning message · 8255e1ef
      Ingo Molnar 提交于
      In this patch we changed the header checks:
      
        perf build: Clarify header version warning message
      
      Unfortunately the header checks were copied to various places and thus the message got
      out of sync. Fix some of them here.
      
      Note that there's still old, misleading messages remaining in:
      
        tools/objtool/Makefile: || echo "warning: objtool: x86 instruction decoder differs from kernel" >&2 )) || true
        tools/objtool/Makefile: || echo "warning: objtool: orc_types.h differs from kernel" >&2 )) || true
      
      here objtool copied the perf message, plus:
      
       tools/perf/util/intel-pt-decoder/Build: || echo "Warning: Intel PT: x86 instruction decoder differs from kernel" >&2 )) || true
      
      here the PT code regressed over the original message and only emits a vague warning
      instead of specific file names...
      
      All of this should be consolidated into tools/Build/ and used in a consistent
      manner.
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
      Cc: Geneviève Bastien <gbastien@versatic.net>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Julien Desfossez <jdesfossez@efficios.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Simon Que <sque@chromium.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20170730095130.bblldwxjz5hamybb@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8255e1ef
    • I
      perf build: Clarify header version warning message · c59796d5
      Ingo Molnar 提交于
      Change this:
      
        Warning: arch/x86/include/asm/disabled-features.h differs from kernel
        Warning: arch/x86/include/asm/cpufeatures.h differs from kernel
        Warning: arch/powerpc/include/uapi/asm/kvm.h differs from kernel
        Warning: arch/s390/include/uapi/asm/kvm.h differs from kernel
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/disabled-features.h' differs from latest version at 'arch/x86/include/asm/disabled-features.h'
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
        Warning: Kernel ABI header at 'tools/arch/powerpc/include/uapi/asm/kvm.h' differs from latest version at 'arch/powerpc/include/uapi/asm/kvm.h'
        Warning: Kernel ABI header at 'tools/arch/s390/include/uapi/asm/kvm.h' differs from latest version at 'arch/s390/include/uapi/asm/kvm.h'
      
      ... to make it clearer what the warning is about, and to make it easier
      to diff the two versions when syncing up the files.
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
      Cc: Geneviève Bastien <gbastien@versatic.net>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Julien Desfossez <jdesfossez@efficios.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Simon Que <sque@chromium.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20170730093747.qogjn3lp7ntwcgwg@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c59796d5
  3. 30 7月, 2017 2 次提交
    • I
      Merge tag 'perf-core-for-mingo-4.14-20170728' of... · c3a3800f
      Ingo Molnar 提交于
      Merge tag 'perf-core-for-mingo-4.14-20170728' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes for 4.14 from Arnaldo Carvalho de Melo:
      
      New features:
      
       - Add PERF_SAMPLE_CALLCHAIN and PERF_RECORD_MMAP[2] to 'perf data' CTF
         conversion, allowing CTF trace visualization tools to show callchains
         and to resolve symbols (Geneviève Bastien)
      
      Improvements:
      
       - Use group read for event groups in 'perf stat', reducing overhead when
         groups are defined in the event specification, i.e. when using {} to
         enclose a list of events, asking them to be read at the same time,
         e.g.: "perf stat -e '{cycles,instructions}'" (Jiri Olsa)
      
      Fixes:
      
       - Do not overwrite perf_sample->weight in 'perf annotate' when
         processing samples, use whatever came from the kernel when
         perf_event_attr.sample_type has PERF_SAMPLE_WEIGHT set or just handle
         its default value, 0, when that is not set and "weight" is one of the
         sort orders chosen (Arnaldo Carvalho de Melo)
      
       - 'perf annotate --show-total-period' fixes:
          - TUI should show period, not nr_samples
          - Set appropriate column width for period/percent
          - Fix the column header to show "Period" when when that is what
            is being asked for
         (Taeung Song, Arnaldo Carvalho de Melo)
      
       - Use default sort if evlist is empty, fixing pipe mode (David Carrillo-Cisneros)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      c3a3800f
    • I
  4. 29 7月, 2017 4 次提交
    • G
      perf data: Add doc when no conversion support compiled · 6b7007af
      Geneviève Bastien 提交于
      This adds documentation on the environment variables needed to the
      message telling that no conversion support is compiled in.
      
      Committer testing:
      
        $ make -C tools/perf install
        $ perf data convert --all --to-ctf myctftrace
        No conversion support compiled in. perf should be compiled with environment variables LIBBABELTRACE=1 and LIBBABELTRACE_DIR=/path/to/libbabeltrace/
        $
      Signed-off-by: NGeneviève Bastien <gbastien@versatic.net>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
      Cc: Julien Desfossez <jdesfossez@efficios.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20170727181205.24843-3-gbastien@versatic.netSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6b7007af
    • G
      perf data: Add mmap[2] events to CTF conversion · f9f6f2a9
      Geneviève Bastien 提交于
      This adds the mmap and mmap2 events to the CTF trace obtained from perf
      data.
      
      These events will allow CTF trace visualization tools like Trace Compass
      to automatically resolve the symbols of the callchain to the
      corresponding function or origin library.
      
      To include those events, one needs to convert with the --all option.
      Here follows an output of babeltrace:
      
        $ sudo perf data convert --all --to-ctf myctftrace
        $ babeltrace ./myctftrace
        [19:00:00.000000000] (+0.000000000) perf_mmap2: { cpu_id = 0 },
       { pid = 638, tid = 638, start = 0x7F54AE39E000, filename =
       "/usr/lib/ld-2.25.so" }
        [19:00:00.000000000] (+0.000000000) perf_mmap2: { cpu_id = 0 }, { pid =
       638, tid = 638, start = 0x7F54AE565000, filename =
       "/usr/lib/libudev.so.1.6.6" }
        [19:00:00.000000000] (+0.000000000) perf_mmap2: { cpu_id = 0 }, { pid =
       638, tid = 638, start = 0x7FFC093EA000, filename = "[vdso]" }
      Signed-off-by: NGeneviève Bastien <gbastien@versatic.net>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
      Cc: Julien Desfossez <jdesfossez@efficios.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20170727181205.24843-2-gbastien@versatic.netSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f9f6f2a9
    • G
      perf data: Add callchain to CTF conversion · a3073c8e
      Geneviève Bastien 提交于
      The field perf_callchain, if available, is added to the sampling events
      during the CTF conversion. It is an array of u64 values.  The
      perf_callchain_size field contains the size of the array.
      
      It will allow the analysis of sampling data in trace visualization tools
      like Trace Compass. Possible analyses with those data: dynamic
      flamegraphs, correlation with other tracing data like a userspace trace.
      
      Here follows a babeltrace CTF output of a trace with callchain:
      
        $ babeltrace ./myctftrace
        [17:38:45.672760285] (+?.?????????) cycles:ppp: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF81063EE4, perf_tid = 25841, perf_pid = 25774, perf_period = 1, perf_callchain_size = 7, perf_callchain = [ [0] = 0xFFFFFFFFFFFFFF80, [1] = 0xFFFFFFFF81063EE4, [2] = 0xFFFFFFFF8100C770, [3] = 0xFFFFFFFF81006EC6, [4] = 0xFFFFFFFF8118245E, [5] = 0xFFFFFFFF810A9224, [6] = 0xFFFFFFFF8164A4C6 ] }
        [17:38:45.672777672] (+0.000017387) cycles:ppp: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF81063EE4, perf_tid = 25841, perf_pid = 25774, perf_period = 1, perf_callchain_size = 8, perf_callchain = [ [0] = 0xFFFFFFFFFFFFFF80, [1] = 0xFFFFFFFF81063EE4, [2] = 0xFFFFFFFF8100C770, [3] = 0xFFFFFFFF81006EC6, [4] = 0xFFFFFFFF8118245E, [5] = 0xFFFFFFFF810A9224, [6] = 0xFFFFFFFF8164A4C6, [7] = 0xFFFFFFFF8164ABAD ] }
        [17:38:45.672786700] (+0.000009028) cycles:ppp: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF81063EE4, perf_tid = 25841, perf_pid = 25774, perf_period = 70, perf_callchain_size = 3, perf_callchain = [ [0] = 0xFFFFFFFFFFFFFF80, [1] = 0xFFFFFFFF81063EE4, [2] = 0xFFFFFFFF8100C770 ] }
      Signed-off-by: NGeneviève Bastien <gbastien@versatic.net>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
      Cc: Julien Desfossez <jdesfossez@efficios.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20170727181205.24843-1-gbastien@versatic.net
      [ Removed PERF_SAMPLE_CALLCHAIN from the TODO list, jolsa ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a3073c8e
    • A
      perf annotate TUI: Set appropriate column width for period/percent · 3861c4a4
      Arnaldo Carvalho de Melo 提交于
      Either when we start 'perf annotate' or 'perf report' with
      --show-total-period or when we, in the annotate browser, press 't' to
      toggle period/percent for the first column, we need to adjust the width
      for the 'period' case.
      Based-on-a-patch-by: NTaeung Song <treeze.taeung@gmail.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-n2np5qcs20u6qjdr9orygne6@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3861c4a4
  5. 28 7月, 2017 5 次提交
  6. 27 7月, 2017 7 次提交
    • A
      perf annotate stdio: Set enough columns for --show-total-period · ce9ee4a2
      Arnaldo Carvalho de Melo 提交于
      Now that we set the first column header according to wether
      --show-total-period is being used, we need to size it accordingly.
      Based-on-a-patch-by: NTaeung Song <treeze.taeung@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/n/tip-pu504ffnit4m334k09hxcbs3@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ce9ee4a2
    • D
      perf sort: Use default sort if evlist is empty · 64831a21
      David Carrillo-Cisneros 提交于
      Fixes bug noted by Jiri in https://lkml.org/lkml/2017/6/13/755 and
      caused by commit d49dadea ("perf tools: Make 'trace' or
      'trace_fields' sort key default for tracepoint events") not taking into
      account that evlist is empty in pipe-mode.
      
      Before this commit, pipe mode will only show bogus "100.00%  N/A"
      instead of correct output as follows:
      
        $ perf record -o - sleep 1 | perf report -i -
        # To display the perf.data header info, please use --header/--header-only options.
        #
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.000 MB - ]
        #
        # Total Lost Samples: 0
        #
        # Samples: 8  of event 'cycles:ppH'
        # Event count (approx.): 145658
        #
        # Overhead  Trace output
        # ........  ............
        #
           100.00%  N/A
      
      Correct output, after patch:
      
        $ perf record -o - sleep 1 | perf report -i -
        # To display the perf.data header info, please use --header/--header-only options.
        #
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.000 MB - ]
        #
        # Total Lost Samples: 0
        #
        # Samples: 8  of event 'cycles:ppH'
        # Event count (approx.): 191331
        #
        # Overhead  Command  Shared Object      Symbol
        # ........  .......  .................  .................................
        #
            81.63%  sleep    libc-2.19.so       [.] _exit
            13.58%  sleep    ld-2.19.so         [.] do_lookup_x
             2.34%  sleep    [kernel.kallsyms]  [k] context_switch
             2.34%  sleep    libc-2.19.so       [.] __GI___libc_nanosleep
             0.11%  perf     [kernel.kallsyms]  [k] __intel_pmu_enable_a
      Reported-by: NJiri Olsa <jolsa@kernel.org>
      Report-Link: https://lkml.kernel.org/r/20170613185422.GA6092@kravaSigned-off-by: NDavid Carrillo-Cisneros <davidcc@google.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Simon Que <sque@chromium.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: d49dadea ("perf tools: Make 'trace' or 'trace_fields' sort key default for tracepoint events")
      Link: https://lkml.kernel.org/r/20170721051157.47331-1-davidcc@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      64831a21
    • A
      perf annotate: Do not overwrite perf_sample->weight · c6c13be7
      Arnaldo Carvalho de Melo 提交于
      When we parse an event we may get a value from the kernel in response to
      PERF_SAMPLE_WEIGHT being set in perf_event_attr->sample_type, and if it
      is not set, then perf_sample->weight will be set to zero, which should
      be ok according to a discussion with Andi Kleen [1]:
      
      1: https://lkml.kernel.org/r/20170724174637.GS3044@two.firstfloor.orgAcked-by: NAndi Kleen <andi@firstfloor.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-8ev8ufk3lzmvgz37yg9nv3qz@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c6c13be7
    • J
      perf stat: Use group read for event groups · 82bf311e
      Jiri Olsa 提交于
      Make perf stat use  group read if there  are groups defined. The group
      read will get the values for all member of groups within a single
      syscall instead of calling read syscall for every event.
      
      We can see considerable less amount of kernel cycles spent on single
      group read, than reading each event separately, like for following perf
      stat command:
      
        # perf stat -e {cycles,instructions} -I 10 -a sleep 1
      
      Monitored with "perf stat -r 5 -e '{cycles:u,cycles:k}'"
      
      Before:
      
              24,325,676      cycles:u
             297,040,775      cycles:k
      
             1.038554134 seconds time elapsed
      
      After:
              25,034,418      cycles:u
             158,256,395      cycles:k
      
             1.036864497 seconds time elapsed
      
      The perf_evsel__open fallback changes contributed by Andi Kleen.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.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/20170726120206.9099-4-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      82bf311e
    • J
      perf evsel: Add read_counter() · f7794d52
      Jiri Olsa 提交于
      Add perf_evsel__read_counter() to read single or group counter. After
      calling this function the counter's evsel::counts struct is filled with
      values for the counter and member of its group if there are any.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.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/20170726120206.9099-3-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f7794d52
    • J
      perf tools: Add perf_evsel__read_size function · de63403b
      Jiri Olsa 提交于
      Currently we use the size of struct perf_counts_values to read the
      event, which prevents us to put any new member to the struct.
      
      Adding perf_evsel__read_size to return size of the buffer needed for
      event read.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.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/20170726120206.9099-2-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      de63403b
    • I
      Merge tag 'perf-core-for-mingo-4.14-20170725' of... · ee438ec8
      Ingo Molnar 提交于
      Merge tag 'perf-core-for-mingo-4.14-20170725' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvemends and fixes for v4.14:
      
      New features:
      
      - Filter out 'sshd' in the tracer ancestry in 'perf trace' syswide tracing,
        to elliminate tracing loops (Arnaldo Carvalho de Melo)
      
      - Support lookup of symbols in other mount namespaces in 'perf top' (Krister Johansen)
      
      - Initial 'clone' syscall args beautifier in 'perf trace' (Arnaldo Carvalho de Melo)
      
      User visible changes:
      
      - Ignore 'fd' and 'offset' args for MAP_ANONYMOUS in 'perf trace'
        (Arnaldo Carvalho de Melo)
      
      - Process tracing data in 'perf annotate' pipe mode (David Carrillo-Cisneros)
      
      - Make 'perf report --branch-history' work without callgraphs(-g) option
        in perf record (Jin Yao)
      
      - Tag branch type/flag on "to" and tag cycles on "from" in 'perf report' (Jin Yao)
      
      Fixes:
      
      - Fix jvmti linker error when libelf config is disabled (Sudeep Holla)
      
      - Fix cgroups refcount usage (Arnaldo Carvalho de Melo)
      
      - Fix kernel symbol adjustment for s390x (Thomas Richter)
      
      - Fix 'perf report --stdio --show-total-period', it was showing the
        number of samples, not the total period (Taeung Song)
      
      Infrastructure changes:
      
      - Add perf_sample dictionary to tracepoint handlers in 'perf script'
        python, which were already present for other types of events
        (hardware, etc) (Arun Kalyanasundaram)
      
      - Make build fail on vendor events JSON parse error (Andi Kleen)
      
      - Adopt strstarts() from the kernel (Arnaldo Carvalho de Melo)
      
      Arch specific changes:
      
      - Set no_aux_samples for the tracking event in Intel PT (Kan Liang)
      
      - Always set no branch for Intel PT dummy event (Kan Liang)
      
      Trivial changes:
      
      - Simplify some error handlers in 'perf script' (Dan Carpenter)
      
      - Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile (David Carrillo-Cisneros)
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      ee438ec8
  7. 26 7月, 2017 12 次提交
  8. 25 7月, 2017 3 次提交
    • J
      perf evsel: Add verbose output for sys_perf_event_open fallback · 2b04e0f8
      Jiri Olsa 提交于
      Adding info about what is being switched off in the sys_perf_event_open
      fallback.
      
      New output (notice the 'switching off' lines):
      
        $ perf stat -e '{cycles,instructions}' -vvv ls
        Using CPUID GenuineIntel-6-3D
        intel_pt default config: tsc
        ------------------------------------------------------------
        perf_event_attr:
          size                             112
          sample_type                      IDENTIFIER
          read_format                      TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING|ID|GROUP
          disabled                         1
          inherit                          1
          enable_on_exec                   1
          exclude_guest                    1
        ------------------------------------------------------------
        sys_perf_event_open: pid 3591  cpu -1  group_fd -1  flags 0x8
        sys_perf_event_open failed, error -22
        switching off cloexec flag
        ------------------------------------------------------------
        perf_event_attr:
          size                             112
          sample_type                      IDENTIFIER
          read_format                      TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING|ID|GROUP
          disabled                         1
          inherit                          1
          enable_on_exec                   1
          exclude_guest                    1
        ------------------------------------------------------------
        sys_perf_event_open: pid 3591  cpu -1  group_fd -1  flags 0
        sys_perf_event_open failed, error -22
        switching off exclude_guest, exclude_host
        ------------------------------------------------------------
        perf_event_attr:
          size                             112
          sample_type                      IDENTIFIER
          read_format                      TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING|ID|GROUP
          disabled                         1
          inherit                          1
          enable_on_exec                   1
        ------------------------------------------------------------
        sys_perf_event_open: pid 3591  cpu -1  group_fd -1  flags 0
        sys_perf_event_open failed, error -22
        switching off sample_id_all
        ------------------------------------------------------------
        perf_event_attr:
          size                             112
          sample_type                      IDENTIFIER
          read_format                      TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING|ID|GROUP
          disabled                         1
          inherit                          1
          enable_on_exec                   1
        ...
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.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/20170721121212.21414-2-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2b04e0f8
    • S
      perf jvmti: Fix linker error when libelf config is disabled · 5d90faf4
      Sudeep Holla 提交于
      When libelf is disabled in the configuration, we get the following
      linker error:
      
        LINK     libperf-jvmti.so
        ld: cannot find -lelf
        Makefile.perf:515: recipe for target 'libperf-jvmti.so' failed
      
      Jiri pointed out that both librt and libelf are not really required. So
      this patch fixes the linker error by getting rid of unwanted libraries
      in the linker stage.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      Acked-by: NDavid Carrillo-Cisneros <davidcc@google.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Elena Reshetova <elena.reshetova@intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 209045ad ("perf tools: add JVMTI agent library")
      Link: http://lkml.kernel.org/r/20170719011839.99399-5-davidcc@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5d90faf4
    • D
      perf annotate: Process tracing data in pipe mode · f4849599
      David Carrillo-Cisneros 提交于
      'perf annotate' was missing the handler for tracing data records.
      
      Prior to this patch we obtained "unhandled" records when piping trace
      events to perf annotate (using -D option to show the dump_printf
      messages in process_event_synth_tracing_data_stub):
      
        $ perf record -o - -e block:bio_free sleep 2 | perf annotate -D --stdio
        ...
        0x78 [0xc]: PERF_RECORD_TRACING_DATA: unhandled!
        ...
      Signed-off-by: NDavid Carrillo-Cisneros <davidcc@google.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Elena Reshetova <elena.reshetova@intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20170719011839.99399-4-davidcc@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f4849599