1. 26 6月, 2019 1 次提交
    • A
      tools perf: Move from sane_ctype.h obtained from git to the Linux's original · 3052ba56
      Arnaldo Carvalho de Melo 提交于
      We got the sane_ctype.h headers from git and kept using it so far, but
      since that code originally came from the kernel sources to the git
      sources, perhaps its better to just use the one in the kernel, so that
      we can leverage tools/perf/check_headers.sh to be notified when our copy
      gets out of sync, i.e. when fixes or goodies are added to the code we've
      copied.
      
      This will help with things like tools/lib/string.c where we want to have
      more things in common with the kernel, such as strim(), skip_spaces(),
      etc so as to go on removing the things that we have in tools/perf/util/
      and instead using the code in the kernel, indirectly and removing things
      like EXPORT_SYMBOL(), etc, getting notified when fixes and improvements
      are made to the original code.
      
      Hopefully this also should help with reducing the difference of code
      hosted in tools/ to the one in the kernel proper.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-7k9868l713wqtgo01xxygn12@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3052ba56
  2. 25 6月, 2019 1 次提交
    • K
      perf tools: Increase MAX_NR_CPUS and MAX_CACHES · 9f94c7f9
      Kyle Meyer 提交于
      Attempting to profile 1024 or more CPUs with perf causes two errors:
      
        perf record -a
        [ perf record: Woken up X times to write data ]
        way too many cpu caches..
        [ perf record: Captured and wrote X MB perf.data (X samples) ]
      
        perf report -C 1024
        Error: failed to set  cpu bitmap
        Requested CPU 1024 too large. Consider raising MAX_NR_CPUS
      
        Increasing MAX_NR_CPUS from 1024 to 2048 and redefining MAX_CACHES as
        MAX_NR_CPUS * 4 returns normal functionality to perf:
      
        perf record -a
        [ perf record: Woken up X times to write data ]
        [ perf record: Captured and wrote X MB perf.data (X samples) ]
      
        perf report -C 1024
        ...
      Signed-off-by: NKyle Meyer <kyle.meyer@hpe.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20190620193630.154025-1-meyerk@stormcage.eag.rdlabs.hpecorp.netSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9f94c7f9
  3. 11 6月, 2019 2 次提交
  4. 16 5月, 2019 1 次提交
  5. 16 4月, 2019 1 次提交
  6. 21 3月, 2019 1 次提交
    • S
      perf bpf: Show more BPF program info in print_bpf_prog_info() · f8dfeae0
      Song Liu 提交于
      This patch enables showing bpf program name, address, and size in the
      header.
      
      Before the patch:
      
        perf report --header-only
        ...
        # bpf_prog_info of id 9
        # bpf_prog_info of id 10
        # bpf_prog_info of id 13
      
      After the patch:
      
        # bpf_prog_info 9: bpf_prog_7be49e3934a125ba addr 0xffffffffa0024947 size 229
        # bpf_prog_info 10: bpf_prog_2a142ef67aaad174 addr 0xffffffffa007c94d size 229
        # bpf_prog_info 13: bpf_prog_47368425825d7384_task__task_newt addr 0xffffffffa0251137 size 369
      
      Committer notes:
      
      Fix the fallback definition when HAVE_LIBBPF_SUPPORT is not defined,
      i.e. add the missing 'static inline' and add the __maybe_unused to the
      args. Also add stdio.h since we now use FILE * in bpf-event.h.
      Signed-off-by: NSong Liu <songliubraving@fb.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stanislav Fomichev <sdf@google.com>
      Link: http://lkml.kernel.org/r/20190319165454.1298742-3-songliubraving@fb.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f8dfeae0
  7. 20 3月, 2019 2 次提交
    • S
      perf bpf: Save BTF information as headers to perf.data · a70a1123
      Song Liu 提交于
      This patch enables 'perf record' to save BTF information as headers to
      perf.data.
      
      A new header type HEADER_BPF_BTF is introduced for this data.
      
      Committer testing:
      
      As root, being on the kernel sources top level directory, run:
      
          # perf trace -e tools/perf/examples/bpf/augmented_raw_syscalls.c -e *msg
      
      Just to compile and load a BPF program that attaches to the
      raw_syscalls:sys_{enter,exit} tracepoints to trace the syscalls ending
      in "msg" (recvmsg, sendmsg, recvmmsg, sendmmsg, etc).
      
      Make sure you have a recent enough clang, say version 9, to get the
      BTF ELF sections needed for this testing:
      
        # clang --version | head -1
        clang version 9.0.0 (https://git.llvm.org/git/clang.git/ 7906282d3afec5dfdc2b27943fd6c0309086c507) (https://git.llvm.org/git/llvm.git/ a1b5de1ff8ae8bc79dc8e86e1f82565229bd0500)
        # readelf -SW tools/perf/examples/bpf/augmented_raw_syscalls.o | grep BTF
          [22] .BTF              PROGBITS        0000000000000000 000ede 000b0e 00      0   0  1
          [23] .BTF.ext          PROGBITS        0000000000000000 0019ec 0002a0 00      0   0  1
          [24] .rel.BTF.ext      REL             0000000000000000 002fa8 000270 10     30  23  8
      
      Then do a systemwide perf record session for a few seconds:
      
        # perf record -a sleep 2s
      
      Then look at:
      
        # perf report --header-only | grep b[pt]f
        # event : name = cycles:ppp, , id = { 1116204, 1116205, 1116206, 1116207, 1116208, 1116209, 1116210, 1116211 }, size = 112, { sample_period, sample_freq } = 4000, sample_type = IP|TID|TIME|PERIOD, read_format = ID, disabled = 1, inherit = 1, mmap = 1, comm = 1, freq = 1, enable_on_exec = 1, task = 1, precise_ip = 3, sample_id_all = 1, exclude_guest = 1, mmap2 = 1, comm_exec = 1, ksymbol = 1, bpf_event = 1
        # bpf_prog_info of id 13
        # bpf_prog_info of id 14
        # bpf_prog_info of id 15
        # bpf_prog_info of id 16
        # bpf_prog_info of id 17
        # bpf_prog_info of id 18
        # bpf_prog_info of id 21
        # bpf_prog_info of id 22
        # bpf_prog_info of id 51
        # bpf_prog_info of id 52
        # btf info of id 8
        #
      
      We need to show more info about these BPF and BTF entries , but that can
      be done later.
      Signed-off-by: NSong Liu <songliubraving@fb.com>
      Reviewed-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stanislav Fomichev <sdf@google.com>
      Cc: kernel-team@fb.com
      Link: http://lkml.kernel.org/r/20190312053051.2690567-10-songliubraving@fb.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a70a1123
    • S
      perf bpf: Save bpf_prog_info information as headers to perf.data · 606f972b
      Song Liu 提交于
      This patch enables perf-record to save bpf_prog_info information as
      headers to perf.data. A new header type HEADER_BPF_PROG_INFO is
      introduced for this data.
      
      Committer testing:
      
      As root, being on the kernel sources top level directory, run:
      
        # perf trace -e tools/perf/examples/bpf/augmented_raw_syscalls.c -e *msg
      
      Just to compile and load a BPF program that attaches to the
      raw_syscalls:sys_{enter,exit} tracepoints to trace the syscalls ending
      in "msg" (recvmsg, sendmsg, recvmmsg, sendmmsg, etc).
      
      Then do a systemwide perf record session for a few seconds:
      
        # perf record -a sleep 2s
      
      Then look at:
      
        # perf report --header-only | grep -i bpf
        # bpf_prog_info of id 13
        # bpf_prog_info of id 14
        # bpf_prog_info of id 15
        # bpf_prog_info of id 16
        # bpf_prog_info of id 17
        # bpf_prog_info of id 18
        # bpf_prog_info of id 21
        # bpf_prog_info of id 22
        # bpf_prog_info of id 208
        # bpf_prog_info of id 209
        #
      
      We need to show more info about these programs, like bpftool does for
      the ones running on the system, i.e. 'perf record/perf report' become a
      way of saving the BPF state in a machine to then analyse on another,
      together with all the other information that is already saved in the
      perf.data header:
      
        # perf report --header-only
        # ========
        # captured on    : Tue Mar 12 11:42:13 2019
        # header version : 1
        # data offset    : 296
        # data size      : 16294184
        # feat offset    : 16294480
        # hostname : quaco
        # os release : 5.0.0+
        # perf version : 5.0.gd783c8
        # arch : x86_64
        # nrcpus online : 8
        # nrcpus avail : 8
        # cpudesc : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
        # cpuid : GenuineIntel,6,142,10
        # total memory : 24555720 kB
        # cmdline : /home/acme/bin/perf (deleted) record -a
        # event : name = cycles:ppp, , id = { 3190123, 3190124, 3190125, 31901264, 3190127, 3190128, 3190129, 3190130 }, size = 112, { sample_period, sample_freq } = 4000, sample_type = IP|TID|TIME|CPU|PERIOD, read_format = ID, disabled = 1, inherit = 1, mmap = 1, comm = 1, freq = 1, task = 1, precise_ip = 3, sample_id_all = 1, exclude_guest = 1, mmap2 = 1, comm_exec = 1
        # CPU_TOPOLOGY info available, use -I to display
        # NUMA_TOPOLOGY info available, use -I to display
        # pmu mappings: intel_pt = 8, software = 1, power = 11, uprobe = 7, uncore_imc = 12, cpu = 4, cstate_core = 18, uncore_cbox_2 = 15, breakpoint = 5, uncore_cbox_0 = 13, tracepoint = 2, cstate_pkg = 19, uncore_arb = 17, kprobe = 6, i915 = 10, msr = 9, uncore_cbox_3 = 16, uncore_cbox_1 = 14
        # CACHE info available, use -I to display
        # time of first sample : 116392.441701
        # time of last sample : 116400.932584
        # sample duration :   8490.883 ms
        # MEM_TOPOLOGY info available, use -I to display
        # bpf_prog_info of id 13
        # bpf_prog_info of id 14
        # bpf_prog_info of id 15
        # bpf_prog_info of id 16
        # bpf_prog_info of id 17
        # bpf_prog_info of id 18
        # bpf_prog_info of id 21
        # bpf_prog_info of id 22
        # bpf_prog_info of id 208
        # bpf_prog_info of id 209
        # missing features: TRACING_DATA BRANCH_STACK GROUP_DESC AUXTRACE STAT CLOCKID DIR_FORMAT
        # ========
        #
      
      Committer notes:
      
      We can't use the libbpf unconditionally, as the build may have been with
      NO_LIBBPF, when we end up with linking errors, so provide dummy
      {process,write}_bpf_prog_info() wrapped by HAVE_LIBBPF_SUPPORT for that
      case.
      
      Printing are not affected by this, so can continue as is.
      Signed-off-by: NSong Liu <songliubraving@fb.com>
      Reviewed-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stanislav Fomichev <sdf@google.com>
      Cc: kernel-team@fb.com
      Link: http://lkml.kernel.org/r/20190312053051.2690567-8-songliubraving@fb.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      606f972b
  8. 11 3月, 2019 1 次提交
    • J
      perf header: Add DIR_FORMAT feature to describe directory data · 258031c0
      Jiri Olsa 提交于
      The data files layout is described by HEADER_DIR_FORMAT feature.
      Currently it holds only version number (1):
      
           uint64_t version;
      
      The current version holds only version value (1) means that data files:
      
        - Follow the 'data.*' name format.
      
        - Contain raw events data in standard perf format as read from kernel
          (and need to be sorted)
      
      Future versions are expected to describe different data files layout
      according to special needs.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/20190308134745.5057-6-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      258031c0
  9. 25 2月, 2019 1 次提交
  10. 19 2月, 2019 3 次提交
  11. 15 2月, 2019 2 次提交
  12. 18 12月, 2018 5 次提交
  13. 22 11月, 2018 1 次提交
  14. 18 10月, 2018 1 次提交
    • A
      perf record: Encode -k clockid frequency into Perf trace · cf790516
      Alexey Budankov 提交于
      Store -k clockid frequency into Perf trace to enable timestamps
      derived metrics conversion into wall clock time on reporting stage.
      
      Below is the example of perf report output:
      
        tools/perf/perf record -k raw -- ../../matrix/linux/matrix.gcc
        ...
        [ perf record: Captured and wrote 31.222 MB perf.data (818054 samples) ]
      
        tools/perf/perf report --header
        # ========
        ...
        # event : name = cycles:ppp, , size = 112, { sample_period, sample_freq } = 4000, sample_type = IP|TID|TIME|PERIOD, disabled = 1, inherit = 1, mmap = 1, comm = 1, freq = 1, enable_on_exec = 1, task = 1, precise_ip = 3, sample_id_all = 1, exclude_guest = 1, mmap2 = 1, comm_exec = 1, use_clockid = 1, clockid = 4
        ...
        # clockid frequency: 1000 MHz
        ...
        # ========
      Signed-off-by: NAlexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/23a4a1dc-b160-85a0-347d-40a2ed6d007b@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cf790516
  15. 20 9月, 2018 1 次提交
  16. 19 9月, 2018 1 次提交
  17. 31 8月, 2018 1 次提交
  18. 14 8月, 2018 1 次提交
  19. 11 8月, 2018 1 次提交
  20. 09 8月, 2018 1 次提交
    • Y
      perf tools: Drop unneeded bitmap_zero() calls · 3c8b8186
      Yury Norov 提交于
      bitmap_zero() is called after bitmap_alloc() in perf code. But
      bitmap_alloc() internally uses calloc() which guarantees that allocated
      area is zeroed. So following bitmap_zero is unneeded. Drop it.
      
      This happened because of confusing name for bitmap allocator. It
      should has name bitmap_zalloc instead of bitmap_alloc.
      
      This series:
      
        https://lkml.org/lkml/2018/6/18/841
      
      introduces a new API for bitmap allocations in kernel, and functions
      there are named correctly. Following patch propogates the API to tools,
      and fixes naming issue.
      Signed-off-by: NYury Norov <ynorov@caviumnetworks.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andriy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Mike Snitzer <snitzer@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Link: http://lkml.kernel.org/r/20180623073502.16321-1-ynorov@caviumnetworks.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3c8b8186
  21. 25 7月, 2018 1 次提交
  22. 25 6月, 2018 2 次提交
    • R
      perf tools: Fix crash caused by accessing feat_ops[HEADER_LAST_FEATURE] · 92ead7ee
      Ravi Bangoria 提交于
      perf_event__process_feature() accesses feat_ops[HEADER_LAST_FEATURE]
      which is not defined and thus perf is crashing. HEADER_LAST_FEATURE is
      used as an end marker for the perf report but it's unused for perf
      script/annotate. Ignore HEADER_LAST_FEATURE for perf script/annotate,
      just like it is done in 'perf report'.
      
      Before:
        # perf record -o - ls | perf script
        <SNIP 'ls' output>
        Segmentation fault (core dumped)
        #
      
      After:
        # perf record -o - ls | perf script
        <SNIP 'ls' output>
        Segmentation fault (core dumped)
        ls 7031 4392.099856:  250000 cpu-clock:uhH:  7f5e0ce7cd60
        ls 7031 4392.100355:  250000 cpu-clock:uhH:  7f5e0c706ef7
        #
      Signed-off-by: NRavi Bangoria <ravi.bangoria@linux.ibm.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: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Fixes: 57b5de46 ("perf report: Support forced leader feature in pipe mode")
      Link: http://lkml.kernel.org/r/20180625124220.6434-4-ravi.bangoria@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      92ead7ee
    • T
      perf record: Support s390 random socket_id assignment · 01766229
      Thomas Richter 提交于
      On s390 the socket identifier assigned to a CPU identifier is random and
      (depending on the configuration of the LPAR) may be higher than the CPU
      identifier. This is currently not supported.
      
      Fix this by allowing arbitrary socket identifiers being assigned to
      CPU id.
      
      Output before:
      
        [root@p23lp27 perf]# ./perf report --header -I -v
        ...
        socket_id number is too big.You may need to upgrade the perf tool.
        Error:
        The perf.data file has no samples!
        # ========
        # captured on    : Tue May 29 09:29:57 2018
        # header version : 1
        ...
        # Core ID and Socket ID information is not available
        ...
        [root@p23lp27 perf]#
      
      Output after:
      
        [root@p23lp27 perf]# ./perf report --header -I -v
        ...
        Error:
        The perf.data file has no samples!
        # ========
        # captured on    : Tue May 29 09:29:57 2018
        # header version : 1
        ...
        # CPU 0: Core ID 0, Socket ID 6
        # CPU 1: Core ID 1, Socket ID 3
        # CPU 2: Core ID -1, Socket ID -1
        ...
        [root@p23lp27 perf]#
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20180611073153.15592-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      01766229
  23. 06 6月, 2018 1 次提交
    • A
      perf record: Enable arbitrary event names thru name= modifier · f92da712
      Alexey Budankov 提交于
      Enable complex event names containing [.:=,] symbols to be encoded into Perf
      trace using name= modifier e.g. like this:
      
        perf record -e cpu/name=\'OFFCORE_RESPONSE:request=DEMAND_RFO:response=L3_HIT.SNOOP_HITM\',\
      		  period=0x3567e0,event=0x3c,cmask=0x1/Duk ./futex
      
      Below is how it looks like in the report output. Please note explicit escaped
      quoting at cmdline string in the header so that thestring can be directly reused
      for another collection in shell:
      
      perf report --header
      
        # ========
        ...
        # cmdline : /root/abudanko/kernel/tip/tools/perf/perf record -v -e cpu/name=\'OFFCORE_RESPONSE:request=DEMAND_RFO:response=L3_HIT.SNOOP_HITM\',period=0x3567e0,event=0x3c,cmask=0x1/Duk ./futex
        # event : name = OFFCORE_RESPONSE:request=DEMAND_RFO:response=L3_HIT.SNOOP_HITM, , type = 4, size = 112, config = 0x100003c, { sample_period, sample_freq } = 3500000, sample_type = IP|TID|TIME, disabled = 1, inh
        ...
        # ========
        #
        #
        # Total Lost Samples: 0
        #
        # Samples: 24K of event 'OFFCORE_RESPONSE:request=DEMAND_RFO:response=L3_HIT.SNOOP_HITM'
        # Event count (approx.): 86492000000
        #
        # Overhead  Command  Shared Object     Symbol
        # ........  .......  ................  ..............................................
        #
            14.75%  futex    [kernel.vmlinux]  [k] __entry_trampoline_start
      ...
      
        perf stat -e cpu/name=\'CPU_CLK_UNHALTED.THREAD:cmask=0x1\',period=0x3567e0,event=0x3c,cmask=0x1/Duk ./futex
      
        10000000 process context switches in 16678890291ns (1667.9ns/ctxsw)
      
         Performance counter stats for './futex':
      
            88,095,770,571      CPU_CLK_UNHALTED.THREAD:cmask=0x1
      
              16.679542407 seconds time elapsed
      Signed-off-by: NAlexey Budankov <alexey.budankov@linux.intel.com>
      Acked-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/c194b060-761d-0d50-3b21-bb4ed680002d@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f92da712
  24. 04 6月, 2018 1 次提交
  25. 13 4月, 2018 1 次提交
    • T
      perf record: Change warning for missing sysfs entry to debug · 4f75f1cb
      Thomas Richter 提交于
      Using perf on 4.16.0 kernel on s390 shows this warning:
      
         failed: can't open node sysfs data
      
      each time I run command perf record ... for example:
      
        [root@s35lp76 perf]# ./perf record -e rB0000 -- sleep 1
        [ perf record: Woken up 1 times to write data ]
        failed: can't open node sysfs data
        [ perf record: Captured and wrote 0.001 MB perf.data (4 samples) ]
        [root@s35lp76 perf]#
      
      It turns out commit e2091ced ("perf tools: Add MEM_TOPOLOGY feature
      to perf data file") tries to open directory named /sys/devices/system/node/
      which does not exist on s390.
      
      This is the call stack:
       __cmd_record
       +---> perf_session__write_header
             +---> perf_header__adds_write
                   +---> do_write_feat
      	           +---> write_mem_topology
      		         +---> build_mem_topology
      			       prints warning
      
      The issue starts in do_write_feat() which unconditionally loops over all
      features and now includes HEADER_MEM_TOPOLOGY and calls write_mem_topology().
      
      Function record__init_features() at the beginning of __cmd_record() sets
      all features and then turns off some of them.
      
      Fix this by changing the warning to a level 2 debug output statement.
      
      So it is only shown when debug level 2 or higher is set.
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20180412133246.92801-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4f75f1cb
  26. 17 3月, 2018 1 次提交
    • J
      perf report: Support forced leader feature in pipe mode · 57b5de46
      Jiri Olsa 提交于
      Stephane reported a problem with forced leader in pipe mode, where
      report does not force the group output. The reason is that we don't
      force the leader in pipe mode.
      
      This patch adds HEADER_LAST_FEATURE mark to have a point where we have
      all events and features received, and force the group if requested.
      
        $ perf record --group -e '{cycles, instructions}' -o - kill | perf report -i - --group
      
        SNIP
      
        #         Overhead  Command  Shared Object     Symbol
        # ................  .......  ................  .......................
        #
            28.36%   0.00%  kill     libc-2.25.so      [.] __unregister_atfork
            26.32%   0.00%  kill     libc-2.25.so      [.] _dl_addr
            26.10%   0.00%  kill     ld-2.25.so        [.] _dl_relocate_object
            17.32%   0.00%  kill     ld-2.25.so        [.] __tunables_init
             1.70%   0.01%  kill     [unknown]         [k] 0xffffffffafa01a40
             0.20%   0.00%  kill     ld-2.25.so        [.] _start
             0.00%  48.77%  kill     ld-2.25.so        [.] do_lookup_x
             0.00%  42.97%  kill     libc-2.25.so      [.] _IO_getline
             0.00%   6.35%  kill     ld-2.25.so        [.] strcmp
             0.00%   1.71%  kill     ld-2.25.so        [.] _dl_sysdep_start
             0.00%   0.19%  kill     ld-2.25.so        [.] _dl_start
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NStephane Eranian <eranian@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180314092205.23291-2-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      57b5de46
  27. 08 3月, 2018 2 次提交
  28. 08 1月, 2018 1 次提交
    • J
      perf header: Add infrastructure to record first and last sample time · 6011518d
      Jin Yao 提交于
      perf report/script/... have a --time option to limit the time range of
      output. That's very useful to slice large traces, e.g. when processing
      the output of perf script for some analysis.
      
      But right now --time only supports absolute time. Also there is no fast
      way to get the start/end times of a given trace except for looking at
      it.  This makes it hard to e.g. only decode the first half of the trace,
      which is useful for parallelization of scripts
      
      Another problem is that perf records are variable size and there is no
      synchronization mechanism. So the only way to find the last sample
      reliably would be to walk all samples. But we want to avoid that in perf
      report/...  because it is already quite expensive. That is why storing
      the first sample time and last sample time in perf record is better.
      
      This patch creates a new header feature type HEADER_SAMPLE_TIME and
      related ops. Save the first sample time and the last sample time to the
      feature section in perf file header. That will be done when, for
      instance, processing build-ids, where we already have to process all
      samples to create the build-id table, take advantage of that to further
      amortize that processing by storing HEADER_SAMPLE_TIME to make 'perf
      report/script' faster when using --time.
      
      Committer testing:
      
      After this patch is applied the header is written with zeroes, we need
      the next patch, for "perf record" to actually write the timestamps:
      
        # perf report -D | grep PERF_RECORD_SAMPLE\(
        22501155244406 0x44f0 [0x28]: PERF_RECORD_SAMPLE(IP, 0x4001): 25016/25016: 0xffffffffa21be8c5 period: 1 addr: 0
        <SNIP>
        22501155793625 0x4a30 [0x28]: PERF_RECORD_SAMPLE(IP, 0x4001): 25016/25016: 0xffffffffa21ffd50 period: 2828043 addr: 0
        # perf report --header | grep "time of "
        # time of first sample : 0.000000
        # time of last sample : 0.000000
        #
      
      Changelog:
      
      v7: 1. Rebase to latest perf/core branch.
      
          2. Add following clarification in patch description according to
             Arnaldo's suggestion.
      
             "That will be done when, for instance, processing build-ids,
      	where we already have to process all samples to create the
      	build-id table, take advantage of that to further amortize
      	that processing by storing HEADER_SAMPLE_TIME to make
      	'perf report/script' faster when using --time."
      
      v4: Use perf script time style for timestamp printing. Also add with
          the printing of sample duration.
      
      v3: Remove the definitions of first_sample_time/last_sample_time from
          perf_session. Just define them in perf_evlist
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      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: Andi Kleen <ak@linux.intel.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1512738826-2628-2-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6011518d
  29. 27 12月, 2017 1 次提交