1. 13 1月, 2014 6 次提交
  2. 28 12月, 2013 1 次提交
  3. 27 11月, 2013 1 次提交
    • S
      tools/perf/stat: Add event unit and scale support · 410136f5
      Stephane Eranian 提交于
      This patch adds perf stat support for handling event units and
      scales as exported by the kernel.
      
      The kernel can export PMU events actual unit and scaling factor
      via sysfs:
      
        $ ls -1 /sys/devices/power/events/energy-*
        /sys/devices/power/events/energy-cores
        /sys/devices/power/events/energy-cores.scale
        /sys/devices/power/events/energy-cores.unit
        /sys/devices/power/events/energy-pkg
        /sys/devices/power/events/energy-pkg.scale
        /sys/devices/power/events/energy-pkg.unit
        $ cat /sys/devices/power/events/energy-cores.scale
        2.3283064365386962890625e-10
        $ cat cat /sys/devices/power/events/energy-cores.unit
        Joules
      
      This patch modifies the pmu event alias code to check
      for the presence of the .unit and .scale files to load
      the corresponding values. They are then used by perf stat
      transparently:
      
         # perf stat -a -e power/energy-pkg/,power/energy-cores/,cycles -I 1000 sleep 1000
         #          time             counts   unit events
             1.000214717               3.07 Joules power/energy-pkg/         [100.00%]
             1.000214717               0.53 Joules power/energy-cores/
             1.000214717           12965028        cycles                    [100.00%]
             2.000749289               3.01 Joules power/energy-pkg/
             2.000749289               0.52 Joules power/energy-cores/
             2.000749289           15817043        cycles
      
      When the event does not have an explicit unit exported by
      the kernel, nothing is printed. In csv output mode, there
      will be an empty field.
      
      Special thanks to Jiri for providing the supporting code
      in the parser to trigger reading of the scale and unit files.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Reviewed-by: NJiri Olsa <jolsa@redhat.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: zheng.z.yan@intel.com
      Cc: bp@alien8.de
      Cc: maria.n.dimakopoulou@gmail.com
      Cc: acme@redhat.com
      Link: http://lkml.kernel.org/r/1384275531-10892-3-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      410136f5
  4. 13 11月, 2013 1 次提交
  5. 04 11月, 2013 1 次提交
  6. 11 10月, 2013 5 次提交
  7. 05 10月, 2013 1 次提交
  8. 04 10月, 2013 1 次提交
  9. 08 8月, 2013 2 次提交
    • A
      perf stat: Flush output after each line in interval mode · 2bbf03f1
      Andi Kleen 提交于
      When interval mode is outputting to a pipe, each measurement should be
      flushed individually, so that the reader sees it timely.
      
      With a terminal each line is automatically flushed by stdio, but that is
      disabled with non terminal output.
      
      Simply fflush output after each time interval
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Reviewed-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1375490473-1503-5-git-send-email-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2bbf03f1
    • A
      perf stat: Add support for --initial-delay option · 41191688
      Andi Kleen 提交于
      When measuring workloads the startup phase -- doing page faults, dynamic
      linking, opening files -- is often very different from the rest of the
      workload.  Especially with smaller kernels and using counter
      multiplexing this can give significant measurement errors.
      
      Multiplexing assumes that the workload is mostly the same over longer
      periods. But at startup there is typically some spike of activity which
      is relatively short.  If many groups are multiplexing the one group
      seeing the spike, and which is then scaled up over the time to run all
      groups, may see a significant error.
      
      Also in general it's often not useful to measure the startup, because it
      is so different from the rest.
      
      One way around this is to use interval mode and discard the first
      sample, but this can be awkward because interval mode doesn't support
      intervals of less than 100ms, and also a useful interval is not
      necessarily the same as a useful startup delay.
      
      This patch adds a new --initial-delay / -D option to skip measuring for
      the startup phase. The time can be specified in ms
      
      Here's a simple example:
      
      perf stat -e page-faults bash -c 'for i in $(seq 100000) ; do true ; done'
      ...
                   3,721 page-faults
      ...
      
      If we just wait 20 ms the number of page faults is 1/3 less:
      
      perf stat -D 20 -e page-faults bash -c 'for i in $(seq 100000) ; do true ; done'
      ...
                   2,823 page-faults
      ...
      
      So we filtered out most of the startup noise from bash.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Reviewed-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1375490473-1503-4-git-send-email-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      41191688
  10. 09 7月, 2013 2 次提交
  11. 26 3月, 2013 3 次提交
  12. 18 3月, 2013 1 次提交
  13. 16 3月, 2013 4 次提交
  14. 07 2月, 2013 1 次提交
    • S
      perf stat: Add per processor socket count aggregation · d7e7a451
      Stephane Eranian 提交于
      This patch adds per-processor socket count aggregation for system-wide
      mode measurements. This is a useful mode to detect imbalance between
      sockets.
      
      To enable this mode, use --aggr-socket in addition
      to -a. (system-wide).
      
      The output includes the socket number and the number of online
      processors on that socket. This is useful to gauge the amount of
      aggregation.
      
       # ./perf stat -I 1000 -a --aggr-socket -e cycles sleep 2
       #           time socket cpus             counts events
            1.000097680 S0        4          5,788,785 cycles
            2.000379943 S0        4         27,361,546 cycles
            2.001167808 S0        4            818,275 cycles
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1360161962-9675-3-git-send-email-eranian@google.com
      [ committer note: Added missing man page entry based on above comments ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d7e7a451
  15. 30 1月, 2013 2 次提交
    • N
      perf evsel: Fix memory leaks on evsel->counts · 43f8e76e
      Namhyung Kim 提交于
      The ->counts field was never freed in the current code.  Add
      perf_evsel__free_counts() function to free it properly.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1359078284-32080-1-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      43f8e76e
    • S
      perf stat: Add interval printing · 13370a9b
      Stephane Eranian 提交于
      This patch adds a new printing mode for perf stat.  It allows interval
      printing. That means perf stat can now print event deltas at regular
      time interval.  This is useful to detect phases in programs.
      
      The -I option enables interval printing. It expects an interval duration
      in milliseconds. Minimum is 100ms. Once, activated perf stat prints
      events deltas since last printout. All modes are supported.
      
      $ perf stat -I 1000 -e cycles noploop 10
      noploop for 10 seconds
       #           time             counts events
            1.000109853      2,388,560,546 cycles
            2.000262846      2,393,332,358 cycles
            3.000354131      2,393,176,537 cycles
            4.000439503      2,393,203,790 cycles
            5.000527075      2,393,167,675 cycles
            6.000609052      2,393,203,670 cycles
            7.000691082      2,393,175,678 cycles
      
      The output format makes it easy to feed into a plotting program such as
      gnuplot when the -I option is used in combination with the -x option:
      
      $ perf stat -x, -I 1000 -e cycles noploop 10
      noploop for 10 seconds
      1.000084113,2378775498,cycles
      2.000245798,2391056897,cycles
      3.000354445,2392089414,cycles
      4.000459115,2390936603,cycles
      5.000565341,2392108173,cycles
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1359460064-3060-3-git-send-email-eranian@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      13370a9b
  16. 25 1月, 2013 2 次提交
  17. 09 12月, 2012 1 次提交
  18. 15 11月, 2012 2 次提交
  19. 26 10月, 2012 1 次提交
  20. 03 10月, 2012 1 次提交
  21. 27 9月, 2012 1 次提交