1. 06 5月, 2020 2 次提交
    • T
      perf symbol: Fix kernel symbol address display · 51d96355
      Thomas Richter 提交于
      Running commands
      
         ./perf record -e rb0000 -- find .
         ./perf report -v
      
      reveals symbol names and its addresses. There is a mismatch between
      kernel symbol and address. Here is an example for kernel symbol
      check_chain_key:
      
       3.55%  find /lib/modules/.../build/vmlinux  0xf11ec  v [k] check_chain_key
      
      This address is off by 0xff000 as can be seen with:
      
      [root@t35lp46 ~]# fgrep check_chain_key /proc/kallsyms
      00000000001f00d0 t check_chain_key
      [root@t35lp46 ~]# objdump -t ~/linux/vmlinux| fgrep check_chain_key
      00000000001f00d0 l     F .text	00000000000001e8 check_chain_key
      [root@t35lp46 ~]#
      
      This function is located in main memory 0x1f00d0 - 0x1f02b4. It has
      several entries in the perf data file with the correct address:
      
      [root@t35lp46 perf]# ./perf report -D -i perf.data.find-bad | \
      				fgrep SAMPLE| fgrep 0x1f01ec
      PERF_RECORD_SAMPLE(IP, 0x1): 22228/22228: 0x1f01ec period: 1300000 addr: 0
      PERF_RECORD_SAMPLE(IP, 0x1): 22228/22228: 0x1f01ec period: 1300000 addr: 0
      
      The root cause happens when reading symbol tables during perf report.
      A long gdb call chain leads to
      
         machine__deliver_events
           perf_evlist__deliver_event
             perf_evlist__deliver_sample
               build_id__mark_dso_hits
      	   thread__find_map(1)      Read correct address from sample entry
      	     map__load
      	       dso__load            Some more functions to end up in
      	         ....
      		 dso__load_sym.
      
      Function dso__load_syms  checks for kernel relocation and symbol
      adjustment for the kernel and results in kernel map adjustment of
      	 kernel .text segment address (0x100000 on s390)
      	 kernel .text segment offset in file (0x1000 on s390).
      This results in all kernel symbol addresses to be changed by subtracting
      0xff000 (on s390). For the symbol check_chain_key we end up with
      
          0x1f00d0 - 0x100000 + 0x1000 = 0xf11d0
      
      and this address is saved in the perf symbol table. This calculation is
      also applied by the mapping functions map__mapip() and map__unmapip()
      to map IP addresses to dso mappings.
      
      During perf report processing functions
      
         process_sample_event    (builtin-report.c)
           machine__resolve
             thread__find_map
           hist_entry_iter_add
      
      are called. Function thread__find_map(1)
      takes the correct sample address and applies the mapping function
      map__mapip() from the kernel dso and saves the modified address
      in struct addr_location for further reference. From now on this address
      is used.
      
      Funktion process_sample_event() then calls hist_entry_iter_add() to save
      the address in member ip of struct hist_entry.
      
      When samples are displayed using
      
          perf_evlist__tty_browse_hists
            hists__fprintf
              hist_entry__fprintf
      	  hist_entry__snprintf
      	    __hist_entry__snprintf
      	      _hist_entry__sym_snprintf()
      
      This simply displays the address of the symbol and ignores the dso <-> map
      mappings done in function thread__find_map. This leads to the address
      mismatch.
      
      Output before:
      
      ot@t35lp46 perf]# ./perf report -v | fgrep check_chain_key
           3.55%  find     /lib/modules/5.6.0d-perf+/build/vmlinux
           						0xf11ec v [k] check_chain_key
      [root@t35lp46 perf]#
      
      Output after:
      
      [root@t35lp46 perf]# ./perf report -v | fgrep check_chain_key
           3.55%  find     /lib/modules/5.6.0d-perf+/build/vmlinux
           						0x1f01ec v [k] check_chain_key
      [root@t35lp46 perf]#
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Acked-by: NSumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Link: http://lore.kernel.org/lkml/20200415070744.59919-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      51d96355
    • A
      perf evsel: Rename perf_evsel__{prev,next}() to evsel__{prev,next}() · e470daea
      Arnaldo Carvalho de Melo 提交于
      As those are 'struct evsel' methods, not part of tools/lib/perf/, aka
      libperf, to whom the perf_ prefix belongs.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e470daea
  2. 18 4月, 2020 1 次提交
    • K
      perf hist: Add fast path for duplicate entries check · 12e89e65
      Kan Liang 提交于
      Perf checks the duplicate entries in a callchain before adding an entry.
      However the check is very slow especially with deeper call stack.
      Almost ~50% elapsed time of perf report is spent on the check when the
      call stack is always depth of 32.
      
      The hist_entry__cmp() is used to compare the new entry with the old
      entries. It will go through all the available sorts in the sort_list,
      and call the specific cmp of each sort, which is very slow.
      
      Actually, for most cases, there are no duplicate entries in callchain.
      The symbols are usually different. It's much faster to do a quick check
      for symbols first. Only do the full cmp when the symbols are exactly the
      same.
      
      The quick check is only to check symbols, not dso. Export
      _sort__sym_cmp.
      
        $ perf record --call-graph lbr ./tchain_edit_64
      
        Without the patch
        $time perf report --stdio
        real    0m21.142s
        user    0m21.110s
        sys     0m0.033s
      
        With the patch
        $time perf report --stdio
        real    0m10.977s
        user    0m10.948s
        sys     0m0.027s
      Signed-off-by: NKan Liang <kan.liang@linux.intel.com>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
      Link: http://lore.kernel.org/lkml/20200319202517.23423-18-kan.liang@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      12e89e65
  3. 03 4月, 2020 1 次提交
    • N
      perf report: Add 'cgroup' sort key · b629f3e9
      Namhyung Kim 提交于
      The cgroup sort key is to show cgroup membership of each task.
      Currently it shows full path in the cgroupfs (not relative to the root
      of cgroup namespace) since it'd be more intuitive IMHO.  Otherwise root
      cgroup in different namespaces will all show same name - "/".
      
      The cgroup sort key should come before cgroup_id otherwise
      sort_dimension__add() will match it to cgroup_id as it only matches with
      the given substring.
      
      For example it will look like following.  Note that record patch adding
      --all-cgroups patch will come later.
      
        $ perf record -a --namespace --all-cgroups  cgtest
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.208 MB perf.data (4090 samples) ]
      
        $ perf report -s cgroup_id,cgroup,pid
        ...
        # Overhead  cgroup id (dev/inode)  Cgroup          Pid:Command
        # ........  .....................  ..........  ...............
        #
            93.96%  0/0x0                  /                 0:swapper
             1.25%  3/0xeffffffb           /               278:looper0
             0.86%  3/0xf000015f           /sub/cgrp1      280:cgtest
             0.37%  3/0xf0000160           /sub/cgrp2      281:cgtest
             0.34%  3/0xf0000163           /sub/cgrp3      282:cgtest
             0.22%  3/0xeffffffb           /sub            278:looper0
             0.20%  3/0xeffffffb           /               280:cgtest
             0.15%  3/0xf0000163           /sub/cgrp3      285:looper3
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20200325124536.2800725-6-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b629f3e9
  4. 23 3月, 2020 1 次提交
    • J
      perf report: Print al_addr when symbol is not found · 443bc639
      Jin Yao 提交于
      For branch mode, if the symbol is not found, it prints
      the address.
      
      For example, 0x0000555eee0365a0 in below output.
      
        Overhead  Command  Source Shared Object  Source Symbol                            Target Symbol
          17.55%  div      libc-2.27.so          [.] __random                             [.] __random
           6.11%  div      div                   [.] 0x0000555eee0365a0                   [.] rand
           6.10%  div      libc-2.27.so          [.] rand                                 [.] 0x0000555eee036769
           5.80%  div      libc-2.27.so          [.] __random_r                           [.] __random
           5.72%  div      libc-2.27.so          [.] __random                             [.] __random_r
           5.62%  div      libc-2.27.so          [.] __random_r                           [.] __random_r
           5.38%  div      libc-2.27.so          [.] __random                             [.] rand
           4.56%  div      libc-2.27.so          [.] __random                             [.] __random
           4.49%  div      div                   [.] 0x0000555eee036779                   [.] 0x0000555eee0365ff
           4.25%  div      div                   [.] 0x0000555eee0365fa                   [.] 0x0000555eee036760
      
      But it's not very easy to understand what the instructions
      are in the binary. So this patch uses the al_addr instead.
      
      With this patch, the output is
      
        Overhead  Command  Source Shared Object  Source Symbol                            Target Symbol
          17.55%  div      libc-2.27.so          [.] __random                             [.] __random
           6.11%  div      div                   [.] 0x00000000000005a0                   [.] rand
           6.10%  div      libc-2.27.so          [.] rand                                 [.] 0x0000000000000769
           5.80%  div      libc-2.27.so          [.] __random_r                           [.] __random
           5.72%  div      libc-2.27.so          [.] __random                             [.] __random_r
           5.62%  div      libc-2.27.so          [.] __random_r                           [.] __random_r
           5.38%  div      libc-2.27.so          [.] __random                             [.] rand
           4.56%  div      libc-2.27.so          [.] __random                             [.] __random
           4.49%  div      div                   [.] 0x0000000000000779                   [.] 0x00000000000005ff
           4.25%  div      div                   [.] 0x00000000000005fa                   [.] 0x0000000000000760
      
      Now we can use objdump to dump the object starting from 0x5a0.
      
      For example,
      objdump -d --start-address 0x5a0 div
      
      00000000000005a0 <rand@plt>:
       5a0:   ff 25 2a 0a 20 00       jmpq   *0x200a2a(%rip)        # 200fd0 <__cxa_finalize@plt+0x200a20>
       5a6:   68 02 00 00 00          pushq  $0x2
       5ab:   e9 c0 ff ff ff          jmpq   570 <srand@plt-0x10>
       ...
      
      Committer testing:
      
        [root@seventh ~]# perf record -a -b sleep 1
        [root@seventh ~]# perf report --header-only | grep cpudesc
        # cpudesc : Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
        [root@seventh ~]# perf evlist -v
        cycles: size: 120, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CPU|PERIOD|BRANCH_STACK, 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, ksymbol: 1, bpf_event: 1, branch_sample_type: ANY
        [root@seventh ~]#
      
      Before:
      
        [root@seventh ~]# perf report --stdio --dso libsystemd-shared-241.so | head -20
        # To display the perf.data header info, please use --header/--header-only options.
        #
        #
        # Total Lost Samples: 0
        #
        # Samples: 2K of event 'cycles'
        # Event count (approx.): 2240
        #
        # Overhead  Command          Source Shared Object      Source Symbol           Target Symbol           Basic Block Cycles
        # ........  ...............  ........................  ......................  ......................  ..................
        #
             0.13%  systemd-journal  libc-2.29.so              [.] cfree@GLIBC_2.2.5   [.] _int_free           1
             0.09%  systemd          libsystemd-shared-241.so  [.] 0x00007fe406465c82  [.] 0x00007fe406465d80  1
             0.09%  systemd          libsystemd-shared-241.so  [.] 0x00007fe406465ded  [.] 0x00007fe406465c30  1
             0.09%  systemd          libsystemd-shared-241.so  [.] 0x00007fe406465e4e  [.] 0x00007fe406465de0  1
             0.09%  systemd-journal  systemd-journald          [.] free@plt            [.] cfree@GLIBC_2.2.5   1
             0.09%  systemd-journal  libc-2.29.so              [.] _int_free           [.] _int_free           18
             0.09%  systemd-journal  libc-2.29.so              [.] _int_free           [.] _int_free           2
             0.04%  systemd          libsystemd-shared-241.so  [.] bus_resolve@plt     [.] bus_resolve         204
             0.04%  systemd          libsystemd-shared-241.so  [.] getpid_cached@plt   [.] getpid_cached       7
        [root@seventh ~]#
      
      After:
      
        [root@seventh ~]# perf report --stdio --dso libsystemd-shared-241.so | head -20
        # To display the perf.data header info, please use --header/--header-only options.
        #
        #
        # Total Lost Samples: 0
        #
        # Samples: 2K of event 'cycles'
        # Event count (approx.): 2240
        #
        # Overhead  Command          Source Shared Object      Source Symbol           Target Symbol           Basic Block Cycles
        # ........  ...............  ........................  ......................  ......................  ..................
        #
             0.13%  systemd-journal  libc-2.29.so              [.] cfree@GLIBC_2.2.5   [.] _int_free           1
             0.09%  systemd          libsystemd-shared-241.so  [.] 0x00000000000f7c82  [.] 0x00000000000f7d80  1
             0.09%  systemd          libsystemd-shared-241.so  [.] 0x00000000000f7ded  [.] 0x00000000000f7c30  1
             0.09%  systemd          libsystemd-shared-241.so  [.] 0x00000000000f7e4e  [.] 0x00000000000f7de0  1
             0.09%  systemd-journal  systemd-journald          [.] free@plt            [.] cfree@GLIBC_2.2.5   1
             0.09%  systemd-journal  libc-2.29.so              [.] _int_free           [.] _int_free           18
             0.09%  systemd-journal  libc-2.29.so              [.] _int_free           [.] _int_free           2
             0.04%  systemd          libsystemd-shared-241.so  [.] bus_resolve@plt     [.] bus_resolve         204
             0.04%  systemd          libsystemd-shared-241.so  [.] getpid_cached@plt   [.] getpid_cached       7
        [root@seventh ~]#
      
      Lets use -v to get full paths and then try objdump on the unresolved address:
      
        [root@seventh ~]# perf report -v --stdio --dso libsystemd-shared-241.so |& grep libsystemd-shared-241.so | tail -1
           0.04% systemd-journal /usr/lib/systemd/libsystemd-shared-241.so 0x80c1a B [.] 0x0000000000080c1a 0x80a95 B [.] 0x0000000000080a95 61
        [root@seventh ~]#
      
        [root@seventh ~]# objdump -d --start-address 0x00000000000f7d80 /usr/lib/systemd/libsystemd-shared-241.so | head -20
      
        /usr/lib/systemd/libsystemd-shared-241.so:     file format elf64-x86-64
      
        Disassembly of section .text:
      
        00000000000f7d80 <proc_cmdline_parse_given@@SD_SHARED+0x330>:
           f7d80:	41 39 11             	cmp    %edx,(%r9)
           f7d83:	0f 84 ff fe ff ff    	je     f7c88 <proc_cmdline_parse_given@@SD_SHARED+0x238>
           f7d89:	4c 8d 05 97 09 0c 00 	lea    0xc0997(%rip),%r8        # 1b8727 <utf8_skip_data@@SD_SHARED+0x3147>
           f7d90:	b9 49 00 00 00       	mov    $0x49,%ecx
           f7d95:	48 8d 15 c9 f5 0b 00 	lea    0xbf5c9(%rip),%rdx        # 1b7365 <utf8_skip_data@@SD_SHARED+0x1d85>
           f7d9c:	31 ff                	xor    %edi,%edi
           f7d9e:	48 8d 35 9b ff 0b 00 	lea    0xbff9b(%rip),%rsi        # 1b7d40 <utf8_skip_data@@SD_SHARED+0x2760>
           f7da5:	e8 a6 d6 f4 ff       	callq  45450 <log_assert_failed_realm@plt>
           f7daa:	66 0f 1f 44 00 00    	nopw   0x0(%rax,%rax,1)
           f7db0:	41 56                	push   %r14
           f7db2:	41 55                	push   %r13
           f7db4:	41 54                	push   %r12
           f7db6:	55                   	push   %rbp
        [root@seventh ~]#
      
      If we tried the the reported address before this patch:
      
        [root@seventh ~]# objdump -d --start-address 0x00007fe406465d80 /usr/lib/systemd/libsystemd-shared-241.so | head -20
      
        /usr/lib/systemd/libsystemd-shared-241.so:     file format elf64-x86-64
      
        [root@seventh ~]#
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20200227043939.4403-2-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      443bc639
  5. 06 1月, 2020 1 次提交
  6. 04 12月, 2019 2 次提交
  7. 20 11月, 2019 3 次提交
    • A
      perf dso: Move dso_id from 'struct map' to 'struct dso' · 0e3149f8
      Arnaldo Carvalho de Melo 提交于
      And take it into account when looking up DSOs when we have the dso_id
      fields obtained from somewhere, like from PERF_RECORD_MMAP2 records.
      
      Instances of struct map pointing to the same DSO pathname but with
      anything in dso_id different are in fact different DSOs, so better have
      different 'struct dso' instances to reflect that. At some point we may
      want to get copies of the contents of the different objects if we want
      to do correct annotation or other analysis.
      
      With this we get 'struct map' 24 bytes leaner:
      
        $ pahole -C map ~/bin/perf
        struct map {
        	union {
        		struct rb_node     rb_node __attribute__((__aligned__(8))); /*     0    24 */
        		struct list_head   node;                 /*     0    16 */
        	} __attribute__((__aligned__(8)));               /*     0    24 */
        	u64                        start;                /*    24     8 */
        	u64                        end;                  /*    32     8 */
        	_Bool                      erange_warned:1;      /*    40: 0  1 */
        	_Bool                      priv:1;               /*    40: 1  1 */
      
        	/* XXX 6 bits hole, try to pack */
        	/* XXX 3 bytes hole, try to pack */
      
        	u32                        prot;                 /*    44     4 */
        	u64                        pgoff;                /*    48     8 */
        	u64                        reloc;                /*    56     8 */
        	/* --- cacheline 1 boundary (64 bytes) --- */
        	u64                        (*map_ip)(struct map *, u64); /*    64     8 */
        	u64                        (*unmap_ip)(struct map *, u64); /*    72     8 */
        	struct dso *               dso;                  /*    80     8 */
        	refcount_t                 refcnt;               /*    88     4 */
        	u32                        flags;                /*    92     4 */
      
        	/* size: 96, cachelines: 2, members: 13 */
        	/* sum members: 92, holes: 1, sum holes: 3 */
        	/* sum bitfield members: 2 bits, bit holes: 1, sum bit holes: 6 bits */
        	/* forced alignments: 1 */
        	/* last cacheline: 32 bytes */
        } __attribute__((__aligned__(8)));
        $
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-g4hxxmraplo7wfjmk384mfsb@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0e3149f8
    • A
      perf map: Move comparision of map's dso_id to a separate function · 7b59a824
      Arnaldo Carvalho de Melo 提交于
      We'll use it when doing DSO lookups using dso_ids.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-u2nr1oq03o0i29w2ay9jx03s@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7b59a824
    • A
      perf map: Move maj/min/ino/ino_generation to separate struct · 99459a84
      Arnaldo Carvalho de Melo 提交于
      And this patch highlights where these fields are being used: in the sort
      order where it uses it to compare maps and classify samples taking into
      account not just the DSO, but those DSO id fields.
      
      I think these should be used to differentiate DSOs with the same name
      but different 'struct dso_id' fields, i.e. these fields should move to
      'struct dso' and then be used as part of the key when doing lookups for
      DSOs, in addition to the DSO name.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-8v5isitqy0dup47nnwkpc80f@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      99459a84
  8. 12 11月, 2019 1 次提交
  9. 25 9月, 2019 1 次提交
  10. 01 9月, 2019 5 次提交
  11. 30 8月, 2019 1 次提交
  12. 26 8月, 2019 3 次提交
  13. 30 7月, 2019 4 次提交
  14. 20 3月, 2019 1 次提交
  15. 12 3月, 2019 1 次提交
    • A
      perf report: Support time sort key · 3723908d
      Andi Kleen 提交于
      Add a time sort key to perf report to display samples for different time
      quantums separately. This allows easier analysis of workloads that
      change over time, and also will allow looking at the context of samples.
      
      % perf record ...
      % perf report --sort time,overhead,symbol --time-quantum 1ms --stdio
      ...
           0.67%  277061.87300  [.] _dl_start
           0.50%  277061.87300  [.] f1
           0.50%  277061.87300  [.] f2
           0.33%  277061.87300  [.] main
           0.29%  277061.87300  [.] _dl_lookup_symbol_x
           0.29%  277061.87300  [.] dl_main
           0.29%  277061.87300  [.] do_lookup_x
           0.17%  277061.87300  [.] _dl_debug_initialize
           0.17%  277061.87300  [.] _dl_init_paths
           0.08%  277061.87300  [.] check_match
           0.04%  277061.87300  [.] _dl_count_modids
           1.33%  277061.87400  [.] f1
           1.33%  277061.87400  [.] f2
           1.33%  277061.87400  [.] main
           1.17%  277061.87500  [.] main
           1.08%  277061.87500  [.] f1
           1.08%  277061.87500  [.] f2
           1.00%  277061.87600  [.] main
           0.83%  277061.87600  [.] f1
           0.83%  277061.87600  [.] f2
           1.00%  277061.87700  [.] main
      
      Committer notes:
      
      Rename 'time' argument to hist_time() to htime to overcome this in older
      distros:
      
        cc1: warnings being treated as errors
        util/hist.c: In function 'hist_time':
        util/hist.c:251: error: declaration of 'time' shadows a global declaration
        /usr/include/time.h:186: error: shadowed declaration is here
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/20190311144502.15423-4-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3723908d
  16. 19 2月, 2019 1 次提交
  17. 06 2月, 2019 2 次提交
  18. 18 12月, 2018 2 次提交
    • I
      perf tools: Fix diverse comment typos · adba1634
      Ingo Molnar 提交于
      Go over the tools/ files that are maintained in Arnaldo's tree and
      fix common typos: half of them were in comments, the other half
      in JSON files.
      
      No change in functionality intended.
      
      Committer notes:
      
      This was split from a larger patch as there are code that is,
      additionally, maintained outside the kernel tree, so to ease
      cherry-picking and/or backporting, split this into multiple patches.
      
      Just typos in comments, no need to backport, reducing the possibility of
      possible backporting artifacts.
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20181203102200.GA104797@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      adba1634
    • J
      perf report: Display average IPC and IPC coverage per symbol · ec6ae74f
      Jin Yao 提交于
      Support displaying the average IPC and IPC coverage per symbol in 'perf
      report' --tui and --stdio modes.
      
      For example,
      
       $ perf record -b ...
       $ perf report -s symbol
      
       Overhead  Symbol                           IPC   [IPC Coverage]
         39.60%  [.] __random                     2.30  [ 54.8%]
         18.02%  [.] main                         0.43  [ 54.3%]
         14.21%  [.] compute_flag                 2.29  [100.0%]
         14.16%  [.] rand                         0.36  [100.0%]
          7.06%  [.] __random_r                   2.57  [ 70.5%]
          6.85%  [.] rand@plt                     0.00  [  0.0%]
      
      Jiri Olsa <jolsa@redhat.com> provided the patch to support the --stdio
      mode. I merged Jiri's code in this patch.
      
        $ perf report -s symbol --stdio
      
          # Overhead  Symbol                       IPC   [IPC Coverage]
          # ........  ...........................  ....................
          #
            39.60%  [.] __random                   2.30  [ 54.8%]
            18.02%  [.] main                       0.43  [ 54.3%]
            14.21%  [.] compute_flag               2.29  [100.0%]
            14.16%  [.] rand                       0.36  [100.0%]
             7.06%  [.] __random_r                 2.57  [ 70.5%]
             6.85%  [.] rand@plt                   0.00  [  0.0%]
             0.02%  [k] run_timer_softirq          1.60  [ 57.2%]
      
      The columns "IPC" and "[IPC Coverage]" are automatically enabled when
      the sort-key "symbol" is specified. If the perf.data file doesn't
      contain timed LBR information, columns are filled with "-".
      
      For example,
      
        # Overhead  Symbol                       IPC   [IPC Coverage]
        # ........  ...........................  ....................
        #
            46.57%  [.] main                     -      -
            17.60%  [.] rand                     -      -
            15.84%  [.] __random_r               -      -
            11.90%  [.] __random                 -      -
             6.50%  [.] compute_flag             -      -
             1.59%  [.] rand@plt                 -      -
             0.00%  [.] _dl_relocate_object      -      -
             0.00%  [k] tlb_flush_mmu            -      -
             0.00%  [k] perf_event_mmap          -      -
             0.00%  [k] native_sched_clock       -      -
             0.00%  [k] intel_pmu_handle_irq_v4  -      -
             0.00%  [k] native_write_msr         -      -
      
       v3:
       ---
       Removed the sortkey 'ipc' from command-line. The columns "IPC"
       and "[IPC Coverage]" are automatically enabled when "symbol"
       is specified.
      
       v2:
       ---
       Merge in Jiri's patch to support stdio mode
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      Reviewed-by: NIngo Molnar <mingo@kernel.org>
      Reviewed-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1543586097-27632-4-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ec6ae74f
  19. 20 9月, 2018 2 次提交
  20. 14 8月, 2018 5 次提交