1. 06 12月, 2017 3 次提交
  2. 05 12月, 2017 5 次提交
  3. 30 11月, 2017 4 次提交
    • A
      perf intel-pt: Improve build messages for files that differ from the kernel · c2653297
      Adrian Hunter 提交于
      Print file names of files that differ. For example, instead of:
      
        Warning: Intel PT: x86 instruction decoder differs from kernel
      
      print:
      
        Warning: Intel PT: x86 instruction decoder header at 'tools/perf/util/intel-pt-decoder/inat.h' differs from latest version at 'arch/x86/include/asm/inat.h'
      Reported-by: NIngo Molnar <mingo@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Link: http://lkml.kernel.org/r/1511253326-22308-2-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c2653297
    • A
      perf report: Fix -D output for user metadata events · f250b09c
      Arnaldo Carvalho de Melo 提交于
      The PERF_RECORD_USER_ events are synthesized by the tool to assist in
      processing the PERF_RECORD_ ones generated by the kernel, the printing
      of that information doesn't come with a perf_sample structure, so, when
      dumping the event fields using 'perf report -D' there were columns that
      end up not being printed.
      
      To tidy up a bit this, fake a perf_sample structure with zeroes to have
      the missing columns printed and avoid the occasional surprise with that.
      
      Before:
      
      0 0x45b8 [0x68]: PERF_RECORD_MMAP -1/0: [0xffffffffc12ec000(0x4000) @ 0]: x /lib/modules/4.14.0+/kernel/fs/nls/nls_utf8.ko
      0x4620 [0x28]: PERF_RECORD_THREAD_MAP nr: 1 thread: 27820
      0x4648 [0x18]: PERF_RECORD_CPU_MAP: 0-3
      0 0x4660 [0x28]: PERF_RECORD_COMM: perf:27820/27820
      0x4a58 [0x8]: PERF_RECORD_FINISHED_ROUND
      447723433020976 0x4688 [0x28]: PERF_RECORD_SAMPLE(IP, 0x4001): 27820/27820: 0xffffffff8f1b6d7a period: 1 addr: 0
      
      After:
      
        $ perf report -D | grep PERF_RECORD_ | head
        0 0xe8 [0x20]: PERF_RECORD_TIME_CONV: unhandled!
        0 0x108 [0x28]: PERF_RECORD_THREAD_MAP nr: 1 thread: 32555
        0 0x130 [0x18]: PERF_RECORD_CPU_MAP: 0-3
        0 0x148 [0x28]: PERF_RECORD_COMM: perf:32555/32555
        0 0x4e8 [0x8]: PERF_RECORD_FINISHED_ROUND
        448743409421205 0x170 [0x28]: PERF_RECORD_COMM exec: sleep:32555/32555
        448743409431883 0x198 [0x68]: PERF_RECORD_MMAP2 32555/32555: [0x55e11d75a000(0x208000) @ 0 fd:00 3147174 2566255743]: r-xp /usr/bin/sleep
        448743409443873 0x200 [0x70]: PERF_RECORD_MMAP2 32555/32555: [0x7f0ced316000(0x229000) @ 0 fd:00 3151761 2566238119]: r-xp /usr/lib64/ld-2.25.so
        448743409454790 0x270 [0x60]: PERF_RECORD_MMAP2 32555/32555: [0x7ffe84f6d000(0x2000) @ 0 00:00 0 0]: r-xp [vdso]
        448743409479500 0x2d0 [0x28]: PERF_RECORD_SAMPLE(IP, 0x4002): 32555/32555: 0xffffffff8f84c7e7 period: 1 addr: 0
        $
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.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>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: 9aefcab0 ("perf session: Consolidate the dump code")
      Link: https://lkml.kernel.org/n/tip-todcu15x0cwgppkh1gi6uhru@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f250b09c
    • A
      perf script: Allow computing 'perf stat' style metrics · 4bd1bef8
      Andi Kleen 提交于
      Add support for computing 'perf stat' style metrics in 'perf script'.
      
      When using leader sampling we can get metrics for each sampling period
      by computing formulas over the values of the different group members.
      
      This allows things like fine grained IPC tracking through sampling, much
      more fine grained than with 'perf stat'.
      
      The metric is still averaged over the sampling period, it is not just
      for the sampling point.
      
      This patch adds a new metric output field for 'perf script' that uses
      the existing 'perf stat' metrics infrastructure to compute any metrics
      supported by 'perf stat'.
      
      For example to sample IPC:
      
        $ perf record -e '{ref-cycles,cycles,instructions}:S' -a sleep 1
        $ perf script -F metric,ip,sym,time,cpu,comm
        ...
         alsa-sink-ALC32 [000] 42815.856074:      7fd65937d6cc [unknown]
         alsa-sink-ALC32 [000] 42815.856074:      7fd65937d6cc [unknown]
         alsa-sink-ALC32 [000] 42815.856074:      7fd65937d6cc [unknown]
         alsa-sink-ALC32 [000] 42815.856074:    metric:    0.13  insn per cycle
                 swapper [000] 42815.857961:  ffffffff81655df0 __schedule
                 swapper [000] 42815.857961:  ffffffff81655df0 __schedule
                 swapper [000] 42815.857961:  ffffffff81655df0 __schedule
                 swapper [000] 42815.857961:    metric:    0.23  insn per cycle
         qemu-system-x86 [000] 42815.858130:  ffffffff8165ad0e _raw_spin_unlock_irqrestore
         qemu-system-x86 [000] 42815.858130:  ffffffff8165ad0e _raw_spin_unlock_irqrestore
         qemu-system-x86 [000] 42815.858130:  ffffffff8165ad0e _raw_spin_unlock_irqrestore
         qemu-system-x86 [000] 42815.858130:    metric:    0.46  insn per cycle
                   :4972 [000] 42815.858312:  ffffffffa080e5f2 vmx_vcpu_run
                   :4972 [000] 42815.858312:  ffffffffa080e5f2 vmx_vcpu_run
                   :4972 [000] 42815.858312:  ffffffffa080e5f2 vmx_vcpu_run
                   :4972 [000] 42815.858312:    metric:    0.45  insn per cycle
      
      TopDown:
      
      This requires disabling SMT if you have it enabled, because SMT would
      require sampling per core, which is not supported.
      
        $ perf record -e '{ref-cycles,topdown-fetch-bubbles,\
                           topdown-recovery-bubbles,\
                           topdown-slots-retired,topdown-total-slots,\
                           topdown-slots-issued}:S' -a sleep 1
        $ perf script --header -I -F cpu,ip,sym,event,metric,period
        ...
        [000]     121108               ref-cycles:  ffffffff8165222e copy_user_enhanced_fast_string
        [000]     190350    topdown-fetch-bubbles:  ffffffff8165222e copy_user_enhanced_fast_string
        [000]       2055 topdown-recovery-bubbles:  ffffffff8165222e copy_user_enhanced_fast_string
        [000]     148729    topdown-slots-retired:  ffffffff8165222e copy_user_enhanced_fast_string
        [000]     144324      topdown-total-slots:  ffffffff8165222e copy_user_enhanced_fast_string
        [000]     160852     topdown-slots-issued:  ffffffff8165222e copy_user_enhanced_fast_string
        [000]   metric:     33.0% frontend bound
        [000]   metric:      3.5% bad speculation
        [000]   metric:     25.8% retiring
        [000]   metric:     37.7% backend bound
        [000]     112112               ref-cycles:  ffffffff8165aec8 _raw_spin_lock_irqsave
        [000]     357222    topdown-fetch-bubbles:  ffffffff8165aec8 _raw_spin_lock_irqsave
        [000]       3325 topdown-recovery-bubbles:  ffffffff8165aec8 _raw_spin_lock_irqsave
        [000]     323553    topdown-slots-retired:  ffffffff8165aec8 _raw_spin_lock_irqsave
        [000]     270507      topdown-total-slots:  ffffffff8165aec8 _raw_spin_lock_irqsave
        [000]     341226     topdown-slots-issued:  ffffffff8165aec8 _raw_spin_lock_irqsave
        [000]   metric:     33.0% frontend bound
        [000]   metric:      2.9% bad speculation
        [000]   metric:     29.9% retiring
        [000]   metric:     34.2% backend bound
      ...
      
      v2:
      Use evsel->priv for new fields
      Port to new base line, support fp output.
      Handle stats in ->stats, not ->priv
      Minor cleanups
      
      Extra explanation about the use of the term 'averaging', from Andi in the
      thread in the Link: tag below:
      
      <quote Andi>
      The current samples contains the sum of event counts for a sampling period.
      
      EventA-1           EventA-2                EventA-3      EventA-4
      EventB-1     EventB-2                             EventC-3
      
                               gap with no events                overflow
      |-----------------------------------------------------------------|
      period-start                                             period-end
      ^                                                                 ^
      |                                                                 |
      previous sample                                      current sample
      
      So EventA = 4 and EventB = 3 at the sample point
      
      I generate a metric, let's say EventA / EventB. It applies to the whole period.
      
      But the metric is over a longer time which does not have the same behavior. For
      example the gap above doesn't have any events, while they are clustered at the
      beginning and end of the sample period.
      
      But we're summing everything together. The metric doesn't know that the gap is
      different than the busy period.
      
      That's what I'm trying to express with averaging.
      </quote>
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/20171117214300.32746-4-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4bd1bef8
    • A
      perf record: Synthesize unit/scale/... in event update · bfd8f72c
      Andi Kleen 提交于
      Move the code to synthesize event updates for scale/unit/cpus to a
      common utility file, and use it both from stat and record.
      
      This allows to access scale and other extra qualifiers from perf script.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/20171117214300.32746-2-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bfd8f72c
  4. 29 11月, 2017 7 次提交
  5. 17 11月, 2017 21 次提交