1. 30 1月, 2013 8 次提交
    • T
      perf tools: Fix possible double free on error · 68c465ad
      Thomas Jarosch 提交于
      Can only be triggered via CROSS_COMPILE env var.
      
      Detected by cppcheck.
      Signed-off-by: NThomas Jarosch <thomas.jarosch@intra2net.com>
      Link: http://lkml.kernel.org/r/36736865.AIlztKhDqN@stormSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      68c465ad
    • S
      perf tools, powerpc: Fix compile warnings in tests/attr.c · e3541ec7
      Sukadev Bhattiprolu 提交于
      We print several '__u64' quantities using '%llu'. On powerpc, we by
      default include '<asm-generic/int-l64.h> which results in __u64 being an
      unsigned long. This causes compile warnings which are treated as errors
      due to '-Werror'.
      
      By defining __SANE_USERSPACE_TYPES__ we include <asm-generic/int-ll64.h>
      and define __u64 as unsigned long long.
      
      Changelog[v2]:
      	[Michael Ellerman] Use __SANE_USERSPACE_TYPES__ and avoid PRIu64
      	format specifier - which as Jiri Olsa pointed out, breaks on x86-64.
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Anton Blanchard <anton@au1.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Michael Ellerman <ellerman@au1.ibm.com>
      Cc: linuxppc-dev@ozlabs.org
      Link: http://lkml.kernel.org/r/20130124054439.GA31588@us.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e3541ec7
    • 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
    • S
      perf evsel: Add prev_raw_count field · c7a79c47
      Stephane Eranian 提交于
      This field will be used by commands which print counter deltas on
      regular timer intervals, such as perf stat -I.
      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-2-git-send-email-eranian@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c7a79c47
    • P
      perf tools: Make numa benchmark optional · 79d824e3
      Peter Hurley 提交于
      Commit "perf: Add 'perf bench numa mem'..." added a NUMA performance
      benchmark to perf. Make this optional and test for required
      dependencies.
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1359337882-21821-1-git-send-email-peter@hurleysoftware.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      79d824e3
    • I
      perf: Add 'perf bench numa mem' NUMA performance measurement suite · 1c13f3c9
      Ingo Molnar 提交于
      Add a suite of NUMA performance benchmarks.
      
      The goal was simulate the behavior and access patterns of real NUMA
      workloads, via a wide range of parameters, so this tool goes well
      beyond simple bzero() measurements that most NUMA micro-benchmarks use:
      
       - It processes the data and creates a chain of data dependencies,
         like a real workload would. Neither the compiler, nor the
         kernel (via KSM and other optimizations) nor the CPU can
         eliminate parts of the workload.
      
       - It randomizes the initial state and also randomizes the target
         addresses of the processing - it's not a simple forward scan
         of addresses.
      
       - It provides flexible options to set process, thread and memory
         relationship information: -G sets "global" memory shared between
         all test processes, -P sets "process" memory shared by all
         threads of a process and -T sets "thread" private memory.
      
       - There's a NUMA convergence monitoring and convergence latency
         measurement option via -c and -m.
      
       - Micro-sleeps and synchronization can be injected to provoke lock
         contention and scheduling, via the -u and -S options. This simulates
         IO and contention.
      
       - The -x option instructs the workload to 'perturb' itself artificially
         every N seconds, by moving to the first and last CPU of the system
         periodically. This way the stability of convergence equilibrium and
         the number of steps taken for the scheduler to reach equilibrium again
         can be measured.
      
       - The amount of work can be specified via the -l loop count, and/or
         via a -s seconds-timeout value.
      
       - CPU and node memory binding options, to test hard binding scenarios.
         THP can be turned on and off via madvise() calls.
      
       - Live reporting of convergence progress in an 'at glance' output format.
         Printing of convergence and deconvergence events.
      
      The 'perf bench numa mem -a' option will start an array of about 30
      individual tests that will each output such measurements:
      
       # Running  5x5-bw-thread, "perf bench numa mem -p 5 -t 5 -P 512 -s 20 -zZ0q --thp  1"
        5x5-bw-thread,                         20.276, secs,           runtime-max/thread
        5x5-bw-thread,                         20.004, secs,           runtime-min/thread
        5x5-bw-thread,                         20.155, secs,           runtime-avg/thread
        5x5-bw-thread,                          0.671, %,              spread-runtime/thread
        5x5-bw-thread,                         21.153, GB,             data/thread
        5x5-bw-thread,                        528.818, GB,             data-total
        5x5-bw-thread,                          0.959, nsecs,          runtime/byte/thread
        5x5-bw-thread,                          1.043, GB/sec,         thread-speed
        5x5-bw-thread,                         26.081, GB/sec,         total-speed
      
      See the help text and the code for more details.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Hugh Dickins <hughd@google.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      1c13f3c9
    • A
      perf tests: Fix leaks on PERF_RECORD_* test · ec13abc3
      Arnaldo Carvalho de Melo 提交于
      This test:
      
       7: Validate PERF_RECORD_* events & perf_sample fields
      
      needs to call perf_evlist__delete_maps().
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-t3181qy15avffdacqjcxfku2@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ec13abc3
  2. 25 1月, 2013 32 次提交