1. 12 1月, 2016 8 次提交
  2. 11 1月, 2016 1 次提交
  3. 09 1月, 2016 8 次提交
  4. 08 1月, 2016 19 次提交
  5. 07 1月, 2016 4 次提交
    • A
      perf tests: No need to set attr.sample_freq in the perf time to TSC test · 4f4ba0e6
      Arnaldo Carvalho de Melo 提交于
      We were asking for a 4kHz sample_freq, making the test fail needlessly
      when the system reduced /proc/sys/kernel/perf_event_max_sample_rate
      below that.
      
      In this test we only look at the PERF_SAMPLE_TIME fields in PERF_RECORD_
      meta events, no need to set sample_freq.
      
      Thanks to Namhyung for suggesting that max_sample_rate could be the
      reason for the test failure, seeing the 'perf test -vv' output I sent.
      
      Before:
      
        # echo 1000 > /proc/sys/kernel/perf_event_max_sample_rate
        # perf test TSC
        45: Test converting perf time to TSC   : FAILED!
      
      After:
      
        # perf test TSC
        45: Test converting perf time to TSC   : Ok
        # cat /proc/sys/kernel/perf_event_max_sample_rate
        1000
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-lcob05qhawkuvsyuu9g1fld5@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4f4ba0e6
    • S
      perf pmu: fix alias->snapshot missing initialization bug · 84530920
      Stephane Eranian 提交于
      This patch fixes a bug in __perf_pmu__new_alias() whereby the
      alias->snapshot field was not initialized to false. This led to random
      alias->snapshot value for an alias and was breaking some measurements
      such as:
      
        $ perf stat -a -e uncore_imc/data_reads/ -I 1000 sleep 100
      
      Because the event ended up being treated as snapshot mode, when it is
      not.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1452106201-13073-1-git-send-email-eranian@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      84530920
    • J
      perf script: Add stat-cpi.py script · b8a1962d
      Jiri Olsa 提交于
      Adding stat-cpi.py as an example of how to do stat scripting.
      
      It computes the CPI metrics from cycles and instructions events.
      
      The CPI is based performance metric showing the Cycles Per Instructions
      ratio, which helps to identify cycles-hungry code.
      
      Following stat record/report/script combinations could be used:
      
      - get CPI for given workload
      
          $ perf stat -e cycles,instructions record ls
      
          SNIP
      
           Performance counter stats for 'ls':
      
                   2,904,431      cycles
                   3,346,878      instructions              #    1.15  insns per cycle
      
                 0.001782686 seconds time elapsed
      
          $ perf script -s ./scripts/python/stat-cpi.py
                 0.001783: cpu -1, thread -1 -> cpi 0.867803 (2904431/3346878)
      
          $ perf stat -e cycles,instructions record ls | perf script -s ./scripts/python/stat-cpi.py
      
          SNIP
      
                 0.001730: cpu -1, thread -1 -> cpi 0.869026 (2928292/3369627)
      
      - get CPI systemwide:
      
          $ perf stat -e cycles,instructions -a -I 1000 record sleep 3
          #           time             counts unit events
               1.000158618        594,274,711      cycles                     (100.00%)
               1.000158618        441,898,250      instructions
               2.000350973        567,649,705      cycles                     (100.00%)
               2.000350973        432,669,206      instructions
               3.000559210        561,940,430      cycles                     (100.00%)
               3.000559210        420,403,465      instructions
               3.000670798            780,105      cycles                     (100.00%)
               3.000670798            326,516      instructions
      
          $ perf script -s ./scripts/python/stat-cpi.py
                 1.000159: cpu -1, thread -1 -> cpi 1.344823 (594274711/441898250)
                 2.000351: cpu -1, thread -1 -> cpi 1.311972 (567649705/432669206)
                 3.000559: cpu -1, thread -1 -> cpi 1.336669 (561940430/420403465)
                 3.000671: cpu -1, thread -1 -> cpi 2.389178 (780105/326516)
      
          $ perf stat -e cycles,instructions -a -I 1000 record sleep 3 | perf script -s ./scripts/python/stat-cpi.py
                 1.000202: cpu -1, thread -1 -> cpi 1.035091 (940778881/908885530)
                 2.000392: cpu -1, thread -1 -> cpi 1.442600 (627493992/434974455)
                 3.000545: cpu -1, thread -1 -> cpi 1.353612 (741463930/547766890)
                 3.000622: cpu -1, thread -1 -> cpi 2.642110 (784083/296764)
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NKan Liang <kan.liang@intel.com>
      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/1452077397-31958-4-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b8a1962d
    • J
      perf script: Display stat events by default · 36e33c53
      Jiri Olsa 提交于
      If no script is specified for stat data, display stat events in raw
      form.
      
        $ perf stat record ls
      
        SNIP
      
         Performance counter stats for 'ls':
      
                  0.851585      task-clock (msec)         #    0.717 CPUs utilized
                         0      context-switches          #    0.000 K/sec
                         0      cpu-migrations            #    0.000 K/sec
                       114      page-faults               #    0.134 M/sec
                 2,620,918      cycles                    #    3.078 GHz
           <not supported>      stalled-cycles-frontend
           <not supported>      stalled-cycles-backend
                 2,714,111      instructions              #    1.04  insns per cycle
                   542,434      branches                  #  636.970 M/sec
                    15,946      branch-misses             #    2.94% of all branches
      
               0.001186954 seconds time elapsed
      
        $ perf script
        CPU   THREAD             VAL             ENA             RUN            TIME EVENT
         -1    26185          851585          851585          851585         1186954 task-clock
         -1    26185               0          851585          851585         1186954 context-switches
         -1    26185               0          851585          851585         1186954 cpu-migrations
         -1    26185             114          851585          851585         1186954 page-faults
         -1    26185         2620918          853340          853340         1186954 cycles
         -1    26185               0               0               0         1186954 stalled-cycles-frontend
         -1    26185               0               0               0         1186954 stalled-cycles-backend
         -1    26185         2714111          853340          853340         1186954 instructions
         -1    26185          542434          853340          853340         1186954 branches
         -1    26185           15946          853340          853340         1186954 branch-misses
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NKan Liang <kan.liang@intel.com>
      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/1452077397-31958-3-git-send-email-jolsa@kernel.org
      [ Rename 'time' parameter to 'tstamp' to fix build on older distros ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      36e33c53